aboutsummaryrefslogtreecommitdiff
path: root/riscv/mmu.h
diff options
context:
space:
mode:
authorYenHaoChen <39526191+YenHaoChen@users.noreply.github.com>2022-09-17 02:59:57 +0800
committerGitHub <noreply@github.com>2022-09-16 11:59:57 -0700
commitccc9791807b59d848e7c8983cea49a16fb4a2912 (patch)
tree41a2e4ec28285a6994c45de58670533e48b353b5 /riscv/mmu.h
parent1fd6f53f5b2730c6cea39365eb1b5343849cfb31 (diff)
downloadspike-ccc9791807b59d848e7c8983cea49a16fb4a2912.zip
spike-ccc9791807b59d848e7c8983cea49a16fb4a2912.tar.gz
spike-ccc9791807b59d848e7c8983cea49a16fb4a2912.tar.bz2
Fix trigger never fire on executing an instruction on plugin devices (#1084)
The trigger matching only checks on TLB hit (after refill_tlb()). However, instructions on plugin devices will never be filled into the TLB; thus, triggers cannot fire when executing instructions on the plugin devices. The PR removes the if-condition of TLB hit for trigger checking. Co-authored-by: Howard Yen-Hao Chen <yhchen@andestech.com>
Diffstat (limited to 'riscv/mmu.h')
-rw-r--r--riscv/mmu.h12
1 files changed, 5 insertions, 7 deletions
diff --git a/riscv/mmu.h b/riscv/mmu.h
index 9a93f16..ca8b792 100644
--- a/riscv/mmu.h
+++ b/riscv/mmu.h
@@ -477,13 +477,11 @@ private:
} else {
result = tlb_data[vpn % TLB_ENTRIES];
}
- if (unlikely(tlb_insn_tag[vpn % TLB_ENTRIES] == (vpn | TLB_CHECK_TRIGGERS))) {
- target_endian<uint16_t>* ptr = (target_endian<uint16_t>*)(tlb_data[vpn % TLB_ENTRIES].host_offset + addr);
- triggers::action_t action;
- auto match = proc->TM.memory_access_match(&action, triggers::OPERATION_EXECUTE, addr, from_target(*ptr));
- if (match != triggers::MATCH_NONE) {
- throw triggers::matched_t(triggers::OPERATION_EXECUTE, addr, from_target(*ptr), action);
- }
+ target_endian<uint16_t>* ptr = (target_endian<uint16_t>*)(result.host_offset + addr);
+ triggers::action_t action;
+ auto match = proc->TM.memory_access_match(&action, triggers::OPERATION_EXECUTE, addr, from_target(*ptr));
+ if (match != triggers::MATCH_NONE) {
+ throw triggers::matched_t(triggers::OPERATION_EXECUTE, addr, from_target(*ptr), action);
}
return result;
}