summaryrefslogtreecommitdiff
path: root/src/mem/cache/cache_impl.hh
diff options
context:
space:
mode:
authorSteve Reinhardt <stever@eecs.umich.edu>2007-06-26 14:53:15 -0700
committerSteve Reinhardt <stever@eecs.umich.edu>2007-06-26 14:53:15 -0700
commit7dacbcf49262605a75e461149ec7bd7a00fca7b7 (patch)
treecd1f5994e726ecd59badb23b8a264c669d37a876 /src/mem/cache/cache_impl.hh
parentf697e959a17646500bca7c12e6bb7b30e047f1bb (diff)
downloadgem5-7dacbcf49262605a75e461149ec7bd7a00fca7b7.tar.xz
Handle replacement of block with pending upgrade.
src/mem/cache/tags/lru.cc: Add some replacement DPRINTFs --HG-- extra : convert_revision : 7993ec24d6af7e7774d04ce36f20e3f43f887fd9
Diffstat (limited to 'src/mem/cache/cache_impl.hh')
-rw-r--r--src/mem/cache/cache_impl.hh27
1 files changed, 21 insertions, 6 deletions
diff --git a/src/mem/cache/cache_impl.hh b/src/mem/cache/cache_impl.hh
index 48efc5ca3..d01adde78 100644
--- a/src/mem/cache/cache_impl.hh
+++ b/src/mem/cache/cache_impl.hh
@@ -300,7 +300,6 @@ Cache<TagStore,Coherence>::timingAccess(PacketPtr pkt)
return true;
}
- PacketList writebacks;
int lat = hitLatency;
bool satisfied = false;
@@ -319,6 +318,8 @@ Cache<TagStore,Coherence>::timingAccess(PacketPtr pkt)
}
#if 0
+ PacketList writebacks;
+
// If this is a block size write/hint (WH64) allocate the block here
// if the coherence protocol allows it.
/** @todo make the fast write alloc (wh64) work with coherence. */
@@ -338,7 +339,6 @@ Cache<TagStore,Coherence>::timingAccess(PacketPtr pkt)
++fastWrites;
}
}
-#endif
// copy writebacks to write buffer
while (!writebacks.empty()) {
@@ -346,6 +346,7 @@ Cache<TagStore,Coherence>::timingAccess(PacketPtr pkt)
allocateBuffer(wbPkt, time, true);
writebacks.pop_front();
}
+#endif
bool needsResponse = pkt->needsResponse();
@@ -676,6 +677,15 @@ Cache<TagStore,Coherence>::handleResponse(PacketPtr pkt)
DPRINTF(Cache, "Block for addr %x being updated in Cache\n",
pkt->getAddr());
BlkType *blk = tags->findBlock(pkt->getAddr());
+
+ if (blk == NULL && pkt->cmd == MemCmd::UpgradeResp) {
+ if (!mshr->handleReplacedPendingUpgrade(pkt)) {
+ mq->markPending(mshr);
+ requestMemSideBus((RequestCause)mq->index, pkt->finishTime);
+ return;
+ }
+ }
+
PacketList writebacks;
blk = handleFill(pkt, blk, writebacks);
deallocate = satisfyMSHR(mshr, pkt, blk);
@@ -747,15 +757,20 @@ Cache<TagStore,Coherence>::handleFill(PacketPtr pkt, BlkType *blk,
Addr addr = pkt->getAddr();
if (blk == NULL) {
- // better have read new data
+ // better have read new data...
assert(pkt->isRead());
// need to do a replacement
blk = tags->findReplacement(addr, writebacks);
if (blk->isValid()) {
+ Addr repl_addr = tags->regenerateBlkAddr(blk->tag, blk->set);
+ MSHR *repl_mshr = mshrQueue.findMatch(repl_addr);
+ if (repl_mshr) {
+ repl_mshr->handleReplacement(blk, blkSize);
+ }
+
DPRINTF(Cache, "replacement: replacing %x with %x: %s\n",
- tags->regenerateBlkAddr(blk->tag, blk->set), addr,
- blk->isDirty() ? "writeback" : "clean");
+ repl_addr, addr, blk->isDirty() ? "writeback" : "clean");
if (blk->isDirty()) {
// Save writeback packet for handling by caller
@@ -992,7 +1007,7 @@ Cache<TagStore,Coherence>::getNextMSHR()
return conflict_mshr;
}
- // No conclifts; issue read
+ // No conflicts; issue read
return miss_mshr;
}