diff options
author | YenHaoChen <howard25336284@gmail.com> | 2023-07-13 09:27:46 +0800 |
---|---|---|
committer | YenHaoChen <howard25336284@gmail.com> | 2023-07-13 11:51:35 +0800 |
commit | faceda27e60c0721b3233658198bcf50d09b02cc (patch) | |
tree | 0c9eca2e4c82df5e3edd8d8e6f5f2b2c8228b8a3 | |
parent | ed5dccb2911f3b2dda731e5fe65e6c03ad0b46fb (diff) | |
download | riscv-isa-sim-faceda27e60c0721b3233658198bcf50d09b02cc.zip riscv-isa-sim-faceda27e60c0721b3233658198bcf50d09b02cc.tar.gz riscv-isa-sim-faceda27e60c0721b3233658198bcf50d09b02cc.tar.bz2 |
refactor: mcontrol/mcontrol6: extend check_triggers() with tval parameter
-rw-r--r-- | riscv/mmu.cc | 6 | ||||
-rw-r--r-- | riscv/mmu.h | 5 |
2 files changed, 7 insertions, 4 deletions
diff --git a/riscv/mmu.cc b/riscv/mmu.cc index 3f90060..f6d23a3 100644 --- a/riscv/mmu.cc +++ b/riscv/mmu.cc @@ -169,7 +169,7 @@ bool mmu_t::mmio(reg_t paddr, size_t len, uint8_t* bytes, access_type type) return true; } -void mmu_t::check_triggers(triggers::operation_t operation, reg_t address, bool virt, std::optional<reg_t> data) +void mmu_t::check_triggers(triggers::operation_t operation, reg_t address, bool virt, reg_t tval, std::optional<reg_t> data) { if (matched_trigger || !proc) return; @@ -179,13 +179,13 @@ void mmu_t::check_triggers(triggers::operation_t operation, reg_t address, bool if (match.has_value()) switch (match->timing) { case triggers::TIMING_BEFORE: - throw triggers::matched_t(operation, address, match->action, virt); + throw triggers::matched_t(operation, tval, match->action, virt); case triggers::TIMING_AFTER: // We want to take this exception on the next instruction. We check // whether to do so in the I$ refill path, so flush the I$. flush_icache(); - matched_trigger = new triggers::matched_t(operation, address, match->action, virt); + matched_trigger = new triggers::matched_t(operation, tval, match->action, virt); } } diff --git a/riscv/mmu.h b/riscv/mmu.h index 46c54ce..62e9a73 100644 --- a/riscv/mmu.h +++ b/riscv/mmu.h @@ -402,7 +402,10 @@ private: bool mmio_store(reg_t paddr, size_t len, const uint8_t* bytes); bool mmio(reg_t paddr, size_t len, uint8_t* bytes, access_type type); bool mmio_ok(reg_t paddr, access_type type); - void check_triggers(triggers::operation_t operation, reg_t address, bool virt, std::optional<reg_t> data = std::nullopt); + void check_triggers(triggers::operation_t operation, reg_t address, bool virt, std::optional<reg_t> data = std::nullopt) { + check_triggers(operation, address, virt, address, data); + } + void check_triggers(triggers::operation_t operation, reg_t address, bool virt, reg_t tval, std::optional<reg_t> data); reg_t translate(mem_access_info_t access_info, reg_t len); reg_t pte_load(reg_t pte_paddr, reg_t addr, bool virt, access_type trap_type, size_t ptesize) { |