aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYenHaoChen <howard25336284@gmail.com>2022-12-30 11:54:37 +0800
committerYenHaoChen <howard25336284@gmail.com>2023-01-04 09:41:08 +0800
commit247f01691b5d72459976f3288f7f48d3d84cd65a (patch)
tree053ce5f92db0bc4e0d2f82e10781e00e6bb622f2
parent0a45912d601fd27bf46c7a51e55dab5e319b15eb (diff)
downloadspike-247f01691b5d72459976f3288f7f48d3d84cd65a.zip
spike-247f01691b5d72459976f3288f7f48d3d84cd65a.tar.gz
spike-247f01691b5d72459976f3288f7f48d3d84cd65a.tar.bz2
triggers: refactor: move textra_match() into detect_trap_match::detect_trap_match()
-rw-r--r--riscv/triggers.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/riscv/triggers.cc b/riscv/triggers.cc
index 455fb07..c292bb5 100644
--- a/riscv/triggers.cc
+++ b/riscv/triggers.cc
@@ -313,7 +313,7 @@ void itrigger_t::tdata1_write(processor_t * const proc, const reg_t val, const b
std::optional<match_result_t> trap_common_t::detect_trap_match(processor_t * const proc, const trap_t& t) noexcept
{
- if (!mode_match(proc->get_state()))
+ if (!mode_match(proc->get_state()) || !textra_match(proc))
return std::nullopt;
auto xlen = proc->get_xlen();
@@ -494,7 +494,7 @@ std::optional<match_result_t> module_t::detect_trap_match(const trap_t& t) noexc
return std::nullopt;
for (auto trigger: triggers) {
- auto result = trigger->textra_match(proc) ? trigger->detect_trap_match(proc, t) : std::nullopt;
+ auto result = trigger->detect_trap_match(proc, t);
if (result.has_value())
return result;
}