aboutsummaryrefslogtreecommitdiff
path: root/riscv/mmu.h
diff options
context:
space:
mode:
authorTim Newsome <tim@sifive.com>2016-04-24 08:54:19 -0700
committerTim Newsome <tim@sifive.com>2016-05-23 12:12:11 -0700
commitd999dfc0d41a119730ff8944d37dbee88bf99723 (patch)
tree2268c9d7d5f122fb81253d10bd05901eaff0ff62 /riscv/mmu.h
parent191671a2015136c429394fd3051e4a9c1ff45352 (diff)
downloadriscv-isa-sim-d999dfc0d41a119730ff8944d37dbee88bf99723.zip
riscv-isa-sim-d999dfc0d41a119730ff8944d37dbee88bf99723.tar.gz
riscv-isa-sim-d999dfc0d41a119730ff8944d37dbee88bf99723.tar.bz2
Add debug_module bus device.
This should replace the ROM hack I implemented earlier, but for now both exist together. Back to the point where gdb connects, core jumps to ROM->RAM->ROM.
Diffstat (limited to 'riscv/mmu.h')
-rw-r--r--riscv/mmu.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/riscv/mmu.h b/riscv/mmu.h
index b6aa2ca..a87b6af 100644
--- a/riscv/mmu.h
+++ b/riscv/mmu.h
@@ -16,6 +16,7 @@
// virtual memory configuration
#define PGSHIFT 12
const reg_t PGSIZE = 1 << PGSHIFT;
+const reg_t PGMASK = ~(PGSIZE-1);
struct insn_fetch_t
{
@@ -153,8 +154,9 @@ private:
reg_t tlb_load_tag[TLB_ENTRIES];
reg_t tlb_store_tag[TLB_ENTRIES];
- // finish translation on a TLB miss and upate the TLB
+ // finish translation on a TLB miss and update the TLB
void refill_tlb(reg_t vaddr, reg_t paddr, access_type type);
+ const char* fill_from_mmio(reg_t vaddr, reg_t paddr);
// perform a page table walk for a given VA; set referenced/dirty bits
reg_t walk(reg_t addr, access_type type, bool supervisor, bool pum);
@@ -172,7 +174,7 @@ private:
return (uint16_t*)(tlb_data[vpn % TLB_ENTRIES] + addr);
return fetch_slow_path(addr);
}
-
+
friend class processor_t;
};