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