From: Mitch Hayenga Date: Wed, 27 Mar 2013 23:36:09 +0000 (-0500) Subject: mem: Fix cache latency bug X-Git-Tag: stable_2013_06_16~24 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=4920f0d7e5a4c29ada074bf3a73f36510e138016;p=gem5.git mem: Fix cache latency bug Fixes a latency calculation bug for accesses during a cache line fill. Under a cache miss, before the line is filled, accesses to the cache are associated with a MSHR and marked as targets. Once the line fill completes, MSHR target packets pay an additional latency of "responseLatency + busSerializationLatency". However, the "whenReady" field of the cache line is only set to an additional delay of "busSerializationLatency". This lacks the responseLatency component of the fill. It is possible for accesses that occur on the cycle of (or briefly after) the line fill to respond without properly paying the responseLatency. This also creates the situation where two accesses to the same address may be serviced in an order opposite of how they were received by the cache. For stores to the same address, this means that although the cache performs the stores in the order they were received, acknowledgements may be sent in a different order. Adding the responseLatency component to the whenReady field preserves the penalty that should be paid and prevents these ordering issues. Committed by: Nilay Vaish --- diff --git a/src/mem/cache/cache_impl.hh b/src/mem/cache/cache_impl.hh index 2be41642d..68b86b121 100644 --- a/src/mem/cache/cache_impl.hh +++ b/src/mem/cache/cache_impl.hh @@ -1242,7 +1242,8 @@ Cache::handleFill(PacketPtr pkt, BlkType *blk, std::memcpy(blk->data, pkt->getPtr(), blkSize); } - blk->whenReady = curTick() + pkt->busLastWordDelay; + blk->whenReady = curTick() + responseLatency * clockPeriod() + + pkt->busLastWordDelay; return blk; }