I have a question about getting FIRRTL out of CIRCT. For example if following along with @mikeurbach’s workflow for getting python all the way into CIRCT would it be possible to generate a .fir file that I could then use in a tool chain that doesn’t include CIRCT?
An example might be that I write something in numpy, lower to CIRCT, and then I have a simulator I want to use that depends on https://github.com/ucsc-vama/essent, it would be pretty nice to be able to use LLVM/MLIR/CIRCT to generate my inputs to this program.
I haven’t tried any of the above steps yet, but it seemed reasonable to ask if CIRCT to .fir is possible or if not currently supported how hard would it be?
The functionality to serialize from the FIRRTL dialect to a .fir file doesn’t exist, yet. However, this is something that we’d like to have and would be a great feature request. I’ve thought that this would be extremely useful if users wanted to interoperate with the existing Scala Chisel/FIRRTL ecosystem where a lot of the backend tooling expects lowered FIRRTL IR or users might want to not migrate their existing Scala FIRRTL Compiler transforms (or the essent work!).
Note: the center of mass has moved towards lowering things from the FIRRTL dialect to a mixture of RTL dialect and SystemVerilog dialect. For a workflow like what you’re suggesting to really be useful, we’d probably also need to go back to FIRRTL dialect from RTL.