summaryrefslogtreecommitdiff
path: root/src/mem/cache/miss/mshr.hh
diff options
context:
space:
mode:
authorSteve Reinhardt <stever@eecs.umich.edu>2007-07-21 18:18:42 -0700
committerSteve Reinhardt <stever@eecs.umich.edu>2007-07-21 18:18:42 -0700
commit92ce2b59743c8cace420147e276d7376a4b905f1 (patch)
tree40068a62ffd952f841ef461933e1faa86493391a /src/mem/cache/miss/mshr.hh
parent91178600947e174041f46f54e4241cedd01bbb34 (diff)
downloadgem5-92ce2b59743c8cace420147e276d7376a4b905f1.tar.xz
Deal with invalidations intersecting outstanding upgrades.
If the invalidation beats the upgrade at a lower level then the upgrade must be converted to a read exclusive "in the field". Restructure target list & deferred target list to factor out some common code. --HG-- extra : convert_revision : 7bab4482dd6c48efdb619610f0d3778c60ff777a
Diffstat (limited to 'src/mem/cache/miss/mshr.hh')
-rw-r--r--src/mem/cache/miss/mshr.hh35
1 files changed, 23 insertions, 12 deletions
diff --git a/src/mem/cache/miss/mshr.hh b/src/mem/cache/miss/mshr.hh
index 9c6a8cf33..06ef6e113 100644
--- a/src/mem/cache/miss/mshr.hh
+++ b/src/mem/cache/miss/mshr.hh
@@ -68,10 +68,21 @@ class MSHR : public Packet::SenderState
{}
};
- /** Defines the Data structure of the MSHR targetlist. */
- typedef std::list<Target> TargetList;
- /** Target list iterator. */
- typedef std::list<Target>::iterator TargetListIterator;
+ class TargetList : public std::list<Target> {
+ /** Target list iterator. */
+ typedef std::list<Target>::iterator Iterator;
+
+ public:
+ bool needsExclusive;
+ bool hasUpgrade;
+
+ TargetList();
+ void resetFlags() { needsExclusive = hasUpgrade = false; }
+ bool isReset() { return !needsExclusive && !hasUpgrade; }
+ void add(PacketPtr pkt, Tick readyTime, Counter order, bool cpuSide);
+ void replaceUpgrades();
+ };
+
/** A list of MSHRs. */
typedef std::list<MSHR *> List;
/** MSHR list iterator. */
@@ -99,13 +110,13 @@ class MSHR : public Packet::SenderState
/** True if we will be putting the returned block in the cache */
bool isCacheFill;
+
/** True if we need to get an exclusive copy of the block. */
- bool needsExclusive;
+ bool needsExclusive() { return targets->needsExclusive; }
/** True if the request is uncacheable */
bool _isUncacheable;
- bool deferredNeedsExclusive;
bool pendingInvalidate;
bool pendingShared;
@@ -133,9 +144,9 @@ class MSHR : public Packet::SenderState
private:
/** List of all requests that match the address */
- TargetList targets;
+ TargetList *targets;
- TargetList deferredTargets;
+ TargetList *deferredTargets;
public:
@@ -179,19 +190,19 @@ public:
* Returns a pointer to the target list.
* @return a pointer to the target list.
*/
- TargetList* getTargetList() { return &targets; }
+ TargetList *getTargetList() { return targets; }
/**
* Returns true if there are targets left.
* @return true if there are targets
*/
- bool hasTargets() { return !targets.empty(); }
+ bool hasTargets() { return !targets->empty(); }
/**
* Returns a reference to the first target.
* @return A pointer to the first target.
*/
- Target *getTarget() { assert(hasTargets()); return &targets.front(); }
+ Target *getTarget() { assert(hasTargets()); return &targets->front(); }
/**
* Pop first target.
@@ -199,7 +210,7 @@ public:
void popTarget()
{
--ntargets;
- targets.pop_front();
+ targets->pop_front();
}
bool isSimpleForward()