Open Timmmm opened 1 week ago
As noted by @KotorinMinami the getPendingSet() function can be simplified quite a lot now that N is gone:
getPendingSet()
function getPendingSet(priv : Privilege) -> option((xlenbits, Privilege)) = { assert(extensionEnabled(Ext_S) | mideleg == zeros()); let pending_m = mip.bits & mie.bits & ~(mideleg); let pending_s = mip.bits & mie.bits & mideleg; let mIE = (priv == Machine & mstatus[MIE] == 0b1) | priv == User | priv == Supervisor; let sIE = (priv == Supervisor & mstatus[SIE] == 0b1)) | priv == User; if mIE & (pending_m != zeros()) then Some((pending_m, Machine)) else if sIE & (pending_s != zeros()) then Some((pending_s, Supervisor)) else None() }
(not tested!)
As noted by @KotorinMinami the
getPendingSet()
function can be simplified quite a lot now that N is gone:(not tested!)