LLVM Discussion Forums

Wrong FIRRTL lowering from Handshake using circt-opt -lower-handshake-to-firrtl

When using the command “circt-opt -lower-handshake-to-firrtl %s” on the test files in the folder HandshakeToFIRRTL, the generated FIRRTL files have functions that are not able to be converted to Verilog either using "circt-translate %s -emit-verilog " nor "firtool %s --format=mlir -verilog ".

The issues are with the .when and .bundle functions. For example, I get the errors:

simple_addiFIRRTL.mlir:36:5: error: value has an unsupported verilog type '!firrtl.bundle<valid: uint<1>, ready: flip<uint<1>>, data: uint<64>>'

simple_addiFIRRTL.mlir:12:7: error: ‘firrtl.when’ op cannot emit this operation to Verilog

Am I missing a lowering step or additional conversion from the output of “circt-opt -lower-handshake-to-firrtl %s” to be able to obtain Verilog or is there another way emit Verilog from the output?

Thanks beforehand,


I don’t think you are missing any lowering step–that is what I have been looking at as well. There is some discussion here about how to lower aggregate types (which come from the Handshake lowering), as well as lowering within FIRRTL in general.

I’m currently experimenting with how to lower bundles into SV interfaces based on this PR. It’s still in progress, but I hope to have something to share soon.

Interesting. Thank you for the feedback! The links are really helpful