-
Notifications
You must be signed in to change notification settings - Fork 586
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UInt<1>(0)' must be a Chisel type, not hardware #4305
Comments
There's not enough in the message to see what the error is, but I'm guessing there is something wrong with It would be easiest to help you if you can provide a reproducible example. Ideally this would be in the form of a stand-alone Scala CLI example, see https://www.chisel-lang.org/docs/installation#quickstart-with-scala-cli for instructions on how to set this up, then you can copy-paste the full, executable code example into the issue. Alternatively you can use Scastie which works in your browser, you can write your code in the template: https://scastie.scala-lang.org/gJse8Wv6RsGX4inwTjjGQA, and then share the link after running it and showing the error you are seeing. The only issue with Scastie is it can't generate Verilog, but it can be used to show basic issues. |
yes the problem was clen_t. |
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)
}
The text was updated successfully, but these errors were encountered: