diff --git a/src/base/cache/associative_cache.hh b/src/base/cache/associative_cache.hh index 64690b847c..eb6d243e62 100644 --- a/src/base/cache/associative_cache.hh +++ b/src/base/cache/associative_cache.hh @@ -232,6 +232,12 @@ class AssociativeCache : public Named auto victim = static_cast(replPolicy->getVictim(candidates)); + if (debugFlag && debugFlag->tracing() && victim->isValid()) { + ::gem5::trace::getDebugLogger()->dprintf_flag( + curTick(), name(), debugFlag->name(), + "Replacing entry: %s\n", victim->print()); + } + invalidate(victim); return victim; @@ -257,6 +263,12 @@ class AssociativeCache : public Named virtual void insertEntry(const KeyType &key, Entry *entry) { + if (debugFlag && debugFlag->tracing()) { + ::gem5::trace::getDebugLogger()->dprintf_flag( + curTick(), name(), debugFlag->name(), + "Inserting entry: %s\n", entry->print()); + } + entry->insert(key); replPolicy->reset(entry->replacementData); }