Option to exclude nodes from transformation
Sometimes it's necessary to iterate over a design multiple times by changing some parameters to observe how the behavior changes. To speed up the dev process for these use cases, it'd be beneficial to have the possibility of filtering out certain nodes prior to applying transformations.
One example of this is the setting of minimal FIFO sizes to get full throughput: we would create a stitched IP design with some initial FIFO sizes, run a throughput test in rtlsim, modify the FIFO sizes based on observations and do it again. In this case, everything but the FIFO nodes can be excluded from code generation transformation since they would remain the same.
In terms of how this could be implemented:
- the
NodeLocalTransformationprovides an almost-natural way of doing this -- we could add an additionalfilter_fxnargument (default valueNone) that takes in a function examining a single node and returning True/False to indicate whether that node should be kept. Internally, the base class impl can be modified to runfilteron the nodes with this function prior to calling parallelmap. - the general
Transformationis a bit harder but we could use the same interface and leave it up to each transformation to respect it.
This would also provide a solution to #92 -- not exactly the same thing, but one could restrict the filter to operate on one or a few nodes per call.