aboutsummaryrefslogtreecommitdiff
path: root/riscv/mmu.cc
diff options
context:
space:
mode:
authorAndrew Waterman <waterman@cs.berkeley.edu>2015-10-13 09:42:36 -0700
committerAndrew Waterman <waterman@cs.berkeley.edu>2015-10-13 09:42:36 -0700
commit8234ee969db475c1ba759dea6938522f64c1ee62 (patch)
treeb40097da63d793e5f30d1c7a8fb8c193b46487ec /riscv/mmu.cc
parentc0af64539fcc799914d4246275aa4e031350bb89 (diff)
downloadspike-8234ee969db475c1ba759dea6938522f64c1ee62.zip
spike-8234ee969db475c1ba759dea6938522f64c1ee62.tar.gz
spike-8234ee969db475c1ba759dea6938522f64c1ee62.tar.bz2
Fix --dc flag
Resolves #33.
Diffstat (limited to 'riscv/mmu.cc')
-rw-r--r--riscv/mmu.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/riscv/mmu.cc b/riscv/mmu.cc
index 6173b43..a8b1675 100644
--- a/riscv/mmu.cc
+++ b/riscv/mmu.cc
@@ -60,7 +60,9 @@ void mmu_t::load_slow_path(reg_t addr, reg_t len, uint8_t* bytes)
reg_t paddr = translate(addr, LOAD);
if (paddr < memsz) {
memcpy(bytes, mem + paddr, len);
- if (!tracer.interested_in_range(paddr, paddr + PGSIZE, LOAD))
+ if (tracer.interested_in_range(paddr, paddr + PGSIZE, LOAD))
+ tracer.trace(paddr, len, LOAD);
+ else
refill_tlb(addr, paddr, LOAD);
} else if (!proc || !proc->sim->mmio_load(addr, len, bytes)) {
throw trap_load_access_fault(addr);
@@ -72,7 +74,9 @@ void mmu_t::store_slow_path(reg_t addr, reg_t len, const uint8_t* bytes)
reg_t paddr = translate(addr, STORE);
if (paddr < memsz) {
memcpy(mem + paddr, bytes, len);
- if (!tracer.interested_in_range(paddr, paddr + PGSIZE, STORE))
+ if (tracer.interested_in_range(paddr, paddr + PGSIZE, STORE))
+ tracer.trace(paddr, len, STORE);
+ else
refill_tlb(addr, paddr, STORE);
} else if (!proc || !proc->sim->mmio_store(addr, len, bytes)) {
throw trap_store_access_fault(addr);