Skip to content

Commit

Permalink
Only implement tcontrol to handle reentrant triggers.
Browse files Browse the repository at this point in the history
The spec says to only implement a single option. Option 2 gives software
more flexibility, and we already have an implementation. Let's use that
one. See also riscv-software-src#1777.
  • Loading branch information
rtwfroody committed Aug 22, 2024
1 parent a8c9d9c commit b88058d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions riscv/triggers.cc
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,12 @@ bool trigger_t::textra_match(processor_t * const proc) const noexcept

bool trigger_t::allow_action(const state_t * const state) const
{
/* This implements option 1 from Section 5.4 in the Debug Spec. Since we
* already implement option 2 (tcontrol), it's disabled for now. Some day when
* there's a mechanism to tell spike which option to use, we can use this code
* again. */

/*
if (get_action() == ACTION_DEBUG_EXCEPTION) {
const bool mstatus_mie = state->mstatus->read() & MSTATUS_MIE;
const bool sstatus_sie = state->sstatus->read() & MSTATUS_SIE;
Expand All @@ -122,6 +128,7 @@ bool trigger_t::allow_action(const state_t * const state) const
(state->prv != PRV_S || state->v || !medeleg_breakpoint || sstatus_sie) &&
(state->prv != PRV_S || !state->v || !medeleg_breakpoint || !hedeleg_breakpoint || vsstatus_sie);
}
*/
return true;
}

Expand Down

0 comments on commit b88058d

Please sign in to comment.