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.