diff options
author | Andrew Waterman <andrew@sifive.com> | 2022-10-05 17:17:40 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-05 17:17:40 -0700 |
commit | cb7e6b840be13ebc46fdcdb23df6db61ff306fde (patch) | |
tree | 549393ded86f05531e63f2bc00caf4f5511f504d /riscv/triggers.cc | |
parent | 9b074198357b77189df989f0e274b23353f7f528 (diff) | |
parent | ab104011ba66fb3c88ce8405236908dc8700c679 (diff) | |
download | spike-cb7e6b840be13ebc46fdcdb23df6db61ff306fde.zip spike-cb7e6b840be13ebc46fdcdb23df6db61ff306fde.tar.gz spike-cb7e6b840be13ebc46fdcdb23df6db61ff306fde.tar.bz2 |
Merge pull request #1105 from YenHaoChen/pr-trigger-priority
Fix trigger priority
Diffstat (limited to 'riscv/triggers.cc')
-rw-r--r-- | riscv/triggers.cc | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/riscv/triggers.cc b/riscv/triggers.cc index 390ebe4..5e2d1f6 100644 --- a/riscv/triggers.cc +++ b/riscv/triggers.cc @@ -101,7 +101,7 @@ bool mcontrol_t::simple_match(unsigned xlen, reg_t value) const { assert(0); } -match_result_t mcontrol_t::memory_access_match(processor_t * const proc, operation_t operation, reg_t address, reg_t data) { +match_result_t mcontrol_t::memory_access_match(processor_t * const proc, operation_t operation, reg_t address, bool has_data, reg_t data) { state_t * const state = proc->get_state(); if ((operation == triggers::OPERATION_EXECUTE && !execute_bit) || (operation == triggers::OPERATION_STORE && !store_bit) || @@ -115,6 +115,8 @@ match_result_t mcontrol_t::memory_access_match(processor_t * const proc, operati reg_t value; if (select) { value = data; + if (!has_data) + return MATCH_NONE; } else { value = address; } @@ -150,7 +152,7 @@ module_t::~module_t() { } } -match_result_t module_t::memory_access_match(action_t * const action, operation_t operation, reg_t address, reg_t data) +match_result_t module_t::memory_access_match(action_t * const action, operation_t operation, reg_t address, bool has_data, reg_t data) { state_t * const state = proc->get_state(); if (state->debug_mode) @@ -170,7 +172,7 @@ match_result_t module_t::memory_access_match(action_t * const action, operation_ * entire chain did not match. This is allowed by the spec, because the final * trigger in the chain will never get `hit` set unless the entire chain * matches. */ - match_result_t result = triggers[i]->memory_access_match(proc, operation, address, data); + match_result_t result = triggers[i]->memory_access_match(proc, operation, address, has_data, data); if (result != MATCH_NONE && !triggers[i]->chain()) { *action = triggers[i]->action; return result; |