packet_queue.cc (8975:7f36d4436074) packet_queue.cc (9152:86c0e6ca5e7c)
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
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"
44#include "debug/PacketQueue.hh"
45#include "mem/packet_queue.hh"
46
47using namespace std;
48
49PacketQueue::PacketQueue(EventManager& _em, const std::string& _label)
50 : em(_em), sendEvent(this), drainEvent(NULL), label(_label),
51 waitingOnRetry(false)

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

163
164 if (nextReady != MaxTick) {
165 // if the sendTiming caused someone else to call our
166 // recvTiming we could already have an event scheduled, check
167 if (!sendEvent.scheduled())
168 em.schedule(&sendEvent, std::max(nextReady, curTick() + 1));
169 } else {
170 // no more to send, so if we're draining, we may be done
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
171 if (drainEvent && !sendEvent.scheduled()) {
172 if (drainEvent && transmitList.empty() && !sendEvent.scheduled()) {
173 DPRINTF(Drain, "PacketQueue done draining,"
174 "processing drain event\n");
172 drainEvent->process();
173 drainEvent = NULL;
174 }
175 }
176}
177
178void
179PacketQueue::sendDeferredPacket()

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

196 sendDeferredPacket();
197}
198
199unsigned int
200PacketQueue::drain(Event *de)
201{
202 if (transmitList.empty() && !sendEvent.scheduled())
203 return 0;
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");
204 drainEvent = de;
205 return 1;
206}
207
208MasterPacketQueue::MasterPacketQueue(EventManager& _em, MasterPort& _masterPort,
209 const std::string _label)
210 : PacketQueue(_em, _label), masterPort(_masterPort)
211{

--- 25 unchanged lines hidden ---
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 ---