Port: Make getAddrRanges const
[gem5.git] / src / mem / cache / mshr.hh
index 26eef2cacd8aae50d9342b67142733c368169a63..7920ad717f12130dd228db0c133402b481a90363 100644 (file)
@@ -72,7 +72,7 @@ class MSHR : public Packet::SenderState, public Printable
 
         Target(PacketPtr _pkt, Tick _readyTime, Counter _order,
                Source _source, bool _markedPending)
-            : recvTime(curTick), readyTime(_readyTime), order(_order),
+            : recvTime(curTick()), readyTime(_readyTime), order(_order),
               pkt(_pkt), source(_source), markedPending(_markedPending)
         {}
     };
@@ -134,8 +134,28 @@ class MSHR : public Packet::SenderState, public Printable
 
     bool downstreamPending;
 
-    bool pendingInvalidate;
-    bool pendingShared;
+    /** The pending* and post* flags are only valid if inService is
+     *  true.  Using the accessor functions lets us detect if these
+     *  flags are accessed improperly.
+     */
+
+    /** Will we have a dirty copy after this request? */
+    bool pendingDirty;
+    bool isPendingDirty() const {
+        assert(inService); return pendingDirty;
+    }
+
+    /** Did we snoop an invalidate while waiting for data? */
+    bool postInvalidate;
+    bool hasPostInvalidate() const {
+        assert(inService); return postInvalidate;
+    }
+
+    /** Did we snoop a read while waiting for data? */
+    bool postDowngrade;
+    bool hasPostDowngrade() const {
+        assert(inService); return postDowngrade;
+    }
 
     /** Thread number of the miss. */
     ThreadID threadNum;
@@ -180,7 +200,7 @@ public:
     void allocate(Addr addr, int size, PacketPtr pkt,
                   Tick when, Counter _order);
 
-    bool markInService();
+    bool markInService(PacketPtr pkt);
 
     void clearDownstreamPending();