mem-cache: Change Cache block tag check
authorDaniel R. Carvalho <odanrc@yahoo.com.br>
Sat, 2 Jun 2018 13:10:42 +0000 (15:10 +0200)
committerDaniel Carvalho <odanrc@yahoo.com.br>
Fri, 8 Jun 2018 09:37:23 +0000 (09:37 +0000)
Change tag to address check for compatibility with sector design.
Cache should not use tag, as sector sub-blocks share them, and
it could lead to wrong accesses.

Change-Id: Id1fa26f417595f475c5b5c07ae1f02f5fa0684ba
Reviewed-on: https://gem5-review.googlesource.com/10723
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com>

src/mem/cache/base.cc

index fdfe37ef4e761c1fe5011f3b2eea78b6278b8e99..a8f29e3709a167565ab91086b8a556f415b21af7 100644 (file)
@@ -1144,7 +1144,7 @@ BaseCache::handleFill(PacketPtr pkt, CacheBlk *blk, PacketList &writebacks,
         assert(!blk->isValid());
     } else {
         // existing block... probably an upgrade
-        assert(blk->tag == tags->extractTag(addr));
+        assert(regenerateBlkAddr(blk) == addr);
         assert(blk->isSecure() == is_secure);
         // either we're getting new data or the block should already be valid
         assert(pkt->hasData() || blk->isValid());