3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2026-02-02 07:16:19 +00:00

Don't update used_signals for retained wires in rmunused_module_signals.

These updates should not be necessary. In fact, if they were necessary, this code
would be buggy, because the results would depend on the order in which wires are traversed:
If wire A is retained, which causes an update to `used_signals`, which then causes wire B
to be retained when it otherwise wouldn't be, then we would get different results depending
on whether A is visited before B.

These updates will also make it difficult to process these wires in parallel.
This commit is contained in:
Robert O'Callahan 2026-01-19 02:44:54 +00:00
parent 125609105d
commit 32e96605d4
2 changed files with 10 additions and 2 deletions

View file

@ -467,8 +467,6 @@ bool rmunused_module_signals(RTLIL::Module *module, bool purge_mode, bool verbos
wire->attributes.erase(ID::init);
else
wire->attributes.at(ID::init) = initval;
used_signals.add(new_conn.first);
used_signals.add(new_conn.second);
module->connect(new_conn);
}

View file

@ -0,0 +1,10 @@
read_rtlil << EOT
module \test
wire \wire_a
wire \wire_f
connect \wire_f \wire_a
end
EOT
opt_clean
select -assert-count 0 */*