@@ -117,8 +117,9 @@ bool trigger_t::textra_match(processor_t * const proc) const noexcept
117
117
return true ;
118
118
}
119
119
120
- bool trigger_t::allow_action (const state_t * const state ) const
120
+ bool trigger_t::allow_action (processor_t * const proc ) const
121
121
{
122
+ const state_t *state = proc->get_state ();
122
123
if (get_action () == ACTION_DEBUG_EXCEPTION) {
123
124
const bool mstatus_mie = state->mstatus ->read () & MSTATUS_MIE;
124
125
const bool sstatus_sie = state->sstatus ->read () & MSTATUS_SIE;
@@ -242,7 +243,7 @@ std::optional<match_result_t> mcontrol_common_t::detect_memory_access_match(proc
242
243
value &= 0xffffffff ;
243
244
}
244
245
245
- if (simple_match (xlen, value) && allow_action (proc-> get_state () )) {
246
+ if (simple_match (xlen, value) && allow_action (proc)) {
246
247
/* This is OK because this function is only called if the trigger was not
247
248
* inhibited by the previous trigger in the chain. */
248
249
set_hit (timing ? HIT_IMMEDIATELY_AFTER : HIT_BEFORE);
@@ -331,7 +332,7 @@ void mcontrol6_t::tdata1_write(processor_t * const proc, const reg_t val, const
331
332
332
333
std::optional<match_result_t > icount_t::detect_icount_fire (processor_t * const proc) noexcept
333
334
{
334
- if (!common_match (proc) || !allow_action (proc-> get_state () ))
335
+ if (!common_match (proc) || !allow_action (proc))
335
336
return std::nullopt;
336
337
337
338
std::optional<match_result_t > ret = std::nullopt;
@@ -346,7 +347,7 @@ std::optional<match_result_t> icount_t::detect_icount_fire(processor_t * const p
346
347
347
348
void icount_t::detect_icount_decrement (processor_t * const proc) noexcept
348
349
{
349
- if (!common_match (proc) || !allow_action (proc-> get_state () ))
350
+ if (!common_match (proc) || !allow_action (proc))
350
351
return ;
351
352
352
353
if (count >= 1 ) {
@@ -438,7 +439,7 @@ std::optional<match_result_t> trap_common_t::detect_trap_match(processor_t * con
438
439
bool interrupt = (t.cause () & ((reg_t )1 << (xlen - 1 ))) != 0 ;
439
440
reg_t bit = t.cause () & ~((reg_t )1 << (xlen - 1 ));
440
441
assert (bit < xlen);
441
- if (simple_match (interrupt, bit) && allow_action (proc-> get_state () )) {
442
+ if (simple_match (interrupt, bit) && allow_action (proc)) {
442
443
hit = true ;
443
444
return match_result_t (TIMING_AFTER, action);
444
445
}
0 commit comments