From 282bde72055741d4e407b3f74a1b0f3d79b3b5dc Mon Sep 17 00:00:00 2001 From: Ross Thompson Date: Sat, 10 Jul 2021 22:34:47 -0500 Subject: [PATCH] Fixed the spurious AHB requests to address 0. Somehow by not having a default (else) in the fsm branch selection for STATE_READY in the d cache it was possible to take an invalid branch through the fsm. --- wally-pipelined/src/cache/dcache.sv | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/wally-pipelined/src/cache/dcache.sv b/wally-pipelined/src/cache/dcache.sv index 9b2365966..2b199609c 100644 --- a/wally-pipelined/src/cache/dcache.sv +++ b/wally-pipelined/src/cache/dcache.sv @@ -370,6 +370,7 @@ module dcache // fsm state regs +/* -----\/----- EXCLUDED -----\/----- flopenl #(.TYPE(statetype)) FSMReg(.clk(clk), .load(reset), @@ -377,6 +378,12 @@ module dcache .val(STATE_READY), .d(NextState), .q(CurrState)); + -----/\----- EXCLUDED -----/\----- */ + + always_ff @(posedge clk, posedge reset) + if (reset) CurrState <= #1 STATE_READY; + else CurrState <= #1 NextState; + // next state logic and some state ouputs. always_comb begin @@ -436,7 +443,9 @@ module dcache else if(|MemRWM & FaultM & ~DTLBMissM) begin NextState = STATE_READY; end + else NextState = STATE_READY; end + STATE_AMO_UPDATE: begin NextState = STATE_AMO_WRITE; SaveSRAMRead = 1'b1;