fix missing top reference renames in param type instantiation

- renaming applies to nodes within generate blocks
- renaming applies to LHSs
This commit is contained in:
Zachary Snow
2021-04-13 16:47:00 -04:00
parent 4ddbff9b97
commit 623f0a2d39
3 changed files with 34 additions and 9 deletions
+12 -5
View File
@@ -1,8 +1,15 @@
module Module;
parameter int S;
parameter type T;
T x = '1;
initial $display("Module %0d: %b, %0d", S, Module.x, $bits(T));
module Module #(
parameter int S,
parameter type T
);
T x;
if (S) begin : a
if (S) begin : b
assign Module.x = '1;
logic [$bits(Module.x):0] y = 'z;
end
end
initial $display("Module %0d: %b %0d %b %0d", S, Module.x, $bits(T), Module.a.b.y, $bits(Module.a.b.y));
endmodule
module top;
+10 -2
View File
@@ -1,8 +1,16 @@
module Module;
parameter S = 0;
parameter T = 0;
wire [T-1:0] x = 1'sb1;
initial $display("Module %0d: %b, %0d", S, Module.x, T);
wire [T-1:0] x;
generate
if (S) begin : a
if (S) begin : b
assign Module.x = 1'sb1;
wire [T:0] y = 1'sbz;
end
end
endgenerate
initial $display("Module %0d: %b %0d %b %0d", S, Module.x, T, Module.a.b.y, T + 1);
endmodule
module top;