diff options
author | Andrew Waterman <andrew@sifive.com> | 2021-09-27 13:47:46 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-27 13:47:46 -0700 |
commit | 663f71bb869c068b6a2896d970a719528f4ec7d8 (patch) | |
tree | ad367fbcac5c3567c10b481891b916170c1391e4 /riscv/csrs.h | |
parent | f9647e824f44ebe5fb5f9c64151daf2b2e86a528 (diff) | |
parent | dac0d3ce7161d480c06b8a19675f66ae636bc20d (diff) | |
download | spike-663f71bb869c068b6a2896d970a719528f4ec7d8.zip spike-663f71bb869c068b6a2896d970a719528f4ec7d8.tar.gz spike-663f71bb869c068b6a2896d970a719528f4ec7d8.tar.bz2 |
Merge pull request #815 from scottj97/mstatush
Convert mstatush to csr_t
Diffstat (limited to 'riscv/csrs.h')
-rw-r--r-- | riscv/csrs.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/riscv/csrs.h b/riscv/csrs.h index 1fe7ddf..fd20782 100644 --- a/riscv/csrs.h +++ b/riscv/csrs.h @@ -225,11 +225,24 @@ class mstatus_csr_t: public base_status_csr_t { virtual bool unlogged_write(const reg_t val) noexcept override; private: reg_t val; + friend class mstatush_csr_t; }; typedef std::shared_ptr<mstatus_csr_t> mstatus_csr_t_p; +class mstatush_csr_t: public csr_t { + public: + mstatush_csr_t(processor_t* const proc, const reg_t addr, mstatus_csr_t_p mstatus); + virtual reg_t read() const noexcept override; + protected: + virtual bool unlogged_write(const reg_t val) noexcept override; + private: + mstatus_csr_t_p mstatus; + const reg_t mask; +}; + + class sstatus_csr_t: public virtualized_csr_t { public: sstatus_csr_t(processor_t* const proc, csr_t_p orig, csr_t_p virt); |