changeset cc7f3988c5a9 in /z/repo/gem5
details: http://repo.gem5.org/gem5?cmd=changeset;node=cc7f3988c5a9
description:
        mem: Allow packet queue to move next send event forward

        This patch changes the packet queue such that when scheduling a send,
        the queue is allowed to move the event forward.

diffstat:

 src/mem/packet_queue.cc |  12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diffs (26 lines):

diff -r 148b96b7bc77 -r cc7f3988c5a9 src/mem/packet_queue.cc
--- a/src/mem/packet_queue.cc   Wed Oct 01 08:05:54 2014 -0400
+++ b/src/mem/packet_queue.cc   Thu Oct 09 17:51:52 2014 -0400
@@ -168,13 +168,19 @@
 {
     // the next ready time is either determined by the next deferred packet,
     // or in the cache through the MSHR ready time
-    Tick nextReady = std::min(deferredPacketReadyTime(), time);
+    Tick nextReady = std::max(std::min(deferredPacketReadyTime(), time),
+                              curTick() + 1);
 
     if (nextReady != MaxTick) {
         // if the sendTiming caused someone else to call our
         // recvTiming we could already have an event scheduled, check
-        if (!sendEvent.scheduled())
-            em.schedule(&sendEvent, std::max(nextReady, curTick() + 1));
+        if (!sendEvent.scheduled()) {
+            em.schedule(&sendEvent, nextReady);
+        } else if (nextReady < sendEvent.when()) {
+            // if the new time is earlier than when the event
+            // currently is scheduled, move it forward
+            em.reschedule(&sendEvent, nextReady);
+        }
     } else {
         // no more to send, so if we're draining, we may be done
         if (drainManager && transmitList.empty() && !sendEvent.scheduled()) {
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to