Skip to content

Commit

Permalink
[emu] add more printf
Browse files Browse the repository at this point in the history
[ipemu] remove unused spaces and add missing bracket

[emu] rename the event name
  • Loading branch information
Clo91eaf committed Apr 19, 2024
1 parent 8b78459 commit 9a83b89
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions ipemu/src/TestBench.scala
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,15 @@ class TestBench(generator: SerializableModuleGenerator[T1, T1Parameter]) extends

withClockAndReset(clock, reset) {
// memory write
lsuProbe.slots.zipWithIndex.foreach { case (mshr, i) => when(mshr.writeValid)(printf(cf"""{"event":"memoryWrite","parameter":{"idx":$i,"vd":${mshr.dataVd},"offset":${mshr.dataOffset},"mask":${mshr.dataMask},"data":${mshr.dataData},"instruction":${mshr.dataInstruction},"lane":${mshr.targetLane}}}""")) }
lsuProbe.slots.zipWithIndex.foreach { case (mshr, i) => when(mshr.writeValid)(printf(cf"""{"event":"vrfWriteFromLsu","parameter":{"idx":$i,"vd":${mshr.dataVd},"offset":${mshr.dataOffset},"mask":${mshr.dataMask},"data":${mshr.dataData},"instruction":${mshr.dataInstruction},"lane":${mshr.targetLane}}}\n""")) }
// vrf write
laneVrfProbes.zipWithIndex.foreach { case (lane, i) => when(lane.valid)(cf"""{"event":"vrfWrite","parameter":{"idx":$i,"vd": ${lane.requestVd},"offset": ${lane.requestOffset},"mask": ${lane.requestMask},"data": ${lane.requestData},"instruction": ${lane.requestInstruction}}}""") }
laneVrfProbes.zipWithIndex.foreach { case (lane, i) => when(lane.valid)(printf(cf"""{"event":"vrfWriteFromLane","parameter":{"idx":$i,"vd":${lane.requestVd},"offset":${lane.requestOffset},"mask":${lane.requestMask},"data":${lane.requestData},"instruction":${lane.requestInstruction}}}\n""")) }
// issue
when(dut.request.fire)(printf(cf"""{"event":"issue", "parameter":{"idx": ${t1Probe.instructionCounter}}}"""))
when(dut.request.fire)(printf(cf"""{"event":"issue","parameter":{"idx":${t1Probe.instructionCounter}}}\n"""))
// inst
when(dut.response.valid)(printf(cf"""{"event":"inst","parameter":{"data":${dut.response.bits.data},"vxsat":${dut.response.bits.vxsat},"rd_valid":${dut.response.bits.rd.valid},"rd":${dut.response.bits.rd.bits},"mem":${dut.response.bits.mem}}}\n"""))
// peekTL
dut.memoryPorts.zipWithIndex.foreach { case (bundle, i) => when(bundle.a.valid)(printf(cf"""{"event":"peekTL","parameter":{"idx":$i,"opcode":${bundle.a.bits.opcode},"param":${bundle.a.bits.param},"size":${bundle.a.bits.size},"source":${bundle.a.bits.source},"address":${bundle.a.bits.address},"mask":${bundle.a.bits.mask},"data":${bundle.a.bits.data},"corrupt":${bundle.a.bits.corrupt},"dReady":${bundle.d.ready}}}\n""")) }
}

// Monitors
Expand Down

0 comments on commit 9a83b89

Please sign in to comment.