diff options
author | Scott Johnson <scott.johnson@arilinc.com> | 2021-09-02 14:50:04 -0700 |
---|---|---|
committer | Andrew Waterman <aswaterman@gmail.com> | 2021-09-08 07:59:02 -0700 |
commit | 4009d54609a61ad594f00fbce4a197dba88ff3de (patch) | |
tree | b325a8af7a600836285e3b3269c7e9fa59dd6dde /riscv/csrs.h | |
parent | 55316421a3f66606a801a471d1b4600b080dba2b (diff) | |
download | spike-4009d54609a61ad594f00fbce4a197dba88ff3de.zip spike-4009d54609a61ad594f00fbce4a197dba88ff3de.tar.gz spike-4009d54609a61ad594f00fbce4a197dba88ff3de.tar.bz2 |
Give virtualized_satp_csr_t a handle to satp
Parent class has orig_csr but it's generic csr_t_p, and I will need to
call methods on satp_csr_t next.
Diffstat (limited to 'riscv/csrs.h')
-rw-r--r-- | riscv/csrs.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/riscv/csrs.h b/riscv/csrs.h index e78a612..2153b5f 100644 --- a/riscv/csrs.h +++ b/riscv/csrs.h @@ -407,11 +407,15 @@ class satp_csr_t: public base_atp_csr_t { virtual void verify_permissions(insn_t insn, bool write) const override; }; +typedef std::shared_ptr<satp_csr_t> satp_csr_t_p; + class virtualized_satp_csr_t: public virtualized_csr_t { public: - virtualized_satp_csr_t(processor_t* const proc, csr_t_p orig, csr_t_p virt); + virtualized_satp_csr_t(processor_t* const proc, satp_csr_t_p orig, csr_t_p virt); virtual void verify_permissions(insn_t insn, bool write) const override; virtual void write(const reg_t val) noexcept override; + private: + satp_csr_t_p orig_satp; }; |