From: Timothy M. Jones Date: Thu, 22 Jul 2010 17:54:37 +0000 (+0100) Subject: Port: Only indicate that a SimpleTimingPort is drained if its send event is X-Git-Tag: stable_2012_02_02~983 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=28a5ea3f999d012be616395f9b396ce341882bb7;p=gem5.git Port: Only indicate that a SimpleTimingPort is drained if its send event is not scheduled, as well as the transmit list being empty. --- diff --git a/src/mem/cache/cache_impl.hh b/src/mem/cache/cache_impl.hh index 76a99109d..bf2901d36 100644 --- a/src/mem/cache/cache_impl.hh +++ b/src/mem/cache/cache_impl.hh @@ -1569,7 +1569,7 @@ Cache::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; } diff --git a/src/mem/tport.cc b/src/mem/tport.cc index e981a7445..4e89544e3 100644 --- a/src/mem/tport.cc +++ b/src/mem/tport.cc @@ -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;