diff options
author | Weiwei Li <liweiwei@iscas.ac.cn> | 2022-07-08 18:34:13 +0800 |
---|---|---|
committer | Weiwei Li <liweiwei@iscas.ac.cn> | 2022-07-21 08:50:23 +0800 |
commit | 28ee0c4d6a1ed221f1a05ba48f54023ac7d455cc (patch) | |
tree | d7bcb889ac5757ee84eb2a09a86cbad96c4db18e /riscv/csrs.h | |
parent | d02b285c8858e33c7f9a79207127c8374c4ddc62 (diff) | |
download | spike-28ee0c4d6a1ed221f1a05ba48f54023ac7d455cc.zip spike-28ee0c4d6a1ed221f1a05ba48f54023ac7d455cc.tar.gz spike-28ee0c4d6a1ed221f1a05ba48f54023ac7d455cc.tar.bz2 |
modify minstret/mcycle/minstreth/mcycleh to reuse rv32_low/high_csr_t
Diffstat (limited to 'riscv/csrs.h')
-rw-r--r-- | riscv/csrs.h | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/riscv/csrs.h b/riscv/csrs.h index 500bde7..8108d1e 100644 --- a/riscv/csrs.h +++ b/riscv/csrs.h @@ -260,6 +260,7 @@ class rv32_low_csr_t: public csr_t { virtual void verify_permissions(insn_t insn, bool write) const override; protected: virtual bool unlogged_write(const reg_t val) noexcept override; + virtual reg_t written_value() const noexcept override; private: csr_t_p orig; }; @@ -271,6 +272,7 @@ class rv32_high_csr_t: public csr_t { virtual void verify_permissions(insn_t insn, bool write) const override; protected: virtual bool unlogged_write(const reg_t val) noexcept override; + virtual reg_t written_value() const noexcept override; private: csr_t_p orig; }; @@ -498,7 +500,6 @@ class wide_counter_csr_t: public csr_t { // Always returns full 64-bit value virtual reg_t read() const noexcept override; void bump(const reg_t howmuch) noexcept; - void write_upper_half(const reg_t val) noexcept; protected: virtual bool unlogged_write(const reg_t val) noexcept override; virtual reg_t written_value() const noexcept override; @@ -508,19 +509,6 @@ class wide_counter_csr_t: public csr_t { typedef std::shared_ptr<wide_counter_csr_t> wide_counter_csr_t_p; -// A simple proxy to read/write the upper half of minstret/mcycle -class counter_top_csr_t: public csr_t { - public: - counter_top_csr_t(processor_t* const proc, const reg_t addr, wide_counter_csr_t_p parent); - virtual reg_t read() const noexcept override; - protected: - virtual bool unlogged_write(const reg_t val) noexcept override; - private: - wide_counter_csr_t_p parent; -}; - -typedef std::shared_ptr<counter_top_csr_t> counter_top_csr_t_p; - // For a CSR that is an alias of another class proxy_csr_t: public csr_t { public: |