misc: Rename misc.(hh|cc) to logging.(hh|cc)
[gem5.git] / src / mem / cache / mshr.cc
index e3ee44cc636b674968052b662035e5950685972b..fa21f5cfc2b18fe8bc9de21840ec74f7eccd797a 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012-2013, 2015-2016 ARM Limited
+ * Copyright (c) 2012-2013, 2015-2017 ARM Limited
  * All rights reserved.
  *
  * The license below extends only to copyright in the software and shall
@@ -54,7 +54,7 @@
 #include <string>
 #include <vector>
 
-#include "base/misc.hh"
+#include "base/logging.hh"
 #include "base/types.hh"
 #include "debug/Cache.hh"
 #include "mem/cache/cache.hh"
@@ -231,6 +231,7 @@ MSHR::TargetList::print(std::ostream &os, int verbosity,
         }
         ccprintf(os, "%s%s: ", prefix, s);
         t.pkt->print(os, verbosity, "");
+        ccprintf(os, "\n");
     }
 }
 
@@ -343,16 +344,14 @@ MSHR::allocateTarget(PacketPtr pkt, Tick whenReady, Counter _order,
 bool
 MSHR::handleSnoop(PacketPtr pkt, Counter _order)
 {
-    DPRINTF(Cache, "%s for %s addr %#llx size %d\n", __func__,
-            pkt->cmdString(), pkt->getAddr(), pkt->getSize());
+    DPRINTF(Cache, "%s for %s\n", __func__, pkt->print());
 
     // when we snoop packets the needsWritable and isInvalidate flags
     // should always be the same, however, this assumes that we never
     // snoop writes as they are currently not marked as invalidations
     panic_if(pkt->needsWritable() != pkt->isInvalidate(),
-             "%s got snoop %s to addr %#llx where needsWritable, "
-             "does not match isInvalidate", name(), pkt->cmdString(),
-             pkt->getAddr());
+             "%s got snoop %s where needsWritable, "
+             "does not match isInvalidate", name(), pkt->print());
 
     if (!inService || (pkt->isExpressSnoop() && downstreamPending)) {
         // Request has not been issued yet, or it's been issued
@@ -402,8 +401,7 @@ MSHR::handleSnoop(PacketPtr pkt, Counter _order)
 
         // Start by determining if we will eventually respond or not,
         // matching the conditions checked in Cache::handleSnoop
-        bool will_respond = isPendingModified() && pkt->needsResponse() &&
-            pkt->cmd != MemCmd::InvalidateReq;
+        bool will_respond = isPendingModified() && pkt->needsResponse();
 
         // The packet we are snooping may be deleted by the time we
         // actually process the target, and we consequently need to
@@ -416,7 +414,7 @@ MSHR::handleSnoop(PacketPtr pkt, Counter _order)
         // the packet and the request as part of handling the deferred
         // snoop.
         PacketPtr cp_pkt = will_respond ? new Packet(pkt, true, true) :
-            new Packet(new Request(*pkt->req), pkt->cmd);
+            new Packet(new Request(*pkt->req), pkt->cmd, blkSize);
 
         if (will_respond) {
             // we are the ordering point, and will consequently
@@ -467,7 +465,8 @@ MSHR::extractServiceableTargets(PacketPtr pkt)
     // avoid memory consistency violations.
     if (pkt->cmd == MemCmd::ReadRespWithInvalidate) {
         auto it = targets.begin();
-        assert(it->source == Target::FromCPU);
+        assert((it->source == Target::FromCPU) ||
+               (it->source == Target::FromPrefetcher));
         ready_targets.push_back(*it);
         it = targets.erase(it);
         while (it != targets.end()) {