diff options
author | YenHaoChen <howard25336284@gmail.com> | 2023-01-06 08:59:23 +0800 |
---|---|---|
committer | YenHaoChen <howard25336284@gmail.com> | 2023-01-13 12:07:00 +0800 |
commit | d61f4a7164ef10bf03f87a65684d801cc47b3d7a (patch) | |
tree | 3e1b00cb80d16f0dd782a2cca13848e72c885bc3 /riscv/triggers.h | |
parent | b8c2b26af85be0d63d05ec97a8bc8f8c60aaaacf (diff) | |
download | spike-d61f4a7164ef10bf03f87a65684d801cc47b3d7a.zip spike-d61f4a7164ef10bf03f87a65684d801cc47b3d7a.tar.gz spike-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.h | 2 |
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; |