diff options
author | YenHaoChen <howard25336284@gmail.com> | 2022-09-30 11:48:44 +0800 |
---|---|---|
committer | YenHaoChen <howard25336284@gmail.com> | 2022-09-30 11:48:44 +0800 |
commit | b724db52f9d7be3e3068e5bf01ac939ece8d032b (patch) | |
tree | eddd458343c4a65764195961e9014938c64aa84a /riscv/mmu.cc | |
parent | 37003b120b1ea704918022216c717e13c391be6c (diff) | |
download | riscv-isa-sim-b724db52f9d7be3e3068e5bf01ac939ece8d032b.zip riscv-isa-sim-b724db52f9d7be3e3068e5bf01ac939ece8d032b.tar.gz riscv-isa-sim-b724db52f9d7be3e3068e5bf01ac939ece8d032b.tar.bz2 |
Add has_data argument to trigger checking functions
The mcontrol trigger can select either address or data for checking. The
The selection decides the priority of the trigger. For instance, the
address trigger has a higher priority over the page fault, and the page
fault has a higher priority over the data trigger.
The previous implementation only has the checking functions for data
trigger, which results in incorrect priority of address trigger.
This commit adds a has_data argument to indicate address trigger and the
priority of the trigger.
Diffstat (limited to 'riscv/mmu.cc')
-rw-r--r-- | riscv/mmu.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/riscv/mmu.cc b/riscv/mmu.cc index d0a55f0..0dbb94e 100644 --- a/riscv/mmu.cc +++ b/riscv/mmu.cc @@ -155,7 +155,7 @@ void mmu_t::load_slow_path(reg_t addr, reg_t len, uint8_t* bytes, uint32_t xlate if (!matched_trigger) { reg_t data = reg_from_bytes(len, bytes); - matched_trigger = trigger_exception(triggers::OPERATION_LOAD, addr, data); + matched_trigger = trigger_exception(triggers::OPERATION_LOAD, addr, true, data); if (matched_trigger) throw *matched_trigger; } @@ -167,7 +167,7 @@ void mmu_t::store_slow_path(reg_t addr, reg_t len, const uint8_t* bytes, uint32_ if (!matched_trigger) { reg_t data = reg_from_bytes(len, bytes); - matched_trigger = trigger_exception(triggers::OPERATION_STORE, addr, data); + matched_trigger = trigger_exception(triggers::OPERATION_STORE, addr, true, data); if (matched_trigger) throw *matched_trigger; } |