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 --- 32 unchanged lines hidden (view full) --- 41 * Andreas Hansson 42 */ 43 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) 52{ 53} 54 55PacketQueue::~PacketQueue() 56{ 57} 58 --- 77 unchanged lines hidden (view full) --- 136{ 137 assert(deferredPacketReady()); 138 139 // take the next packet off the list here, as we might return to 140 // ourselves through the sendTiming call below 141 DeferredPacket dp = transmitList.front(); 142 transmitList.pop_front(); 143 |
144 // use the appropriate implementation of sendTiming based on the 145 // type of port associated with the queue, and whether the packet 146 // is to be sent as a snoop or not 147 waitingOnRetry = !sendTiming(dp.pkt, dp.sendAsSnoop); |
148 149 if (waitingOnRetry) { 150 // put the packet back at the front of the list (packet should 151 // not have changed since it wasn't accepted) 152 assert(!sendEvent.scheduled()); 153 transmitList.push_front(dp); 154 } 155} --- 43 unchanged lines hidden (view full) --- 199unsigned int 200PacketQueue::drain(Event *de) 201{ 202 if (transmitList.empty() && !sendEvent.scheduled()) 203 return 0; 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{ 212} 213 214bool 215MasterPacketQueue::sendTiming(PacketPtr pkt, bool send_as_snoop) 216{ 217 // attempt to send the packet and return according to the outcome 218 if (!send_as_snoop) 219 return masterPort.sendTimingReq(pkt); 220 else 221 return masterPort.sendTimingSnoopResp(pkt); 222} 223 224SlavePacketQueue::SlavePacketQueue(EventManager& _em, SlavePort& _slavePort, 225 const std::string _label) 226 : PacketQueue(_em, _label), slavePort(_slavePort) 227{ 228} 229 230bool 231SlavePacketQueue::sendTiming(PacketPtr pkt, bool send_as_snoop) 232{ 233 // we should never have queued snoop requests 234 assert(!send_as_snoop); 235 return slavePort.sendTimingResp(pkt); 236} |