CreditCounter.bsv: Actually rate-limit

If DRAM latency is too high and the cache is performing frequent writes,
it would be possible to overflow this counter, which means we don't rate
limit, the cache could erroneously believe it's safe to do I/O
accesses/cache refills/page table walks, and the cache would block due
to the guard on decr when it finally gets enough write responses back.
We should block the incr method to automatically stall the cache until
it receives a new write response.
This commit is contained in:
Jessica Clarke
2020-05-15 19:51:43 +01:00
parent 9c12b97a09
commit a154207d3f

View File

@@ -37,7 +37,7 @@ module mkCreditCounter (CreditCounter_IFC #(w));
method UInt #(w) value = crg [1];
method Action incr;
method Action incr if (crg [0] != maxBound);
if (crg [0] == maxBound) begin
$display ("%0d: ERROR: CreditCounter: overflow", cur_cycle);
$finish (1); // Assertion failure