Is there are any general solution that can handle adding same generic type addition in chisel3?

Viewed 38

I was trying to make generic hardware class module, which is written in chisel3.

My codes look like below.

class hardware_module[T <: Data](bandwidth: T)extends Module {
  val io = IO(new Bundle {
    val in0 = Input(bandwidth)
    val in1 = Input(bandwidth)
    val out = Output(bandwidth)          
    })
    io.out := io.in0 + io.in1
}

Error message looks like this

type mismatch; found: T requried: String

Through internet, i found that this error message comes from adding two generic type at the same time. I want to know that there are general solution about this problem in Chisel3 too.

1 Answers
Related