提交 ea2822a3 编写于 作者: W William Wang

fix(CSR): all exceptions now set cf.wen to 0

上级 ba6eb9e6
......@@ -547,11 +547,11 @@ class CSR(implicit val p: NOOPConfig) extends NOOPModule with HasCSRConst{
csrExceptionVec(illegalInstr) := isIllegalAddr && wen // Trigger an illegal instr exception when unimplemented csr is being read/written
csrExceptionVec(loadPageFault) := hasLoadPageFault
csrExceptionVec(storePageFault) := hasStorePageFault
io.wenFix := isIllegalAddr && wen
val iduExceptionVec = io.cfIn.exceptionVec
val raiseExceptionVec = csrExceptionVec.asUInt() | iduExceptionVec.asUInt()
val raiseException = raiseExceptionVec.orR
val exceptionNO = ExcPriority.foldRight(0.U)((i: Int, sum: UInt) => Mux(raiseExceptionVec(i), i.U, sum))
io.wenFix := raiseException
val causeNO = (raiseIntr << (XLEN-1)) | Mux(raiseIntr, intrNO, exceptionNO)
io.intrNO := Mux(raiseIntr, causeNO, 0.U)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册