Skip to content

Commit

Permalink
dcache: Fix issue with missing writes during invalidate
Browse files Browse the repository at this point in the history
This again fixes: openrisc#122

Testing to see how it helps with: openrisc#146

However, this time I hope it is more stable as formal now caught this
bug and now asserts that the formal properties pass.

The fix is slightly different than the original as now we only change
the state machine to allow going directly from INVALIDATE to WRITE with
write having higher priority over invalidate as per comment.
  • Loading branch information
stffrdhrn committed May 14, 2022
1 parent 9a993ee commit c8456dc
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion rtl/verilog/mor1kx_dcache.v
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,13 @@ module mor1kx_dcache
end

INVALIDATE: begin
if (invalidate) begin
if (cpu_we_i) begin
// If we get a write while we are in invalidate its because
// We have already acked the invalidate and the control unit
// has moved on. So start the write as if we were in READ
// or idle.
state <= WRITE;
end else if (invalidate) begin
// Store address in invalidate_adr that is muxed to the tag
// memory write address
invalidate_adr <= spr_bus_dat_i[WAY_WIDTH-1:OPTION_DCACHE_BLOCK_WIDTH];
Expand Down

0 comments on commit c8456dc

Please sign in to comment.