From c2b9544794945b1693b759323479bd21699079c0 Mon Sep 17 00:00:00 2001 From: Dolu1990 Date: Sat, 24 Nov 2018 13:37:53 +0100 Subject: [PATCH] Allow iBusCached plugin to be used when no memory stage is present --- src/main/scala/vexriscv/plugin/IBusCachedPlugin.scala | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/main/scala/vexriscv/plugin/IBusCachedPlugin.scala b/src/main/scala/vexriscv/plugin/IBusCachedPlugin.scala index e9623cf..66348f4 100644 --- a/src/main/scala/vexriscv/plugin/IBusCachedPlugin.scala +++ b/src/main/scala/vexriscv/plugin/IBusCachedPlugin.scala @@ -182,15 +182,13 @@ class IBusCachedPlugin(resetVector : BigInt = 0x80000000l, iBusRsp.output.pc := cacheRspArbitration.output.payload - - memory plug new Area { - - import memory._ + val flushStage = if(memory != null) memory else execute + flushStage plug new Area { + import flushStage._ cache.io.flush.cmd.valid := False when(arbitration.isValid && input(FLUSH_ALL)) { cache.io.flush.cmd.valid := True - decode.arbitration.flushAll := True when(!cache.io.flush.cmd.ready) { arbitration.haltItself := True