Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(exception): check high address bits of jump target #3003

Merged
merged 27 commits into from
Sep 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
b7bf1cc
exception: check high bits of target in brh and jmp
Tang-Haojin May 23, 2024
a86ad4b
Frontend: Receive backend PF and AF signals and invoke corresponding …
Yan-Muzi May 24, 2024
8dd803a
fix: backend ipf and iaf are not guaranteed to be correct when redire…
Yan-Muzi May 27, 2024
04ecede
fix: new redirect request should overwrite previous redirect request
Yan-Muzi May 27, 2024
bea09e1
FTQ: add some comments for backend IPF and IAF
Yan-Muzi Jun 2, 2024
96329f5
fix: more accurately control ipf and iaf signals sent to ICache
Yan-Muzi Jun 24, 2024
b5a9fef
feat: notify backend if ipf and iaf are sent from backend
Yan-Muzi Jun 24, 2024
3f873c8
Merge branch 'master' into high-address-check
Yan-Muzi Jul 9, 2024
7a8c464
IFU: add some comments
Yan-Muzi Jul 10, 2024
93d433e
HighAddress: check igpf
Tang-Haojin Aug 8, 2024
b1ecea5
Merge remote-tracking branch 'origin/master' into high-address-check
Tang-Haojin Aug 8, 2024
ebb0eac
Merge branch 'master' into high-address-check
ngc7331 Aug 12, 2024
21a0ca2
Merge commit '8b9535b8ff104373776344175e045080e7f3ddb2' into high-add…
Tang-Haojin Aug 30, 2024
7473c9f
feat(CSR): implement high addr check for trap and mret for ifetch
Tang-Haojin Aug 30, 2024
d060f69
Merge remote-tracking branch 'origin/master' into high-address-check
Tang-Haojin Aug 30, 2024
09eed61
feat(CSR): add Sv48 and Sv48x4 support for AddrTransType
Tang-Haojin Aug 30, 2024
52e4ca1
fix(ICacheMainPipe): use s0_itlb_exception
Tang-Haojin Aug 30, 2024
3f2d348
Merge remote-tracking branch 'origin/master' into high-address-check
Tang-Haojin Sep 3, 2024
7fd3957
Merge remote-tracking branch 'origin/master' into high-address-check
Tang-Haojin Sep 4, 2024
384accc
save complete tval
Tang-Haojin Sep 6, 2024
5b51017
Merge remote-tracking branch 'origin/master' into high-address-check
Tang-Haojin Sep 6, 2024
bf95695
adapt nmi
Tang-Haojin Sep 6, 2024
1e7f88e
fix TrapEntryMNEvent
Tang-Haojin Sep 6, 2024
9bc7d32
bump ready-to-run
Tang-Haojin Sep 6, 2024
943552c
Merge remote-tracking branch 'origin/master' into high-address-check
Tang-Haojin Sep 8, 2024
76eef45
code refactor
Tang-Haojin Sep 9, 2024
0b37b5a
Merge branch 'master' into high-address-check
Tang-Haojin Sep 9, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ready-to-run
43 changes: 43 additions & 0 deletions src/main/scala/xiangshan/Bundle.scala
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import org.chipsalliance.cde.config.Parameters
import chisel3._
import chisel3.util.BitPat.bitPatToUInt
import chisel3.util._
import chisel3.experimental.BundleLiterals._
import utility._
import utils._
import xiangshan.backend.decode.{ImmUnion, XDecode}
Expand Down Expand Up @@ -118,6 +119,10 @@ class CfiUpdateInfo(implicit p: Parameters) extends XSBundle with HasBPUParamete
val isMisPred = Bool()
val shift = UInt((log2Ceil(numBr)+1).W)
val addIntoHist = Bool()
// raise exceptions from backend
val backendIGPF = Bool() // instruction guest page fault
val backendIPF = Bool() // instruction page fault
val backendIAF = Bool() // instruction access fault

def fromFtqRedirectSram(entry: Ftq_Redirect_SRAMEntry) = {
// this.hist := entry.ghist
Expand All @@ -130,6 +135,8 @@ class CfiUpdateInfo(implicit p: Parameters) extends XSBundle with HasBPUParamete
this.topAddr := entry.topAddr
this
}

def hasBackendFault = backendIGPF || backendIPF || backendIAF
}

// Dequeue DecodeWidth insts from Ibuffer
Expand All @@ -138,6 +145,7 @@ class CtrlFlow(implicit p: Parameters) extends XSBundle {
val pc = UInt(VAddrBits.W)
val foldpc = UInt(MemPredPCWidth.W)
val exceptionVec = ExceptionVec()
val exceptionFromBackend = Bool()
val trigger = TriggerAction()
val pd = new PreDecodeInfo
val pred_taken = Bool()
Expand Down Expand Up @@ -305,6 +313,7 @@ class Redirect(implicit p: Parameters) extends XSBundle {
val level = RedirectLevel()
val interrupt = Bool()
val cfiUpdate = new CfiUpdateInfo
val fullTarget = UInt(XLEN.W) // only used for tval storage in backend

val stFtqIdx = new FtqPtr // for load violation predict
val stFtqOffset = UInt(log2Up(PredictWidth).W)
Expand Down Expand Up @@ -631,6 +640,40 @@ class DistributedCSRUpdateReq(implicit p: Parameters) extends XSBundle {
}
}

class AddrTransType(implicit p: Parameters) extends XSBundle {
val bare, sv39, sv39x4, sv48, sv48x4 = Bool()

def checkAccessFault(target: UInt): Bool = bare && target(XLEN - 1, PAddrBits).orR
def checkPageFault(target: UInt): Bool =
sv39 && target(XLEN - 1, 39) =/= VecInit.fill(XLEN - 39)(target(38)).asUInt ||
sv48 && target(XLEN - 1, 48) =/= VecInit.fill(XLEN - 48)(target(47)).asUInt
def checkGuestPageFault(target: UInt): Bool =
sv39x4 && target(XLEN - 1, 41).orR || sv48x4 && target(XLEN - 1, 50).orR
}

object AddrTransType {
def apply(bare: Boolean = false,
sv39: Boolean = false,
sv39x4: Boolean = false,
sv48: Boolean = false,
sv48x4: Boolean = false)(implicit p: Parameters): AddrTransType =
(new AddrTransType).Lit(_.bare -> bare.B,
_.sv39 -> sv39.B,
_.sv39x4 -> sv39x4.B,
_.sv48 -> sv48.B,
_.sv48x4 -> sv48x4.B)

def apply(bare: Bool, sv39: Bool, sv39x4: Bool, sv48: Bool, sv48x4: Bool)(implicit p: Parameters): AddrTransType = {
val addrTransType = Wire(new AddrTransType)
addrTransType.bare := bare
addrTransType.sv39 := sv39
addrTransType.sv39x4 := sv39x4
addrTransType.sv48 := sv48
addrTransType.sv48x4 := sv48x4
addrTransType
}
}

class L1CacheErrorInfo(implicit p: Parameters) extends XSBundle {
// L1CacheErrorInfo is also used to encode customized CACHE_ERROR CSR
val source = Output(new Bundle() {
Expand Down
1 change: 1 addition & 0 deletions src/main/scala/xiangshan/backend/Backend.scala
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,7 @@ class BackendImp(override val wrapper: Backend)(implicit p: Parameters) extends
csrio.vpu.vl := ZeroExt(debugVl_s1, XLEN)
csrio.vpu.dirty_vs := ctrlBlock.io.robio.csr.dirty_vs
csrio.exception := ctrlBlock.io.robio.exception
csrio.robDeqPtr := ctrlBlock.io.robio.robDeqPtr
csrio.memExceptionVAddr := io.mem.exceptionAddr.vaddr
csrio.memExceptionGPAddr := io.mem.exceptionAddr.gpaddr
csrio.externalInterrupt := RegNext(io.fromTop.externalInterrupt)
Expand Down
5 changes: 5 additions & 0 deletions src/main/scala/xiangshan/backend/Bundles.scala
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ object Bundles {
val pc = UInt(VAddrBits.W)
val foldpc = UInt(MemPredPCWidth.W)
val exceptionVec = ExceptionVec()
val isFetchMalAddr = Bool()
val trigger = TriggerAction()
val preDecodeInfo = new PreDecodeInfo
val pred_taken = Bool()
Expand All @@ -56,6 +57,7 @@ object Bundles {
this.pc := source.pc
this.foldpc := source.foldpc
this.exceptionVec := source.exceptionVec
this.isFetchMalAddr := source.exceptionFromBackend
this.trigger := source.trigger
this.preDecodeInfo := source.pd
this.pred_taken := source.pred_taken
Expand All @@ -73,6 +75,7 @@ object Bundles {
val pc = UInt(VAddrBits.W)
val foldpc = UInt(MemPredPCWidth.W)
val exceptionVec = ExceptionVec()
val isFetchMalAddr = Bool()
val trigger = TriggerAction()
val preDecodeInfo = new PreDecodeInfo
val pred_taken = Bool()
Expand Down Expand Up @@ -166,6 +169,7 @@ object Bundles {
val pc = UInt(VAddrBits.W)
val foldpc = UInt(MemPredPCWidth.W)
val exceptionVec = ExceptionVec()
val isFetchMalAddr = Bool()
val hasException = Bool()
val trigger = TriggerAction()
val preDecodeInfo = new PreDecodeInfo
Expand Down Expand Up @@ -850,6 +854,7 @@ object Bundles {
val instr = UInt(32.W)
val commitType = CommitType()
val exceptionVec = ExceptionVec()
val isFetchMalAddr = Bool()
val gpaddr = UInt(GPAddrBits.W)
val singleStep = Bool()
val crossPageIPFFix = Bool()
Expand Down
8 changes: 7 additions & 1 deletion src/main/scala/xiangshan/backend/CtrlBlock.scala
Original file line number Diff line number Diff line change
Expand Up @@ -295,10 +295,16 @@ class CtrlBlockImp(
private val s5_csrIsTrap = DelayN(rob.io.exception.valid, 4)
private val s5_trapTargetFromCsr = io.robio.csr.trapTarget

val flushTarget = Mux(s5_csrIsTrap, s5_trapTargetFromCsr, s2_robFlushPc)
val flushTarget = Mux(s5_csrIsTrap, s5_trapTargetFromCsr.pc, s2_robFlushPc)
val s5_trapTargetIAF = Mux(s5_csrIsTrap, s5_trapTargetFromCsr.raiseIAF, false.B)
val s5_trapTargetIPF = Mux(s5_csrIsTrap, s5_trapTargetFromCsr.raiseIPF, false.B)
val s5_trapTargetIGPF = Mux(s5_csrIsTrap, s5_trapTargetFromCsr.raiseIGPF, false.B)
when (s6_flushFromRobValid) {
io.frontend.toFtq.redirect.bits.level := RedirectLevel.flush
io.frontend.toFtq.redirect.bits.cfiUpdate.target := RegEnable(flushTarget, s5_flushFromRobValidAhead)
io.frontend.toFtq.redirect.bits.cfiUpdate.backendIAF := RegEnable(s5_trapTargetIAF, s5_flushFromRobValidAhead)
io.frontend.toFtq.redirect.bits.cfiUpdate.backendIPF := RegEnable(s5_trapTargetIPF, s5_flushFromRobValidAhead)
io.frontend.toFtq.redirect.bits.cfiUpdate.backendIGPF := RegEnable(s5_trapTargetIGPF, s5_flushFromRobValidAhead)
}

for (i <- 0 until DecodeWidth) {
Expand Down
6 changes: 5 additions & 1 deletion src/main/scala/xiangshan/backend/MemBlock.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1287,7 +1287,11 @@ class MemBlockImp(outer: MemBlock) extends LazyModuleImp(outer)
}
val allRedirect = loadUnits.map(_.io.rollback) ++ hybridUnits.map(_.io.ldu_io.rollback) ++ Seq(lsq.io.nack_rollback) ++ lsq.io.nuke_rollback
val oldestOneHot = selectOldestRedirect(allRedirect)
val oldestRedirect = Mux1H(oldestOneHot, allRedirect)
val oldestRedirect = WireDefault(Mux1H(oldestOneHot, allRedirect))
// memory replay would not cause IAF/IPF/IGPF
oldestRedirect.bits.cfiUpdate.backendIAF := false.B
oldestRedirect.bits.cfiUpdate.backendIPF := false.B
oldestRedirect.bits.cfiUpdate.backendIGPF := false.B
io.mem_to_ooo.memoryViolation := oldestRedirect
io.mem_to_ooo.lsqio.lqCanAccept := lsq.io.lqCanAccept
io.mem_to_ooo.lsqio.sqCanAccept := lsq.io.sqCanAccept
Expand Down
5 changes: 4 additions & 1 deletion src/main/scala/xiangshan/backend/exu/ExeUnit.scala
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import freechips.rocketchip.diplomacy.{LazyModule, LazyModuleImp}
import utility._
import xiangshan.backend.fu.{CSRFileIO, FenceIO, FuncUnitInput}
import xiangshan.backend.Bundles.{ExuInput, ExuOutput, MemExuInput, MemExuOutput}
import xiangshan.{FPUCtrlSignals, HasXSParameter, Redirect, XSBundle, XSModule}
import xiangshan.{AddrTransType, FPUCtrlSignals, HasXSParameter, Redirect, XSBundle, XSModule}
import xiangshan.backend.datapath.WbConfig.{PregWB, _}
import xiangshan.backend.fu.FuType
import xiangshan.backend.fu.vector.Bundles.{VType, Vxrm}
Expand All @@ -44,6 +44,7 @@ class ExeUnitIO(params: ExeUnitParams)(implicit p: Parameters) extends XSBundle
val vtype = Option.when(params.writeVConfig)((Valid(new VType)))
val vlIsZero = Option.when(params.writeVConfig)(Output(Bool()))
val vlIsVlmax = Option.when(params.writeVConfig)(Output(Bool()))
val instrAddrTransType = Option.when(params.hasJmpFu || params.hasBrhFu)(Input(new AddrTransType))
}

class ExeUnit(val exuParams: ExeUnitParams)(implicit p: Parameters) extends LazyModule {
Expand Down Expand Up @@ -329,6 +330,7 @@ class ExeUnitImp(
fuio =>
exuio <> fuio
fuio.exception := DelayN(exuio.exception, 2)
fuio.robDeqPtr := DelayN(exuio.robDeqPtr, 2)
}))
io.csrin.foreach(exuio => funcUnits.foreach(fu => fu.io.csrin.foreach{fuio => fuio := exuio}))
io.csrToDecode.foreach(toDecode => funcUnits.foreach(fu => fu.io.csrToDecode.foreach(fuOut => toDecode := fuOut)))
Expand All @@ -339,6 +341,7 @@ class ExeUnitImp(
io.vxrm.foreach(exuio => funcUnits.foreach(fu => fu.io.vxrm.foreach(fuio => fuio <> exuio)))
io.vlIsZero.foreach(exuio => funcUnits.foreach(fu => fu.io.vlIsZero.foreach(fuio => exuio := fuio)))
io.vlIsVlmax.foreach(exuio => funcUnits.foreach(fu => fu.io.vlIsVlmax.foreach(fuio => exuio := fuio)))
io.instrAddrTransType.foreach(exuio => funcUnits.foreach(fu => fu.io.instrAddrTransType.foreach(fuio => fuio := exuio)))

// debug info
io.out.bits.debug := 0.U.asTypeOf(io.out.bits.debug)
Expand Down
3 changes: 3 additions & 0 deletions src/main/scala/xiangshan/backend/exu/ExuBlock.scala
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ class ExuBlockImp(
// }
XSPerfAccumulate(s"${(exu.wrapper.exuParams.name)}_fire_cnt", PopCount(exu.io.in.fire))
}
exus.find(_.io.csrio.nonEmpty).map(_.io.csrio.get).foreach { csrio =>
exus.map(_.io.instrAddrTransType.foreach(_ := csrio.instrAddrTransType))
}
val aluFireSeq = exus.filter(_.wrapper.exuParams.fuConfigs.contains(AluCfg)).map(_.io.in.fire)
for (i <- 0 until (aluFireSeq.size + 1)){
XSPerfAccumulate(s"alu_fire_${i}_cnt", PopCount(aluFireSeq) === i.U)
Expand Down
7 changes: 6 additions & 1 deletion src/main/scala/xiangshan/backend/fu/CSR.scala
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ import xiangshan._
import xiangshan.backend.fu.util._
import xiangshan.cache._
import xiangshan.backend.Bundles.{ExceptionInfo, TrapInstInfo}
import xiangshan.backend.fu.NewCSR.CSREvents.TargetPCBundle
import xiangshan.backend.fu.NewCSR.CSRNamedConstant.ContextStatus
import xiangshan.backend.rob.RobPtr
import utils.MathUtils.{BigIntGenMask, BigIntNot}

class FpuCsrIO extends Bundle {
Expand Down Expand Up @@ -90,9 +92,10 @@ class CSRFileIO(implicit p: Parameters) extends XSBundle {
val vpu = Flipped(new VpuCsrIO)
// from rob
val exception = Flipped(ValidIO(new ExceptionInfo))
val robDeqPtr = Input(new RobPtr)
// to ROB
val isXRet = Output(Bool())
val trapTarget = Output(UInt(VAddrBits.W))
val trapTarget = Output(new TargetPCBundle)
val interrupt = Output(Bool())
val wfi_event = Output(Bool())
// from LSQ
Expand All @@ -107,6 +110,8 @@ class CSRFileIO(implicit p: Parameters) extends XSBundle {
val debugMode = Output(Bool())
// Custom microarchiture ctrl signal
val customCtrl = Output(new CustomCSRCtrlIO)
// instruction fetch address translation type
val instrAddrTransType = Output(new AddrTransType)
}

class VtypeStruct(implicit p: Parameters) extends XSBundle {
Expand Down
4 changes: 4 additions & 0 deletions src/main/scala/xiangshan/backend/fu/FuConfig.scala
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,10 @@ case class FuConfig (

def isCsr: Boolean = fuType == FuType.csr

def isBrh: Boolean = fuType == FuType.brh

def isJmp: Boolean = fuType == FuType.jmp

def isFence: Boolean = fuType == FuType.fence

def isVecArith: Boolean = fuType == FuType.vialuF || fuType == FuType.vimac ||
Expand Down
1 change: 1 addition & 0 deletions src/main/scala/xiangshan/backend/fu/FuncUnit.scala
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ class FuncUnitIO(cfg: FuConfig)(implicit p: Parameters) extends XSBundle {
val vtype = OptionWrapper(cfg.writeVlRf, (Valid(new VType)))
val vlIsZero = OptionWrapper(cfg.writeVlRf, Output(Bool()))
val vlIsVlmax = OptionWrapper(cfg.writeVlRf, Output(Bool()))
val instrAddrTransType = Option.when(cfg.isJmp || cfg.isBrh)(Input(new AddrTransType))
}

abstract class FuncUnit(val cfg: FuConfig)(implicit p: Parameters) extends XSModule {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,10 @@ class TrapEntryEventInput(implicit val p: Parameters) extends Bundle with HasXSP
val trapPc = Input(UInt(VaddrMaxWidth.W))
val trapPcGPA = Input(UInt(GPAddrBits.W))
val trapInst = Input(ValidIO(UInt(InstWidth.W)))
val fetchMalTval = Input(UInt(XLEN.W))
val isCrossPageIPF = Input(Bool())
val isHls = Input(Bool())
val isFetchMalAddr = Input(Bool())

// always current privilege
val iMode = Input(new PrivState())
Expand All @@ -126,7 +128,7 @@ class TrapEntryEventInput(implicit val p: Parameters) extends Bundle with HasXSP

val tcontrol = Input(new TcontrolBundle)

val pcFromXtvec = Input(UInt(VaddrMaxWidth.W))
val pcFromXtvec = Input(UInt(XLEN.W))

val satp = Input(new SatpBundle)
val vsatp = Input(new SatpBundle)
Expand All @@ -137,3 +139,12 @@ class TrapEntryEventInput(implicit val p: Parameters) extends Bundle with HasXSP
val virtualInterruptIsHvictlInject = Input(Bool())
val hvictlIID = Input(UInt(HIIDWidth.W))
}

class TargetPCBundle extends Bundle {
val pc = UInt(XLEN.W)
val raiseIPF = Bool()
val raiseIAF = Bool()
val raiseIGPF = Bool()

def raiseFault = raiseIPF || raiseIAF || raiseIGPF
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,19 @@ package xiangshan.backend.fu.NewCSR.CSREvents

import chisel3._
import chisel3.util._
import org.chipsalliance.cde.config.Parameters
import xiangshan.backend.fu.NewCSR.CSRConfig.VaddrMaxWidth
import xiangshan.backend.fu.NewCSR.CSRDefines.PrivMode
import xiangshan.backend.fu.NewCSR.CSRDefines.{HgatpMode, PrivMode, SatpMode}
import xiangshan.backend.fu.NewCSR._
import xiangshan.AddrTransType


class DretEventOutput extends Bundle with EventUpdatePrivStateOutput with EventOutputBase {
val dcsr = ValidIO((new DcsrBundle).addInEvent(_.V, _.PRV))
val mstatus = ValidIO((new MstatusBundle).addInEvent(_.MPRV))
val debugMode = ValidIO(Bool())
val debugIntrEnable = ValidIO(Bool())
val targetPc = ValidIO(UInt(VaddrMaxWidth.W))
val targetPc = ValidIO(new TargetPCBundle)

override def getBundleByName(name: String): ValidIO[CSRBundle] = {
name match {
Expand All @@ -26,12 +28,32 @@ class DretEventInput extends Bundle {
val dcsr = Input(new DcsrBundle)
val dpc = Input(new Epc)
val mstatus = Input(new MstatusBundle)
val satp = Input(new SatpBundle)
val vsatp = Input(new SatpBundle)
val hgatp = Input(new HgatpBundle)
}

class DretEventModule extends Module with CSREventBase {
class DretEventModule(implicit p: Parameters) extends Module with CSREventBase {
val in = IO(new DretEventInput)
val out = IO(new DretEventOutput)

private val satp = in.satp
private val vsatp = in.vsatp
private val hgatp = in.hgatp
private val nextPrivState = out.privState.bits

private val instrAddrTransType = AddrTransType(
bare = nextPrivState.isModeM ||
(!nextPrivState.isVirtual && satp.MODE === SatpMode.Bare) ||
(nextPrivState.isVirtual && vsatp.MODE === SatpMode.Bare && hgatp.MODE === HgatpMode.Bare),
sv39 = !nextPrivState.isModeM && !nextPrivState.isVirtual && satp.MODE === SatpMode.Sv39 ||
nextPrivState.isVirtual && vsatp.MODE === SatpMode.Sv39,
sv48 = !nextPrivState.isModeM && !nextPrivState.isVirtual && satp.MODE === SatpMode.Sv48 ||
nextPrivState.isVirtual && vsatp.MODE === SatpMode.Sv48,
sv39x4 = nextPrivState.isVirtual && vsatp.MODE === SatpMode.Bare && hgatp.MODE === HgatpMode.Sv39x4,
sv48x4 = nextPrivState.isVirtual && vsatp.MODE === SatpMode.Bare && hgatp.MODE === HgatpMode.Sv48x4
)

out := DontCare

out.debugMode.valid := valid
Expand All @@ -41,12 +63,15 @@ class DretEventModule extends Module with CSREventBase {
out.debugIntrEnable.valid := valid
out.targetPc.valid := valid

out.privState.bits.PRVM := in.dcsr.PRV.asUInt
out.privState.bits.V := in.dcsr.V
out.mstatus.bits.MPRV := Mux(!out.privState.bits.isModeM, 0.U, in.mstatus.MPRV.asUInt)
out.debugMode.bits := false.B
out.debugIntrEnable.bits := true.B
out.targetPc.bits := in.dpc.asUInt
out.privState.bits.PRVM := in.dcsr.PRV.asUInt
out.privState.bits.V := in.dcsr.V
out.mstatus.bits.MPRV := Mux(!out.privState.bits.isModeM, 0.U, in.mstatus.MPRV.asUInt)
out.debugMode.bits := false.B
out.debugIntrEnable.bits := true.B
out.targetPc.bits.pc := in.dpc.asUInt
out.targetPc.bits.raiseIPF := instrAddrTransType.checkPageFault(in.dpc.asUInt)
out.targetPc.bits.raiseIAF := instrAddrTransType.checkAccessFault(in.dpc.asUInt)
out.targetPc.bits.raiseIGPF := instrAddrTransType.checkGuestPageFault(in.dpc.asUInt)
}

trait DretEventSinkBundle { self: CSRModule[_] =>
Expand Down
Loading
Loading