Closed leonardt closed 4 years ago
@rsetaluri and I discussed a feature like this to extend inline_single_instances. I think a very good approach is to have a consistent way to label (instances, modules, generators) as inlineable, then run the inline pass. So in this case we would label mantle.wire generator as inlinable and run the pass.
That makes sense, perhaps we can use a metadata field?
Yeah, I detailed the full proposal in #882
See https://github.com/rdaly525/coreir/pull/897 for a case where this pops up.
One option would be to run inline_single_instances after the wire generator is run, however this might have the side effect of inlining other modules that match the single instance pattern but perhaps the user will not expect them to be inlined.
One option would be to extend inline_single_instances to accept a module/generator name as a parameter to filter the modules to be inlined.
Alternatively, we could use API to inline the wire module at the time it's inserted (ideally just reusing the code for inline single instances, but invoking it inside the passthrough logic that inserts the mantle wire)