Skip to content

Commit

Permalink
fix(xtval): fix selection of tval for trap
Browse files Browse the repository at this point in the history
  • Loading branch information
wissygh authored and Tang-Haojin committed Nov 18, 2024
1 parent 1035522 commit 3b733a2
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,10 @@ class TrapEntryHSEventModule(implicit val p: Parameters) extends Module with CSR
private val tvalFillInst = isIllegalInst

private val tval = Mux1H(Seq(
(tvalFillPc ) -> trapPC,
(tvalFillPcPlus2 ) -> (trapPC + 2.U),
(tvalFillMemVaddr && !memIsVirt ) -> trapMemVA,
(tvalFillMemVaddr && memIsVirt ) -> trapMemVA,
(isLSGuestExcp ) -> trapMemVA,
(tvalFillInst ) -> trapInst,
(tvalFillPc ) -> trapPC,
(tvalFillPcPlus2 ) -> (trapPC + 2.U),
(tvalFillMemVaddr || isLSGuestExcp ) -> trapMemVA,
(tvalFillInst ) -> trapInst,
))

private val tval2 = Mux1H(Seq(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,10 @@ class TrapEntryMEventModule(implicit val p: Parameters) extends Module with CSRE
private val tvalFillInst = isIllegalInst

private val tval = Mux1H(Seq(
(tvalFillPc ) -> trapPC,
(tvalFillPcPlus2 ) -> (trapPC + 2.U),
(tvalFillMemVaddr && !memIsVirt ) -> trapMemVA,
(tvalFillMemVaddr && memIsVirt ) -> trapMemVA,
(isLSGuestExcp ) -> trapMemVA,
(tvalFillInst ) -> trapInst,
(tvalFillPc ) -> trapPC,
(tvalFillPcPlus2 ) -> (trapPC + 2.U),
(tvalFillMemVaddr || isLSGuestExcp ) -> trapMemVA,
(tvalFillInst ) -> trapInst,
))

private val tval2 = Mux1H(Seq(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,10 @@ class TrapEntryVSEventModule(implicit val p: Parameters) extends Module with CSR
private val tvalFillInst = isIllegalInst

private val tval = Mux1H(Seq(
(tvalFillPc ) -> trapPC,
(tvalFillPcPlus2 ) -> (trapPC + 2.U),
(tvalFillMemVaddr && !memIsVirt ) -> trapMemVA,
(tvalFillMemVaddr && memIsVirt ) -> trapMemVA,
(tvalFillInst ) -> trapInst,
tvalFillPc -> trapPC,
tvalFillPcPlus2 -> (trapPC + 2.U),
tvalFillMemVaddr -> trapMemVA,
tvalFillInst -> trapInst,
))

private val instrAddrTransType = AddrTransType(
Expand Down

0 comments on commit 3b733a2

Please sign in to comment.