diff options
-rw-r--r-- | riscv/insns/csrrc.h | 2 | ||||
-rw-r--r-- | riscv/insns/csrrci.h | 2 | ||||
-rw-r--r-- | riscv/insns/csrrs.h | 2 | ||||
-rw-r--r-- | riscv/insns/csrrsi.h | 2 | ||||
-rw-r--r-- | riscv/insns/csrrw.h | 2 | ||||
-rw-r--r-- | riscv/insns/csrrwi.h | 2 | ||||
-rw-r--r-- | riscv/insns/mret.h | 2 | ||||
-rw-r--r-- | riscv/processor.cc | 6 | ||||
-rw-r--r-- | riscv/processor.h | 2 |
9 files changed, 11 insertions, 11 deletions
diff --git a/riscv/insns/csrrc.h b/riscv/insns/csrrc.h index 37384b0..019a9ce 100644 --- a/riscv/insns/csrrc.h +++ b/riscv/insns/csrrc.h @@ -2,7 +2,7 @@ bool write = insn.rs1() != 0; int csr = validate_csr(insn.csr(), write); reg_t old = p->get_csr(csr, insn, write); if (write) { - p->set_csr(csr, old & ~RS1); + p->put_csr(csr, old & ~RS1); } WRITE_RD(sext_xlen(old)); serialize(); diff --git a/riscv/insns/csrrci.h b/riscv/insns/csrrci.h index ad40c8f..f02d326 100644 --- a/riscv/insns/csrrci.h +++ b/riscv/insns/csrrci.h @@ -2,7 +2,7 @@ bool write = insn.rs1() != 0; int csr = validate_csr(insn.csr(), write); reg_t old = p->get_csr(csr, insn, write); if (write) { - p->set_csr(csr, old & ~(reg_t)insn.rs1()); + p->put_csr(csr, old & ~(reg_t)insn.rs1()); } WRITE_RD(sext_xlen(old)); serialize(); diff --git a/riscv/insns/csrrs.h b/riscv/insns/csrrs.h index 91fcc7a..7632d1f 100644 --- a/riscv/insns/csrrs.h +++ b/riscv/insns/csrrs.h @@ -2,7 +2,7 @@ bool write = insn.rs1() != 0; int csr = validate_csr(insn.csr(), write); reg_t old = p->get_csr(csr, insn, write); if (write) { - p->set_csr(csr, old | RS1); + p->put_csr(csr, old | RS1); } WRITE_RD(sext_xlen(old)); serialize(); diff --git a/riscv/insns/csrrsi.h b/riscv/insns/csrrsi.h index f348e57..9acfcfc 100644 --- a/riscv/insns/csrrsi.h +++ b/riscv/insns/csrrsi.h @@ -2,7 +2,7 @@ bool write = insn.rs1() != 0; int csr = validate_csr(insn.csr(), write); reg_t old = p->get_csr(csr, insn, write); if (write) { - p->set_csr(csr, old | insn.rs1()); + p->put_csr(csr, old | insn.rs1()); } WRITE_RD(sext_xlen(old)); serialize(); diff --git a/riscv/insns/csrrw.h b/riscv/insns/csrrw.h index cc0c28d..e4c605b 100644 --- a/riscv/insns/csrrw.h +++ b/riscv/insns/csrrw.h @@ -1,5 +1,5 @@ int csr = validate_csr(insn.csr(), true); reg_t old = p->get_csr(csr, insn, true); -p->set_csr(csr, RS1); +p->put_csr(csr, RS1); WRITE_RD(sext_xlen(old)); serialize(); diff --git a/riscv/insns/csrrwi.h b/riscv/insns/csrrwi.h index 4d5d064..77fec15 100644 --- a/riscv/insns/csrrwi.h +++ b/riscv/insns/csrrwi.h @@ -1,5 +1,5 @@ int csr = validate_csr(insn.csr(), true); reg_t old = p->get_csr(csr, insn, true); -p->set_csr(csr, insn.rs1()); +p->put_csr(csr, insn.rs1()); WRITE_RD(sext_xlen(old)); serialize(); diff --git a/riscv/insns/mret.h b/riscv/insns/mret.h index 77847dd..5198b8f 100644 --- a/riscv/insns/mret.h +++ b/riscv/insns/mret.h @@ -9,6 +9,6 @@ s = set_field(s, MSTATUS_MIE, get_field(s, MSTATUS_MPIE)); s = set_field(s, MSTATUS_MPIE, 1); s = set_field(s, MSTATUS_MPP, p->extension_enabled('U') ? PRV_U : PRV_M); s = set_field(s, MSTATUS_MPV, 0); -p->set_csr(CSR_MSTATUS, s); +p->put_csr(CSR_MSTATUS, s); p->set_privilege(prev_prv); p->set_virt(prev_virt); diff --git a/riscv/processor.cc b/riscv/processor.cc index e6783bf..3b8d2ec 100644 --- a/riscv/processor.cc +++ b/riscv/processor.cc @@ -496,8 +496,8 @@ void processor_t::reset() if (n_pmp > 0) { // For backwards compatibility with software that is unaware of PMP, // initialize PMP to permit unprivileged access to all of memory. - set_csr(CSR_PMPADDR0, ~reg_t(0)); - set_csr(CSR_PMPCFG0, PMP_R | PMP_W | PMP_X | PMP_NAPOT); + put_csr(CSR_PMPADDR0, ~reg_t(0)); + put_csr(CSR_PMPCFG0, PMP_R | PMP_W | PMP_X | PMP_NAPOT); } for (auto e : custom_extensions) // reset any extensions @@ -838,7 +838,7 @@ int processor_t::paddr_bits() return max_xlen == 64 ? 50 : 34; } -void processor_t::set_csr(int which, reg_t val) +void processor_t::put_csr(int which, reg_t val) { val = zext_xlen(val); auto search = state.csrmap.find(which); diff --git a/riscv/processor.h b/riscv/processor.h index 7d05346..617fa42 100644 --- a/riscv/processor.h +++ b/riscv/processor.h @@ -279,7 +279,7 @@ public: #endif void reset(); void step(size_t n); // run for n cycles - void set_csr(int which, reg_t val); + void put_csr(int which, reg_t val); uint32_t get_id() const { return id; } reg_t get_csr(int which, insn_t insn, bool write, bool peek = 0); reg_t get_csr(int which) { return get_csr(which, insn_t(0), false, true); } |