From bea283531abfd013811e83c75ff6189a0d9b3075 Mon Sep 17 00:00:00 2001 From: Andrew Waterman Date: Wed, 3 Feb 2016 23:38:29 -0800 Subject: [PATCH] Actually refill ITLB on ITLB miss oops. --- riscv/mmu.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/riscv/mmu.cc b/riscv/mmu.cc index 4558b1e..0073a8a 100644 --- a/riscv/mmu.cc +++ b/riscv/mmu.cc @@ -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); } -- 2.30.2