mshr_queue.cc (9347:b02075171b57) mshr_queue.cc (9725:0d4ee33078bb)
1/*
1/*
2 * Copyright (c) 2012 ARM Limited
2 * Copyright (c) 2012-2013 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
9 * licensed hereunder. You may use the software subject to the license
10 * terms below provided that you ensure that this notice is replicated

--- 35 unchanged lines hidden (view full) ---

46 */
47
48#include "mem/cache/mshr_queue.hh"
49
50using namespace std;
51
52MSHRQueue::MSHRQueue(const std::string &_label,
53 int num_entries, int reserve, int _index)
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
9 * licensed hereunder. You may use the software subject to the license
10 * terms below provided that you ensure that this notice is replicated

--- 35 unchanged lines hidden (view full) ---

46 */
47
48#include "mem/cache/mshr_queue.hh"
49
50using namespace std;
51
52MSHRQueue::MSHRQueue(const std::string &_label,
53 int num_entries, int reserve, int _index)
54 : label(_label),
55 numEntries(num_entries + reserve - 1), numReserve(reserve),
56 drainManager(NULL), index(_index)
54 : label(_label), numEntries(num_entries + reserve - 1),
55 numReserve(reserve), registers(numEntries),
56 drainManager(NULL), allocated(0), inServiceEntries(0), index(_index)
57{
57{
58 allocated = 0;
59 inServiceEntries = 0;
60 registers = new MSHR[numEntries];
61 for (int i = 0; i < numEntries; ++i) {
62 registers[i].queue = this;
63 freeList.push_back(&registers[i]);
64 }
65}
66
58 for (int i = 0; i < numEntries; ++i) {
59 registers[i].queue = this;
60 freeList.push_back(&registers[i]);
61 }
62}
63
67MSHRQueue::~MSHRQueue()
68{
69 delete [] registers;
70}
71
72MSHR *
73MSHRQueue::findMatch(Addr addr) const
74{
75 MSHR::ConstIterator i = allocatedList.begin();
76 MSHR::ConstIterator end = allocatedList.end();
77 for (; i != end; ++i) {
78 MSHR *mshr = *i;
79 if (mshr->addr == addr) {

--- 168 unchanged lines hidden (view full) ---

248 for (; i != end;) {
249 MSHR *mshr = *i;
250 if (mshr->threadNum == threadNum) {
251 while (mshr->hasTargets()) {
252 mshr->popTarget();
253 assert(0/*target->req->threadId()*/ == threadNum);
254 }
255 assert(!mshr->hasTargets());
64MSHR *
65MSHRQueue::findMatch(Addr addr) const
66{
67 MSHR::ConstIterator i = allocatedList.begin();
68 MSHR::ConstIterator end = allocatedList.end();
69 for (; i != end; ++i) {
70 MSHR *mshr = *i;
71 if (mshr->addr == addr) {

--- 168 unchanged lines hidden (view full) ---

240 for (; i != end;) {
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());
256 assert(mshr->ntargets==0);
248 assert(mshr->getNumTargets()==0);
257 if (!mshr->inService) {
258 i = deallocateOne(mshr);
259 } else {
260 //mshr->pkt->flags &= ~CACHE_LINE_FILL;
261 ++i;
262 }
263 } else {
264 ++i;

--- 16 unchanged lines hidden ---
249 if (!mshr->inService) {
250 i = deallocateOne(mshr);
251 } else {
252 //mshr->pkt->flags &= ~CACHE_LINE_FILL;
253 ++i;
254 }
255 } else {
256 ++i;

--- 16 unchanged lines hidden ---