Deleted Added
sdiff udiff text old ( 5730:dea5fcd1ead0 ) new ( 5875:d82be3235ab4 )
full compact
1/*
2 * Copyright (c) 2002-2005 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

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

50 */
51class MSHR : public Packet::SenderState, public Printable
52{
53
54 public:
55
56 class Target {
57 public:
58 Tick recvTime; //!< Time when request was received (for stats)
59 Tick readyTime; //!< Time when request is ready to be serviced
60 Counter order; //!< Global order (for memory consistency mgmt)
61 PacketPtr pkt; //!< Pending request packet.
62 bool cpuSide; //!< Did request come from cpu side or mem side?
63 bool markedPending; //!< Did we mark upstream MSHR
64 //!< as downstreamPending?
65
66 bool isCpuSide() const { return cpuSide; }
67
68 Target(PacketPtr _pkt, Tick _readyTime, Counter _order,
69 bool _cpuSide, bool _markedPending)
70 : recvTime(curTick), readyTime(_readyTime), order(_order),
71 pkt(_pkt), cpuSide(_cpuSide), markedPending(_markedPending)
72 {}
73 };
74
75 class TargetList : public std::list<Target> {
76 /** Target list iterator. */
77 typedef std::list<Target>::iterator Iterator;
78 typedef std::list<Target>::const_iterator ConstIterator;
79
80 public:
81 bool needsExclusive;
82 bool hasUpgrade;
83
84 TargetList();
85 void resetFlags() { needsExclusive = hasUpgrade = false; }
86 bool isReset() { return !needsExclusive && !hasUpgrade; }
87 void add(PacketPtr pkt, Tick readyTime, Counter order,
88 bool cpuSide, bool markPending);
89 void replaceUpgrades();
90 void clearDownstreamPending();
91 bool checkFunctional(PacketPtr pkt);
92 void print(std::ostream &os, int verbosity,
93 const std::string &prefix) const;
94 };
95
96 /** A list of MSHRs. */

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

233 targets->pop_front();
234 }
235
236 bool isForwardNoResponse() const
237 {
238 if (getNumTargets() != 1)
239 return false;
240 Target *tgt = getTarget();
241 return tgt->isCpuSide() && !tgt->pkt->needsResponse();
242 }
243
244 bool promoteDeferredTargets();
245
246 void handleFill(Packet *pkt, CacheBlk *blk);
247
248 bool checkFunctional(PacketPtr pkt);
249
250 /**
251 * Prints the contents of this MSHR for debugging.
252 */
253 void print(std::ostream &os,
254 int verbosity = 0,
255 const std::string &prefix = "") const;
256};
257
258#endif //__MSHR_HH__