Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions core/load_unit.sv
Original file line number Diff line number Diff line change
Expand Up @@ -156,10 +156,6 @@ module load_unit
ldbuf_flushed_d = ldbuf_flushed_q;
ldbuf_valid_d = ldbuf_valid_q;

// In case of flush, raise the flushed flag in all slots.
if (flush_i) begin
ldbuf_flushed_d = '1;
end
// Free read entry (in the case of fall-through mode, free the entry
// only if there is no pending load)
if (ldbuf_r && (!LDBUF_FALLTHROUGH || !ldbuf_w)) begin
Expand All @@ -170,6 +166,15 @@ module load_unit
ldbuf_flushed_d[ldbuf_windex] = 1'b0;
ldbuf_valid_d[ldbuf_windex] = 1'b1;
end
// In case of flush, raise the flushed flag in all slots, including any
// slot just allocated by ldbuf_w in the same cycle. This branch must
// appear after ldbuf_w so that flush_i wins the lexical priority contest
// for the newly written slot; if it appeared before, a simultaneous
// data_gnt would clear flushed_d[windex] back to 0 and the slot would
// survive the flush, later producing a phantom valid_o writeback.
if (flush_i) begin
ldbuf_flushed_d = '1;
end
end

always_ff @(posedge clk_i or negedge rst_ni) begin : ldbuf_ff
Expand Down
Loading