summaryrefslogtreecommitdiff
path: root/src/mem/cache
diff options
context:
space:
mode:
authorNikos Nikoleris <nikos.nikoleris@arm.com>2018-05-01 12:02:14 +0100
committerNikos Nikoleris <nikos.nikoleris@arm.com>2018-05-17 14:16:01 +0000
commit403c0158f57090dbbd4b21166887eb53b13a7fc6 (patch)
treea60622e9dbb272afb200a075a886fd779097e08d /src/mem/cache
parent49f96e7b77925837aa5bc84d4c3453ab5f07408e (diff)
downloadgem5-403c0158f57090dbbd4b21166887eb53b13a7fc6.tar.xz
mem-cache: Simplify writeback for the tempBlock in recvTimingResp
When we use the tempBlock to fill-in, we have to write it back and invalidate it at the end of current transaction. This patch simplifies the writeback flow by treating it as a regular writeback. Change-Id: I257be7bbff211e2832ad001a4e991daf67704485 Reviewed-on: https://gem5-review.googlesource.com/10421 Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br> Reviewed-by: Jason Lowe-Power <jason@lowepower.com> Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com>
Diffstat (limited to 'src/mem/cache')
-rw-r--r--src/mem/cache/cache.cc30
1 files changed, 7 insertions, 23 deletions
diff --git a/src/mem/cache/cache.cc b/src/mem/cache/cache.cc
index 2d3ab8312..b9625beee 100644
--- a/src/mem/cache/cache.cc
+++ b/src/mem/cache/cache.cc
@@ -1611,33 +1611,17 @@ Cache::recvTimingResp(PacketPtr pkt)
// reset the xbar additional timinig as it is now accounted for
pkt->headerDelay = pkt->payloadDelay = 0;
- // copy writebacks to write buffer
- doWritebacks(writebacks, forward_time);
-
// if we used temp block, check to see if its valid and then clear it out
if (blk == tempBlock && tempBlock->isValid()) {
- // We use forwardLatency here because we are copying
- // Writebacks/CleanEvicts to write buffer. It specifies the latency to
- // allocate an internal buffer and to schedule an event to the
- // queued port.
- if (blk->isDirty() || writebackClean) {
- PacketPtr wbPkt = writebackBlk(blk);
- allocateWriteBuffer(wbPkt, forward_time);
- // Set BLOCK_CACHED flag if cached above.
- if (isCachedAbove(wbPkt))
- wbPkt->setBlockCached();
- } else {
- PacketPtr wcPkt = cleanEvictBlk(blk);
- // Check to see if block is cached above. If not allocate
- // write buffer
- if (isCachedAbove(wcPkt))
- delete wcPkt;
- else
- allocateWriteBuffer(wcPkt, forward_time);
- }
- invalidateBlock(blk);
+ PacketPtr wb_pkt = tempBlock->isDirty() || writebackClean ?
+ writebackBlk(blk) : cleanEvictBlk(blk);
+ writebacks.push_back(wb_pkt);
+ invalidateBlock(tempBlock);
}
+ // copy writebacks to write buffer
+ doWritebacks(writebacks, forward_time);
+
DPRINTF(CacheVerbose, "%s: Leaving with %s\n", __func__, pkt->print());
delete pkt;
}