diff options
author | YenHaoChen <howard25336284@gmail.com> | 2023-01-11 18:45:24 +0800 |
---|---|---|
committer | YenHaoChen <howard25336284@gmail.com> | 2023-01-30 21:16:42 +0800 |
commit | b59ff6fec2d390afdcadc82bf8d679e8385cd444 (patch) | |
tree | b3ce2772b077814be25e7557ba22debad3fd8d67 /riscv/triggers.h | |
parent | 1230b321f9f547b6ab728cdb1ff1d82fb230df2a (diff) | |
download | riscv-isa-sim-b59ff6fec2d390afdcadc82bf8d679e8385cd444.zip riscv-isa-sim-b59ff6fec2d390afdcadc82bf8d679e8385cd444.tar.gz riscv-isa-sim-b59ff6fec2d390afdcadc82bf8d679e8385cd444.tar.bz2 |
triggers: add detect_icount_match()
Diffstat (limited to 'riscv/triggers.h')
-rw-r--r-- | riscv/triggers.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/riscv/triggers.h b/riscv/triggers.h index e1a0fd7..aa41a6a 100644 --- a/riscv/triggers.h +++ b/riscv/triggers.h @@ -80,9 +80,11 @@ public: virtual bool get_load() const { return false; } virtual action_t get_action() const { return ACTION_DEBUG_EXCEPTION; } virtual bool icount_check_needed() const { return false; } + virtual void stash_read_values() {} virtual std::optional<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) noexcept { return std::nullopt; } + virtual std::optional<match_result_t> detect_icount_match(processor_t UNUSED * const proc) { return std::nullopt; } virtual std::optional<match_result_t> detect_trap_match(processor_t UNUSED * const proc, const trap_t UNUSED & t) noexcept { return std::nullopt; } protected: @@ -242,12 +244,15 @@ public: bool get_dmode() const override { return dmode; } virtual action_t get_action() const override { return action; } virtual bool icount_check_needed() const override { return true; } + virtual void stash_read_values() override; + + virtual std::optional<match_result_t> detect_icount_match(processor_t * const proc) noexcept override; private: bool dmode; bool hit; - unsigned count; - bool pending; + unsigned count, count_read_value; + bool pending, pending_read_value; action_t action; }; @@ -267,6 +272,7 @@ public: unsigned count() const { return triggers.size(); } std::optional<match_result_t> detect_memory_access_match(operation_t operation, reg_t address, std::optional<reg_t> data) noexcept; + std::optional<match_result_t> detect_icount_match() noexcept; std::optional<match_result_t> detect_trap_match(const trap_t& t) noexcept; processor_t *proc; |