diff options
author | Atul Khare <atulkhare@rivosinc.com> | 2023-05-14 09:28:48 -0700 |
---|---|---|
committer | Atul Khare <atulkhare@rivosinc.com> | 2023-05-14 09:29:23 -0700 |
commit | d61addf174f9448b44237b02dbe36252908ad422 (patch) | |
tree | 45a8188b6bdc78678bb42841316fa73d227285b6 | |
parent | 76b0027c177113fcf083ba2c95b3c35feb642957 (diff) | |
download | spike-d61addf174f9448b44237b02dbe36252908ad422.zip spike-d61addf174f9448b44237b02dbe36252908ad422.tar.gz spike-d61addf174f9448b44237b02dbe36252908ad422.tar.bz2 |
Fix last_inst_* processor state update
Presently, the following fields in the processor state are updated only
when commit logging is enabled.
last_inst_priv
last_inst_xlen
last_inst_flen
This means that these fields won't be updated if commit logging is
disabled, or if we are in the fast execution path.
The fix lays the groundwork for a subsequent patch that uses the
previous privilege mode to perform trigger matching.
-rw-r--r-- | riscv/execute.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/riscv/execute.cc b/riscv/execute.cc index 295879d..4284198 100644 --- a/riscv/execute.cc +++ b/riscv/execute.cc @@ -160,14 +160,15 @@ inline void processor_t::update_histogram(reg_t pc) // These two functions are expected to be inlined by the compiler separately in // the processor_t::step() loop. The logged variant is used in the slow path static inline reg_t execute_insn_fast(processor_t* p, reg_t pc, insn_fetch_t fetch) { + commit_log_stash_privilege(p); return fetch.func(p, fetch.insn, pc); } static inline reg_t execute_insn_logged(processor_t* p, reg_t pc, insn_fetch_t fetch) { if (p->get_log_commits_enabled()) { commit_log_reset(p); - commit_log_stash_privilege(p); } + commit_log_stash_privilege(p); reg_t npc; |