提交 2f5f05fd 编写于 作者: W William Wang

CSR: Block stap write if satp mode is invalid

* If satp is written with an unsupported MODE,
the entire write has no effect
上级 bac25314
......@@ -510,7 +510,10 @@ class CSR extends FunctionUnit(csrCfg) with HasCSRConst{
))
// satp wen check
val wen = valid && func =/= CSROpType.jmp
val satpLegalMode = (wdata.asTypeOf(new SatpStruct).mode===0.U) || (wdata.asTypeOf(new SatpStruct).mode===8.U)
// general CSR wen check
val wen = valid && func =/= CSROpType.jmp && (addr=/=Satp.U || satpLegalMode)
val permitted = csrAccessPermissionCheck(addr, false.B, priviledgeMode)
// Writeable check is ingored.
// Currently, write to illegal csr addr will be ignored
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册