mshr.hh (11740:6e1cb0f750c0) mshr.hh (11741:72916416d2e2)
1/*
2 * Copyright (c) 2012-2013, 2015-2016 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

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

123
124 const Tick recvTime; //!< Time when request was received (for stats)
125 const Tick readyTime; //!< Time when request is ready to be serviced
126 const Counter order; //!< Global order (for memory consistency mgmt)
127 const PacketPtr pkt; //!< Pending request packet.
128 const Source source; //!< Request from cpu, memory, or prefetcher?
129 const bool markedPending; //!< Did we mark upstream MSHR
130 //!< as downstreamPending?
1/*
2 * Copyright (c) 2012-2013, 2015-2016 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

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

123
124 const Tick recvTime; //!< Time when request was received (for stats)
125 const Tick readyTime; //!< Time when request is ready to be serviced
126 const Counter order; //!< Global order (for memory consistency mgmt)
127 const PacketPtr pkt; //!< Pending request packet.
128 const Source source; //!< Request from cpu, memory, or prefetcher?
129 const bool markedPending; //!< Did we mark upstream MSHR
130 //!< as downstreamPending?
131 const bool allocOnFill; //!< Should the response servicing this
132 //!< target list allocate in the cache?
131
132 Target(PacketPtr _pkt, Tick _readyTime, Counter _order,
133
134 Target(PacketPtr _pkt, Tick _readyTime, Counter _order,
133 Source _source, bool _markedPending)
135 Source _source, bool _markedPending, bool alloc_on_fill)
134 : recvTime(curTick()), readyTime(_readyTime), order(_order),
136 : recvTime(curTick()), readyTime(_readyTime), order(_order),
135 pkt(_pkt), source(_source), markedPending(_markedPending)
137 pkt(_pkt), source(_source), markedPending(_markedPending),
138 allocOnFill(alloc_on_fill)
136 {}
137 };
138
139 class TargetList : public std::list<Target> {
140
141 public:
142 bool needsWritable;
143 bool hasUpgrade;
139 {}
140 };
141
142 class TargetList : public std::list<Target> {
143
144 public:
145 bool needsWritable;
146 bool hasUpgrade;
147 /** Set when the response should allocate on fill */
148 bool allocOnFill;
144
145 TargetList();
146
147 /**
148 * Use the provided packet and the source to update the
149 * flags of this TargetList.
150 *
151 * @param pkt Packet considered for the flag update
152 * @param source Indicates the source of the packet
149
150 TargetList();
151
152 /**
153 * Use the provided packet and the source to update the
154 * flags of this TargetList.
155 *
156 * @param pkt Packet considered for the flag update
157 * @param source Indicates the source of the packet
158 * @param alloc_on_fill Whether the pkt would allocate on a fill
153 */
159 */
154 void updateFlags(PacketPtr pkt, Target::Source source);
160 void updateFlags(PacketPtr pkt, Target::Source source,
161 bool alloc_on_fill);
155
162
156 void resetFlags() { needsWritable = hasUpgrade = false; }
163 void resetFlags() { needsWritable = hasUpgrade = allocOnFill = false; }
157
158 /**
159 * Goes through the list of targets and uses them to populate
160 * the flags of this TargetList. When the function returns the
161 * flags are consistent with the properties of packets in the
162 * list.
163 */
164 void populateFlags();
165
164
165 /**
166 * Goes through the list of targets and uses them to populate
167 * the flags of this TargetList. When the function returns the
168 * flags are consistent with the properties of packets in the
169 * list.
170 */
171 void populateFlags();
172
166 bool isReset() const { return !needsWritable && !hasUpgrade; }
173 /**
174 * Tests if the flags of this TargetList have their default
175 * values.
176 */
177 bool isReset() const {
178 return !needsWritable && !hasUpgrade && !allocOnFill;
179 }
180
181 /**
182 * Add the specified packet in the TargetList. This function
183 * stores information related to the added packet and updates
184 * accordingly the flags.
185 *
186 * @param pkt Packet considered for adding
187 * @param readTime Tick at which the packet is processed by this cache
188 * @param order A counter giving a unique id to each target
189 * @param source Indicates the source agent of the packet
190 * @param markPending Set for deferred targets or pending MSHRs
191 * @param alloc_on_fill Whether it should allocate on a fill
192 */
167 void add(PacketPtr pkt, Tick readyTime, Counter order,
193 void add(PacketPtr pkt, Tick readyTime, Counter order,
168 Target::Source source, bool markPending);
194 Target::Source source, bool markPending,
195 bool alloc_on_fill);
169
170 /**
171 * Convert upgrades to the equivalent request if the cache line they
172 * refer to would have been invalid (Upgrade -> ReadEx, SC* -> Fail).
173 * Used to rejig ordering between targets waiting on an MSHR. */
174 void replaceUpgrades();
175
176 void clearDownstreamPending();
177 bool checkFunctional(PacketPtr pkt);
178 void print(std::ostream &os, int verbosity,
179 const std::string &prefix) const;
180 };
181
182 /** A list of MSHRs. */
183 typedef std::list<MSHR *> List;
184 /** MSHR list iterator. */
185 typedef List::iterator Iterator;
186
196
197 /**
198 * Convert upgrades to the equivalent request if the cache line they
199 * refer to would have been invalid (Upgrade -> ReadEx, SC* -> Fail).
200 * Used to rejig ordering between targets waiting on an MSHR. */
201 void replaceUpgrades();
202
203 void clearDownstreamPending();
204 bool checkFunctional(PacketPtr pkt);
205 void print(std::ostream &os, int verbosity,
206 const std::string &prefix) const;
207 };
208
209 /** A list of MSHRs. */
210 typedef std::list<MSHR *> List;
211 /** MSHR list iterator. */
212 typedef List::iterator Iterator;
213
187 /** Keep track of whether we should allocate on fill or not */
188 bool allocOnFill;
189
190 /** The pending* and post* flags are only valid if inService is
191 * true. Using the accessor functions lets us detect if these
192 * flags are accessed improperly.
193 */
194
195 /** True if we need to get a writable copy of the block. */
196 bool needsWritable() const { return targets.needsWritable; }
197

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

204 }
205
206 bool hasPostDowngrade() const {
207 assert(inService); return postDowngrade;
208 }
209
210 bool sendPacket(Cache &cache);
211
214 /** The pending* and post* flags are only valid if inService is
215 * true. Using the accessor functions lets us detect if these
216 * flags are accessed improperly.
217 */
218
219 /** True if we need to get a writable copy of the block. */
220 bool needsWritable() const { return targets.needsWritable; }
221

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

228 }
229
230 bool hasPostDowngrade() const {
231 assert(inService); return postDowngrade;
232 }
233
234 bool sendPacket(Cache &cache);
235
236 bool allocOnFill() const {
237 return targets.allocOnFill;
238 }
212 private:
213
214 /**
215 * Pointer to this MSHR on the ready list.
216 * @sa MissQueue, MSHRQueue::readyList
217 */
218 Iterator readyIter;
219

--- 98 unchanged lines hidden ---
239 private:
240
241 /**
242 * Pointer to this MSHR on the ready list.
243 * @sa MissQueue, MSHRQueue::readyList
244 */
245 Iterator readyIter;
246

--- 98 unchanged lines hidden ---