diff options
author | Andrew Waterman <andrew@sifive.com> | 2022-10-06 14:35:59 -0700 |
---|---|---|
committer | Andrew Waterman <andrew@sifive.com> | 2022-10-06 19:30:40 -0700 |
commit | 197f3e2640a182c7734d781bf61f570457cce5b8 (patch) | |
tree | 6ae979a862ff59562c0ba55bf2db5f9f6368813c /riscv/mmu.h | |
parent | 14410156b2d796dad0e439b9535057f1e4c5a13c (diff) | |
download | spike-197f3e2640a182c7734d781bf61f570457cce5b8.zip spike-197f3e2640a182c7734d781bf61f570457cce5b8.tar.gz spike-197f3e2640a182c7734d781bf61f570457cce5b8.tar.bz2 |
DRY in checking triggers
Diffstat (limited to 'riscv/mmu.h')
-rw-r--r-- | riscv/mmu.h | 17 |
1 files changed, 1 insertions, 16 deletions
diff --git a/riscv/mmu.h b/riscv/mmu.h index 74c9a71..8eeea31 100644 --- a/riscv/mmu.h +++ b/riscv/mmu.h @@ -384,6 +384,7 @@ private: bool mmio_load(reg_t addr, size_t len, uint8_t* bytes); bool mmio_store(reg_t addr, size_t len, const uint8_t* bytes); bool mmio_ok(reg_t addr, access_type type); + void check_triggers(triggers::operation_t operation, reg_t address, bool has_data, reg_t data = 0); reg_t translate(reg_t addr, reg_t len, access_type type, uint32_t xlate_flags); // ITLB lookup @@ -398,22 +399,6 @@ private: return (uint16_t*)(translate_insn_addr(addr).host_offset + addr); } - inline triggers::matched_t *trigger_exception(triggers::operation_t operation, - reg_t address, bool has_data, reg_t data=0) - { - if (!proc) { - return NULL; - } - triggers::action_t action; - auto match = proc->TM.memory_access_match(&action, operation, address, has_data, data); - if (match == triggers::MATCH_NONE) - return NULL; - if (match == triggers::MATCH_FIRE_BEFORE) { - throw triggers::matched_t(operation, address, data, action); - } - return new triggers::matched_t(operation, address, data, action); - } - reg_t pmp_homogeneous(reg_t addr, reg_t len); bool pmp_ok(reg_t addr, reg_t len, access_type type, reg_t mode); |