Skip to content

Instantly share code, notes, and snippets.

@sagar5258
Created December 28, 2015 09:53
package my_pkg1;
int unsigned a = 1;
endpackage : my_pkg1
package my_pkg2;
import my_pkg1 :: *;
int unsigned b = 2;
function void pkg2_print();
$display("my_pkg2 : pkg2_print : my_pkg1::a = %0d, my_pkg2::b = %0d", a, b);
endfunction : pkg2_print
endpackage : my_pkg2
module top4();
import my_pkg2 :: *;
initial begin
void '(pkg2_print());
end
endmodule : top4
//Output:
// my_pkg2 : pkg2_print : my_pkg1::a = 1, my_pkg2::b = 2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment