A collection of classes providing simple hardware specification, simulation, tracing, and testing suitable for teaching and research. Simplicity, usability, clarity, and extensibility are the overarching goals, rather than performance or optimization.
This PR adds an optional pass (pyrtl.two_way_fanout()) that makes it so all wires go to at most 2 destinations. It also adds a convenient helper function called pyrtl.fanout for calculating the fanout of a wire.
In a future PR, it would be nice to make the maximum target fanout an argument to the function. Another nicety would be to optimize so that the first split after the original wire isn't needed.
Note the fanout of the wire coming out of and in this example was originally 4 but now has a tree of wires so that no fanout is greater than 2.
This PR adds an optional pass (
pyrtl.two_way_fanout()
) that makes it so all wires go to at most 2 destinations. It also adds a convenient helper function calledpyrtl.fanout
for calculating the fanout of a wire.In a future PR, it would be nice to make the maximum target fanout an argument to the function. Another nicety would be to optimize so that the first split after the original wire isn't needed.
Note the fanout of the wire coming out of
and
in this example was originally 4 but now has a tree of wires so that no fanout is greater than 2.Before
After