diff options
author | Mrinmoy Ghosh <mrinmoy.ghosh@arm.com> | 2012-09-25 11:49:41 -0500 |
---|---|---|
committer | Mrinmoy Ghosh <mrinmoy.ghosh@arm.com> | 2012-09-25 11:49:41 -0500 |
commit | 6fc0094337bc0356c55232c3850fb5fd2dab1f0c (patch) | |
tree | f23261eb3f3a7e91b08505e68015941b1d04ba7c /src/mem/cache/cache_impl.hh | |
parent | 74ab69c7eafc2f0d187ce3ba7d6b9a59ba291b9f (diff) | |
download | gem5-6fc0094337bc0356c55232c3850fb5fd2dab1f0c.tar.xz |
Cache: add a response latency to the caches
In the current caches the hit latency is paid twice on a miss. This patch lets
a configurable response latency be set of the cache for the backward path.
Diffstat (limited to 'src/mem/cache/cache_impl.hh')
-rw-r--r-- | src/mem/cache/cache_impl.hh | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/mem/cache/cache_impl.hh b/src/mem/cache/cache_impl.hh index 9b9010d34..a22003c4f 100644 --- a/src/mem/cache/cache_impl.hh +++ b/src/mem/cache/cache_impl.hh @@ -897,8 +897,11 @@ Cache<TagStore>::handleResponse(PacketPtr pkt) transfer_offset += blkSize; } - // If critical word (no offset) return first word time - completion_time = tags->getHitLatency() + + // If critical word (no offset) return first word time. + // responseLatency is the latency of the return path + // from lower level caches/memory to an upper level cache or + // the core. + completion_time = responseLatency + (transfer_offset ? pkt->finishTime : pkt->firstWordTime); assert(!target->pkt->req->isUncacheable()); @@ -911,11 +914,16 @@ Cache<TagStore>::handleResponse(PacketPtr pkt) assert(target->pkt->cmd == MemCmd::StoreCondReq || target->pkt->cmd == MemCmd::StoreCondFailReq || target->pkt->cmd == MemCmd::SCUpgradeFailReq); - completion_time = tags->getHitLatency() + pkt->finishTime; + // responseLatency is the latency of the return path + // from lower level caches/memory to an upper level cache or + // the core. + completion_time = responseLatency + pkt->finishTime; target->pkt->req->setExtraData(0); } else { // not a cache fill, just forwarding response - completion_time = tags->getHitLatency() + pkt->finishTime; + // responseLatency is the latency of the return path + // from lower level cahces/memory to the core. + completion_time = responseLatency + pkt->finishTime; if (pkt->isRead() && !is_error) { target->pkt->setData(pkt->getPtr<uint8_t>()); } |