Circt-opt gives error for the input mlir (in core dialects) - which was generated by the firtool from the .fir file corresponding to the standard GCD tester

When circt-opt is run on the firtool generated mlir (with core dialects), got the following error:

circt-opt: /circt/lib/Conversion/ExportVerilog/ExportVerilog.cpp:709: llvm::StringRef {anonymous}::ModuleNameManager::getName({anonymous}::ModuleNameManager::ValueOrOp): Assertion `entry != nameTable.end() && “value expected a name but doesn’t have one”’ failed.

Could you please let me know what could have happened ? By the way, the firtool generated mlir has an anonymous module.

Thanks,
Pinaki

Could you paste your IR input if you can? My guess from your error message is you are missing to run -lower-seq-to-sv before -export-verilog.

Thanks for the report!

The error should indicate something around an “unsupported op” and not the crash.

There is a tracking issue here: ExportVerilog crashes when encountering an seq.firrtlreg · Issue #3966 · llvm/circt · GitHub