sail-riscv
sail-riscv copied to clipboard
is_CSR_defined has redundant privilege mode checks
is_CSR_defined has a ton of p == Machine etc. checks that should be replaced by true, since the permission check is already handled in a generic way by this:
function check_CSR(csr : csreg, p : Privilege, isWrite : bool) -> bool =
is_CSR_defined(csr, p)
& check_CSR_access(csrAccess(csr), csrPriv(csr), p, isWrite) <------------- this checks the privilege mode already
& check_TVM_SATP(csr, p)
& check_Counteren(csr, p)
& check_seed_CSR(csr, p, isWrite)