[error] Testbench.scala:45: FOUND COMBINATIONAL PATH! in class main$
[error] Rasterizer.scala:139: (0) in class Rasterizer
[error] Rasterizer.scala:139: (1) in class Rasterizer
...
[error] Rasterizer.scala:139: (22) in class Rasterizer
[error] Rasterizer.scala:139: (23) in class Rasterizer
[error] Rasterizer.scala:104: (24) in class Rasterizer
139: for (i <- 0 until 4)
140: io.outputMask(i) := quad.io.coverageMask(i) && pixelValid104: val io = new Bundle {Stack trace suppressed: run last compile:run for the full output.class Foo extends Module {
val io = new Bundle {
val in = UInt(INPUT, 4)
val out = UInt(OUTPUT, 4)
val enable = Bool(INPUT)
}
var i = 0
io.out := UInt(0)
for (i <- 0 until 4) {
io.out(i) := io.in(i) && io.enable
}
}[error] CombLoop.scala:21: FOUND COMBINATIONAL PATH! in class testbench$
[error] CombLoop.scala:14: (0) in class Foo
[error] CombLoop.scala:14: (1) in class Foo
...
I know a previous message on this list mentioned that if you read and write bits from the same signal combinationally, you will trigger the loop error (for example, ripple carry), but in my code, I'm only ever reading from in and writing to out.
Note that I initially assign a zero to io.out because it gives an error if I don't:
[error] CombLoop.scala:14: Subword assignment requires a default value to have been assigned in class FooIs there a different idiom I should be using for this?
--Jeff
A couple of comments.
First, avoid "var". There's no need for it in your code (you don't need to declare it before using it in the for loop).
for (val grantIndex <- 0 until numInputs) {
[error] /Users/jeffbush/src/gpu/hardware/src/main/scala/Arbiter.scala:38: val in for comprehension must be followed by assignment
[error] for (val grantIndex <- 0 until numInputs) {
I tried switching it to var:
for (var grantIndex <- 0 until numInputs) {[error] /Users/jeffbush/src/gpu/hardware/src/main/scala/Arbiter.scala:38: illegal start of simple pattern
[error] for (var grantIndex <- 0 until numInputs) {
[error] ^
It only works if I declare a var outside the for loop. I tried this with Scala 2.10.4 and 2.11.7.
There looks to be a bug in the combinational path code. I've found that this still triggers a failure!
deqReg := Cat((0 until ports).map(ownReg === Cat(io.configVal(portBits*(_) + 2),io.configVal(portBits*(_)+ 1), io.configVal(portBits*(_)))))[error] /home/jayant/Dropbox/FIFO/fifo.scala:24: missing parameter type for expanded function ((x$1) => portBits.$times(x$1).$plus(2))
[error] deqReg := Cat((0 until ports).map(ownReg === Cat(io.configVal(portBits*(_) + 2),io.configVal(portBits*(_)+ 1), io.configVal(portBits*(_)))))
[error] ^
[error] one error found
[error] (compile:compileIncremental) Compilation failed
[error] Total time: 2 s, completed 4 Sep, 2015 12:31:40 PM