[rtl] Clear mprv on mret to non M-mode

This is specification change between the v1.11 and v1.12 privileged
architectures. Previously mprv wasn't altered on mret. Now if returning
to a privilege level other than M mode mprv must be cleared.
This commit is contained in:
Greg Chadwick 2022-09-07 08:58:42 +01:00 committed by Greg Chadwick
parent 1d0344eb89
commit 423264ce5f

View file

@ -763,6 +763,10 @@ module ibex_cs_registers #(
mstatus_en = 1'b1;
mstatus_d.mie = mstatus_q.mpie; // re-enable interrupts
if (mstatus_q.mpp != PRIV_LVL_M) begin
mstatus_d.mprv = 1'b0;
end
// SEC_CM: EXCEPTION.CTRL_FLOW.LOCAL_ESC
// SEC_CM: EXCEPTION.CTRL_FLOW.GLOBAL_ESC
cpuctrl_we = 1'b1;