aboutsummaryrefslogtreecommitdiff
path: root/riscv/triggers.h
diff options
context:
space:
mode:
authorYenHaoChen <howard25336284@gmail.com>2023-01-06 08:59:23 +0800
committerYenHaoChen <howard25336284@gmail.com>2023-01-13 12:07:00 +0800
commitd61f4a7164ef10bf03f87a65684d801cc47b3d7a (patch)
tree3e1b00cb80d16f0dd782a2cca13848e72c885bc3 /riscv/triggers.h
parentb8c2b26af85be0d63d05ec97a8bc8f8c60aaaacf (diff)
downloadriscv-isa-sim-d61f4a7164ef10bf03f87a65684d801cc47b3d7a.zip
riscv-isa-sim-d61f4a7164ef10bf03f87a65684d801cc47b3d7a.tar.gz
riscv-isa-sim-d61f4a7164ef10bf03f87a65684d801cc47b3d7a.tar.bz2
triggers: legalize timing=1(after) for load data trigger
As recommended in the debug spec table "Suggested Trigger Timings", to avoid the footgun of replaying a load (which may have side effects) when the breakpoint trap handler returns. reference: https://github.com/riscv-software-src/riscv-isa-sim/pull/1208#issuecomment-1373035906 ----------------------------------------------------------------------- The legalize_timing() depends on select, execution, load, and store, which are updated in the same function tdata1_write(). As a result, reordering statements in the tdata1_write() may break the functionality. Passing those variables as parameters to legalize_timing() does not solve the problem. Thus, we give the original write value and the masks of the variables to the legalize_timing(). This makes the legalization function independent of the updating variables and resolves the issue. reference: https://github.com/riscv-software-src/riscv-isa-sim/pull/1214
Diffstat (limited to 'riscv/triggers.h')
-rw-r--r--riscv/triggers.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/riscv/triggers.h b/riscv/triggers.h
index 6de0f2d..3fc2275 100644
--- a/riscv/triggers.h
+++ b/riscv/triggers.h
@@ -208,7 +208,7 @@ private:
protected:
match_t legalize_match(reg_t val) const noexcept;
- static bool legalize_timing(reg_t val, reg_t timing_mask, reg_t execute_mask) noexcept;
+ static bool legalize_timing(reg_t val, reg_t timing_mask, reg_t select_mask, reg_t execute_mask, reg_t load_mask) noexcept;
bool dmode = false;
action_t action = ACTION_DEBUG_EXCEPTION;
bool hit = false;