aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--riscv/csrs.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/riscv/csrs.cc b/riscv/csrs.cc
index 70468d0..914662a 100644
--- a/riscv/csrs.cc
+++ b/riscv/csrs.cc
@@ -1866,7 +1866,7 @@ void sscsrind_reg_csr_t::verify_permissions(insn_t insn, bool write) const {
}
if (proc->extension_enabled(EXT_SMCDELEG)) {
- if (insn.csr() >= CSR_VSIREG && insn.csr() <= CSR_VSIREG6) {
+ if (address >= CSR_VSIREG && address <= CSR_VSIREG6) {
if (!state->v) {
// An attempt to access any vsireg* from M or S mode raises an illegal instruction exception.
throw trap_illegal_instruction(insn.bits());
@@ -1884,7 +1884,7 @@ void sscsrind_reg_csr_t::verify_permissions(insn_t insn, bool write) const {
}
}
}
- if (insn.csr() >= CSR_SIREG && insn.csr() <= CSR_SIREG6) {
+ if (address >= CSR_SIREG && address <= CSR_SIREG6) {
// attempts to access any sireg* when menvcfg.CDE = 0;
if ((state->menvcfg->read() & MENVCFG_CDE) != MENVCFG_CDE) {
if (!state->v) {