packet_queue.cc (10745:791e4619919d) | packet_queue.cc (10913:38dbdeea7f1f) |
---|---|
1/* 2 * Copyright (c) 2012,2015 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 --- 35 unchanged lines hidden (view full) --- 44#include "base/trace.hh" 45#include "debug/Drain.hh" 46#include "debug/PacketQueue.hh" 47#include "mem/packet_queue.hh" 48 49using namespace std; 50 51PacketQueue::PacketQueue(EventManager& _em, const std::string& _label) | 1/* 2 * Copyright (c) 2012,2015 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 --- 35 unchanged lines hidden (view full) --- 44#include "base/trace.hh" 45#include "debug/Drain.hh" 46#include "debug/PacketQueue.hh" 47#include "mem/packet_queue.hh" 48 49using namespace std; 50 51PacketQueue::PacketQueue(EventManager& _em, const std::string& _label) |
52 : em(_em), sendEvent(this), drainManager(NULL), label(_label), | 52 : em(_em), sendEvent(this), label(_label), |
53 waitingOnRetry(false) 54{ 55} 56 57PacketQueue::~PacketQueue() 58{ 59} 60 --- 132 unchanged lines hidden (view full) --- 193 } else if (when < sendEvent.when()) { 194 // if the new time is earlier than when the event 195 // currently is scheduled, move it forward 196 em.reschedule(&sendEvent, when); 197 } 198 } else { 199 // we get a MaxTick when there is no more to send, so if we're 200 // draining, we may be done at this point | 53 waitingOnRetry(false) 54{ 55} 56 57PacketQueue::~PacketQueue() 58{ 59} 60 --- 132 unchanged lines hidden (view full) --- 193 } else if (when < sendEvent.when()) { 194 // if the new time is earlier than when the event 195 // currently is scheduled, move it forward 196 em.reschedule(&sendEvent, when); 197 } 198 } else { 199 // we get a MaxTick when there is no more to send, so if we're 200 // draining, we may be done at this point |
201 if (drainManager && transmitList.empty() && !sendEvent.scheduled()) { | 201 if (drainState() == DrainState::Draining && 202 transmitList.empty() && !sendEvent.scheduled()) { 203 |
202 DPRINTF(Drain, "PacketQueue done draining," 203 "processing drain event\n"); | 204 DPRINTF(Drain, "PacketQueue done draining," 205 "processing drain event\n"); |
204 drainManager->signalDrainDone(); 205 drainManager = NULL; | 206 signalDrainDone(); |
206 } 207 } 208} 209 210void 211PacketQueue::sendDeferredPacket() 212{ 213 // sanity checks --- 25 unchanged lines hidden (view full) --- 239 240void 241PacketQueue::processSendEvent() 242{ 243 assert(!waitingOnRetry); 244 sendDeferredPacket(); 245} 246 | 207 } 208 } 209} 210 211void 212PacketQueue::sendDeferredPacket() 213{ 214 // sanity checks --- 25 unchanged lines hidden (view full) --- 240 241void 242PacketQueue::processSendEvent() 243{ 244 assert(!waitingOnRetry); 245 sendDeferredPacket(); 246} 247 |
247unsigned int 248PacketQueue::drain(DrainManager *dm) | 248DrainState 249PacketQueue::drain() |
249{ | 250{ |
250 if (transmitList.empty()) 251 return 0; 252 DPRINTF(Drain, "PacketQueue not drained\n"); 253 drainManager = dm; 254 return 1; | 251 if (transmitList.empty()) { 252 return DrainState::Drained; 253 } else { 254 DPRINTF(Drain, "PacketQueue not drained\n"); 255 return DrainState::Draining; 256 } |
255} 256 257ReqPacketQueue::ReqPacketQueue(EventManager& _em, MasterPort& _masterPort, 258 const std::string _label) 259 : PacketQueue(_em, _label), masterPort(_masterPort) 260{ 261} 262 --- 30 unchanged lines hidden --- | 257} 258 259ReqPacketQueue::ReqPacketQueue(EventManager& _em, MasterPort& _masterPort, 260 const std::string _label) 261 : PacketQueue(_em, _label), masterPort(_masterPort) 262{ 263} 264 --- 30 unchanged lines hidden --- |