summaryrefslogtreecommitdiff
path: root/src/mem/packet_queue.cc
diff options
context:
space:
mode:
authorAndreas Hansson <andreas.hansson@arm.com>2014-10-09 17:51:52 -0400
committerAndreas Hansson <andreas.hansson@arm.com>2014-10-09 17:51:52 -0400
commit4a453e8c95bb030d6b50cab8d42825142b093df2 (patch)
treec05d2e608bd9cea8cddcd89dce822d86eba3abdd /src/mem/packet_queue.cc
parent6498ccddb2f13a6fac6a210372b1aa86873507b9 (diff)
downloadgem5-4a453e8c95bb030d6b50cab8d42825142b093df2.tar.xz
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 (limited to 'src/mem/packet_queue.cc')
-rw-r--r--src/mem/packet_queue.cc12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/mem/packet_queue.cc b/src/mem/packet_queue.cc
index 428f8c13f..e9fe72ead 100644
--- a/src/mem/packet_queue.cc
+++ b/src/mem/packet_queue.cc
@@ -168,13 +168,19 @@ PacketQueue::scheduleSend(Tick time)
{
// 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()) {