From 624b3e3ab243af28a22db2cecf54e26a837a965e Mon Sep 17 00:00:00 2001 From: Ross Thompson Date: Wed, 16 Aug 2023 14:23:56 -0500 Subject: [PATCH] Added clean and flush to cache fsm. --- src/cache/cachefsm.sv | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/cache/cachefsm.sv b/src/cache/cachefsm.sv index 4a0f0cb0d..9d819f000 100644 --- a/src/cache/cachefsm.sv +++ b/src/cache/cachefsm.sv @@ -120,7 +120,8 @@ module cachefsm import cvw::*; #(parameter cvw_t P, STATE_READ_HOLD: if(Stall) NextState = STATE_READ_HOLD; else NextState = STATE_READY; // exclusion-tag-start: icache case - STATE_WRITEBACK: if(CacheBusAck) NextState = STATE_FETCH; + STATE_WRITEBACK: if(CacheBusAck & (CMop[2] | CMOp[3])) NextState = STATE_READY; + else if(CacheBusAck) NextState = STATE_FETCH; else NextState = STATE_WRITEBACK; // eviction needs a delay as the bus fsm does not correctly handle sending the write command at the same time as getting back the bus ack. STATE_FLUSH: if(LineDirty) NextState = STATE_FLUSH_WRITEBACK;