diff --git a/src/privileged/csri.sv b/src/privileged/csri.sv index 2e5488af7..ea7bf7afb 100644 --- a/src/privileged/csri.sv +++ b/src/privileged/csri.sv @@ -60,7 +60,7 @@ module csri import cvw::*; #(parameter cvw_t P) ( // SSIP is writable in SIP if S mode exists if (P.S_SUPPORTED) begin:mask if (P.SSTC_SUPPORTED) begin - assign MIP_WRITE_MASK = 12'h202; // SEIP and SSIP are writable, but STIP is not writable when STIMECMP is implemented (see SSTC spec) + assign MIP_WRITE_MASK = ENVCFG_STCE ? 12'h202 : 12'h222; // SEIP and SSIP are writable, but STIP is not writable when STIMECMP is implemented (see SSTC spec) assign STIP = ENVCFG_STCE ? STimerInt : MIP_REGW_writeable[5]; end else begin assign MIP_WRITE_MASK = 12'h222; // SEIP, STIP, SSIP are writeable in MIP (20210108-draft 3.1.9) diff --git a/tests/coverage/priv.S b/tests/coverage/priv.S index 76c188413..aa9c8b50b 100644 --- a/tests/coverage/priv.S +++ b/tests/coverage/priv.S @@ -72,7 +72,7 @@ sretdone: li a0, 3 ecall # in M-mode li t0, 32 - csrs sip, t0 + csrs mip, t0 li a0, 1 ecall # in S-mode and expects stimer interrupt to occur li a0, 3