circt icon indicating copy to clipboard operation
circt copied to clipboard

[firtool] OM MemorySchema prevents round-tripping FIRRTL output

Open fabianschuiki opened this issue 1 year ago • 1 comments

When running a design through firtool with --repl-seq-mem enabled and --ir-fir to emit FIRRTL dialect IR, the resulting file cannot be run through firtool again to get SV output. The intermediate FIRRTL dialect IR file contains om.class @MemorySchema objects, which get re-created in the second run through firtool, which causes the verifier to detect a duplicate definition of @MemorySchema.

Should the --repl-seq-mem option be sensitive to classes already having been declared, and just update them if present?

fabianschuiki avatar Feb 02 '24 20:02 fabianschuiki

Thanks for bringing it up. I don't think we envisioned this usage pattern when we added this. The same thing would probably happen in -firrtl-lower-classes as well. I'm not sure what the best thing to do is, but we can take a look. cc @prithayan who is looking at the memory schema stuff.

mikeurbach avatar Feb 02 '24 22:02 mikeurbach