59 #include "debug/Cache.hh"
66 pendingModified(false),
67 postInvalidate(false), postDowngrade(false),
73 : needsWritable(false), hasUpgrade(false), allocOnFill(false)
103 for (
auto&
t: *
this) {
104 updateFlags(
t.pkt,
t.source,
t.allocOnFill);
113 updateFlags(pkt, source, alloc_on_fill);
119 if (mshr !=
nullptr) {
128 emplace_back(pkt, readyTime, order, source, markPending, alloc_on_fill);
140 DPRINTF(
Cache,
"Replacing UpgradeReq with ReadExReq\n");
143 DPRINTF(
Cache,
"Replacing SCUpgradeReq with SCUpgradeFailReq\n");
146 DPRINTF(
Cache,
"Replacing StoreCondReq with StoreCondFailReq\n");
170 for (
auto&
t : *
this) {
181 for (
auto&
t : *
this) {
182 if (
t.markedPending) {
189 MSHR *mshr =
t.pkt->findNextSenderState<
MSHR>();
190 if (mshr !=
nullptr) {
193 t.markedPending =
false;
202 for (
auto&
t : *
this) {
214 const std::string &prefix)
const
216 for (
auto&
t : *
this) {
226 s =
"FromPrefetcher";
233 t.pkt->print(os, verbosity,
"");
241 Tick when_ready,
Counter _order,
bool alloc_on_fill)
258 targets.
add(target, when_ready, _order, source,
true, alloc_on_fill);
353 "%s got snoop %s where needsWritable, "
354 "does not match isInvalidate",
name(), pkt->
print());
470 ready_targets.push_back(*it);
477 ready_targets.push_back(*it);
483 std::swap(ready_targets,
targets);
487 return ready_targets;
564 MSHR::print(std::ostream &
os,
int verbosity,
const std::string &prefix)
const
566 ccprintf(os,
"%s[%#llx:%#llx](%s) %s %s %s state: %s %s %s %s %s\n",
579 ccprintf(os,
"%s Targets:\n", prefix);
583 ccprintf(os,
"%s Deferred Targets:\n", prefix);
Miss Status and Handling Register (MSHR) declaration.
void ccprintf(cp::Print &print)
bool isUncacheable() const
Accessor functions for flags.
bool isSecure
True if the entry targets the secure memory space.
void setResponderHadWritable()
On responding to a snoop request (which only happens for Modified or Owned lines), make sure that we can transform an Owned response to a Modified one.
std::string print() const
A no-args wrapper of print(std::ostream...) meant to be invoked from DPRINTFs avoiding string overhea...
void setHasSharers()
On fills, the hasSharers flag is used by the caches in combination with the cacheResponding flag...
bool inService
True if the entry has been sent downstream.
const std::string & name()
bool needsWritable() const
The pending* and post* flags are only valid if inService is true.
bool isReset() const
Tests if the flags of this TargetList have their default values.
bool isExpressSnoop() const
panic_if(!root,"Invalid expression\n")
bool checkFunctional(PacketPtr pkt)
void print(std::ostream &os, int verbosity, const std::string &prefix) const
Tick readyTime
Tick when ready to issue.
Counter order
Order number assigned to disambiguate writes and misses.
TargetList deferredTargets
bool sendMSHRQueuePacket(MSHR *mshr)
Take an MSHR, turn it into a suitable downstream packet, and send it out.
A template-policy based cache.
bool postInvalidate
Did we snoop an invalidate while waiting for data?
Tick curTick()
The current simulated tick.
void allocateTarget(PacketPtr target, Tick when, Counter order, bool alloc_on_fill)
Add a request to the list of targets.
void markInService(bool pending_modified_resp)
uint64_t Tick
Tick count type.
Miss Status and handling Register.
const RequestPtr req
A pointer to the original request.
bool needsResponse() const
void clearDownstreamPending()
TargetList targets
List of all requests that match the address.
static void replaceUpgrade(PacketPtr pkt)
bool needsWritable() const
Defines global host-dependent types: Counter, Tick, and (indirectly) {int,uint}{8,16,32,64}_t.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
void print(std::ostream &o, int verbosity=0, const std::string &prefix="") const
int64_t Counter
Statistics counter type.
A Packet is used to encapsulate a transfer between two objects in the memory system (e...
bool checkFunctional(PacketPtr other)
Check a functional request against a memory value stored in another packet (i.e.
void updateFlags(PacketPtr pkt, Target::Source source, bool alloc_on_fill)
Use the provided packet and the source to update the flags of this TargetList.
bool sendPacket(Cache &cache)
Send this queue entry as a downstream packet, with the exact behaviour depending on the specific entr...
void populateFlags()
Goes through the list of targets and uses them to populate the flags of this TargetList.
void clearDownstreamPending()
Addr blkAddr
Block aligned address.
bool hasPostDowngrade() const
bool handleSnoop(PacketPtr target, Counter order)
void replaceUpgrades()
Convert upgrades to the equivalent request if the cache line they refer to would have been invalid (U...
MemCmd cmd
The command field of the packet.
TargetList extractServiceableTargets(PacketPtr pkt)
Extracts the subset of the targets that can be serviced given a received response.
bool isForward
True if the entry is just a simple forward from an upper level.
MSHR()
A simple constructor.
bool promoteDeferredTargets()
bool pendingModified
Here we use one flag to track both if:
T * findNextSenderState() const
Go through the sender state stack and return the first instance that is of type T (as determined by a...
void deallocate()
Mark this MSHR as free.
bool checkFunctional(PacketPtr pkt)
bool isInvalidate() const
Describes a cache based on template policies.
void add(PacketPtr pkt, Tick readyTime, Counter order, Target::Source source, bool markPending, bool alloc_on_fill)
Add the specified packet in the TargetList.
void allocate(Addr blk_addr, unsigned blk_size, PacketPtr pkt, Tick when_ready, Counter _order, bool alloc_on_fill)
Allocate a miss to this MSHR.
unsigned blkSize
Block size of the cache.
bool hasPostInvalidate() const
void allocate()
Allocate memory for the packet.
bool isPendingModified() const
bool downstreamPending
Flag set by downstream caches.
ProbePointArg< PacketInfo > Packet
Packet probe point.
void setCacheResponding()
Snoop flags.
bool postDowngrade
Did we snoop a read while waiting for data?
bool _isUncacheable
True if the entry is uncacheable.