diff options
author | Scott Johnson <scott.johnson@arilinc.com> | 2022-12-01 08:30:47 -0800 |
---|---|---|
committer | Scott Johnson <scott.johnson@arilinc.com> | 2022-12-01 08:30:47 -0800 |
commit | a0baf8c02fe4f573a42158f2a5ae17c637f06693 (patch) | |
tree | 90f4b66baf687e9f374de37370304f85c79e2c7f /riscv/triggers.h | |
parent | 39c3b2540047ef6d32398566780889bc52a48ca3 (diff) | |
download | riscv-isa-sim-a0baf8c02fe4f573a42158f2a5ae17c637f06693.zip riscv-isa-sim-a0baf8c02fe4f573a42158f2a5ae17c637f06693.tar.gz riscv-isa-sim-a0baf8c02fe4f573a42158f2a5ae17c637f06693.tar.bz2 |
Move tdata2 into parent class
Since all triggers currently implemented have tdata2.
Diffstat (limited to 'riscv/triggers.h')
-rw-r--r-- | riscv/triggers.h | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/riscv/triggers.h b/riscv/triggers.h index eb6a681..afbc614 100644 --- a/riscv/triggers.h +++ b/riscv/triggers.h @@ -57,8 +57,8 @@ public: virtual reg_t tdata1_read(const processor_t * const proc) const noexcept = 0; virtual void tdata1_write(processor_t * const proc, const reg_t val, const bool allow_chain) noexcept = 0; - virtual reg_t tdata2_read(const processor_t * const proc) const noexcept = 0; - virtual void tdata2_write(processor_t * const proc, const reg_t val) noexcept = 0; + reg_t tdata2_read(const processor_t * const proc) const noexcept; + void tdata2_write(processor_t * const proc, const reg_t val) noexcept; virtual bool get_dmode() const = 0; virtual bool get_chain() const { return false; } @@ -70,17 +70,14 @@ public: virtual match_result_t detect_memory_access_match(processor_t UNUSED * const proc, operation_t UNUSED operation, reg_t UNUSED address, std::optional<reg_t> UNUSED data) { return match_result_t(false); } virtual match_result_t detect_trap_match(processor_t UNUSED * const proc, const trap_t UNUSED & t) { return match_result_t(false); } -}; - -class trigger_with_tdata2_t : public trigger_t { -public: - reg_t tdata2_read(const processor_t * const proc) const noexcept override; - void tdata2_write(processor_t * const proc, const reg_t val) noexcept override; protected: reg_t tdata2; }; +class trigger_with_tdata2_t : public trigger_t { +}; + class disabled_trigger_t : public trigger_with_tdata2_t { public: virtual reg_t tdata1_read(const processor_t * const proc) const noexcept override; |