aboutsummaryrefslogtreecommitdiff
path: root/riscv/csrs.h
diff options
context:
space:
mode:
authorScott Johnson <scott.johnson@arilinc.com>2021-11-13 09:17:10 -0800
committerScott Johnson <scott.johnson@arilinc.com>2021-11-13 09:17:10 -0800
commit5cf772f90a94bcbd2ed2191e6809bd14eee201cb (patch)
treeebe50e52170f65ce977545343f6f6e87699fb697 /riscv/csrs.h
parentdbf9fdd3a06694c53ce2e468f690736f60d8567b (diff)
downloadspike-5cf772f90a94bcbd2ed2191e6809bd14eee201cb.zip
spike-5cf772f90a94bcbd2ed2191e6809bd14eee201cb.tar.gz
spike-5cf772f90a94bcbd2ed2191e6809bd14eee201cb.tar.bz2
Use enum to specify the 3 options for masking of intr CSRs
Because using two booleans gives the impression that there are four possibilities. Since hideleg is itself masked by mideleg, there are effectively only three choices, so make that explicit via enum.
Diffstat (limited to 'riscv/csrs.h')
-rw-r--r--riscv/csrs.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/riscv/csrs.h b/riscv/csrs.h
index 6e218db..245edf5 100644
--- a/riscv/csrs.h
+++ b/riscv/csrs.h
@@ -323,12 +323,13 @@ typedef std::shared_ptr<mie_csr_t> mie_csr_t_p;
// etc.
class generic_int_accessor_t {
public:
+ enum mask_mode_t { NONE, MIDELEG, HIDELEG };
+
generic_int_accessor_t(state_t* const state,
const reg_t read_mask,
const reg_t ip_write_mask,
const reg_t ie_write_mask,
- const bool mask_mideleg,
- const bool mask_hideleg,
+ const mask_mode_t mask_mode,
const int shiftamt);
reg_t ip_read() const noexcept;
void ip_write(const reg_t val) noexcept;