@@ -117,8 +117,9 @@ bool trigger_t::textra_match(processor_t * const proc) const noexcept
117117 return true ;
118118}
119119
120- bool trigger_t::allow_action (const state_t * const state ) const
120+ bool trigger_t::allow_action (processor_t * const proc ) const
121121{
122+ const state_t *state = proc->get_state ();
122123 if (get_action () == ACTION_DEBUG_EXCEPTION) {
123124 const bool mstatus_mie = state->mstatus ->read () & MSTATUS_MIE;
124125 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
242243 value &= 0xffffffff ;
243244 }
244245
245- if (simple_match (xlen, value) && allow_action (proc-> get_state () )) {
246+ if (simple_match (xlen, value) && allow_action (proc)) {
246247 /* This is OK because this function is only called if the trigger was not
247248 * inhibited by the previous trigger in the chain. */
248249 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
331332
332333std::optional<match_result_t > icount_t::detect_icount_fire (processor_t * const proc) noexcept
333334{
334- if (!common_match (proc) || !allow_action (proc-> get_state () ))
335+ if (!common_match (proc) || !allow_action (proc))
335336 return std::nullopt ;
336337
337338 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
346347
347348void icount_t::detect_icount_decrement (processor_t * const proc) noexcept
348349{
349- if (!common_match (proc) || !allow_action (proc-> get_state () ))
350+ if (!common_match (proc) || !allow_action (proc))
350351 return ;
351352
352353 if (count >= 1 ) {
@@ -438,7 +439,7 @@ std::optional<match_result_t> trap_common_t::detect_trap_match(processor_t * con
438439 bool interrupt = (t.cause () & ((reg_t )1 << (xlen - 1 ))) != 0 ;
439440 reg_t bit = t.cause () & ~((reg_t )1 << (xlen - 1 ));
440441 assert (bit < xlen);
441- if (simple_match (interrupt, bit) && allow_action (proc-> get_state () )) {
442+ if (simple_match (interrupt, bit) && allow_action (proc)) {
442443 hit = true ;
443444 return match_result_t (TIMING_AFTER, action);
444445 }
0 commit comments