# Node ID 311127245c416ba3d66fb81a1bdf1c56d24aa867 # Parent d660f0d38e3baa1bcaf5a570c270ffa8d98e1d45 diff --git a/src/mem/cache/SConscript b/src/mem/cache/SConscript --- a/src/mem/cache/SConscript +++ b/src/mem/cache/SConscript @@ -42,4 +42,12 @@ DebugFlag('CachePort') DebugFlag('CacheRepl') DebugFlag('CacheTags') +DebugFlag('CacheVerbose') DebugFlag('HWPrefetch') + +# CacheTags is so outrageously verbose, printing the cache's entire tag +# array on each timing access, that you should probably have to ask for +# it explicitly even above and beyond CacheAll. +CompoundFlag('CacheAll', ['Cache', 'CachePort', 'CacheRepl', 'CacheVerbose', + 'HWPrefetch']) + diff --git a/src/mem/cache/cache.cc b/src/mem/cache/cache.cc --- a/src/mem/cache/cache.cc +++ b/src/mem/cache/cache.cc @@ -58,6 +58,7 @@ #include "debug/Cache.hh" #include "debug/CachePort.hh" #include "debug/CacheTags.hh" +#include "debug/CacheVerbose.hh" #include "mem/cache/blk.hh" #include "mem/cache/mshr.hh" #include "mem/cache/prefetch/base.hh" @@ -170,8 +171,8 @@ // appended themselves to this cache before knowing the store // will fail. blk->status |= BlkDirty; - DPRINTF(Cache, "%s for %s addr %#llx size %d (write)\n", __func__, - pkt->cmdString(), pkt->getAddr(), pkt->getSize()); + DPRINTF(CacheVerbose, "%s for %s addr %#llx size %d (write)\n", + __func__, pkt->cmdString(), pkt->getAddr(), pkt->getSize()); } else if (pkt->isRead()) { if (pkt->isLLSC()) { blk->trackLoadLocked(pkt); @@ -244,7 +245,7 @@ assert(blk != tempBlock); tags->invalidate(blk); blk->invalidate(); - DPRINTF(Cache, "%s for %s addr %#llx size %d (invalidation)\n", + DPRINTF(CacheVerbose, "%s for %s addr %#llx size %d (invalidation)\n", __func__, pkt->cmdString(), pkt->getAddr(), pkt->getSize()); } } @@ -280,7 +281,7 @@ "Should never see a write in a read-only cache %s\n", name()); - DPRINTF(Cache, "%s for %s addr %#llx size %d\n", __func__, + DPRINTF(CacheVerbose, "%s for %s addr %#llx size %d\n", __func__, pkt->cmdString(), pkt->getAddr(), pkt->getSize()); if (pkt->req->isUncacheable()) { @@ -1123,7 +1124,7 @@ || writeBuffer.checkFunctional(pkt, blk_addr) || memSidePort->checkFunctional(pkt); - DPRINTF(Cache, "functional %s %#llx (%s) %s%s%s\n", + DPRINTF(CacheVerbose, "functional %s %#llx (%s) %s%s%s\n", pkt->cmdString(), pkt->getAddr(), is_secure ? "s" : "ns", (blk && blk->isValid()) ? "valid " : "", have_data ? "data " : "", done ? "done " : ""); @@ -1431,7 +1432,7 @@ blk->invalidate(); } - DPRINTF(Cache, "Leaving %s with %s for addr %#llx\n", __func__, + DPRINTF(CacheVerbose, "Leaving %s with %s for addr %#llx\n", __func__, pkt->cmdString(), pkt->getAddr()); delete pkt; } @@ -1756,7 +1757,8 @@ Tick forward_time = clockEdge(forwardLatency) + pkt->headerDelay; // Here we reset the timing of the packet. pkt->headerDelay = pkt->payloadDelay = 0; - DPRINTF(Cache, "%s created response: %s addr %#llx size %d tick: %lu\n", + DPRINTF(CacheVerbose, + "%s created response: %s addr %#llx size %d tick: %lu\n", __func__, pkt->cmdString(), pkt->getAddr(), pkt->getSize(), forward_time); memSidePort->schedTimingSnoopResp(pkt, forward_time, true); @@ -1766,7 +1768,7 @@ Cache::handleSnoop(PacketPtr pkt, CacheBlk *blk, bool is_timing, bool is_deferred, bool pending_inval) { - DPRINTF(Cache, "%s for %s addr %#llx size %d\n", __func__, + DPRINTF(CacheVerbose, "%s for %s addr %#llx size %d\n", __func__, pkt->cmdString(), pkt->getAddr(), pkt->getSize()); // deferred snoops can only happen in timing mode assert(!(is_deferred && !is_timing)); @@ -1834,13 +1836,13 @@ } if (!blk || !blk->isValid()) { - DPRINTF(Cache, "%s snoop miss for %s addr %#llx size %d\n", + DPRINTF(CacheVerbose, "%s snoop miss for %s addr %#llx size %d\n", __func__, pkt->cmdString(), pkt->getAddr(), pkt->getSize()); return snoop_delay; } else { - DPRINTF(Cache, "%s snoop hit for %s for addr %#llx size %d, " - "old state is %s\n", __func__, pkt->cmdString(), - pkt->getAddr(), pkt->getSize(), blk->print()); + DPRINTF(Cache, "%s snoop hit for %s addr %#llx size %d, " + "old state is %s\n", __func__, pkt->cmdString(), + pkt->getAddr(), pkt->getSize(), blk->print()); } chatty_assert(!(isReadOnly && blk->isDirty()), @@ -1932,7 +1934,7 @@ void Cache::recvTimingSnoopReq(PacketPtr pkt) { - DPRINTF(Cache, "%s for %s addr %#llx size %d\n", __func__, + DPRINTF(CacheVerbose, "%s for %s addr %#llx size %d\n", __func__, pkt->cmdString(), pkt->getAddr(), pkt->getSize()); // Snoops shouldn't happen when bypassing caches