Skip to content

Commit b88058d

Browse files
committed
Only implement tcontrol to handle reentrant triggers.
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 #1777.
1 parent a8c9d9c commit b88058d

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

riscv/triggers.cc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,12 @@ bool trigger_t::textra_match(processor_t * const proc) const noexcept
112112

113113
bool trigger_t::allow_action(const state_t * const state) const
114114
{
115+
/* This implements option 1 from Section 5.4 in the Debug Spec. Since we
116+
* already implement option 2 (tcontrol), it's disabled for now. Some day when
117+
* there's a mechanism to tell spike which option to use, we can use this code
118+
* again. */
119+
120+
/*
115121
if (get_action() == ACTION_DEBUG_EXCEPTION) {
116122
const bool mstatus_mie = state->mstatus->read() & MSTATUS_MIE;
117123
const bool sstatus_sie = state->sstatus->read() & MSTATUS_SIE;
@@ -122,6 +128,7 @@ bool trigger_t::allow_action(const state_t * const state) const
122128
(state->prv != PRV_S || state->v || !medeleg_breakpoint || sstatus_sie) &&
123129
(state->prv != PRV_S || !state->v || !medeleg_breakpoint || !hedeleg_breakpoint || vsstatus_sie);
124130
}
131+
*/
125132
return true;
126133
}
127134

0 commit comments

Comments
 (0)