aboutsummaryrefslogtreecommitdiff
path: root/riscv/execute.cc
diff options
context:
space:
mode:
authorTim Newsome <tim@sifive.com>2018-08-10 14:55:28 -0700
committerAndrew Waterman <aswaterman@gmail.com>2018-08-10 14:55:28 -0700
commit1390eb2b728452f1fcdd8d090f194516733a0242 (patch)
tree979e52e17acb6deef8bf2c5d17580f6b60141c3e /riscv/execute.cc
parent3e2e18b7e18d6bf45b64140f43ad9d2face67de0 (diff)
downloadspike-1390eb2b728452f1fcdd8d090f194516733a0242.zip
spike-1390eb2b728452f1fcdd8d090f194516733a0242.tar.gz
spike-1390eb2b728452f1fcdd8d090f194516733a0242.tar.bz2
Fix 2 trigger corner cases. (#229)
1. When hitting a trigger during a single step, dcsr.cause must reflect the trigger not the step. 2. Also check for triggers on accesses that require a slow path fetch.
Diffstat (limited to 'riscv/execute.cc')
-rw-r--r--riscv/execute.cc8
1 files changed, 5 insertions, 3 deletions
diff --git a/riscv/execute.cc b/riscv/execute.cc
index b110d09..e639e90 100644
--- a/riscv/execute.cc
+++ b/riscv/execute.cc
@@ -130,9 +130,11 @@ void processor_t::step(size_t n)
{
if (unlikely(!state.serialized && state.single_step == state.STEP_STEPPED)) {
state.single_step = state.STEP_NONE;
- enter_debug_mode(DCSR_CAUSE_STEP);
- // enter_debug_mode changed state.pc, so we can't just continue.
- break;
+ if (state.dcsr.cause == DCSR_CAUSE_NONE) {
+ enter_debug_mode(DCSR_CAUSE_STEP);
+ // enter_debug_mode changed state.pc, so we can't just continue.
+ break;
+ }
}
if (unlikely(state.single_step == state.STEP_STEPPING)) {