verilator icon indicating copy to clipboard operation
verilator copied to clipboard

Optimize continuous assignment with delay `UNOPTFLAT`

Open kbieganski opened this issue 3 years ago • 0 comments

After #3363, we support continuous assignments like:

assign #1 clk = ~clk;

Such as assignment is converted into:

always_comb fork temp = #1 ~clk; join_none
assign clk = temp;

We disable UNOPTFLAT for temp, as otherwise Verilator complains about a cycle (even though this isn't a cycle within one time slot). We introduce temp so that we don't have to disable the warning for clk, as it could be involved in some other cycle.

This could be fixed by teaching V3SchedAcyclic about awaits, but that requires proper dataflow analysis to handle all the possible branching.

kbieganski avatar Aug 19 '22 16:08 kbieganski