diff options
author | Andrew Waterman <andrew@sifive.com> | 2024-05-31 01:24:02 -0700 |
---|---|---|
committer | Andrew Waterman <andrew@sifive.com> | 2024-05-31 01:24:02 -0700 |
commit | 759599553bab6c95399253ba366a0f5b1b3dd48f (patch) | |
tree | 8f84650d9d8c783ee582c8d2956cce995fd8dca1 /riscv/execute.cc | |
parent | 148e6d63e036a611537f7afbee771d9b83d348fb (diff) | |
download | spike-759599553bab6c95399253ba366a0f5b1b3dd48f.zip spike-759599553bab6c95399253ba366a0f5b1b3dd48f.tar.gz spike-759599553bab6c95399253ba366a0f5b1b3dd48f.tar.bz2 |
Avoid checking ELP before every instruction fetch
Serialize after setting ELP. That way, we can hoist the check
outside of the main simulation loop.
Diffstat (limited to 'riscv/execute.cc')
-rw-r--r-- | riscv/execute.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/riscv/execute.cc b/riscv/execute.cc index b2532c9..f263dce 100644 --- a/riscv/execute.cc +++ b/riscv/execute.cc @@ -247,6 +247,8 @@ void processor_t::step(size_t n) { take_pending_interrupt(); + check_if_lpad_required(); + if (unlikely(slow_path())) { // Main simulation loop, slow path. @@ -280,7 +282,6 @@ void processor_t::step(size_t n) in_wfi = false; insn_fetch_t fetch = mmu->load_insn(pc); - execute_insn_prehook(fetch.insn); if (debug && !state.serialized) disasm(fetch.insn); pc = execute_insn_logged(this, pc, fetch); @@ -292,7 +293,6 @@ void processor_t::step(size_t n) // Main simulation loop, fast path. for (auto ic_entry = _mmu->access_icache(pc); ; ) { auto fetch = ic_entry->data; - execute_insn_prehook(fetch.insn); pc = execute_insn_fast(this, pc, fetch); ic_entry = ic_entry->next; if (unlikely(ic_entry->tag != pc)) |