diff options
Diffstat (limited to 'riscv/triggers.h')
-rw-r--r-- | riscv/triggers.h | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/riscv/triggers.h b/riscv/triggers.h index 6f00122..24f9206 100644 --- a/riscv/triggers.h +++ b/riscv/triggers.h @@ -51,6 +51,13 @@ struct match_result_t { action_t action; }; +typedef enum { + HIT_FALSE = 0, + HIT_BEFORE = 1, + HIT_AFTER = 2, + HIT_IMMEDIATELY_AFTER = 3 +} hit_t; + class matched_t { public: @@ -205,6 +212,7 @@ public: virtual bool get_store() const override { return store; } virtual bool get_load() const override { return load; } virtual action_t get_action() const override { return action; } + virtual void set_hit(hit_t val) = 0; virtual std::optional<match_result_t> detect_memory_access_match(processor_t * const proc, operation_t operation, reg_t address, std::optional<reg_t> data) noexcept override; @@ -217,7 +225,6 @@ protected: static bool legalize_timing(reg_t val, reg_t timing_mask, reg_t select_mask, reg_t execute_mask, reg_t load_mask) noexcept; bool dmode = false; action_t action = ACTION_DEBUG_EXCEPTION; - bool hit = false; bool select = false; bool timing = false; bool chain = false; @@ -231,12 +238,22 @@ class mcontrol_t : public mcontrol_common_t { public: virtual reg_t tdata1_read(const processor_t * const proc) const noexcept override; virtual void tdata1_write(processor_t * const proc, const reg_t val, const bool allow_chain) noexcept override; + + virtual void set_hit(hit_t val) override { hit = val != HIT_FALSE; } + +private: + bool hit = false; }; class mcontrol6_t : public mcontrol_common_t { public: virtual reg_t tdata1_read(const processor_t * const proc) const noexcept override; virtual void tdata1_write(processor_t * const proc, const reg_t val, const bool allow_chain) noexcept override; + + virtual void set_hit(hit_t val) override { hit = val; } + +private: + hit_t hit = HIT_FALSE; }; class icount_t : public trigger_t { |