mshr_queue.cc (9725:0d4ee33078bb) mshr_queue.cc (10028:fb8c44de891a)
1/*
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

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

57{
58 for (int i = 0; i < numEntries; ++i) {
59 registers[i].queue = this;
60 freeList.push_back(&registers[i]);
61 }
62}
63
64MSHR *
1/*
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

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

57{
58 for (int i = 0; i < numEntries; ++i) {
59 registers[i].queue = this;
60 freeList.push_back(&registers[i]);
61 }
62}
63
64MSHR *
65MSHRQueue::findMatch(Addr addr) const
65MSHRQueue::findMatch(Addr addr, bool is_secure) const
66{
67 MSHR::ConstIterator i = allocatedList.begin();
68 MSHR::ConstIterator end = allocatedList.end();
69 for (; i != end; ++i) {
70 MSHR *mshr = *i;
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) {
71 if (mshr->addr == addr && mshr->isSecure == is_secure) {
72 return mshr;
73 }
74 }
75 return NULL;
76}
77
78bool
72 return mshr;
73 }
74 }
75 return NULL;
76}
77
78bool
79MSHRQueue::findMatches(Addr addr, vector& matches) const
79MSHRQueue::findMatches(Addr addr, bool is_secure, vector<MSHR*>& matches) const
80{
81 // Need an empty vector
82 assert(matches.empty());
83 bool retval = false;
84 MSHR::ConstIterator i = allocatedList.begin();
85 MSHR::ConstIterator end = allocatedList.end();
86 for (; i != end; ++i) {
87 MSHR *mshr = *i;
80{
81 // Need an empty vector
82 assert(matches.empty());
83 bool retval = false;
84 MSHR::ConstIterator i = allocatedList.begin();
85 MSHR::ConstIterator end = allocatedList.end();
86 for (; i != end; ++i) {
87 MSHR *mshr = *i;
88 if (mshr->addr == addr) {
88 if (mshr->addr == addr && mshr->isSecure == is_secure) {
89 retval = true;
90 matches.push_back(mshr);
91 }
92 }
93 return retval;
94}
95
96

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

108 }
109 }
110 pkt->popLabel();
111 return false;
112}
113
114
115MSHR *
89 retval = true;
90 matches.push_back(mshr);
91 }
92 }
93 return retval;
94}
95
96

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

108 }
109 }
110 pkt->popLabel();
111 return false;
112}
113
114
115MSHR *
116MSHRQueue::findPending(Addr addr, int size) const
116MSHRQueue::findPending(Addr addr, int size, bool is_secure) const
117{
118 MSHR::ConstIterator i = readyList.begin();
119 MSHR::ConstIterator end = readyList.end();
120 for (; i != end; ++i) {
121 MSHR *mshr = *i;
117{
118 MSHR::ConstIterator i = readyList.begin();
119 MSHR::ConstIterator end = readyList.end();
120 for (; i != end; ++i) {
121 MSHR *mshr = *i;
122 if (mshr->addr < addr) {
123 if (mshr->addr + mshr->size > addr) {
124 return mshr;
122 if (mshr->isSecure == is_secure) {
123 if (mshr->addr < addr) {
124 if (mshr->addr + mshr->size > addr)
125 return mshr;
126 } else {
127 if (addr + size > mshr->addr)
128 return mshr;
125 }
129 }
126 } else {
127 if (addr + size > mshr->addr) {
128 return mshr;
129 }
130 }
131 }
132 return NULL;
133}
134
135
136MSHR::Iterator
137MSHRQueue::addToReadyList(MSHR *mshr)

--- 135 unchanged lines hidden ---
130 }
131 }
132 return NULL;
133}
134
135
136MSHR::Iterator
137MSHRQueue::addToReadyList(MSHR *mshr)

--- 135 unchanged lines hidden ---