Commit 2ae7b74d authored by Jens Korinth's avatar Jens Korinth
Browse files

AxiSlidingWindow: reverse order in window

parent 992c37c2
......@@ -87,9 +87,9 @@ class AxiSlidingWindow[T <: Data](val cfg: AxiSlidingWindowConfiguration[T]) ext
// shift data on handshake
when (data_in.ready && data_in.valid) {
mem(0) := data_in.bits
for (i <- 1 until cfg.depth)
mem(i) := mem(i - 1)
mem(cfg.depth - 1) := data_in.bits
for (i <- 0 until cfg.depth - 1)
mem(i) := mem(i + 1)
when (state === init) {
cnt := cnt + UInt(1)
......
......@@ -47,7 +47,7 @@ class AxiSlidingWindowTester[T <: Data](m: AxiSlidingWindowTestModule[T], isTrac
// check all sliding windows within size of memory slave (no border handling)
for (i <- 0 until totalSteps if noErrors) {
val expected = (0 until m.asw.cfg.depth) map (i => (i + start) % maxData)
val found = (0 until m.asw.cfg.depth) map (i => peek(m.asw.io.data.bits)(i))
val found = (0 until m.asw.cfg.depth) map (i => peek(m.asw.io.data.bits)(m.asw.cfg.depth - i - 1))
noErrors = expected.equals(found)
if (!noErrors)
println("Mismatch at step #%d: expected %s, found %s".format(start, expected.toString, found.toString))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment