Skip to content

Commit

Permalink
[rocketemu] reset nmi
Browse files Browse the repository at this point in the history
  • Loading branch information
PorterLu committed Aug 13, 2024
1 parent d6e607d commit 8a26d72
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion rocketemu/src/TestBench.scala
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ class TestBench(generator: SerializableModuleGenerator[RocketTile, RocketTilePar
}

val dut: RocketTile = withClockAndReset(clock, reset)(Module(generator.module()))
val resetVector = RawUnclockedNonVoidFunctionCall("get_resetvector", UInt(64.W))(simulationTime === 0.U)
dut.io.clock := clockGen.clock.asClock
dut.io.reset := clockGen.reset
dut.io.hartid := 0.U
Expand All @@ -68,10 +69,13 @@ class TestBench(generator: SerializableModuleGenerator[RocketTile, RocketTilePar
dut.io.meip := 0.U
dut.io.msip := 0.U
dut.io.seip.foreach(_ := 0.U)
dut.io.nmi.foreach(_ := false.B)
dut.io.nmiInterruptVector.foreach(_ := resetVector)
dut.io.nmiIxceptionVector.foreach(_ := resetVector)
dut.io.buserror := 0.U

// get resetVector from simulator
dut.io.resetVector := RawUnclockedNonVoidFunctionCall("get_resetvector", Const(UInt(64.W)))(simulationTime === 0.U)
dut.io.resetVector := resetVector

// output probes
val rocketProbe = probe.read(dut.io.rocketProbe)
Expand Down

0 comments on commit 8a26d72

Please sign in to comment.