Hi *!
I'm trying to instantiate a cross-domain clocking AsyncFifo like this:
class AsyncFifoProblem extends Module {
val io = new Bundle { val out = Decoupled(UInt(width=8)) }
val in_clock = clock * 2
val fifo = Module (new AsyncFifo(UInt(width=8), 1, in_clock, clock))
fifo.io.enq.bits := UInt(1)
fifo.io.enq.valid := Bool(true)
io.out <> fifo.io.deq
}
However, this during elaboration with the C++ backend I get this error:
[info] Set current project to asyncfifoproblem (in build file:/tmp/asyncfifoproblem/)
[info] Compiling 1 Scala source to /tmp/asyncfifoproblem/target/scala-2.11/classes...
[warn] there was one feature warning; re-run with -feature for details
[warn] one warning found
[info] Running AsyncFifoProblem
CPP elaborate
[error] ChiselUtil.scala:627: Extract (hi = -1, lo = 0) requires hi >= lo in class Chisel.AsyncFifo
[error] (run-main-0) java.lang.IllegalStateException: CODE HAS 1 ERRORS and 0 WARNINGS and 0 CHECKS
java.lang.IllegalStateException: CODE HAS 1 ERRORS and 0 WARNINGS and 0 CHECKS
at Chisel.ChiselError$.checkpoint(ChiselError.scala:179)
at Chisel.Backend.elaborate(Backend.scala:826)
at Chisel.CppBackend.elaborate(Cpp.scala:1406)
at Chisel.Driver$.execute(Driver.scala:111)
at Chisel.Driver$.apply(Driver.scala:41)
at Chisel.chiselMain$.apply(hcl.scala:59)
at AsyncFifoProblem$.main(asnycfifoproblem.scala:14)
at AsyncFifoProblem.main(asnycfifoproblem.scala)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
[trace] Stack trace suppressed: run last compile:run for the full output.
java.lang.RuntimeException: Nonzero exit code: 1
at scala.sys.package$.error(package.scala:27)
[trace] Stack trace suppressed: run last
Same for 2 elements, but if I increase the number of elements in the Fifo to, e.g., 10 it works just fine:
val fifo = Module (new AsyncFifo(UInt(width=8), 10, in_clock, clock))
Did I miss something or is this a bug?
Thanks!
Jens