Give slack time after trace EOF before sim termination

... so that we make sure to receive all outstanding responses.
This fixes the response traces being truncated too early.
This commit is contained in:
Hansung Kim
2023-04-21 16:26:09 -07:00
parent 3f9f7a1d67
commit 3ba566b9f7

View File

@@ -760,18 +760,19 @@ class MemTraceDriverImp(outer: MemTraceDriver, numLanes: Int, traceFile: String)
dontTouch(tlOut.d) dontTouch(tlOut.d)
} }
io.finished := sim.io.trace_read.finished // Give some slack time after trace EOF to the downstream system so that we
when(io.finished) { // make sure to receive all outstanding responses.
assert( val finishCounter = RegInit(200.U(64.W))
false.B, when (sim.io.trace_read.finished) {
"\n\n\nsimulation Successfully finished\n\n\n (this assertion intentional fail upon MemTracer termination)" finishCounter := finishCounter - 1.U
)
} }
io.finished := (finishCounter === 0.U)
// Clock Counter, for debugging purpose // when(io.finished) {
val clkcount = RegInit(0.U(64.W)) // assert(
clkcount := clkcount + 1.U // false.B,
dontTouch(clkcount) // "\n\n\nsimulation Successfully finished\n\n\n (this assertion intentional fail upon MemTracer termination)"
// )
// }
} }
class SimMemTrace(filename: String, numLanes: Int) class SimMemTrace(filename: String, numLanes: Int)