diff options
-rw-r--r-- | src/mem/cache/cache.cc | 1 | ||||
-rw-r--r-- | src/mem/cache/tags/base.cc | 6 |
2 files changed, 3 insertions, 4 deletions
diff --git a/src/mem/cache/cache.cc b/src/mem/cache/cache.cc index 5d7fcca84..c755fb29c 100644 --- a/src/mem/cache/cache.cc +++ b/src/mem/cache/cache.cc @@ -1858,6 +1858,7 @@ Cache::allocateBlock(Addr addr, bool is_secure, PacketList &writebacks) } else { writebacks.push_back(cleanEvictBlk(blk)); } + invalidateBlock(blk); replacements++; } } diff --git a/src/mem/cache/tags/base.cc b/src/mem/cache/tags/base.cc index dfd6976fd..7d0a93989 100644 --- a/src/mem/cache/tags/base.cc +++ b/src/mem/cache/tags/base.cc @@ -75,13 +75,11 @@ BaseTags::setCache(BaseCache *_cache) void BaseTags::insertBlock(PacketPtr pkt, CacheBlk *blk) { + assert(!blk->isValid()); + // Get address Addr addr = pkt->getAddr(); - if (blk->isValid()) { - invalidate(blk); - } - // Previous block, if existed, has been removed, and now we have // to insert the new one |