-
Notifications
You must be signed in to change notification settings - Fork 2
Description
Issue description:
We use Decoupled object to create handshake interface. For example, val test = Decoupled(UInt(128.W)) produces a 128-bit output with valid/ready interface. In secure chisel extension, the API is apply(gen: T, rdyl: Label = UnknownLabel, vall: Label = UnknownLabel) to specify labels. In the API, only ready and valid signals are explicitly labeled, and the bits should be implicitly labeled with data type gen. But the compiler does not work as expected, the bits is not labeled in the generated firrtl.
Example code:
class Test extends Module {
val io = IO(new Bundle {
val msg_o = Decoupled(UInt(128.W, bot), bot, bot)
})
}
Error message: [declaration io, with bad field bits in internal record msg_o : {ready : {L, H}, valid : {L, H}, bits : {, }}] does not have a declared label.
Opinion:
File secure-chisel3/src/main/scala/chisel3/util/Decoupled.scala defines the interface:
val ready = Input(Bool(), rdyl)
val valid = Output(Bool(), vall)
val bits = Output(gen.chiselCloneType)
In the definition, bits inherits the data type from gen, but I think chiselCloneType method does not inherits the label information. Possible solution is val bits = Output(gen.chiselCloneType, gen.lbl_)?