mirror of https://github.com/YosysHQ/yosys.git
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 != top_mod){
|
||||
top_mod = tmp_top_mod;
|
||||
top_mod->attributes[ID::initial_top] = RTLIL::Const(1);
|
||||
did_something = true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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 .
|
|
@ -0,0 +1,3 @@
|
|||
module sub #(parameter d=1) (input in, output out);
|
||||
assign out = in;
|
||||
endmodule
|
Loading…
Reference in New Issue