Nikos Nikoleris has submitted this change and it was merged. ( https://gem5-review.googlesource.com/10429 )

Change subject: mem-cache: Delegate block invalidation to block allocation
......................................................................

mem-cache: Delegate block invalidation to block allocation

For a block replacement we first select a victim block, we invalidate
it and then populate it with the new information. Prior to this change
BaseTags::insertBlock() did the invalidation and filled in the block
with the new information. Now that the replacements stat is moved to
the BaseCache, insertBlock does not need to perform the invalidation
and as a result we can unify the block eviction code in BaseCache.

Change-Id: I5bdf00b2dab2752ed2137ab7201ed1dc451333b3
Reviewed-on: https://gem5-review.googlesource.com/10429
Maintainer: Nikos Nikoleris <nikos.nikole...@arm.com>
Reviewed-by: Jason Lowe-Power <ja...@lowepower.com>
Reviewed-by: Daniel Carvalho <oda...@yahoo.com.br>
---
M src/mem/cache/cache.cc
M src/mem/cache/tags/base.cc
2 files changed, 3 insertions(+), 4 deletions(-)

Approvals:
  Jason Lowe-Power: Looks good to me, approved
  Daniel Carvalho: Looks good to me, approved
  Nikos Nikoleris: Looks good to me, approved



diff --git a/src/mem/cache/cache.cc b/src/mem/cache/cache.cc
index 5d7fcca..c755fb2 100644
--- a/src/mem/cache/cache.cc
+++ b/src/mem/cache/cache.cc
@@ -1858,6 +1858,7 @@
             } 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 dfd6976..7d0a939 100644
--- a/src/mem/cache/tags/base.cc
+++ b/src/mem/cache/tags/base.cc
@@ -75,13 +75,11 @@
 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


--
To view, visit https://gem5-review.googlesource.com/10429
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-Change-Id: I5bdf00b2dab2752ed2137ab7201ed1dc451333b3
Gerrit-Change-Number: 10429
Gerrit-PatchSet: 7
Gerrit-Owner: Nikos Nikoleris <nikos.nikole...@arm.com>
Gerrit-Reviewer: Daniel Carvalho <oda...@yahoo.com.br>
Gerrit-Reviewer: Jason Lowe-Power <ja...@lowepower.com>
Gerrit-Reviewer: Nikos Nikoleris <nikos.nikole...@arm.com>
Gerrit-MessageType: merged
_______________________________________________
gem5-dev mailing list
gem5-dev@gem5.org
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to