From 6b225949614498eab9521620c980b891ce0420e0 Mon Sep 17 00:00:00 2001 From: Charles Papon Date: Wed, 10 Apr 2019 15:42:39 +0200 Subject: [PATCH] Flush MMU line with exception on context switching instead than on cmd fire --- src/main/scala/vexriscv/plugin/MmuPlugin.scala | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/scala/vexriscv/plugin/MmuPlugin.scala b/src/main/scala/vexriscv/plugin/MmuPlugin.scala index 9fce74e..a243484 100644 --- a/src/main/scala/vexriscv/plugin/MmuPlugin.scala +++ b/src/main/scala/vexriscv/plugin/MmuPlugin.scala @@ -137,11 +137,11 @@ class MmuPlugin(ioRange : UInt => Bool, } port.bus.rsp.isIoAccess := ioRange(port.bus.rsp.physicalAddress) - // Avoid keeping any invalid line in the cache more than one memory translation. + // Avoid keeping any invalid line in the cache after an exception. // https://github.com/riscv/riscv-linux/blob/8fe28cb58bcb235034b64cbbb7550a8a43fd88be/arch/riscv/include/asm/pgtable.h#L276 - when(port.bus.cmd.isValid && port.bus.end) { + when(service(classOf[IContextSwitching]).isContextSwitching) { for (line <- cache) { - when(line.valid && line.exception) { + when(line.exception) { line.valid := False } }