aboutsummaryrefslogtreecommitdiff
path: root/riscv/triggers.h
diff options
context:
space:
mode:
authorScott Johnson <scott.johnson@arilinc.com>2022-12-01 09:31:21 -0800
committerScott Johnson <scott.johnson@arilinc.com>2022-12-01 09:31:35 -0800
commit849ec1e129e2654cb60dcbc1dfb6ab5b9cc6902b (patch)
tree88ed8d850ad6a897647ddaafd1d7856c9e18703b /riscv/triggers.h
parenta315193ab08abc3aaaa1885370253992c110b6ec (diff)
downloadriscv-isa-sim-849ec1e129e2654cb60dcbc1dfb6ab5b9cc6902b.zip
riscv-isa-sim-849ec1e129e2654cb60dcbc1dfb6ab5b9cc6902b.tar.gz
riscv-isa-sim-849ec1e129e2654cb60dcbc1dfb6ab5b9cc6902b.tar.bz2
Use std::optional for detect_memory_access_match in trigger_t hierarchy
Goal is to remove match_result_t.fire field to eliminate dont-care fields.
Diffstat (limited to 'riscv/triggers.h')
-rw-r--r--riscv/triggers.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/riscv/triggers.h b/riscv/triggers.h
index 27f1c0e..365dbe2 100644
--- a/riscv/triggers.h
+++ b/riscv/triggers.h
@@ -67,8 +67,8 @@ public:
virtual bool get_load() const { return false; }
virtual action_t get_action() const { return ACTION_DEBUG_EXCEPTION; }
- 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) noexcept { return match_result_t(false); }
+ 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 match_result_t detect_trap_match(processor_t UNUSED * const proc, const trap_t UNUSED & t) noexcept { return match_result_t(false); }
protected:
@@ -152,7 +152,7 @@ public:
virtual bool get_load() const override { return load; }
virtual action_t get_action() const override { return action; }
- virtual match_result_t detect_memory_access_match(processor_t * const proc,
+ 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;
private: