1/* 2 * Copyright (c) 2012-2013, 2015 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 --- 66 unchanged lines hidden (view full) --- 75 Tick readyTime; 76 77 /** True if the request is uncacheable */ 78 bool _isUncacheable; 79 80 /** Flag set by downstream caches */ 81 bool downstreamPending; 82 |
83 /** 84 * Here we use one flag to track both if: 85 * 86 * 1. We are going to become owner or not, i.e., we will get the 87 * block in an ownership state (Owned or Modified) with BlkDirty 88 * set. This determines whether or not we are going to become the 89 * responder and ordering point for future requests that we snoop. 90 * 91 * 2. We know that we are going to get a writable block, i.e. we 92 * will get the block in writable state (Exclusive or Modified 93 * state) with BlkWritable set. That determines whether additional 94 * targets with needsWritable set will be able to be satisfied, or 95 * if not should be put on the deferred list to possibly wait for 96 * another request that does give us writable access. 97 * 98 * Condition 2 is actually just a shortcut that saves us from 99 * possibly building a deferred target list and calling 100 * promoteWritable() every time we get a writable block. Condition 101 * 1, tracking ownership, is what is important. However, we never 102 * receive ownership without marking the block dirty, and 103 * consequently use pendingModified to track both ownership and 104 * writability rather than having separate pendingDirty and 105 * pendingWritable flags. 106 */ 107 bool pendingModified; |
108 109 /** Did we snoop an invalidate while waiting for data? */ 110 bool postInvalidate; 111 112 /** Did we snoop a read while waiting for data? */ 113 bool postDowngrade; 114 115 public: --- 20 unchanged lines hidden (view full) --- 136 : recvTime(curTick()), readyTime(_readyTime), order(_order), 137 pkt(_pkt), source(_source), markedPending(_markedPending) 138 {} 139 }; 140 141 class TargetList : public std::list<Target> { 142 143 public: |
144 bool needsWritable; |
145 bool hasUpgrade; 146 147 TargetList(); |
148 void resetFlags() { needsWritable = hasUpgrade = false; } 149 bool isReset() const { return !needsWritable && !hasUpgrade; } |
150 void add(PacketPtr pkt, Tick readyTime, Counter order, 151 Target::Source source, bool markPending); 152 void replaceUpgrades(); 153 void clearDownstreamPending(); 154 bool checkFunctional(PacketPtr pkt); 155 void print(std::ostream &os, int verbosity, 156 const std::string &prefix) const; 157 }; --- 29 unchanged lines hidden (view full) --- 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 |
198 bool isPendingModified() const { 199 assert(inService); return pendingModified; |
200 } 201 202 bool hasPostInvalidate() const { 203 assert(inService); return postInvalidate; 204 } 205 206 bool hasPostDowngrade() const { 207 assert(inService); return postDowngrade; --- 33 unchanged lines hidden (view full) --- 241 * @param pkt The original miss. 242 * @param when_ready When should the MSHR be ready to act upon. 243 * @param _order The logical order of this MSHR 244 * @param alloc_on_fill Should the cache allocate a block on fill 245 */ 246 void allocate(Addr blk_addr, unsigned blk_size, PacketPtr pkt, 247 Tick when_ready, Counter _order, bool alloc_on_fill); 248 |
249 bool markInService(bool pending_modified_resp); |
250 251 void clearDownstreamPending(); 252 253 /** 254 * Mark this MSHR as free. 255 */ 256 void deallocate(); 257 --- 44 unchanged lines hidden (view full) --- 302 if (getNumTargets() != 1) 303 return false; 304 const Target *tgt = &targets.front(); 305 return tgt->source == Target::FromCPU && !tgt->pkt->needsResponse(); 306 } 307 308 bool promoteDeferredTargets(); 309 |
310 void promoteWritable(); |
311 312 bool checkFunctional(PacketPtr pkt); 313 314 /** 315 * Prints the contents of this MSHR for debugging. 316 */ 317 void print(std::ostream &os, 318 int verbosity = 0, 319 const std::string &prefix = "") const; 320 /** 321 * A no-args wrapper of print(std::ostream...) meant to be 322 * invoked from DPRINTFs avoiding string overheads in fast mode 323 * 324 * @return string with mshr fields + [deferred]targets 325 */ 326 std::string print() const; 327}; 328 329#endif // __MEM_CACHE_MSHR_HH__ |