Skip to content

Commit

Permalink
[rocketemu] reset nmi
Browse files Browse the repository at this point in the history
  • Loading branch information
PorterLu authored and sequencer committed Aug 14, 2024
1 parent 1c4484f commit 8aaba3e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
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
2 changes: 1 addition & 1 deletion rocketv/src/Frontend.scala
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ case class FrontendParameter(
class FrontendInterface(parameter: FrontendParameter) extends Bundle {
val clock = Input(Clock())
val reset = Input(if (parameter.useAsyncReset) AsyncReset() else Bool())
val resetVector = Input(Const(UInt(parameter.resetVectorBits.W)))
val resetVector = Input(UInt(parameter.resetVectorBits.W))
val nonDiplomatic = new FrontendBundle(
parameter.vaddrBitsExtended,
parameter.vaddrBits,
Expand Down
2 changes: 1 addition & 1 deletion rocketv/src/RocketTile.scala
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ class RocketTileInterface(parameter: RocketTileParameter) extends Bundle {
val reset = Input(if (parameter.useAsyncReset) AsyncReset() else Bool())

val hartid = Flipped(UInt(parameter.hartIdLen.W))
val resetVector = Input(Const(UInt(parameter.resetVectorBits.W)))
val resetVector = Input(UInt(parameter.resetVectorBits.W))

val debug: Bool = Input(Bool())
val mtip: Bool = Input(Bool())
Expand Down

0 comments on commit 8aaba3e

Please sign in to comment.