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 --- 27 unchanged lines hidden (view full) --- 36 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 37 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 38 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 * 40 * Authors: Ali Saidi 41 * Andreas Hansson 42 */ 43 |
44#include "debug/Drain.hh" |
45#include "debug/PacketQueue.hh" 46#include "mem/packet_queue.hh" 47 48using namespace std; 49 50PacketQueue::PacketQueue(EventManager& _em, const std::string& _label) 51 : em(_em), sendEvent(this), drainEvent(NULL), label(_label), 52 waitingOnRetry(false) --- 111 unchanged lines hidden (view full) --- 164 165 if (nextReady != MaxTick) { 166 // if the sendTiming caused someone else to call our 167 // recvTiming we could already have an event scheduled, check 168 if (!sendEvent.scheduled()) 169 em.schedule(&sendEvent, std::max(nextReady, curTick() + 1)); 170 } else { 171 // no more to send, so if we're draining, we may be done |
172 if (drainEvent && transmitList.empty() && !sendEvent.scheduled()) { 173 DPRINTF(Drain, "PacketQueue done draining," 174 "processing drain event\n"); |
175 drainEvent->process(); 176 drainEvent = NULL; 177 } 178 } 179} 180 181void 182PacketQueue::sendDeferredPacket() --- 16 unchanged lines hidden (view full) --- 199 sendDeferredPacket(); 200} 201 202unsigned int 203PacketQueue::drain(Event *de) 204{ 205 if (transmitList.empty() && !sendEvent.scheduled()) 206 return 0; |
207 DPRINTF(Drain, "PacketQueue not drained\n"); |
208 drainEvent = de; 209 return 1; 210} 211 212MasterPacketQueue::MasterPacketQueue(EventManager& _em, MasterPort& _masterPort, 213 const std::string _label) 214 : PacketQueue(_em, _label), masterPort(_masterPort) 215{ --- 25 unchanged lines hidden --- |