diff options
author | YenHaoChen <howard25336284@gmail.com> | 2022-12-09 15:32:49 +0800 |
---|---|---|
committer | YenHaoChen <howard25336284@gmail.com> | 2022-12-09 15:32:49 +0800 |
commit | b035edab78ba9248ee1c2334c0ff2cadc7cfb8cb (patch) | |
tree | e830e45d4a9042e3fed9701fd054227958ae1f21 /riscv | |
parent | adfaef00e5cd57bef0aa6a9909b4bff5b3863c40 (diff) | |
download | riscv-isa-sim-b035edab78ba9248ee1c2334c0ff2cadc7cfb8cb.zip riscv-isa-sim-b035edab78ba9248ee1c2334c0ff2cadc7cfb8cb.tar.gz riscv-isa-sim-b035edab78ba9248ee1c2334c0ff2cadc7cfb8cb.tar.bz2 |
refactor: remove proc parameter from functions of module_t
Diffstat (limited to 'riscv')
-rw-r--r-- | riscv/csrs.cc | 10 | ||||
-rw-r--r-- | riscv/triggers.cc | 10 | ||||
-rw-r--r-- | riscv/triggers.h | 10 |
3 files changed, 15 insertions, 15 deletions
diff --git a/riscv/csrs.cc b/riscv/csrs.cc index d3314ba..6bbc9f8 100644 --- a/riscv/csrs.cc +++ b/riscv/csrs.cc @@ -1134,11 +1134,11 @@ tdata1_csr_t::tdata1_csr_t(processor_t* const proc, const reg_t addr): } reg_t tdata1_csr_t::read() const noexcept { - return proc->TM.tdata1_read(proc, state->tselect->read()); + return proc->TM.tdata1_read(state->tselect->read()); } bool tdata1_csr_t::unlogged_write(const reg_t val) noexcept { - return proc->TM.tdata1_write(proc, state->tselect->read(), val); + return proc->TM.tdata1_write(state->tselect->read(), val); } tdata2_csr_t::tdata2_csr_t(processor_t* const proc, const reg_t addr): @@ -1146,11 +1146,11 @@ tdata2_csr_t::tdata2_csr_t(processor_t* const proc, const reg_t addr): } reg_t tdata2_csr_t::read() const noexcept { - return proc->TM.tdata2_read(proc, state->tselect->read()); + return proc->TM.tdata2_read(state->tselect->read()); } bool tdata2_csr_t::unlogged_write(const reg_t val) noexcept { - return proc->TM.tdata2_write(proc, state->tselect->read(), val); + return proc->TM.tdata2_write(state->tselect->read(), val); } tinfo_csr_t::tinfo_csr_t(processor_t* const proc, const reg_t addr) : @@ -1158,7 +1158,7 @@ tinfo_csr_t::tinfo_csr_t(processor_t* const proc, const reg_t addr) : } reg_t tinfo_csr_t::read() const noexcept { - return proc->TM.tinfo_read(proc, state->tselect->read()); + return proc->TM.tinfo_read(state->tselect->read()); } debug_mode_csr_t::debug_mode_csr_t(processor_t* const proc, const reg_t addr): diff --git a/riscv/triggers.cc b/riscv/triggers.cc index eba31b5..81d059c 100644 --- a/riscv/triggers.cc +++ b/riscv/triggers.cc @@ -270,12 +270,12 @@ module_t::~module_t() { } } -reg_t module_t::tdata1_read(const processor_t * const proc, unsigned index) const noexcept +reg_t module_t::tdata1_read(unsigned index) const noexcept { return triggers[index]->tdata1_read(proc); } -bool module_t::tdata1_write(processor_t * const proc, unsigned index, const reg_t val) noexcept +bool module_t::tdata1_write(unsigned index, const reg_t val) noexcept { if (triggers[index]->get_dmode() && !proc->get_state()->debug_mode) { return false; @@ -316,12 +316,12 @@ bool module_t::tdata1_write(processor_t * const proc, unsigned index, const reg_ return true; } -reg_t module_t::tdata2_read(const processor_t * const proc, unsigned index) const noexcept +reg_t module_t::tdata2_read(unsigned index) const noexcept { return triggers[index]->tdata2_read(proc); } -bool module_t::tdata2_write(processor_t * const proc, unsigned index, const reg_t val) noexcept +bool module_t::tdata2_write(unsigned index, const reg_t val) noexcept { if (triggers[index]->get_dmode() && !proc->get_state()->debug_mode) { return false; @@ -374,7 +374,7 @@ std::optional<match_result_t> module_t::detect_trap_match(const trap_t& t) noexc return std::nullopt; } -reg_t module_t::tinfo_read(UNUSED const processor_t * const proc, unsigned UNUSED index) const noexcept +reg_t module_t::tinfo_read(unsigned UNUSED index) const noexcept { /* In spike, every trigger supports the same types. */ return (1 << CSR_TDATA1_TYPE_MCONTROL) | diff --git a/riscv/triggers.h b/riscv/triggers.h index 37759df..fccd45b 100644 --- a/riscv/triggers.h +++ b/riscv/triggers.h @@ -176,11 +176,11 @@ public: module_t(unsigned count); ~module_t(); - reg_t tdata1_read(const processor_t * const proc, unsigned index) const noexcept; - bool tdata1_write(processor_t * const proc, unsigned index, const reg_t val) noexcept; - reg_t tdata2_read(const processor_t * const proc, unsigned index) const noexcept; - bool tdata2_write(processor_t * const proc, unsigned index, const reg_t val) noexcept; - reg_t tinfo_read(const processor_t * const proc, unsigned index) const noexcept; + reg_t tdata1_read(unsigned index) const noexcept; + bool tdata1_write(unsigned index, const reg_t val) noexcept; + reg_t tdata2_read(unsigned index) const noexcept; + bool tdata2_write(unsigned index, const reg_t val) noexcept; + reg_t tinfo_read(unsigned index) const noexcept; unsigned count() const { return triggers.size(); } |