Skip to content
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

Queue.irrevocable #1134

Closed
245950258 opened this issue Jul 27, 2019 · 5 comments · Fixed by #1136
Closed

Queue.irrevocable #1134

245950258 opened this issue Jul 27, 2019 · 5 comments · Fixed by #1136

Comments

@245950258
Copy link

I write the following codes in Chisel2. And it generates verilog fine.
val io = new Bundle { val in = Flipped(Decoupled(UInt(w.W))) } val x = Queue.irrevocable(io.in, 4)

But when I try to convert this to chisel3, it reports "must be a Chisel type, not hardware".

I find that the problem is due to https://github.com/freechipsproject/chisel3/blob/master/src/main/scala/chisel3/util/Decoupled.scala.

private val genType = (DataMirror.internal.isSynthesizable(gen), chisel3.internal.Builder.currentModule) match { case (true, Some(module: MultiIOModule)) if !module.compileOptions.declaredTypeMustBeUnbound => chiselTypeOf(gen) case _ => gen }
If I change "!module.compileOptions.declaredTypeMustBeUnbound => chiselTypeOf(gen)" to “module.compileOptions.declaredTypeMustBeUnbound => chiselTypeOf(gen)”, I can get verilog without error.

@edwardcwang
Copy link
Contributor

edwardcwang commented Jul 27, 2019

Could you please post your full Chisel3 module or a more complete representative Chisel3 example so that we can better help you?

@245950258
Copy link
Author

245950258 commented Jul 27, 2019

This is my code.

import chisel3._
import chisel3.util._
class Queue5(w:Int , n:Int) extends Module{
val io = IO(new Bundle {
val in = Flipped(Decoupled(UInt(w.W)))
val out = Decoupled(UInt(w.W))
})
val x = Queue.irrevocable(io.in, n)
x.ready := io.out.ready
io.out.valid := x.valid
io.out.bits := x.bits
}

It is compiled successfully, But when elaborating design, reporting following error "'chisel3.core.UInt@79' must be a Chisel type, not hardware".

@edwardcwang
Copy link
Contributor

@245950258 Thank you for the catch - there does indeed appear to be a bug in Chisel. I've gotten a fix going in #1136 to fix it.

@245950258
Copy link
Author

It is my pleasure.

@edwardcwang
Copy link
Contributor

(leaving issue open for tracking)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants