Skip to content

Commit dc4e12d

Browse files
authored
Merge pull request pulp-platform#27 from planvtech/PROJ-271-amo-lr-reservation-erroneously-cleared-by-writeback
Wait for completion on write back before AMO
2 parents c5264d2 + dd984e2 commit dc4e12d

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

core/cache_subsystem/miss_handler.sv

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,8 @@ module miss_handler import ariane_pkg::*; import std_cache_pkg::*; #(
102102
WB_CACHELINE_AMO, // F
103103
AMO_WAIT_RESP, // 10
104104
SEND_CLEAN, // 11
105-
REQ_CACHELINE_UNIQUE // 12
105+
REQ_CACHELINE_UNIQUE, // 12
106+
WB_CACHELINE_AMO_WAIT_ACK // 13
106107
} state_d, state_q;
107108

108109
// Registers
@@ -432,11 +433,19 @@ module miss_handler import ariane_pkg::*; import std_cache_pkg::*; #(
432433
state_d = (state_q == WB_CACHELINE_MISS) ?
433434
(colliding_clean_q[mshr_q.id] ? REQ_CACHELINE_UNIQUE : REQ_CACHELINE) :
434435
(state_q == WB_CACHELINE_FLUSH) ? FLUSH_REQ_STATUS :
435-
(state_q == WB_CACHELINE_AMO) ? AMO_REQ :
436+
(state_q == WB_CACHELINE_AMO) ? WB_CACHELINE_AMO_WAIT_ACK :
436437
IDLE;
437438
end
438439
end
439440

441+
// ~> write back before AMO needs to wait until write is completely finished
442+
WB_CACHELINE_AMO_WAIT_ACK: begin
443+
if (valid_miss_fsm) begin
444+
state_d = AMO_REQ;
445+
end
446+
end
447+
448+
440449
// ------------------------------
441450
// Flushing & Initialization
442451
// ------------------------------

0 commit comments

Comments
 (0)