aboutsummaryrefslogtreecommitdiff
path: root/riscv/triggers.h
diff options
context:
space:
mode:
authorYenHaoChen <howard25336284@gmail.com>2023-02-21 12:20:47 +0800
committerYenHaoChen <howard25336284@gmail.com>2024-05-22 09:04:23 +0800
commit2f12bb8c58286c45b19ded54a242a03ec24131f7 (patch)
tree66e9e74b804f67c6ae00300eb9f6bec1db87b35b /riscv/triggers.h
parent983eb01557e0f447fbbcb29d088bfa682787c427 (diff)
downloadspike-2f12bb8c58286c45b19ded54a242a03ec24131f7.zip
spike-2f12bb8c58286c45b19ded54a242a03ec24131f7.tar.gz
spike-2f12bb8c58286c45b19ded54a242a03ec24131f7.tar.bz2
triggers: refactor: move mcontrol_common_t::hit to mcontrol_t::hit and mcontrol6_t::hit
Add mcontrol_common_t::set_hit()
Diffstat (limited to 'riscv/triggers.h')
-rw-r--r--riscv/triggers.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/riscv/triggers.h b/riscv/triggers.h
index 6f00122..7a4a942 100644
--- a/riscv/triggers.h
+++ b/riscv/triggers.h
@@ -205,6 +205,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(bool 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 +218,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 +231,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(bool val) override { hit = val; }
+
+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(bool val) override { hit = val; }
+
+private:
+ bool hit = false;
};
class icount_t : public trigger_t {