mshr.hh (10764:b32578b2af99) | mshr.hh (10766:b2071d0eb5f1) |
---|---|
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 --- 86 unchanged lines hidden (view full) --- 95 public: 96 97 enum Source { 98 FromCPU, 99 FromSnoop, 100 FromPrefetcher 101 }; 102 | 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 --- 86 unchanged lines hidden (view full) --- 95 public: 96 97 enum Source { 98 FromCPU, 99 FromSnoop, 100 FromPrefetcher 101 }; 102 |
103 Tick recvTime; //!< Time when request was received (for stats) 104 Tick readyTime; //!< Time when request is ready to be serviced 105 Counter order; //!< Global order (for memory consistency mgmt) 106 PacketPtr pkt; //!< Pending request packet. 107 Source source; //!< Did request come from cpu, memory, or prefetcher? 108 bool markedPending; //!< Did we mark upstream MSHR 109 //!< as downstreamPending? | 103 const Tick recvTime; //!< Time when request was received (for stats) 104 const Tick readyTime; //!< Time when request is ready to be serviced 105 const Counter order; //!< Global order (for memory consistency mgmt) 106 const PacketPtr pkt; //!< Pending request packet. 107 const Source source; //!< Request from cpu, memory, or prefetcher? 108 const bool markedPending; //!< Did we mark upstream MSHR 109 //!< as downstreamPending? |
110 111 Target(PacketPtr _pkt, Tick _readyTime, Counter _order, 112 Source _source, bool _markedPending) 113 : recvTime(curTick()), readyTime(_readyTime), order(_order), 114 pkt(_pkt), source(_source), markedPending(_markedPending) 115 {} 116 }; 117 118 class TargetList : public std::list<Target> { | 110 111 Target(PacketPtr _pkt, Tick _readyTime, Counter _order, 112 Source _source, bool _markedPending) 113 : recvTime(curTick()), readyTime(_readyTime), order(_order), 114 pkt(_pkt), source(_source), markedPending(_markedPending) 115 {} 116 }; 117 118 class TargetList : public std::list<Target> { |
119 /** Target list iterator. */ 120 typedef std::list<Target>::iterator Iterator; 121 typedef std::list<Target>::const_iterator ConstIterator; | |
122 123 public: 124 bool needsExclusive; 125 bool hasUpgrade; 126 127 TargetList(); 128 void resetFlags() { needsExclusive = hasUpgrade = false; } | 119 120 public: 121 bool needsExclusive; 122 bool hasUpgrade; 123 124 TargetList(); 125 void resetFlags() { needsExclusive = hasUpgrade = false; } |
129 bool isReset() { return !needsExclusive && !hasUpgrade; } | 126 bool isReset() const { return !needsExclusive && !hasUpgrade; } |
130 void add(PacketPtr pkt, Tick readyTime, Counter order, 131 Target::Source source, bool markPending); 132 void replaceUpgrades(); 133 void clearDownstreamPending(); 134 bool checkFunctional(PacketPtr pkt); 135 void print(std::ostream &os, int verbosity, 136 const std::string &prefix) const; 137 }; --- 142 unchanged lines hidden (view full) --- 280 if (getNumTargets() != 1) 281 return false; 282 const Target *tgt = &targets.front(); 283 return tgt->source == Target::FromCPU && !tgt->pkt->needsResponse(); 284 } 285 286 bool promoteDeferredTargets(); 287 | 127 void add(PacketPtr pkt, Tick readyTime, Counter order, 128 Target::Source source, bool markPending); 129 void replaceUpgrades(); 130 void clearDownstreamPending(); 131 bool checkFunctional(PacketPtr pkt); 132 void print(std::ostream &os, int verbosity, 133 const std::string &prefix) const; 134 }; --- 142 unchanged lines hidden (view full) --- 277 if (getNumTargets() != 1) 278 return false; 279 const Target *tgt = &targets.front(); 280 return tgt->source == Target::FromCPU && !tgt->pkt->needsResponse(); 281 } 282 283 bool promoteDeferredTargets(); 284 |
288 void handleFill(Packet *pkt, CacheBlk *blk); | 285 void handleFill(PacketPtr pkt, CacheBlk *blk); |
289 290 bool checkFunctional(PacketPtr pkt); 291 292 /** 293 * Prints the contents of this MSHR for debugging. 294 */ 295 void print(std::ostream &os, 296 int verbosity = 0, 297 const std::string &prefix = "") const; 298 /** 299 * A no-args wrapper of print(std::ostream...) meant to be 300 * invoked from DPRINTFs avoiding string overheads in fast mode 301 * 302 * @return string with mshr fields + [deferred]targets 303 */ 304 std::string print() const; 305}; 306 307#endif // __MEM_CACHE_MSHR_HH__ | 286 287 bool checkFunctional(PacketPtr pkt); 288 289 /** 290 * Prints the contents of this MSHR for debugging. 291 */ 292 void print(std::ostream &os, 293 int verbosity = 0, 294 const std::string &prefix = "") const; 295 /** 296 * A no-args wrapper of print(std::ostream...) meant to be 297 * invoked from DPRINTFs avoiding string overheads in fast mode 298 * 299 * @return string with mshr fields + [deferred]targets 300 */ 301 std::string print() const; 302}; 303 304#endif // __MEM_CACHE_MSHR_HH__ |