packet_queue.cc (8914:8c3bd7bea667) | packet_queue.cc (8948:e95ee70f876c) |
---|---|
1/* 2 * Copyright (c) 2012 ARM Limited 3 * All rights reserved. 4 * 5 * The license below extends only to copyright in the software and shall 6 * not be construed as granting a license to any other intellectual 7 * property including but not limited to intellectual property relating 8 * to a hardware implementation of the functionality of the software --- 90 unchanged lines hidden (view full) --- 99 if (!sendEvent.scheduled()) { 100 em.schedule(&sendEvent, when); 101 } else if (sendEvent.when() > when) { 102 em.reschedule(&sendEvent, when); 103 } 104} 105 106void | 1/* 2 * Copyright (c) 2012 ARM Limited 3 * All rights reserved. 4 * 5 * The license below extends only to copyright in the software and shall 6 * not be construed as granting a license to any other intellectual 7 * property including but not limited to intellectual property relating 8 * to a hardware implementation of the functionality of the software --- 90 unchanged lines hidden (view full) --- 99 if (!sendEvent.scheduled()) { 100 em.schedule(&sendEvent, when); 101 } else if (sendEvent.when() > when) { 102 em.reschedule(&sendEvent, when); 103 } 104} 105 106void |
107PacketQueue::schedSendTiming(PacketPtr pkt, Tick when) | 107PacketQueue::schedSendTiming(PacketPtr pkt, Tick when, bool send_as_snoop) |
108{ 109 assert(when > curTick()); 110 111 // nothing on the list, or earlier than current front element, 112 // schedule an event 113 if (transmitList.empty() || when < transmitList.front().tick) { 114 // note that currently we ignore a potentially outstanding retry 115 // and could in theory put a new packet at the head of the 116 // transmit list before retrying the existing packet | 108{ 109 assert(when > curTick()); 110 111 // nothing on the list, or earlier than current front element, 112 // schedule an event 113 if (transmitList.empty() || when < transmitList.front().tick) { 114 // note that currently we ignore a potentially outstanding retry 115 // and could in theory put a new packet at the head of the 116 // transmit list before retrying the existing packet |
117 transmitList.push_front(DeferredPacket(when, pkt)); | 117 transmitList.push_front(DeferredPacket(when, pkt, send_as_snoop)); |
118 schedSendEvent(when); 119 return; 120 } 121 122 // list is non-empty and this belongs at the end 123 if (when >= transmitList.back().tick) { | 118 schedSendEvent(when); 119 return; 120 } 121 122 // list is non-empty and this belongs at the end 123 if (when >= transmitList.back().tick) { |
124 transmitList.push_back(DeferredPacket(when, pkt)); | 124 transmitList.push_back(DeferredPacket(when, pkt, send_as_snoop)); |
125 return; 126 } 127 128 // this belongs in the middle somewhere, insertion sort 129 DeferredPacketIterator i = transmitList.begin(); 130 ++i; // already checked for insertion at front 131 while (i != transmitList.end() && when >= i->tick) 132 ++i; | 125 return; 126 } 127 128 // this belongs in the middle somewhere, insertion sort 129 DeferredPacketIterator i = transmitList.begin(); 130 ++i; // already checked for insertion at front 131 while (i != transmitList.end() && when >= i->tick) 132 ++i; |
133 transmitList.insert(i, DeferredPacket(when, pkt)); | 133 transmitList.insert(i, DeferredPacket(when, pkt, send_as_snoop)); |
134} 135 136void PacketQueue::trySendTiming() 137{ 138 assert(deferredPacketReady()); 139 140 // take the next packet off the list here, as we might return to 141 // ourselves through the sendTiming call below 142 DeferredPacket dp = transmitList.front(); 143 transmitList.pop_front(); 144 145 // attempt to send the packet and remember the outcome | 134} 135 136void PacketQueue::trySendTiming() 137{ 138 assert(deferredPacketReady()); 139 140 // take the next packet off the list here, as we might return to 141 // ourselves through the sendTiming call below 142 DeferredPacket dp = transmitList.front(); 143 transmitList.pop_front(); 144 145 // attempt to send the packet and remember the outcome |
146 waitingOnRetry = !port.sendTiming(dp.pkt); | 146 if (!dp.sendAsSnoop) 147 waitingOnRetry = !port.sendTiming(dp.pkt); 148 else 149 waitingOnRetry = !port.sendTimingSnoop(dp.pkt); |
147 148 if (waitingOnRetry) { 149 // put the packet back at the front of the list (packet should 150 // not have changed since it wasn't accepted) 151 assert(!sendEvent.scheduled()); 152 transmitList.push_front(dp); 153 } 154} --- 51 unchanged lines hidden --- | 150 151 if (waitingOnRetry) { 152 // put the packet back at the front of the list (packet should 153 // not have changed since it wasn't accepted) 154 assert(!sendEvent.scheduled()); 155 transmitList.push_front(dp); 156 } 157} --- 51 unchanged lines hidden --- |