Browse Source

Fix triggers for accesses wider than XLEN

I believe that @en-sc's comment here is correct:
https://github.com/riscv-software-src/riscv-isa-sim/pull/2161#discussion_r2564958203

Nevertheless, failing an assertion when someone sets a trigger on memory
accessed by a wide access is not reasonable behavior for Spike.  Better to
do something that follows the principle of least surprise, despite the
debug spec's lack of clarity on this point.
pull/2198/head
Andrew Waterman 7 months ago
parent
commit
0f59a6dc75
  1. 5
      riscv/mmu.cc

5
riscv/mmu.cc

@ -223,9 +223,8 @@ void mmu_t::check_triggers(triggers::operation_t operation,
reg_t addr, bool virt, std::size_t data_size, const std::uint8_t* bytes)
{
assert(data_size > 0);
assert(data_size <= sizeof(reg_t));
check_triggers(operation, addr, virt,
data_size, reg_from_bytes(data_size, bytes));
check_triggers(operation, addr, virt, data_size, reg_from_bytes(std::min(data_size, sizeof(reg_t)), bytes));
}
void mmu_t::check_triggers(triggers::operation_t operation,

Loading…
Cancel
Save