finn icon indicating copy to clipboard operation
finn copied to clipboard

Option to exclude nodes from transformation

Open maltanar opened this issue 5 years ago • 0 comments

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 NodeLocalTransformation provides an almost-natural way of doing this -- we could add an additional filter_fxn argument (default value None) 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 run filter on the nodes with this function prior to calling parallel map.
  • the general Transformation is 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.

maltanar avatar Jun 16 '20 09:06 maltanar