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

Change subject: mem-cache: Add invalidation/eviction probe to cache
......................................................................

mem-cache: Add invalidation/eviction probe to cache

Some devices and policies may need the invalidation/eviction
information to handle their affairs.

Jira: https://gem5.atlassian.net/browse/GEM5-814

Change-Id: I1ff3c09c63d5402765c2125c4d76d95b614877d6
Signed-off-by: Daniel R. Carvalho <[email protected]>
---
M src/mem/cache/base.cc
M src/mem/cache/base.hh
2 files changed, 16 insertions(+), 0 deletions(-)



diff --git a/src/mem/cache/base.cc b/src/mem/cache/base.cc
index b74e8cc..4378889 100644
--- a/src/mem/cache/base.cc
+++ b/src/mem/cache/base.cc
@@ -1467,6 +1467,17 @@
         stats.unusedPrefetches++;
     }

+    // Create a dummy packet to inform the probe of the invalidation
+    RequestPtr req = std::make_shared<Request>(
+        regenerateBlkAddr(blk), blkSize, 0, Request::wbMasterId);
+    if (blk->isSecure())
+        req->setFlags(Request::SECURE);
+    req->taskId(blk->getTaskId());
+    Packet dummy_pkt(req, MemCmd::WriteClean);
+    dummy_pkt.allocate();
+    dummy_pkt.setDataFromBlock(blk->data, blkSize);
+    ppInvalidation->notify(&dummy_pkt);
+
     // 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) {
@@ -2283,6 +2294,8 @@
     ppHit = new ProbePointArg<PacketPtr>(this->getProbeManager(), "Hit");
     ppMiss = new ProbePointArg<PacketPtr>(this->getProbeManager(), "Miss");
     ppFill = new ProbePointArg<PacketPtr>(this->getProbeManager(), "Fill");
+    ppInvalidation =
+ new ProbePointArg<PacketPtr>(this->getProbeManager(), "Invalidation");
 }

 ///////////////
diff --git a/src/mem/cache/base.hh b/src/mem/cache/base.hh
index 99b03ab..51b4a60 100644
--- a/src/mem/cache/base.hh
+++ b/src/mem/cache/base.hh
@@ -334,6 +334,9 @@
     /** To probe when a cache fill occurs */
     ProbePointArg<PacketPtr> *ppFill;

+    /** To probe when a cache invalidation or eviction occurs */
+    ProbePointArg<PacketPtr> *ppInvalidation;
+
     /**
      * The writeAllocator drive optimizations for streaming writes.
      * It first determines whether a WriteReq MSHR should be delayed,

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

Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: I1ff3c09c63d5402765c2125c4d76d95b614877d6
Gerrit-Change-Number: 37096
Gerrit-PatchSet: 1
Gerrit-Owner: Daniel Carvalho <[email protected]>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to