chisel
chisel copied to clipboard
UInt<1>(0)' must be a Chisel type, not hardware
Hi I defined class cap_result_t , I use this class in another class crevokeModule . then use crevokeModule in another class by this sentence " val crevokeModule = Module(new crevokeModule(new cap_result_t))". I do not know why I get below error after using crevokeModule ?!
error "Exception in thread "main" chisel3.package$ExpectedChiselTypeException: 'UInt<1>(0)' must be a Chisel type, not hardware"
class cap_result_t extends Bundle{ val cap = clen_t val tag = UInt (1.W) val valid = UInt (1.W) }
class crevokeModule ( typ: cap_result_t) extends Module {
// class crevokeModule extends bundle { val io = IO(new Bundle() { val src = Input(UInt(XLEN.W)) val crevoke = Output(UInt(XLEN.W)) })
val rd_result_o = IO(Output(typ))
rd_result_o := 0.U.asTypeOf(chiselTypeOf(rd_result_o)) rd_result_o.tag:= 1.U(1.W)
}