Nikos Nikoleris has uploaded this change for review. (
https://gem5-review.googlesource.com/10422
Change subject: mem-cache: Determine if an MSHR has requests from another
cache
......................................................................
mem-cache: Determine if an MSHR has requests from another cache
To decide whether we allocate upon receiving a response we need to
determine if any of the currently serviced requests (non-deferred
targets) is comming from another cache. This change adds support for
tracking this information in the MSHR.
Change-Id: If1db93c12b6af5813b91b9d6b6e5e196d327f038
---
M src/mem/cache/mshr.cc
M src/mem/cache/mshr.hh
2 files changed, 29 insertions(+), 5 deletions(-)
diff --git a/src/mem/cache/mshr.cc b/src/mem/cache/mshr.cc
index cc26b56..14ac342 100644
--- a/src/mem/cache/mshr.cc
+++ b/src/mem/cache/mshr.cc
@@ -68,7 +68,8 @@
}
MSHR::TargetList::TargetList()
- : needsWritable(false), hasUpgrade(false), allocOnFill(false)
+ : needsWritable(false), hasUpgrade(false), allocOnFill(false),
+ hasFromCache(false)
{}
@@ -91,6 +92,8 @@
// potentially re-evaluate whether we should allocate on a fill or
// not
allocOnFill = allocOnFill || alloc_on_fill;
+
+ hasFromCache = hasFromCache || pkt->fromCache();
}
}
@@ -590,7 +593,7 @@
void
MSHR::print(std::ostream &os, int verbosity, const std::string &prefix)
const
{
- ccprintf(os, "%s[%#llx:%#llx](%s) %s %s %s state: %s %s %s %s %s\n",
+ ccprintf(os, "%s[%#llx:%#llx](%s) %s %s %s state: %s %s %s %s %s %s\n",
prefix, blkAddr, blkAddr + blkSize - 1,
isSecure ? "s" : "ns",
isForward ? "Forward" : "",
@@ -600,7 +603,8 @@
inService ? "InSvc" : "",
downstreamPending ? "DwnPend" : "",
postInvalidate ? "PostInv" : "",
- postDowngrade ? "PostDowngr" : "");
+ postDowngrade ? "PostDowngr" : "",
+ hasFromCache() ? "HasFromCache" : "");
if (!targets.empty()) {
ccprintf(os, "%s Targets:\n", prefix);
diff --git a/src/mem/cache/mshr.hh b/src/mem/cache/mshr.hh
index 5fe0fb9..2894482 100644
--- a/src/mem/cache/mshr.hh
+++ b/src/mem/cache/mshr.hh
@@ -162,6 +162,11 @@
bool hasUpgrade;
/** Set when the response should allocate on fill */
bool allocOnFill;
+ /**
+ * Determine whether there was at least one non-snooping
+ * target coming from another cache.
+ */
+ bool hasFromCache;
TargetList();
@@ -176,7 +181,12 @@
void updateFlags(PacketPtr pkt, Target::Source source,
bool alloc_on_fill);
- void resetFlags() { needsWritable = hasUpgrade = allocOnFill =
false; }
+ void resetFlags() {
+ needsWritable = false;
+ hasUpgrade = false;
+ allocOnFill = false;
+ hasFromCache = false;
+ }
/**
* Goes through the list of targets and uses them to populate
@@ -191,7 +201,8 @@
* values.
*/
bool isReset() const {
- return !needsWritable && !hasUpgrade && !allocOnFill;
+ return !needsWritable && !hasUpgrade && !allocOnFill &&
+ !hasFromCache;
}
/**
@@ -257,6 +268,15 @@
bool allocOnFill() const {
return targets.allocOnFill;
}
+
+ /**
+ * Determine if there are non-deferred requests from other caches
+ *
+ * @return true if any of the targets is from another cache
+ */
+ bool hasFromCache() const {
+ return targets.hasFromCache;
+ }
private:
/**
--
To view, visit https://gem5-review.googlesource.com/10422
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: If1db93c12b6af5813b91b9d6b6e5e196d327f038
Gerrit-Change-Number: 10422
Gerrit-PatchSet: 1
Gerrit-Owner: Nikos Nikoleris <nikos.nikole...@arm.com>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list
gem5-dev@gem5.org
http://m5sim.org/mailman/listinfo/gem5-dev