From d7e9c726c36c66caf0f6bc4c15ffc659f27c237f Mon Sep 17 00:00:00 2001 From: Dolu1990 Date: Thu, 23 Feb 2023 14:42:21 +0100 Subject: [PATCH] Fix datacache initial flush --- src/main/scala/vexriscv/ip/DataCache.scala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/scala/vexriscv/ip/DataCache.scala b/src/main/scala/vexriscv/ip/DataCache.scala index b4b04f7..a2e43aa 100644 --- a/src/main/scala/vexriscv/ip/DataCache.scala +++ b/src/main/scala/vexriscv/ip/DataCache.scala @@ -855,7 +855,7 @@ class DataCache(val p : DataCacheConfig, mmuParameter : MemoryTranslatorBusParam io.cpu.execute.haltIt := True when(!hold) { counter := counter + 1 - when(io.cpu.flush.singleLine){ + when(io.cpu.flush.valid && io.cpu.flush.singleLine){ counter.msb := True } } @@ -869,7 +869,7 @@ class DataCache(val p : DataCacheConfig, mmuParameter : MemoryTranslatorBusParam when(start){ waitDone := True counter := 0 - when(io.cpu.flush.singleLine){ + when(io.cpu.flush.valid && io.cpu.flush.singleLine){ counter := U"0" @@ io.cpu.flush.lineId } }