#include "base/logging.hh"
#include "debug/Cache.hh"
#include "debug/CachePort.hh"
+#include "debug/CacheRepl.hh"
#include "debug/CacheVerbose.hh"
#include "mem/cache/mshr.hh"
#include "mem/cache/prefetch/base.hh"
if (!victim)
return nullptr;
+ // Print victim block's information
+ DPRINTF(CacheRepl, "Replacement victim: %s\n", victim->print());
+
// Check for transient state allocations. If any of the entries listed
// for eviction has a transient state, the allocation fails
for (const auto& blk : evict_blks) {
}
/**
- * Pretty-print a tag, and interpret state bits to readable form
+ * Pretty-print tag, set and way, and interpret state bits to readable form
* including mapping to a MOESI state.
*
* @return string with basic state information
*/
- std::string print() const
+ virtual std::string print() const
{
/**
* state M O E S I
default: s = 'T'; break; // @TODO add other types
}
return csprintf("state: %x (%c) valid: %d writable: %d readable: %d "
- "dirty: %d tag: %x", status, s, isValid(),
- isWritable(), isReadable(), isDirty(), tag);
+ "dirty: %d | tag: %#x set: %#x way: %#x", status, s,
+ isValid(), isWritable(), isReadable(), isDirty(), tag,
+ getSet(), getWay());
}
/**
#include <cassert>
+#include "base/cprintf.hh"
#include "base/logging.hh"
void
_sectorBlk->setTag(tag);
}
+std::string
+SectorSubBlk::print() const
+{
+ return csprintf("%s sector offset: %#x", CacheBlk::print(),
+ getSectorOffset());
+}
+
bool
SectorBlk::isValid() const
{
*/
void insert(const Addr tag, const bool is_secure, const int src_master_ID,
const uint32_t task_ID) override;
+
+ /**
+ * Pretty-print sector offset and other CacheBlk information.
+ *
+ * @return string with basic state information
+ */
+ std::string print() const override;
};
/**
auto print_blk = [&str](CacheBlk &blk) {
if (blk.isValid())
- str += csprintf("\tset: %x, way: %x %s\n", blk.getSet(),
- blk.getWay(), blk.print());
+ str += csprintf("\tBlock: %s\n", blk.print());
};
forEachBlk(print_blk);
#include "base/logging.hh"
#include "base/types.hh"
-#include "debug/CacheRepl.hh"
#include "mem/cache/base.hh"
#include "mem/cache/blk.hh"
#include "mem/cache/replacement_policies/base.hh"
// There is only one eviction for this replacement
evict_blks.push_back(victim);
- DPRINTF(CacheRepl, "set %x, way %x: selecting blk for replacement\n",
- victim->getSet(), victim->getWay());
-
return victim;
}
#include "base/logging.hh"
#include "mem/cache/base.hh"
+std::string
+FALRUBlk::print() const
+{
+ return csprintf("%s inCachesMask: %#x", CacheBlk::print(), inCachesMask);
+}
+
FALRU::FALRU(const Params *p)
: BaseTags(p),
/** A bit mask of the caches that fit this block. */
CachesMask inCachesMask;
+
+ /**
+ * Pretty-print inCachesMask and other CacheBlk information.
+ *
+ * @return string with basic state information
+ */
+ std::string print() const override;
};
/**
#include "base/intmath.hh"
#include "base/logging.hh"
#include "base/types.hh"
-#include "debug/CacheRepl.hh"
#include "mem/cache/base.hh"
#include "mem/cache/replacement_policies/base.hh"
#include "mem/cache/tags/indexing_policies/base.hh"
}
}
- DPRINTF(CacheRepl, "set %x, way %x, sector offset %x: selecting blk " \
- "for replacement\n", victim->getSet(), victim->getWay(),
- victim->getSectorOffset());
-
return victim;
}