Deleted Added
sdiff udiff text old ( 11740:6e1cb0f750c0 ) new ( 11741:72916416d2e2 )
full compact
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
132 Target(PacketPtr _pkt, Tick _readyTime, Counter _order,
133 Source _source, bool _markedPending)
134 : recvTime(curTick()), readyTime(_readyTime), order(_order),
135 pkt(_pkt), source(_source), markedPending(_markedPending)
136 {}
137 };
138
139 class TargetList : public std::list<Target> {
140
141 public:
142 bool needsWritable;
143 bool hasUpgrade;
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
153 */
154 void updateFlags(PacketPtr pkt, Target::Source source);
155
156 void resetFlags() { needsWritable = hasUpgrade = 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
166 bool isReset() const { return !needsWritable && !hasUpgrade; }
167 void add(PacketPtr pkt, Tick readyTime, Counter order,
168 Target::Source source, bool markPending);
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
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
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 ---