From: Andrew Waterman Date: Thu, 23 Jun 2016 06:25:55 +0000 (-0700) Subject: Don't use I$ in debug mode X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=7b9cd3e781a6bf359f31f2da3d05fcda27dafe98;p=riscv-isa-sim.git Don't use I$ in debug mode This avoids the need for fence.i. --- diff --git a/riscv/mmu.h b/riscv/mmu.h index a87b6af..03be15d 100644 --- a/riscv/mmu.h +++ b/riscv/mmu.h @@ -40,7 +40,7 @@ public: // template for functions that load an aligned value from memory #define load_func(type) \ - type##_t load_##type(reg_t addr) __attribute__((always_inline)) { \ + inline type##_t load_##type(reg_t addr) { \ if (addr & (sizeof(type##_t)-1)) \ throw trap_load_address_misaligned(addr); \ reg_t vpn = addr >> PGSHIFT; \ @@ -130,7 +130,8 @@ public: inline insn_fetch_t load_insn(reg_t addr) { - return access_icache(addr)->data; + icache_entry_t entry; + return refill_icache(addr, &entry)->data; } void flush_tlb(); @@ -168,7 +169,7 @@ private: reg_t translate(reg_t addr, access_type type); // ITLB lookup - const uint16_t* translate_insn_addr(reg_t addr) __attribute__((always_inline)) { + inline const uint16_t* translate_insn_addr(reg_t addr) { reg_t vpn = addr >> PGSHIFT; if (likely(tlb_insn_tag[vpn % TLB_ENTRIES] == vpn)) return (uint16_t*)(tlb_data[vpn % TLB_ENTRIES] + addr);