mirror of
https://github.com/YosysHQ/yosys
synced 2025-04-13 04:28:18 +00:00
Merge pull request #3463 from YosysHQ/micko/hierarchy_fix
Makes sure to set initial_top when top change, fixes #3462
This commit is contained in:
commit
a8506c1c76
|
@ -1058,6 +1058,7 @@ struct HierarchyPass : public Pass {
|
||||||
if (tmp_top_mod != NULL) {
|
if (tmp_top_mod != NULL) {
|
||||||
if (tmp_top_mod != top_mod){
|
if (tmp_top_mod != top_mod){
|
||||||
top_mod = tmp_top_mod;
|
top_mod = tmp_top_mod;
|
||||||
|
top_mod->attributes[ID::initial_top] = RTLIL::Const(1);
|
||||||
did_something = true;
|
did_something = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
12
tests/various/bug3462.ys
Normal file
12
tests/various/bug3462.ys
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
read_verilog <<EOT
|
||||||
|
module top();
|
||||||
|
wire array[0:0];
|
||||||
|
wire out;
|
||||||
|
sub #(.d(1)) inst(
|
||||||
|
.in(array[0]),
|
||||||
|
.out(out)
|
||||||
|
);
|
||||||
|
endmodule
|
||||||
|
EOT
|
||||||
|
|
||||||
|
hierarchy -top top -libdir .
|
3
tests/various/sub.v
Normal file
3
tests/various/sub.v
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
module sub #(parameter d=1) (input in, output out);
|
||||||
|
assign out = in;
|
||||||
|
endmodule
|
Loading…
Reference in a new issue