1/* 2 * Copyright (c) 2012-2013, 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 --- 42 unchanged lines hidden (view full) --- 51 52using namespace std; 53 54MSHRQueue::MSHRQueue(const std::string &_label, 55 int num_entries, int reserve, int demand_reserve, 56 int _index) 57 : label(_label), numEntries(num_entries + reserve - 1), 58 numReserve(reserve), demandReserve(demand_reserve), |
59 registers(numEntries), allocated(0), |
60 inServiceEntries(0), index(_index) 61{ 62 for (int i = 0; i < numEntries; ++i) { 63 registers[i].queue = this; 64 freeList.push_back(®isters[i]); 65 } 66} 67 --- 107 unchanged lines hidden (view full) --- 175 freeList.push_front(mshr); 176 allocated--; 177 if (mshr->inService) { 178 inServiceEntries--; 179 } else { 180 readyList.erase(mshr->readyIter); 181 } 182 mshr->deallocate(); |
183 if (drainState() == DrainState::Draining && allocated == 0) { |
184 // Notify the drain manager that we have completed draining if 185 // there are no other outstanding requests in this MSHR queue. 186 DPRINTF(Drain, "MSHRQueue now empty, signalling drained\n"); |
187 signalDrainDone(); |
188 } 189 return retval; 190} 191 192void 193MSHRQueue::moveToFront(MSHR *mshr) 194{ 195 if (!mshr->inService) { --- 62 unchanged lines hidden (view full) --- 258 ++i; 259 } 260 } else { 261 ++i; 262 } 263 } 264} 265 |
266DrainState 267MSHRQueue::drain() |
268{ |
269 return allocated == 0 ? DrainState::Drained : DrainState::Draining; |
270} |