diff options
author | YenHaoChen <howard25336284@gmail.com> | 2023-01-04 09:35:20 +0800 |
---|---|---|
committer | YenHaoChen <howard25336284@gmail.com> | 2023-01-04 09:35:20 +0800 |
commit | 4cf0ef9c4e71c815014f38fc2a2961c697efc741 (patch) | |
tree | 0f0874deed4b46fa4a3547122ea926d4fbf45fe8 /riscv/triggers.h | |
parent | c0cc59d5c4febaf1f45688e865e39e55b4cc72e3 (diff) | |
download | riscv-isa-sim-4cf0ef9c4e71c815014f38fc2a2961c697efc741.zip riscv-isa-sim-4cf0ef9c4e71c815014f38fc2a2961c697efc741.tar.gz riscv-isa-sim-4cf0ef9c4e71c815014f38fc2a2961c697efc741.tar.bz2 |
triggers: refactor: create virtual function trap_common_t::simple_match()
Diffstat (limited to 'riscv/triggers.h')
-rw-r--r-- | riscv/triggers.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/riscv/triggers.h b/riscv/triggers.h index dec4d98..49538ab 100644 --- a/riscv/triggers.h +++ b/riscv/triggers.h @@ -150,6 +150,9 @@ public: bool get_dmode() const override { return dmode; } virtual action_t get_action() const override { return action; } +private: + virtual bool simple_match(bool interrupt, reg_t bit) const = 0; + protected: bool dmode; bool hit; @@ -164,7 +167,7 @@ public: virtual std::optional<match_result_t> detect_trap_match(processor_t * const proc, const trap_t& t) noexcept override; private: - bool simple_match(bool interrupt, reg_t bit) const; + virtual bool simple_match(bool interrupt, reg_t bit) const override; bool nmi; }; @@ -176,7 +179,7 @@ public: virtual std::optional<match_result_t> detect_trap_match(processor_t * const proc, const trap_t& t) noexcept override; private: - bool simple_match(bool interrupt, reg_t bit) const; + virtual bool simple_match(bool interrupt, reg_t bit) const override; }; class mcontrol_common_t : public trigger_t { |