You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Tracking the invalid name generation in a separate issue
I think I have two more reproducers that lead to heaps of duplication, with a clock primitive being involved. I'm using GHC 9.8.2. They generate funky names as well: names like Duplicate.topEntity_cntr as well as \Duplicate.topEntity_cntr. The latter might technically be valid Verilog, but it seems Vivado isn't too happy about it anyway.
along with 2 instead of 1 clock primitive, and 2 register blocks for cntr instead of 1.
[edit]
I noticed I could get rid of the second clock and still have the duplication. The one with the second clock might still be interesting because of other weirdness, such as the done signal in HDL being not <$> done in Haskell?
// tbClockGen begin
[...]
if (~ Duplicate.topEntity_done) begin `ifdef VERILATOR
$c("std::exit(0);");
`endif$finish(0);
endassign Duplicate.topEntity_done =~ (Duplicate.topEntity_cntr ==8'd100);
The global vars are usually backed by a clock generator that
are not work-free.
In addition, when these global vars are recursively defined,
they can mess up the post-normalization flattening stage which
then violates certain invariants of the netlist generation stage.
This then causes the netlist generation stage to generate bad
Verilog names.
Fixes#2845
The global vars are usually backed by a clock generator that
are not work-free.
In addition, when these global vars are recursively defined,
they can mess up the post-normalization flattening stage which
then violates certain invariants of the netlist generation stage.
This then causes the netlist generation stage to generate bad
Verilog names.
Fixes#2845
Tracking the invalid name generation in a separate issue
The first variant is without
NOINLINE cntr
:This generates the following Verilog:
Duplicate.hs Verilog
Al least the following things are duplicated:
along with 2 instead of 1 clock primitive, and 2 register blocks for
cntr
instead of 1.[edit]
I noticed I could get rid of the second clock and still have the duplication. The one with the second clock might still be interesting because of other weirdness, such as the
done
signal in HDL beingnot <$> done
in Haskell?This is output generated by the following code:
Originally posted by @DigitalBrains1 in #2570 (comment)
The text was updated successfully, but these errors were encountered: