aboutsummaryrefslogtreecommitdiff
path: root/riscv/csrs.h
diff options
context:
space:
mode:
authorScott Johnson <scott.johnson@arilinc.com>2021-09-14 18:56:45 -0700
committerScott Johnson <scott.johnson@arilinc.com>2021-09-16 10:52:15 -0700
commitb23d9d5b1d906fd92a160774986ad40851c21020 (patch)
treeafad0ed1cb134ac1e57b43b75be67bf13558c178 /riscv/csrs.h
parentd0a3e776084f3c3d39bba205f6e1304c765c6cc5 (diff)
downloadspike-b23d9d5b1d906fd92a160774986ad40851c21020.zip
spike-b23d9d5b1d906fd92a160774986ad40851c21020.tar.gz
spike-b23d9d5b1d906fd92a160774986ad40851c21020.tar.bz2
Convert mcycle[h] (which is a mirror of minstret[h]) to csr_t
Diffstat (limited to 'riscv/csrs.h')
-rw-r--r--riscv/csrs.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/riscv/csrs.h b/riscv/csrs.h
index eeab892..11b13e8 100644
--- a/riscv/csrs.h
+++ b/riscv/csrs.h
@@ -447,4 +447,19 @@ class minstreth_csr_t: public csr_t {
minstret_csr_t_p minstret;
};
+typedef std::shared_ptr<minstreth_csr_t> minstreth_csr_t_p;
+
+
+// For a CSR that is an alias of another
+class proxy_csr_t: public csr_t {
+ public:
+ proxy_csr_t(processor_t* const proc, const reg_t addr, csr_t_p delegate);
+ virtual reg_t read() const noexcept override;
+ protected:
+ bool unlogged_write(const reg_t val) noexcept override;
+ private:
+ csr_t_p delegate;
+};
+
+
#endif