Skip to content

Commit

Permalink
fix(critical-error): critical-error pass early then trap
Browse files Browse the repository at this point in the history
* critical-error diff REF as xiangshan pass criticial-error too early
* bump difftest to make critical_error more prominent
  • Loading branch information
lewislzh committed Nov 18, 2024
1 parent cfa1639 commit 9c2c99a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion difftest
5 changes: 5 additions & 0 deletions src/main/scala/xiangshan/backend/fu/NewCSR/NewCSR.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1372,6 +1372,11 @@ class NewCSR(implicit val p: Parameters) extends Module
diffArchEvent.exceptionInst := RegEnable(io.fromRob.trap.bits.instr, hasTrap)
}

val diffCriticalErrorEvent = DifftestModule(new DiffCriticalErrorEvent, delay = 4, dontCare = true)
diffCriticalErrorEvent.valid := io.status.criticalErrorState && trapValid
diffCriticalErrorEvent.coreid := hartId
diffCriticalErrorEvent.criticalError := io.status.criticalErrorState

val diffCSRState = DifftestModule(new DiffCSRState)
diffCSRState.coreid := hartId
diffCSRState.privilegeMode := privState.PRVM.asUInt
Expand Down
5 changes: 0 additions & 5 deletions src/main/scala/xiangshan/backend/rob/Rob.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1489,11 +1489,6 @@ class RobImp(override val wrapper: Rob)(implicit p: Parameters, params: BackendP
difftest.code := trapCode
difftest.pc := trapPC
}

val diffCriticalErrorEvent = DifftestModule(new DiffCriticalErrorEvent)
diffCriticalErrorEvent.valid := criticalErrorState && !RegNext(criticalErrorState)
diffCriticalErrorEvent.coreid := io.hartId
diffCriticalErrorEvent.criticalError := criticalErrorState
}

//store evetn difftest information
Expand Down

0 comments on commit 9c2c99a

Please sign in to comment.