1/* 2 * Copyright (c) 2011-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 --- 131 unchanged lines hidden (view full) --- 140 // already done using the header delay, and the payload delay is 141 // also used to determine how long the crossbar layer is busy and 142 // thus regulates throughput 143} 144 145template <typename SrcType, typename DstType> 146BaseXBar::Layer<SrcType,DstType>::Layer(DstType& _port, BaseXBar& _xbar, 147 const std::string& _name) : |
148 port(_port), xbar(_xbar), _name(_name), state(IDLE), |
149 waitingForPeer(NULL), releaseEvent(this) 150{ 151} 152 153template <typename SrcType, typename DstType> 154void BaseXBar::Layer<SrcType,DstType>::occupyLayer(Tick until) 155{ 156 // ensure the state is busy at this point, as the layer should --- 90 unchanged lines hidden (view full) --- 247 state = IDLE; 248 249 // bus layer is now idle, so if someone is waiting we can retry 250 if (!waitingForLayer.empty()) { 251 // there is no point in sending a retry if someone is still 252 // waiting for the peer 253 if (waitingForPeer == NULL) 254 retryWaiting(); |
255 } else if (waitingForPeer == NULL && drainState() == DrainState::Draining) { |
256 DPRINTF(Drain, "Crossbar done draining, signaling drain manager\n"); 257 //If we weren't able to drain before, do it now. |
258 signalDrainDone(); |
259 } 260} 261 262template <typename SrcType, typename DstType> 263void 264BaseXBar::Layer<SrcType,DstType>::retryWaiting() 265{ 266 // this should never be called with no one waiting --- 313 unchanged lines hidden (view full) --- 580 for (int j = 0; j < masterPorts.size(); j++) { 581 pktCount.ysubname(j, masterPorts[j]->getSlavePort().name()); 582 pktSize.ysubname(j, masterPorts[j]->getSlavePort().name()); 583 } 584 } 585} 586 587template <typename SrcType, typename DstType> |
588DrainState 589BaseXBar::Layer |
590{ 591 //We should check that we're not "doing" anything, and that noone is 592 //waiting. We might be idle but have someone waiting if the device we 593 //contacted for a retry didn't actually retry. 594 if (state != IDLE) { 595 DPRINTF(Drain, "Crossbar not drained\n"); |
596 return DrainState::Draining; 597 } else { 598 return DrainState::Drained; |
599 } |
600} 601 602template <typename SrcType, typename DstType> 603void 604BaseXBar::Layer<SrcType,DstType>::regStats() 605{ 606 using namespace Stats; 607 --- 21 unchanged lines hidden --- |