packet_queue.cc (9163:3b5e13ac1940) packet_queue.cc (9342:6fec8f26e56d)
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

--- 34 unchanged lines hidden (view full) ---

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)
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

--- 34 unchanged lines hidden (view full) ---

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),
51 : em(_em), sendEvent(this), drainManager(NULL), label(_label),
52 waitingOnRetry(false)
53{
54}
55
56PacketQueue::~PacketQueue()
57{
58}
59

--- 108 unchanged lines hidden (view full) ---

168
169 if (nextReady != MaxTick) {
170 // if the sendTiming caused someone else to call our
171 // recvTiming we could already have an event scheduled, check
172 if (!sendEvent.scheduled())
173 em.schedule(&sendEvent, std::max(nextReady, curTick() + 1));
174 } else {
175 // no more to send, so if we're draining, we may be done
52 waitingOnRetry(false)
53{
54}
55
56PacketQueue::~PacketQueue()
57{
58}
59

--- 108 unchanged lines hidden (view full) ---

168
169 if (nextReady != MaxTick) {
170 // if the sendTiming caused someone else to call our
171 // recvTiming we could already have an event scheduled, check
172 if (!sendEvent.scheduled())
173 em.schedule(&sendEvent, std::max(nextReady, curTick() + 1));
174 } else {
175 // no more to send, so if we're draining, we may be done
176 if (drainEvent && transmitList.empty() && !sendEvent.scheduled()) {
176 if (drainManager && transmitList.empty() && !sendEvent.scheduled()) {
177 DPRINTF(Drain, "PacketQueue done draining,"
178 "processing drain event\n");
177 DPRINTF(Drain, "PacketQueue done draining,"
178 "processing drain event\n");
179 drainEvent->process();
180 drainEvent = NULL;
179 drainManager->signalDrainDone();
180 drainManager = NULL;
181 }
182 }
183}
184
185void
186PacketQueue::sendDeferredPacket()
187{
188 // try to send what is on the list, this will set waitingOnRetry

--- 10 unchanged lines hidden (view full) ---

199void
200PacketQueue::processSendEvent()
201{
202 assert(!waitingOnRetry);
203 sendDeferredPacket();
204}
205
206unsigned int
181 }
182 }
183}
184
185void
186PacketQueue::sendDeferredPacket()
187{
188 // try to send what is on the list, this will set waitingOnRetry

--- 10 unchanged lines hidden (view full) ---

199void
200PacketQueue::processSendEvent()
201{
202 assert(!waitingOnRetry);
203 sendDeferredPacket();
204}
205
206unsigned int
207PacketQueue::drain(Event *de)
207PacketQueue::drain(DrainManager *dm)
208{
209 if (transmitList.empty() && !sendEvent.scheduled())
210 return 0;
211 DPRINTF(Drain, "PacketQueue not drained\n");
208{
209 if (transmitList.empty() && !sendEvent.scheduled())
210 return 0;
211 DPRINTF(Drain, "PacketQueue not drained\n");
212 drainEvent = de;
212 drainManager = dm;
213 return 1;
214}
215
216MasterPacketQueue::MasterPacketQueue(EventManager& _em, MasterPort& _masterPort,
217 const std::string _label)
218 : PacketQueue(_em, _label), masterPort(_masterPort)
219{
220}

--- 24 unchanged lines hidden ---
213 return 1;
214}
215
216MasterPacketQueue::MasterPacketQueue(EventManager& _em, MasterPort& _masterPort,
217 const std::string _label)
218 : PacketQueue(_em, _label), masterPort(_masterPort)
219{
220}

--- 24 unchanged lines hidden ---