mshr_queue.hh (10192:5c2c4195b839) mshr_queue.hh (10622:0b969a35781f)
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

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

72 const int numEntries;
73
74 /**
75 * The number of entries to hold in reserve. This is needed because copy
76 * operations can allocate upto 4 entries at one time.
77 */
78 const int numReserve;
79
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

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

72 const int numEntries;
73
74 /**
75 * The number of entries to hold in reserve. This is needed because copy
76 * operations can allocate upto 4 entries at one time.
77 */
78 const int numReserve;
79
80 /**
81 * The number of entries to reserve for future demand accesses.
82 * Prevent prefetcher from taking all mshr entries
83 */
84 const int demandReserve;
85
80 /** MSHR storage. */
81 std::vector<MSHR> registers;
82 /** Holds pointers to all allocated entries. */
83 MSHR::List allocatedList;
84 /** Holds pointers to entries that haven't been sent to the bus. */
85 MSHR::List readyList;
86 /** Holds non allocated entries. */
87 MSHR::List freeList;

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

101 * buffer). */
102 const int index;
103
104 /**
105 * Create a queue with a given number of entries.
106 * @param num_entrys The number of entries in this queue.
107 * @param reserve The minimum number of entries needed to satisfy
108 * any access.
86 /** MSHR storage. */
87 std::vector<MSHR> registers;
88 /** Holds pointers to all allocated entries. */
89 MSHR::List allocatedList;
90 /** Holds pointers to entries that haven't been sent to the bus. */
91 MSHR::List readyList;
92 /** Holds non allocated entries. */
93 MSHR::List freeList;

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

107 * buffer). */
108 const int index;
109
110 /**
111 * Create a queue with a given number of entries.
112 * @param num_entrys The number of entries in this queue.
113 * @param reserve The minimum number of entries needed to satisfy
114 * any access.
115 * @param demand_reserve The minimum number of entries needed to satisfy
116 * demand accesses.
109 */
110 MSHRQueue(const std::string &_label, int num_entries, int reserve,
117 */
118 MSHRQueue(const std::string &_label, int num_entries, int reserve,
111 int index);
119 int demand_reserve, int index);
112
113 /**
114 * Find the first MSHR that matches the provided address.
115 * @param addr The address to find.
116 * @param is_secure True if the target memory space is secure.
117 * @return Pointer to the matching MSHR, null if not found.
118 */
119 MSHR *findMatch(Addr addr, bool is_secure) const;

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

213 * @return True if this queue is full.
214 */
215 bool isFull() const
216 {
217 return (allocated > numEntries - numReserve);
218 }
219
220 /**
120
121 /**
122 * Find the first MSHR that matches the provided address.
123 * @param addr The address to find.
124 * @param is_secure True if the target memory space is secure.
125 * @return Pointer to the matching MSHR, null if not found.
126 */
127 MSHR *findMatch(Addr addr, bool is_secure) const;

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

221 * @return True if this queue is full.
222 */
223 bool isFull() const
224 {
225 return (allocated > numEntries - numReserve);
226 }
227
228 /**
229 * Returns true if sufficient mshrs for prefetch.
230 * @return True if sufficient mshrs for prefetch.
231 */
232 bool canPrefetch() const
233 {
234 return (allocated < numEntries - (numReserve + demandReserve));
235 }
236
237 /**
221 * Returns the MSHR at the head of the readyList.
222 * @return The next request to service.
223 */
224 MSHR *getNextMSHR() const
225 {
226 if (readyList.empty() || readyList.front()->readyTime > curTick()) {
227 return NULL;
228 }

--- 12 unchanged lines hidden ---
238 * Returns the MSHR at the head of the readyList.
239 * @return The next request to service.
240 */
241 MSHR *getNextMSHR() const
242 {
243 if (readyList.empty() || readyList.front()->readyTime > curTick()) {
244 return NULL;
245 }

--- 12 unchanged lines hidden ---