Actually refill ITLB on ITLB miss
authorAndrew Waterman <waterman@cs.berkeley.edu>
Thu, 4 Feb 2016 07:38:29 +0000 (23:38 -0800)
committerAndrew Waterman <waterman@cs.berkeley.edu>
Thu, 4 Feb 2016 07:38:29 +0000 (23:38 -0800)
oops.

riscv/mmu.cc

index 4558b1e7bf0481d50a8f9e102ac86e6e78f8d308..0073a8a562e840915353b4947e87b2b5517ff97d 100644 (file)
@@ -50,7 +50,9 @@ reg_t mmu_t::translate(reg_t addr, access_type type)
 const uint16_t* mmu_t::fetch_slow_path(reg_t addr)
 {
   reg_t paddr = translate(addr, FETCH);
-  if (paddr >= memsz)
+  if (paddr < memsz)
+    refill_tlb(addr, paddr, FETCH);
+  else
     throw trap_instruction_access_fault(addr);
   return (const uint16_t*)(mem + paddr);
 }