-
Notifications
You must be signed in to change notification settings - Fork 902
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve opt_expr
performance
#4176
Conversation
1bdb80d
to
06c4b21
Compare
Avoid building a cell-to-inbit map when sorting the cells, add a warning if we are unable to sort, and move the code treating non-combinational cells ahead of the rest (this means we don't need to pass non-combinational cells to the TopoSort object at all).
Each call to `handle_clkpol_celltype_swap` has a conversion of the cell's type ID to an allocated string. This can sum up to a non-negligible time being spent in the clkpol code even for a design which doesn't have any flip-flop gates.
06c4b21
to
fa4a2b6
Compare
With |
Since yosys/techlibs/xilinx/cells_sim.v Line 3900 in 1e401c3
and yosys/techlibs/xilinx/cells_sim.v Line 3726 in 1e401c3
and |
I think if you're okay with it we should just supress the warning with |
Ah so it was the new warning which was tripping up the tests. I am fine with suppressing it to pass the test, but I think we should discuss whether we want the warning in the first place. In the meantime we have changed |
c4b65d4
to
532188f
Compare
See the commits. This avoids having to populate
dict<RTLIL::Cell*, std::set<RTLIL::SigBit>> cell_to_inbit;
, and it saves repeated conversions of type IDs to strings (36 times per cell for one iteration of the loop inopt_expr
). Allocating a string for the IDs was significant enough to stand out when watching whereopt_expr
spends its time.