Consider the following minimal.mlir (compiled from SV):
module {
hw.module @demo(in %a : !hw.union<a: i1>, in %b : !hw.union<a: i1>, in %c : i1, out d : !hw.union<a: i1>) {
%0 = comb.mux %c, %a, %b : !hw.union<a: i1>
hw.output %0 : !hw.union<a: i1>
}
}
circt-opt minimal.mlir --aggregate-to-comb fails with
minimal.mlir:3:10: error: failed to legalize operation 'comb.mux' that was explicitly marked illegal: %0 = "comb.mux"(%arg2, %arg0, %arg1) : (i1, !hw.union<a: i1>, !hw.union<a: i1>) -> !hw.union<a: i1>
%0 = comb.mux %c, %a, %b : !hw.union<a: i1>
Muxes of hw.struct work fine.
If this is a bug/unimplemented feature then I'm happy to try to implement the fix myself, though some guidance on where to start would be great! If it's not a bug, advice on what I should be doing differently would be great also!
Thanks!
Consider the following
minimal.mlir(compiled from SV):circt-opt minimal.mlir --aggregate-to-combfails withMuxes of
hw.structwork fine.If this is a bug/unimplemented feature then I'm happy to try to implement the fix myself, though some guidance on where to start would be great! If it's not a bug, advice on what I should be doing differently would be great also!
Thanks!