diff options
author | Andrew Waterman <andrew@sifive.com> | 2022-10-06 17:40:41 -0700 |
---|---|---|
committer | Andrew Waterman <andrew@sifive.com> | 2022-10-06 19:30:40 -0700 |
commit | 7b8114f707a7b2de9fd2d393b9d019180de83025 (patch) | |
tree | dc4c83a2ab0e7050758214025c15991f9e78a5eb /riscv/execute.cc | |
parent | fd50768df9ec4d9f80c6a37d89734d9e27443f6b (diff) | |
download | spike-7b8114f707a7b2de9fd2d393b9d019180de83025.zip spike-7b8114f707a7b2de9fd2d393b9d019180de83025.tar.gz spike-7b8114f707a7b2de9fd2d393b9d019180de83025.tar.bz2 |
Don't use reexecution as the means to implement trigger-after
The scheme was based on the notion that memory accesses are idempotent
up until the point the trigger would've been hit, which isn't true in
the case of side-effecting loads and data-value triggers.
Instead, check the trigger on the next instruction fetch. To keep the
perf overhead minimal, perform this check on the I$ refill path, and
ensure that path is taken by flushing the I$.
Diffstat (limited to 'riscv/execute.cc')
-rw-r--r-- | riscv/execute.cc | 9 |
1 files changed, 0 insertions, 9 deletions
diff --git a/riscv/execute.cc b/riscv/execute.cc index 5d24ce8..f0bb946 100644 --- a/riscv/execute.cc +++ b/riscv/execute.cc @@ -309,15 +309,6 @@ void processor_t::step(size_t n) catch (triggers::matched_t& t) { if (mmu->matched_trigger) { - // This exception came from the MMU. That means the instruction hasn't - // fully executed yet. We start it again, but this time it won't throw - // an exception because matched_trigger is already set. (All memory - // instructions are idempotent so restarting is safe.) - - insn_fetch_t fetch = mmu->load_insn(pc); - pc = execute_insn(this, pc, fetch); - advance_pc(); - delete mmu->matched_trigger; mmu->matched_trigger = NULL; } |