Fix bus in FS mode.
[gem5.git] / src / mem / bus.hh
index 4f330230f5a995678ebca30fe30054c8d96883a5..b1cbbe1e3f12e4ad63e0706629c172429462a110 100644 (file)
@@ -107,7 +107,7 @@ class Bus : public MemObject
     std::vector<int> findSnoopPorts(Addr addr, int id);
 
     /** Snoop all relevant ports atomicly. */
-    void atomicSnoop(Packet *pkt);
+    Tick atomicSnoop(Packet *pkt);
 
     /** Snoop all relevant ports functionally. */
     void functionalSnoop(Packet *pkt);
@@ -125,6 +125,8 @@ class Bus : public MemObject
      */
     void addressRanges(AddrRangeList &resp, AddrRangeList &snoop, int id);
 
+    /** Occupy the bus with transmitting the packet pkt */
+    void occupyBus(PacketPtr pkt);
 
     /** Declaration of the buses port type, one will be instantiated for each
         of the interfaces connecting to the bus. */
@@ -222,13 +224,15 @@ class Bus : public MemObject
             port->onRetryList(true);
             retryList.push_back(port);
         } else {
-            // The device was retrying a packet. It didn't work, so we'll leave
-            // it at the head of the retry list.
-            inRetry = false;
-
-/*         // We shouldn't be receiving a packet from one port when a different
-            // one is retrying.
-            assert(port == retryingPort);*/
+            if (port->onRetryList()) {
+                // The device was retrying a packet. It didn't work, so we'll leave
+                // it at the head of the retry list.
+                assert(port == retryList.front());
+                inRetry = false;
+            }
+            else {
+                retryList.push_back(port);
+            }
         }
     }