diff options
author | Scott Johnson <scott.johnson@arilinc.com> | 2021-02-22 18:34:05 -0800 |
---|---|---|
committer | Scott Johnson <scott.johnson@arilinc.com> | 2021-09-20 12:55:09 -0700 |
commit | 19a1d6f028f0e72d705091c1e8165cf93942431c (patch) | |
tree | dd712412a30cc6593dbd55104fdad0fc59cdc145 /riscv/csrs.h | |
parent | b3b61bd0fb39f55514026560d24adb20ae8eaf13 (diff) | |
download | spike-19a1d6f028f0e72d705091c1e8165cf93942431c.zip spike-19a1d6f028f0e72d705091c1e8165cf93942431c.tar.gz spike-19a1d6f028f0e72d705091c1e8165cf93942431c.tar.bz2 |
Provide mechanism (not yet used) for the logged value to be different from read()
I will need this soon for minstret.
Diffstat (limited to 'riscv/csrs.h')
-rw-r--r-- | riscv/csrs.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/riscv/csrs.h b/riscv/csrs.h index f96e7bd..7b238ed 100644 --- a/riscv/csrs.h +++ b/riscv/csrs.h @@ -41,6 +41,10 @@ class csr_t { // Record a write to an alternate CSR (e.g. minstreth instead of minstret) void log_special_write(const reg_t address, const reg_t val) const noexcept; + // What value was written to this reg? Default implementation simply + // calls read(), but a few CSRs are special. + virtual reg_t written_value() const noexcept; + processor_t* const proc; state_t* const state; public: |