mshr.hh (5730:dea5fcd1ead0) mshr.hh (5875:d82be3235ab4)
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:
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
59 enum Source {
60 FromCPU,
61 FromSnoop,
62 FromPrefetcher
63 };
64
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.
65 Tick recvTime; //!< Time when request was received (for stats)
66 Tick readyTime; //!< Time when request is ready to be serviced
67 Counter order; //!< Global order (for memory consistency mgmt)
68 PacketPtr pkt; //!< Pending request packet.
62 bool cpuSide; //!< Did request come from cpu side or mem side?
69 Source source; //!< Did request come from cpu, memory, or prefetcher?
63 bool markedPending; //!< Did we mark upstream MSHR
64 //!< as downstreamPending?
65
70 bool markedPending; //!< Did we mark upstream MSHR
71 //!< as downstreamPending?
72
66 bool isCpuSide() const { return cpuSide; }
67
68 Target(PacketPtr _pkt, Tick _readyTime, Counter _order,
73 Target(PacketPtr _pkt, Tick _readyTime, Counter _order,
69 bool _cpuSide, bool _markedPending)
74 Source _source, bool _markedPending)
70 : recvTime(curTick), readyTime(_readyTime), order(_order),
75 : recvTime(curTick), readyTime(_readyTime), order(_order),
71 pkt(_pkt), cpuSide(_cpuSide), markedPending(_markedPending)
76 pkt(_pkt), source(_source), 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,
77 {}
78 };
79
80 class TargetList : public std::list<Target> {
81 /** Target list iterator. */
82 typedef std::list<Target>::iterator Iterator;
83 typedef std::list<Target>::const_iterator ConstIterator;
84
85 public:
86 bool needsExclusive;
87 bool hasUpgrade;
88
89 TargetList();
90 void resetFlags() { needsExclusive = hasUpgrade = false; }
91 bool isReset() { return !needsExclusive && !hasUpgrade; }
92 void add(PacketPtr pkt, Tick readyTime, Counter order,
88 bool cpuSide, bool markPending);
93 Target::Source source, 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();
94 void replaceUpgrades();
95 void clearDownstreamPending();
96 bool checkFunctional(PacketPtr pkt);
97 void print(std::ostream &os, int verbosity,
98 const std::string &prefix) const;
99 };
100
101 /** A list of MSHRs. */

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

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