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? |
133 134 Target(PacketPtr _pkt, Tick _readyTime, Counter _order, |
135 Source _source, bool _markedPending, bool alloc_on_fill) |
136 : recvTime(curTick()), readyTime(_readyTime), order(_order), |
137 pkt(_pkt), source(_source), markedPending(_markedPending), 138 allocOnFill(alloc_on_fill) |
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; |
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 |
159 */ |
160 void updateFlags(PacketPtr pkt, Target::Source source, 161 bool alloc_on_fill); |
162 |
163 void resetFlags() { needsWritable = hasUpgrade = allocOnFill = false; } |
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 |
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 */ |
193 void add(PacketPtr pkt, Tick readyTime, Counter order, |
194 Target::Source source, bool markPending, 195 bool alloc_on_fill); |
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 |
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 } |
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 --- |