circt
circt copied to clipboard
[ExportVerilog] Crash with unsupported op (seq.compreg)
circt-opt -export-verilog crashes with this IR (https://godbolt.org/z/1qxzPva35) since seq.compreg is expected to be lowered before ExportVerilog (circt-opt -lower-seq-to-sv -export-verilog compiles https://godbolt.org/z/7666xaz7v). However it would be nice to emit good error messages instead of crashing.
hw.module @Counter(%clock: i1, %reset: i1) -> (count: i8) {
%c0_i8 = hw.constant 0 : i8
%c1_i8 = hw.constant 1 : i8
%counter = seq.compreg %0, %clock, %reset, %c0_i8 : i8
%0 = comb.add %counter, %c1_i8 : i8
hw.output %counter : i8
}