summaryrefslogtreecommitdiff
path: root/src/mem/cache/mshr.cc
diff options
context:
space:
mode:
authorAndreas Hansson <andreas.hansson@arm.com>2016-03-17 09:51:18 -0400
committerAndreas Hansson <andreas.hansson@arm.com>2016-03-17 09:51:18 -0400
commit041ea8107e4250a9c120a6fde11f3dc415c2fe6a (patch)
tree13c75f78d88ab7c9077babd5e9b8a3a36fcba3d7 /src/mem/cache/mshr.cc
parentf5d1dd75e57d9c63c5f6ab4d0c7c0c45f8726a95 (diff)
downloadgem5-041ea8107e4250a9c120a6fde11f3dc415c2fe6a.tar.xz
mem: Create a separate class for the cache write buffer
This patch breaks out the cache write buffer into a separate class, without affecting any stats. The goal of the patch is to avoid encumbering the much-simpler write queue with the complex MSHR handling. In a follow on patch this simplification allows us to implement write combining. The WriteQueue gets its own class, but shares a common ancestor, the generic Queue, with the MSHRQueue.
Diffstat (limited to 'src/mem/cache/mshr.cc')
-rw-r--r--src/mem/cache/mshr.cc27
1 files changed, 9 insertions, 18 deletions
diff --git a/src/mem/cache/mshr.cc b/src/mem/cache/mshr.cc
index 1d18a2861..14f381e91 100644
--- a/src/mem/cache/mshr.cc
+++ b/src/mem/cache/mshr.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012-2013, 2015 ARM Limited
+ * Copyright (c) 2012-2013, 2015-2016 ARM Limited
* All rights reserved.
*
* The license below extends only to copyright in the software and shall
@@ -61,17 +61,13 @@
using namespace std;
-MSHR::MSHR() : readyTime(0), _isUncacheable(false), downstreamPending(false),
+MSHR::MSHR() : downstreamPending(false),
pendingModified(false),
postInvalidate(false), postDowngrade(false),
- queue(NULL), order(0), blkAddr(0),
- blkSize(0), isSecure(false), inService(false),
- isForward(false), allocOnFill(false),
- data(NULL)
+ isForward(false), allocOnFill(false)
{
}
-
MSHR::TargetList::TargetList()
: needsWritable(false), hasUpgrade(false)
{}
@@ -239,7 +235,6 @@ MSHR::allocate(Addr blk_addr, unsigned blk_size, PacketPtr target,
Target::FromPrefetcher : Target::FromCPU;
targets.add(target, when_ready, _order, source, true);
assert(deferredTargets.isReset());
- data = NULL;
}
@@ -253,17 +248,10 @@ MSHR::clearDownstreamPending()
targets.clearDownstreamPending();
}
-bool
+void
MSHR::markInService(bool pending_modified_resp)
{
assert(!inService);
- if (isForwardNoResponse()) {
- // we just forwarded the request packet & don't expect a
- // response, so get rid of it
- assert(getNumTargets() == 1);
- popTarget();
- return true;
- }
inService = true;
pendingModified = targets.needsWritable || pending_modified_resp;
@@ -274,7 +262,6 @@ MSHR::markInService(bool pending_modified_resp)
// level where it's going to get a response
targets.clearDownstreamPending();
}
- return false;
}
@@ -512,6 +499,11 @@ MSHR::checkFunctional(PacketPtr pkt)
}
}
+bool
+MSHR::sendPacket(Cache &cache)
+{
+ return cache.sendMSHRQueuePacket(this);
+}
void
MSHR::print(std::ostream &os, int verbosity, const std::string &prefix) const
@@ -521,7 +513,6 @@ MSHR::print(std::ostream &os, int verbosity, const std::string &prefix) const
isSecure ? "s" : "ns",
isForward ? "Forward" : "",
allocOnFill ? "AllocOnFill" : "",
- isForwardNoResponse() ? "ForwNoResp" : "",
needsWritable() ? "Wrtbl" : "",
_isUncacheable ? "Unc" : "",
inService ? "InSvc" : "",