mem-cache: Virtualize block print
[gem5.git] / src / mem / cache / cache.cc
index ffd60811e4b1ecf00c89043e040d3259d630aefa..1b5316383d1f38d628b45870fa0671272a2bd7de 100644 (file)
@@ -560,7 +560,7 @@ Cache::createMissPacket(PacketPtr cpu_pkt, CacheBlk *blk,
 
 
 Cycles
-Cache::handleAtomicReqMiss(PacketPtr pkt, CacheBlk *blk,
+Cache::handleAtomicReqMiss(PacketPtr pkt, CacheBlk *&blk,
                            PacketList &writebacks)
 {
     // deal with the packets that go through the write path of
@@ -674,8 +674,6 @@ Cache::serviceMSHRTargets(MSHR *mshr, const PacketPtr pkt, CacheBlk *blk,
     const int initial_offset = initial_tgt->pkt->getOffset(blkSize);
 
     const bool is_error = pkt->isError();
-    bool is_fill = !mshr->isForward &&
-        (pkt->isRead() || pkt->cmd == MemCmd::UpgradeResp);
     // allow invalidation responses originating from write-line
     // requests to be discarded
     bool is_invalidate = pkt->isInvalidate();
@@ -716,13 +714,11 @@ Cache::serviceMSHRTargets(MSHR *mshr, const PacketPtr pkt, CacheBlk *blk,
                                  targets.allocOnFill);
                 assert(blk);
 
-                // treat as a fill, and discard the invalidation
-                // response
-                is_fill = true;
+                // discard the invalidation response
                 is_invalidate = false;
             }
 
-            if (is_fill) {
+            if (blk && blk->isValid() && !mshr->isForward) {
                 satisfyRequest(tgt_pkt, blk, true, mshr->hasPostDowngrade());
 
                 // How many bytes past the first request is this one