diff options
author | Rupert Swarbrick <rswarbrick@gmail.com> | 2022-02-18 17:04:34 +0000 |
---|---|---|
committer | Rupert Swarbrick <rswarbrick@gmail.com> | 2022-02-18 17:08:04 +0000 |
commit | 24953e7c0072e372fc8f7315715f2ba435209e30 (patch) | |
tree | 4d475b7100a33521936f52c759a9a8539bef834e /riscv/csrs.h | |
parent | 5892e9356e53129afa6cdcaf3fc5aad5490a7f83 (diff) | |
download | spike-24953e7c0072e372fc8f7315715f2ba435209e30.zip spike-24953e7c0072e372fc8f7315715f2ba435209e30.tar.gz spike-24953e7c0072e372fc8f7315715f2ba435209e30.tar.bz2 |
Rename minstret CSR classes to something more general
No other functional change. This is preparation for a follow-up
commit, which will split MINSTRET and MCYCLE (to allow cosimulation
environments where the two values might not be equal)
Diffstat (limited to 'riscv/csrs.h')
-rw-r--r-- | riscv/csrs.h | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/riscv/csrs.h b/riscv/csrs.h index 245edf5..074d9dc 100644 --- a/riscv/csrs.h +++ b/riscv/csrs.h @@ -439,9 +439,9 @@ class virtualized_satp_csr_t: public virtualized_csr_t { // For minstret, which is always 64 bits, but in RV32 is split into // high and low halves. The first class always holds the full 64-bit // value. -class minstret_csr_t: public csr_t { +class wide_counter_csr_t: public csr_t { public: - minstret_csr_t(processor_t* const proc, const reg_t addr); + wide_counter_csr_t(processor_t* const proc, const reg_t addr); // Always returns full 64-bit value virtual reg_t read() const noexcept override; void bump(const reg_t howmuch) noexcept; @@ -453,21 +453,21 @@ class minstret_csr_t: public csr_t { reg_t val; }; -typedef std::shared_ptr<minstret_csr_t> minstret_csr_t_p; +typedef std::shared_ptr<wide_counter_csr_t> wide_counter_csr_t_p; // A simple proxy to read/write the upper half of minstret -class minstreth_csr_t: public csr_t { +class counter_top_csr_t: public csr_t { public: - minstreth_csr_t(processor_t* const proc, const reg_t addr, minstret_csr_t_p minstret); + 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: - minstret_csr_t_p minstret; + wide_counter_csr_t_p parent; }; -typedef std::shared_ptr<minstreth_csr_t> minstreth_csr_t_p; +typedef std::shared_ptr<counter_top_csr_t> counter_top_csr_t_p; // For a CSR that is an alias of another |