my solution:
val allReady = io.outputs.map(s => s.ready).asBits()
val low = util.lowbit(allReady)
val unbusy = allReady.orR
val num = OHToUInt(low)
it's a one cycle dispatcher, but it fails, when I take a look to test script then:
fork{
val startX = -2.0
val startY = -1.5
val endX = 0.8
val endY = 1.5
val stepX = (endX - startX) / resX
val stepY = (endY - startY) / resY
cmd.valid #= false
cd.waitSampling()
for (y <- 0 until resY;
x <- 0 until resX) {
cd.waitSampling(Random.nextInt(10))
cmd.valid #= true
cmd.x.raw #= ((startX + x * stepX) * (1 << 20)).toInt
cmd.y.raw #= ((startY + y * stepY) * (1 << 20)).toInt
cd.waitSamplingWhere(cmd.ready.toBoolean)
cmd.valid #= false
}
}
just imagine 2 task back2back transform, a one cycle dispatcher and Arbiter may not distinguish 2 results between (x ,y) and (x+1, y)
result of (x+1, y) may appear first in this situation. (with the simple strategy mentioned in spec.
so I think there will be more information in PixelResult, both iteration and (x, y)
my solution:
it's a one cycle dispatcher, but it fails, when I take a look to test script then:
fork{ val startX = -2.0 val startY = -1.5 val endX = 0.8 val endY = 1.5 val stepX = (endX - startX) / resX val stepY = (endY - startY) / resY cmd.valid #= false cd.waitSampling() for (y <- 0 until resY; x <- 0 until resX) { cd.waitSampling(Random.nextInt(10)) cmd.valid #= true cmd.x.raw #= ((startX + x * stepX) * (1 << 20)).toInt cmd.y.raw #= ((startY + y * stepY) * (1 << 20)).toInt cd.waitSamplingWhere(cmd.ready.toBoolean) cmd.valid #= false } }just imagine 2 task back2back transform, a one cycle dispatcher and Arbiter may not distinguish 2 results between (x ,y) and (x+1, y)
result of (x+1, y) may appear first in this situation. (with the simple strategy mentioned in spec.
so I think there will be more information in
PixelResult, both iteration and (x, y)