This PR adds a splitfanout pass that splits cells with fanout > 1 into copies, each with fanout 1. It is effectively the opposite of opt_merge and is useful for (1) enabling optimizations that cannot work when there is fanout, (2) splitting high fanout cells/nets that might cause problems in PD.
The pass can operate on selections and has a -limit flag to selectively operate on cells with fanout < specified limit. It does not operate on "bit-split" cells (word-level cells where different bits of the word have different/non-contiguous destinations), so splitcells should be run first if fanout splitting is desired for such cells.
Explain how this is achieved.
The pass works by building a database of drivers and loads, then operating in reverse topological order on selected cells. It checks that each cell is not "bit-split", then makes a copy to drive each load. The original cell is used to drive the final load.
[x] passes/cmds/splitfanout.cc: splitfanout pass
[x] passes/cmds/Makefile.inc: Add the new source
If applicable, please suggest to reviewers how they can test the change.
[ ] YosysHQ to review source code and provide feedback/edits as necessary
[ ] YosysHQ to construct test plan of 15-20 small-medium test cases
[ ] Silimate to review test plan and sign off
[ ] YosysHQ to write test cases according to test plan and add to regression
[ ] YosysHQ to provide formal equivalence checking scripts with equiv_opt or FOSS eqy
[ ] Silimate to sign off on test case implementation
What are the reasons/motivation for this change?
This PR adds a
splitfanout
pass that splits cells with fanout > 1 into copies, each with fanout 1. It is effectively the opposite ofopt_merge
and is useful for (1) enabling optimizations that cannot work when there is fanout, (2) splitting high fanout cells/nets that might cause problems in PD.The pass can operate on selections and has a
-limit
flag to selectively operate on cells with fanout < specified limit. It does not operate on "bit-split" cells (word-level cells where different bits of the word have different/non-contiguous destinations), sosplitcells
should be run first if fanout splitting is desired for such cells.Explain how this is achieved.
The pass works by building a database of drivers and loads, then operating in reverse topological order on selected cells. It checks that each cell is not "bit-split", then makes a copy to drive each load. The original cell is used to drive the final load.
passes/cmds/splitfanout.cc
:splitfanout
passpasses/cmds/Makefile.inc
: Add the new sourceIf applicable, please suggest to reviewers how they can test the change.
equiv_opt
or FOSSeqy