Port: Only indicate that a SimpleTimingPort is drained if its send event is
authorTimothy M. Jones <tjones1@inf.ed.ac.uk>
Thu, 22 Jul 2010 17:54:37 +0000 (18:54 +0100)
committerTimothy M. Jones <tjones1@inf.ed.ac.uk>
Thu, 22 Jul 2010 17:54:37 +0000 (18:54 +0100)
not scheduled, as well as the transmit list being empty.

src/mem/cache/cache_impl.hh
src/mem/tport.cc

index 76a99109d3bfbf952d93062c709cdfc3f0da83df..bf2901d3691477ce2cdf35d0ed5812d1dbe0c07c 100644 (file)
@@ -1569,7 +1569,7 @@ Cache<TagStore>::MemSidePort::sendPacket()
             schedule(sendEvent, std::max(nextReady, curTick + 1));
         } else {
             // no more to send right now: if we're draining, we may be done
-            if (drainEvent) {
+            if (drainEvent && !sendEvent->scheduled()) {
                 drainEvent->process();
                 drainEvent = NULL;
             }
index e981a74455bde7b57b772dc667b883c130e0a32d..4e89544e3b94e698be03f3dd4edb2c6cb0e00b84 100644 (file)
@@ -155,7 +155,7 @@ SimpleTimingPort::sendDeferredPacket()
             schedule(sendEvent, time <= curTick ? curTick+1 : time);
         }
 
-        if (transmitList.empty() && drainEvent) {
+        if (transmitList.empty() && drainEvent && !sendEvent->scheduled()) {
             drainEvent->process();
             drainEvent = NULL;
         }
@@ -195,7 +195,7 @@ SimpleTimingPort::processSendEvent()
 unsigned int
 SimpleTimingPort::drain(Event *de)
 {
-    if (transmitList.size() == 0)
+    if (transmitList.size() == 0 && !sendEvent->scheduled())
         return 0;
     drainEvent = de;
     return 1;