mshr_queue.cc (10764:b32578b2af99) | mshr_queue.cc (10766:b2071d0eb5f1) |
---|---|
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 --- 54 unchanged lines hidden (view full) --- 63 registers[i].queue = this; 64 freeList.push_back(®isters[i]); 65 } 66} 67 68MSHR * 69MSHRQueue::findMatch(Addr blk_addr, bool is_secure) const 70{ | 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 --- 54 unchanged lines hidden (view full) --- 63 registers[i].queue = this; 64 freeList.push_back(®isters[i]); 65 } 66} 67 68MSHR * 69MSHRQueue::findMatch(Addr blk_addr, bool is_secure) const 70{ |
71 MSHR::ConstIterator i = allocatedList.begin(); 72 MSHR::ConstIterator end = allocatedList.end(); 73 for (; i != end; ++i) { 74 MSHR *mshr = *i; | 71 for (const auto& mshr : allocatedList) { |
75 if (mshr->blkAddr == blk_addr && mshr->isSecure == is_secure) { 76 return mshr; 77 } 78 } 79 return NULL; 80} 81 82bool 83MSHRQueue::findMatches(Addr blk_addr, bool is_secure, 84 vector<MSHR*>& matches) const 85{ 86 // Need an empty vector 87 assert(matches.empty()); 88 bool retval = false; | 72 if (mshr->blkAddr == blk_addr && mshr->isSecure == is_secure) { 73 return mshr; 74 } 75 } 76 return NULL; 77} 78 79bool 80MSHRQueue::findMatches(Addr blk_addr, bool is_secure, 81 vector<MSHR*>& matches) const 82{ 83 // Need an empty vector 84 assert(matches.empty()); 85 bool retval = false; |
89 MSHR::ConstIterator i = allocatedList.begin(); 90 MSHR::ConstIterator end = allocatedList.end(); 91 for (; i != end; ++i) { 92 MSHR *mshr = *i; | 86 for (const auto& mshr : allocatedList) { |
93 if (mshr->blkAddr == blk_addr && mshr->isSecure == is_secure) { 94 retval = true; 95 matches.push_back(mshr); 96 } 97 } 98 return retval; 99} 100 101 102bool 103MSHRQueue::checkFunctional(PacketPtr pkt, Addr blk_addr) 104{ 105 pkt->pushLabel(label); | 87 if (mshr->blkAddr == blk_addr && mshr->isSecure == is_secure) { 88 retval = true; 89 matches.push_back(mshr); 90 } 91 } 92 return retval; 93} 94 95 96bool 97MSHRQueue::checkFunctional(PacketPtr pkt, Addr blk_addr) 98{ 99 pkt->pushLabel(label); |
106 MSHR::ConstIterator i = allocatedList.begin(); 107 MSHR::ConstIterator end = allocatedList.end(); 108 for (; i != end; ++i) { 109 MSHR *mshr = *i; | 100 for (const auto& mshr : allocatedList) { |
110 if (mshr->blkAddr == blk_addr && mshr->checkFunctional(pkt)) { 111 pkt->popLabel(); 112 return true; 113 } 114 } 115 pkt->popLabel(); 116 return false; 117} 118 119 120MSHR * 121MSHRQueue::findPending(Addr blk_addr, bool is_secure) const 122{ | 101 if (mshr->blkAddr == blk_addr && mshr->checkFunctional(pkt)) { 102 pkt->popLabel(); 103 return true; 104 } 105 } 106 pkt->popLabel(); 107 return false; 108} 109 110 111MSHR * 112MSHRQueue::findPending(Addr blk_addr, bool is_secure) const 113{ |
123 MSHR::ConstIterator i = readyList.begin(); 124 MSHR::ConstIterator end = readyList.end(); 125 for (; i != end; ++i) { 126 MSHR *mshr = *i; | 114 for (const auto& mshr : readyList) { |
127 if (mshr->blkAddr == blk_addr && mshr->isSecure == is_secure) { 128 return mshr; 129 } 130 } 131 return NULL; 132} 133 134 135MSHR::Iterator 136MSHRQueue::addToReadyList(MSHR *mshr) 137{ 138 if (readyList.empty() || readyList.back()->readyTime <= mshr->readyTime) { 139 return readyList.insert(readyList.end(), mshr); 140 } 141 | 115 if (mshr->blkAddr == blk_addr && mshr->isSecure == is_secure) { 116 return mshr; 117 } 118 } 119 return NULL; 120} 121 122 123MSHR::Iterator 124MSHRQueue::addToReadyList(MSHR *mshr) 125{ 126 if (readyList.empty() || readyList.back()->readyTime <= mshr->readyTime) { 127 return readyList.insert(readyList.end(), mshr); 128 } 129 |
142 MSHR::Iterator i = readyList.begin(); 143 MSHR::Iterator end = readyList.end(); 144 for (; i != end; ++i) { | 130 for (auto i = readyList.begin(); i != readyList.end(); ++i) { |
145 if ((*i)->readyTime > mshr->readyTime) { 146 return readyList.insert(i, mshr); 147 } 148 } 149 assert(false); | 131 if ((*i)->readyTime > mshr->readyTime) { 132 return readyList.insert(i, mshr); 133 } 134 } 135 assert(false); |
150 return end; // keep stupid compilers happy | 136 return readyList.end(); // keep stupid compilers happy |
151} 152 153 154MSHR * 155MSHRQueue::allocate(Addr blk_addr, unsigned blk_size, PacketPtr pkt, 156 Tick when_ready, Counter order) 157{ 158 assert(!freeList.empty()); --- 87 unchanged lines hidden (view full) --- 246 247 // Notify if MSHR queue no longer full 248 return was_full && !isFull(); 249} 250 251void 252MSHRQueue::squash(int threadNum) 253{ | 137} 138 139 140MSHR * 141MSHRQueue::allocate(Addr blk_addr, unsigned blk_size, PacketPtr pkt, 142 Tick when_ready, Counter order) 143{ 144 assert(!freeList.empty()); --- 87 unchanged lines hidden (view full) --- 232 233 // Notify if MSHR queue no longer full 234 return was_full && !isFull(); 235} 236 237void 238MSHRQueue::squash(int threadNum) 239{ |
254 MSHR::Iterator i = allocatedList.begin(); 255 MSHR::Iterator end = allocatedList.end(); 256 for (; i != end;) { | 240 for (auto i = allocatedList.begin(); i != allocatedList.end();) { |
257 MSHR *mshr = *i; 258 if (mshr->threadNum == threadNum) { 259 while (mshr->hasTargets()) { 260 mshr->popTarget(); 261 assert(0/*target->req->threadId()*/ == threadNum); 262 } 263 assert(!mshr->hasTargets()); 264 assert(mshr->getNumTargets()==0); --- 24 unchanged lines hidden --- | 241 MSHR *mshr = *i; 242 if (mshr->threadNum == threadNum) { 243 while (mshr->hasTargets()) { 244 mshr->popTarget(); 245 assert(0/*target->req->threadId()*/ == threadNum); 246 } 247 assert(!mshr->hasTargets()); 248 assert(mshr->getNumTargets()==0); --- 24 unchanged lines hidden --- |