allow packages to reference their own items explicitly

This commit is contained in:
Zachary Snow
2021-04-13 14:44:42 -04:00
parent c0b8ba17de
commit eeeade3e19
9 changed files with 71 additions and 6 deletions
+8
View File
@@ -0,0 +1,8 @@
package P;
localparam Bar = 1;
localparam Foo = P::Bar;
endpackage
module top;
import P::*;
initial $display(Foo);
endmodule
+4
View File
@@ -0,0 +1,4 @@
module top;
localparam Foo = 1;
initial $display(Foo);
endmodule
@@ -0,0 +1,11 @@
package Q;
localparam Bar = 1;
endpackage
package P;
import Q::Bar;
localparam Foo = P::Bar;
endpackage
module top;
import P::*;
initial $display(Foo);
endmodule
@@ -0,0 +1,4 @@
module top;
localparam Foo = 1;
initial $display(Foo);
endmodule
@@ -0,0 +1,11 @@
package P;
localparam Bar = 1;
function automatic integer func;
localparam Bar = 2;
func = Bar + P::Bar;
endfunction
endpackage
module top;
import P::*;
initial $display(func());
endmodule
@@ -0,0 +1,5 @@
module top;
localparam Foo = 1;
localparam Bar = 2;
initial $display(Foo + Bar);
endmodule