aboutsummaryrefslogtreecommitdiff
path: root/riscv/mmu.cc
diff options
context:
space:
mode:
authorScott Johnson <scott.johnson@arilinc.com>2022-12-01 09:21:58 -0800
committerScott Johnson <scott.johnson@arilinc.com>2022-12-01 09:22:01 -0800
commita315193ab08abc3aaaa1885370253992c110b6ec (patch)
treea6f44ec1d0f9d93fa335fd20fe6815e162350870 /riscv/mmu.cc
parent024533d921eadd44149a7361d3d94217593ef2a0 (diff)
downloadriscv-isa-sim-a315193ab08abc3aaaa1885370253992c110b6ec.zip
riscv-isa-sim-a315193ab08abc3aaaa1885370253992c110b6ec.tar.gz
riscv-isa-sim-a315193ab08abc3aaaa1885370253992c110b6ec.tar.bz2
Convert triggers::module_t::detect_memory_access_match to std::optional
Goal is to remove match_result_t.fire field to eliminate dont-care fields when fire=false.
Diffstat (limited to 'riscv/mmu.cc')
-rw-r--r--riscv/mmu.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/riscv/mmu.cc b/riscv/mmu.cc
index e4fba3d..1d15b91 100644
--- a/riscv/mmu.cc
+++ b/riscv/mmu.cc
@@ -157,18 +157,18 @@ void mmu_t::check_triggers(triggers::operation_t operation, reg_t address, std::
if (matched_trigger || !proc)
return;
- triggers::match_result_t match = proc->TM.detect_memory_access_match(operation, address, data);
+ auto match = proc->TM.detect_memory_access_match(operation, address, data);
- if (match.fire)
- switch (match.timing) {
+ if (match.has_value())
+ switch (match->timing) {
case triggers::TIMING_BEFORE:
- throw triggers::matched_t(operation, address, match.action);
+ throw triggers::matched_t(operation, address, match->action);
case triggers::TIMING_AFTER:
// We want to take this exception on the next instruction. We check
// whether to do so in the I$ refill path, so flush the I$.
flush_icache();
- matched_trigger = new triggers::matched_t(operation, address, match.action);
+ matched_trigger = new triggers::matched_t(operation, address, match->action);
}
}