Huang Jiasen has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/54223 )

Change subject: mem-cache: Fixed the bug of simply returning hasBeenPrefetched without judging FLAGS indiating valid data contained.
......................................................................

mem-cache: Fixed the bug of simply returning hasBeenPrefetched without judging FLAGS indiating valid data contained.

Change-Id: I13f7cf56dfd058a85e1e01909c92747628ddcbe6
---
M src/mem/cache/prefetch/base.cc
M src/mem/packet.hh
2 files changed, 17 insertions(+), 1 deletion(-)



diff --git a/src/mem/cache/prefetch/base.cc b/src/mem/cache/prefetch/base.cc
index cb4c1e8..d3ab1bb 100644
--- a/src/mem/cache/prefetch/base.cc
+++ b/src/mem/cache/prefetch/base.cc
@@ -165,8 +165,12 @@
     bool inv = pkt->isInvalidate();

     if (!miss) {
-        if (prefetchOnPfHit)
+        if (prefetchOnPfHit) {
+            if (!pkt->hasStaticData() && !pkt->hasDynamicData()) {
+                return false;
+            }
             return hasBeenPrefetched(pkt->getAddr(), pkt->isSecure());
+        }
         if (!prefetchOnAccess)
             return false;
     }
diff --git a/src/mem/packet.hh b/src/mem/packet.hh
index 88995f1..6b49ae2 100644
--- a/src/mem/packet.hh
+++ b/src/mem/packet.hh
@@ -741,6 +741,9 @@
     }
     bool satisfied() const { return flags.isSet(SATISFIED); }

+    bool hasStaticData() { return flags.isSet(STATIC_DATA); }
+    bool hasDynamicData() { return flags.isSet(DYNAMIC_DATA); }
+
     void setSuppressFuncError()     { flags.set(SUPPRESS_FUNC_ERROR); }
bool suppressFuncError() const { return flags.isSet(SUPPRESS_FUNC_ERROR); }
     void setBlockCached()          { flags.set(BLOCK_CACHED); }

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/54223
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: I13f7cf56dfd058a85e1e01909c92747628ddcbe6
Gerrit-Change-Number: 54223
Gerrit-PatchSet: 1
Gerrit-Owner: Huang Jiasen <[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