Skip to content

Commit eccb8f7

Browse files
committed
hw: Guard against long-blocked SSR write stream on reversal
1 parent 1542031 commit eccb8f7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

hw/snitch_ssr/src/snitch_ssr.sv

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,8 @@ module snitch_ssr import snitch_ssr_pkg::*; #(
116116
// The datamover must preserve its directional muxing until the flush is complete.
117117
// This will *not* block write preloading of the FIFO.
118118
assign agen_write_reversing = agen_write ^ agen_write_q;
119-
assign agen_flush = agen_write_reversing & ~credit_full;
119+
// When switching from writes to reads, the FIFO must be *fully* read too.
120+
assign agen_flush = agen_write_reversing & (~credit_full | (agen_write_q & ~fifo_empty));
120121
assign dm_write = agen_flush ? agen_write_q : agen_write;
121122

122123
assign agen_ready = ~agen_flush & (agen_zero ?

0 commit comments

Comments
 (0)