You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Feature Request][FIRRTL] add a pass on firrtl.circuit to create a firrtl.extmodule for all firrtl.instance without its firrtl.module or firrtl.extmodule
#8030
Closed
sequencer opened this issue
Jan 4, 2025
· 2 comments
Since our eDSL frontend only can operate on the firrtl.module block,: It's not possible to insert the firrtl.extmodule to firrtl.circuit at the time when adding the firrtl.instance to firrtl.module.
It generates a non-valid firrtl.circuit, since all instances cannot refer to the firrtl.extmodules.
Since firrtl.instance operator already contains the necessary information for creating the external module, it's reasonable to adding all non-refered firrtl.instance as firrtl.extmodule to firrtl.circuit with a simple pass.
The text was updated successfully, but these errors were encountered:
I don't think we can support this. This is ill-formed IR and it's frontend's responsibility to produce well-formed IR.
Since our eDSL frontend only can operate on the firrtl.module block,: It's not possible to insert the firrtl.extmodule to firrtl.circuit at the time when adding the firrtl.instance to firrtl.module.
I'm not sure how your eDSL works but MLIR CAPI provides standard builder utilities so you should be able to change insertion point to firrtl.circuit body.
Thanks! I found it's simple to do the post-processing at the final stage of firrtl.circuit generation with the mlirOperationWalk API. Also discussed with @seldridge about this. I agree using a spacial pass to do so is not good at all. Since we should provide a valid IR for each stage.
This is for the separate linking flow, this is a almost minimal example provided generated by the zaozi project:
Since our eDSL frontend only can operate on the
firrtl.module
block,: It's not possible to insert thefirrtl.extmodule
tofirrtl.circuit
at the time when adding thefirrtl.instance
tofirrtl.module
.It generates a non-valid
firrtl.circuit
, since all instances cannot refer to thefirrtl.extmodules
.Since
firrtl.instance
operator already contains the necessary information for creating the external module, it's reasonable to adding all non-referedfirrtl.instance
asfirrtl.extmodule
tofirrtl.circuit
with a simple pass.The text was updated successfully, but these errors were encountered: