Daniel Carvalho has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/18908

Change subject: mem-cache: Move unused prefetches counter update
......................................................................

mem-cache: Move unused prefetches counter update

The number of unused prefetches should be updated every time
a block is invalidated, therefore we move the update to within
the corresponding function.

Change-Id: If3ac2ea43611525bd3c36d628d88382042fcb7dc
Signed-off-by: Daniel R. Carvalho <[email protected]>
---
M src/mem/cache/base.cc
1 file changed, 5 insertions(+), 7 deletions(-)



diff --git a/src/mem/cache/base.cc b/src/mem/cache/base.cc
index 1536ada..94fff2d 100644
--- a/src/mem/cache/base.cc
+++ b/src/mem/cache/base.cc
@@ -863,9 +863,6 @@
     // Evict valid blocks
     for (const auto& evict_blk : evict_blks) {
         if (evict_blk->isValid()) {
-            if (evict_blk->wasPrefetched()) {
-                unusedPrefetches++;
-            }
Cycles lat = calculateAccessLatency(evict_blk, delay, tag_latency);
             evictBlock(evict_blk, clockEdge(lat + forwardLatency));
         }
@@ -1503,10 +1500,6 @@
"%#llx (%s)\n", blk->print(), regenerateBlkAddr(blk),
                         addr, is_secure);

-                if (blk->wasPrefetched()) {
-                    unusedPrefetches++;
-                }
-
                 Cycles lat =
calculateAccessLatency(blk, pkt->headerDelay, tag_latency);
                 evictBlock(blk, clockEdge(lat + forwardLatency));
@@ -1532,6 +1525,11 @@
 void
 BaseCache::invalidateBlock(CacheBlk *blk)
 {
+    // If block is still marked as prefetched, then it hasn't been used
+    if (blk->wasPrefetched()) {
+        unusedPrefetches++;
+    }
+
     // If handling a block present in the Tags, let it do its invalidation
     // process, which will update stats and invalidate the block itself
     if (blk != tempBlock) {

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/18908
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: If3ac2ea43611525bd3c36d628d88382042fcb7dc
Gerrit-Change-Number: 18908
Gerrit-PatchSet: 1
Gerrit-Owner: Daniel Carvalho <[email protected]>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to