Tests: Add case for `bind` into parametrised hier_block
Using `bind` into a parametrized hier_block used to be broken due to name
mangling, but was 'unintentionally' fixed by
916a89761e. Adding test to avoid
regressions.
This commit is contained in:
parent
fbb195e054
commit
6e05361318
|
|
@ -268,6 +268,8 @@ module sub4 #(
|
|||
end
|
||||
end
|
||||
|
||||
int driven_from_bind = 0;
|
||||
|
||||
always @(posedge clk) begin
|
||||
count <= count + 1;
|
||||
if (count > 0) begin
|
||||
|
|
@ -284,6 +286,11 @@ module sub4 #(
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
if (driven_from_bind != int'(2*P1)) begin
|
||||
$display("%m driven_from_bind: %0d != %0d", driven_from_bind, int'(2*P1));
|
||||
$stop;
|
||||
end
|
||||
end
|
||||
end
|
||||
endmodule
|
||||
|
|
@ -361,3 +368,14 @@ module delay #(
|
|||
assign out = tmp;
|
||||
end
|
||||
endmodule
|
||||
|
||||
// Module bound into parametrized hier_block that undergoes name mangling
|
||||
module sub4_bound #(
|
||||
parameter P1 = 1
|
||||
) (
|
||||
output int driven_from_bind
|
||||
);
|
||||
assign driven_from_bind = int'(P1*2);
|
||||
endmodule
|
||||
|
||||
bind sub4 sub4_bound #(.P1(P1)) i_sub4_bound (.*);
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue