csrExceptionVec(illegalInstr):=isIllegalAddr&&wen// Trigger an illegal instr exception when unimplemented csr is being read/written // TODO: if csrrw under wrong priv mode will cause illegal instr now ?
@@ -655,23 +688,13 @@ class CSR extends FunctionUnit(csrCfg) with HasCSRConst{
XSDebug(raiseExceptionIntr,"int/exc: pc %x int (%d):%x exc: (%d):%x\n",io.exception.bits.cf.pc,intrNO,io.exception.bits.cf.intrVec.asUInt,exceptionNO,raiseExceptionVec.asUInt)
XSDebug(io.redirectValid,"redirect to %x\n",io.redirect.target)
XSDebug(valid&&isMret,"Mret to %x!\n[CSR] int/exc: pc %x int (%d):%x exc: (%d):%x\n",retTarget,io.cfIn.pc,intrNO,io.cfIn.intrVec.asUInt,exceptionNO,raiseExceptionVec.asUInt)
XSDebug(valid&&isSret,"Sret to %x!\n[CSR] int/exc: pc %x int (%d):%x exc: (%d):%x\n",retTarget,io.cfIn.pc,intrNO,io.cfIn.intrVec.asUInt,exceptionNO,raiseExceptionVec.asUInt)
valtvalWen=!(hasInstrPageFault||hasLoadPageFault||hasStorePageFault||hasLoadAddrMisaligned||hasStoreAddrMisaligned)||raiseIntr// in noop-riscv64, no exception will come together with PF
valtvalWen=!(hasInstrPageFault||hasLoadPageFault||hasStorePageFault||hasLoadAddrMisaligned||hasStoreAddrMisaligned)||raiseIntr// TODO: need check