mem-cache: Add match functions to QueueEntry
[gem5.git] / src / mem / bridge.hh
index e6fa498cb3a8e6a387186b159569921e16b006c0..b3fb90d93a07d5902b62079e739621918bd359ef 100644 (file)
@@ -135,6 +135,12 @@ class Bridge : public MemObject
         /** Max queue size for reserved responses. */
         unsigned int respQueueLimit;
 
+        /**
+         * Upstream caches need this packet until true is returned, so
+         * hold it for deletion until a subsequent call
+         */
+        std::unique_ptr<Packet> pendingDelete;
+
         /**
          * Is this side blocked from accepting new response packets.
          *
@@ -150,8 +156,7 @@ class Bridge : public MemObject
         void trySendTiming();
 
         /** Send event for the response queue. */
-        EventWrapper<BridgeSlavePort,
-                     &BridgeSlavePort::trySendTiming> sendEvent;
+        EventFunctionWrapper sendEvent;
 
       public:
 
@@ -193,7 +198,7 @@ class Bridge : public MemObject
 
         /** When receiving a retry request from the peer port,
             pass it to the bridge. */
-        void recvRetry();
+        void recvRespRetry();
 
         /** When receiving a Atomic requestfrom the peer port,
             pass it to the bridge. */
@@ -249,8 +254,7 @@ class Bridge : public MemObject
         void trySendTiming();
 
         /** Send event for the request queue. */
-        EventWrapper<BridgeMasterPort,
-                     &BridgeMasterPort::trySendTiming> sendEvent;
+        EventFunctionWrapper sendEvent;
 
       public:
 
@@ -291,7 +295,7 @@ class Bridge : public MemObject
          *
          * @return true if we find a match
          */
-        bool checkFunctional(PacketPtr pkt);
+        bool trySatisfyFunctional(PacketPtr pkt);
 
       protected:
 
@@ -301,7 +305,7 @@ class Bridge : public MemObject
 
         /** When receiving a retry request from the peer port,
             pass it to the bridge. */
-        void recvRetry();
+        void recvReqRetry();
     };
 
     /** Slave port of the bridge. */
@@ -312,12 +316,10 @@ class Bridge : public MemObject
 
   public:
 
-    virtual BaseMasterPort& getMasterPort(const std::string& if_name,
-                                          PortID idx = InvalidPortID);
-    virtual BaseSlavePort& getSlavePort(const std::string& if_name,
-                                        PortID idx = InvalidPortID);
+    Port &getPort(const std::string &if_name,
+                  PortID idx=InvalidPortID) override;
 
-    virtual void init();
+    void init() override;
 
     typedef BridgeParams Params;