tmrg raises incorrect warning
Summary
When having multiple potential hiearchies, controlled via paramter, tmrg produces an incorrect warning
Describe your setup
fastrich
TMRG Version
REPRODUCED_127
Steps to reproduce
module mux;
endmodule
module mux1;
endmodule
module test1 #(parameter BEHAVIORAL_MUX = 1);
if (BEHAVIORAL_MUX == 1) begin : gen_behavioral_mux
mux mux ();
end else begin : gen_and_or_mux
mux1 mux();
end
endmodule
What is the current bug behavior?
$ tmrg test1.sv
[WARNING] The design has multiple top cells! Output may not be correct!
Running with verbose
$ tmrg test1.sv
[...]
[INFO ] Checking the design hierarchy
[INFO ] [mux]
[INFO ] [test1]
[INFO ] |- mux:mux1
[WARNING] The design has multiple top cells! Output may not be correct!
As it can be seen the mux
is not in hierarchy.
If I re-run commenting out mux
from the test file, tmrg (correctly) fails because the module is not found.
$ tmrg test1.sv
[...]
[DEBUG ] [module instances]
[DEBUG ] Module name :mux
[DEBUG ] Instance names :mux
[ERROR ]
[ERROR ] Module mux is unknown
[ERROR ] Module mux is unknown
What is the expected correct behavior?
No warning is raised
Possible fixes
To be investigated. Probably we're not building the correct hierarchy in the multiple possible cases.
Edited by Matteo Lupi