From 6337aab7579ea686f316fb415090473bbc8d7f96 Mon Sep 17 00:00:00 2001 From: Ross Thompson Date: Fri, 18 Aug 2023 16:36:13 -0500 Subject: [PATCH] Fixed issue when with flush miss. --- src/cache/cachefsm.sv | 2 +- tests/custom/simple/cbom.s | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/src/cache/cachefsm.sv b/src/cache/cachefsm.sv index 8628937e7..5be35a1a8 100644 --- a/src/cache/cachefsm.sv +++ b/src/cache/cachefsm.sv @@ -146,7 +146,7 @@ module cachefsm import cvw::*; #(parameter cvw_t P, // com back to CPU assign CacheCommitted = (CurrState != STATE_READY) & ~(READ_ONLY_CACHE & (CurrState == STATE_READ_HOLD | CurrState == STATE_CMO_DONE)); - assign CacheStall = (CurrState == STATE_READY & (FlushCache | AnyMiss | CMOp[1] | CMOp[2])) | // exclusion-tag: icache StallStates + assign CacheStall = (CurrState == STATE_READY & (FlushCache | AnyMiss | ((CMOp[1] | CMOp[2]) & CacheHit))) | // exclusion-tag: icache StallStates (CurrState == STATE_FETCH) | (CurrState == STATE_WRITEBACK) | (CurrState == STATE_WRITE_LINE) | // this cycle writes the sram, must keep stalling so the next cycle can read the next hit/miss unless its a write. diff --git a/tests/custom/simple/cbom.s b/tests/custom/simple/cbom.s index e2c89284e..814b776a6 100644 --- a/tests/custom/simple/cbom.s +++ b/tests/custom/simple/cbom.s @@ -156,6 +156,15 @@ CBOMTest_clean_step3: cbo.inval (a1) la a1, Destination2+448 cbo.inval (a1) + cbo.inval (a1) + cbo.inval (a1) + cbo.inval (a1) + cbo.inval (a1) + cbo.inval (a1) + cbo.inval (a1) + cbo.inval (a1) + cbo.inval (a1) + cbo.inval (a1) # step 4 All should be invalid CBOMTest_clean_step4: @@ -235,6 +244,14 @@ CBOMTest_clean_step6_clean_all: cbo.clean (a1) la a1, Destination2+448 cbo.clean (a1) + cbo.clean (a1) + cbo.clean (a1) + cbo.clean (a1) + cbo.clean (a1) + cbo.clean (a1) + cbo.clean (a1) + cbo.clean (a1) + cbo.clean (a1) # step 8 # invalidate all remaining CBOMTest_clean_step7_invalidate_all: @@ -324,6 +341,11 @@ CBOMTest_flush_step5_flush_all: cbo.flush (a1) la a1, Destination3+448 cbo.flush (a1) + cbo.flush (a1) + cbo.flush (a1) + cbo.flush (a1) + cbo.flush (a1) + cbo.flush (a1) # step 6 CBOMTest_flush_step6_verify: