aboutsummaryrefslogtreecommitdiff
path: root/riscv/execute.cc
diff options
context:
space:
mode:
authorScott Johnson <scott.johnson@arilinc.com>2022-12-01 09:47:09 -0800
committerScott Johnson <scott.johnson@arilinc.com>2022-12-01 09:47:09 -0800
commita078ef221f222ca5536307c6e695999b60b2a1ff (patch)
tree8a444400baeaf3132f009956eab8896177dbee84 /riscv/execute.cc
parentaa5c5a6e037bf793fb3ee47d2dca044dcdb72870 (diff)
downloadriscv-isa-sim-a078ef221f222ca5536307c6e695999b60b2a1ff.zip
riscv-isa-sim-a078ef221f222ca5536307c6e695999b60b2a1ff.tar.gz
riscv-isa-sim-a078ef221f222ca5536307c6e695999b60b2a1ff.tar.bz2
Convert triggers::module_t::detect_trap_match to std::optional
Goal is to remove match_result_t.fire field to eliminate dont-care fields.
Diffstat (limited to 'riscv/execute.cc')
-rw-r--r--riscv/execute.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/riscv/execute.cc b/riscv/execute.cc
index 1426d2d..3c627a4 100644
--- a/riscv/execute.cc
+++ b/riscv/execute.cc
@@ -302,9 +302,9 @@ void processor_t::step(size_t n)
n = instret;
// Trigger action takes priority over single step
- triggers::match_result_t match = TM.detect_trap_match(t);
- if (match.fire)
- take_trigger_action(match.action, 0, state.pc);
+ auto match = TM.detect_trap_match(t);
+ if (match.has_value())
+ take_trigger_action(match->action, 0, state.pc);
else if (unlikely(state.single_step == state.STEP_STEPPED)) {
state.single_step = state.STEP_NONE;
enter_debug_mode(DCSR_CAUSE_STEP);