Go to the documentation of this file.
55 #include "debug/Cache.hh"
61 pendingModified(false),
62 postInvalidate(false), postDowngrade(false),
63 wasWholeLineWrite(false), isForward(false)
68 : needsWritable(false), hasUpgrade(false), allocOnFill(false),
96 updateWriteFlags(pkt);
105 for (
auto&
t: *
this) {
106 updateFlags(
t.pkt,
t.source,
t.allocOnFill);
120 if (canMergeWrites) {
124 canMergeWrites =
false;
134 const auto &req_flags = pkt->
req->getFlags();
135 bool compat_write = !req_flags.isSet(no_merge_flags);
142 bool first_write = empty();
143 if (first_write || compat_write) {
145 auto begin = writesBitmap.begin() +
offset;
151 canMergeWrites &= compat_write;
160 updateFlags(pkt, source, alloc_on_fill);
166 if (mshr !=
nullptr) {
175 emplace_back(pkt,
readyTime,
order, source, markPending, alloc_on_fill);
187 DPRINTF(
Cache,
"Replacing UpgradeReq with ReadExReq\n");
190 DPRINTF(
Cache,
"Replacing SCUpgradeReq with SCUpgradeFailReq\n");
193 DPRINTF(
Cache,
"Replacing StoreCondReq with StoreCondFailReq\n");
217 for (
auto&
t : *
this) {
227 MSHR::TargetList::iterator end)
229 for (
auto t = begin;
t != end;
t++) {
230 if (
t->markedPending) {
237 MSHR *mshr =
t->pkt->findNextSenderState<
MSHR>();
238 if (mshr !=
nullptr) {
241 t->markedPending =
false;
256 for (
auto&
t : *
this) {
268 const std::string &prefix)
const
270 for (
auto&
t : *
this) {
280 s =
"FromPrefetcher";
287 t.pkt->print(
os, verbosity,
"");
295 Tick when_ready,
Counter _order,
bool alloc_on_fill)
316 targets.
add(target, when_ready, _order, source,
true, alloc_on_fill);
389 if (pkt->
req->isCacheMaintenance() ||
390 tgt_pkt->
req->isCacheMaintenance() ||
420 !pkt->
req->isCacheMaintenance(),
421 "%s got snoop %s where needsWritable, "
422 "does not match isInvalidate",
name(), pkt->
print());
487 new Packet(std::make_shared<Request>(*pkt->
req), pkt->
cmd,
549 ready_targets.push_back(*it);
556 ready_targets.push_back(*it);
562 std::swap(ready_targets,
targets);
566 return ready_targets;
583 return t.pkt->req->isCacheMaintenance();
645 return !
t.pkt->req->isCacheInvalidate() &&
646 !
t.pkt->needsWritable();
658 !def_tgt_pkt->
req->isCacheInvalidate()) {
671 return !
t.pkt->req->isCacheInvalidate();
701 MSHR::print(std::ostream &
os,
int verbosity,
const std::string &prefix)
const
703 ccprintf(
os,
"%s[%#llx:%#llx](%s) %s %s %s state: %s %s %s %s %s %s\n",
721 ccprintf(
os,
"%s Deferred Targets:\n", prefix);
729 std::ostringstream str;
bool trySatisfyFunctional(PacketPtr pkt)
TargetList deferredTargets
void clearDownstreamPending()
Addr blkAddr
Block aligned address.
bool matchBlockAddr(const Addr addr, const bool is_secure) const override
Check if entry corresponds to the one being looked for.
void setCacheResponding()
Snoop flags.
bool isExpressSnoop() const
bool needsWritable() const
The pending* and post* flags are only valid if inService is true.
void setResponderHadWritable()
On responding to a snoop request (which only happens for Modified or Owned lines),...
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.
virtual bool matchBlockAddr(const Addr addr, const bool is_secure) const =0
Check if entry corresponds to the one being looked for.
void setHasSharers()
On fills, the hasSharers flag is used by the caches in combination with the cacheResponding flag,...
void markInService(bool pending_modified_resp)
void setSatisfied()
Set when a request hits in a cache and the cache is not going to respond.
bool hasTargets() const
Returns true if there are targets left.
uint64_t Tick
Tick count type.
void populateFlags()
Goes through the list of targets and uses them to populate the flags of this TargetList.
bool conflictAddr(const QueueEntry *entry) const override
Check if given entry's packets conflict with this' entries packets.
bool needsWritable() const
bool isInvalidate() const
void replaceUpgrades()
Convert upgrades to the equivalent request if the cache line they refer to would have been invalid (U...
RequestPtr req
A pointer to the original request.
@ PRIVILEGED
This request is made in privileged mode.
bool hasFromCache() const
Determine if there are non-deferred requests from other caches.
std::string print() const
A no-args wrapper of print(std::ostream...) meant to be invoked from DPRINTFs avoiding string overhea...
bool matchBlockAddr(const Addr addr, const bool is_secure, const int blk_size) const
Check if packet corresponds to a given block-aligned address and address space.
static void replaceUpgrade(PacketPtr pkt)
void promoteWritable()
Promotes deferred targets that do not require writable.
TargetList targets
List of all requests that match the address.
TargetList extractServiceableTargets(PacketPtr pkt)
Extracts the subset of the targets that can be serviced given a received response.
void print(std::ostream &o, int verbosity=0, const std::string &prefix="") const
bool trySatisfyFunctional(PacketPtr pkt)
void clearDownstreamPending()
void promoteIf(const std::function< bool(Target &)> &pred)
Promotes deferred targets that satisfy a predicate.
bool isPendingModified() const
bool postInvalidate
Did we snoop an invalidate while waiting for data?
int64_t Counter
Statistics counter type.
@ STRICT_ORDER
The request is required to be strictly ordered by CPU models and is non-speculative.
bool isSecure
True if the entry targets the secure memory space.
bool promoteDeferredTargets()
@ SECURE
The request targets the secure memory space.
bool handleSnoop(PacketPtr target, Counter order)
unsigned blkSize
Block size of the cache.
void add(PacketPtr pkt, Tick readyTime, Counter order, Target::Source source, bool markPending, bool alloc_on_fill)
Add the specified packet in the TargetList.
bool needsResponse() const
void updateWriteFlags(PacketPtr pkt)
Add the specified packet in the TargetList.
T * findNextSenderState() const
Go through the sender state stack and return the first instance that is of type T (as determined by a...
bool postDowngrade
Did we snoop a read while waiting for data?
@ MEM_SWAP
This request is for a memory swap.
Addr getOffset(unsigned int blk_size) const
virtual bool sendMSHRQueuePacket(MSHR *mshr)
Take an MSHR, turn it into a suitable downstream packet, and send it out.
@ UNCACHEABLE
The request is to an uncacheable address.
void init(Addr blk_addr, Addr blk_size)
Reset state.
ProbePointArg< PacketInfo > Packet
Packet probe point.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Tick readyTime
Tick when ready to issue.
const std::string & name()
Counter order
Order number assigned to disambiguate writes and misses.
bool _isUncacheable
True if the entry is uncacheable.
MemCmd cmd
The command field of the packet.
bool downstreamPending
Flag set by downstream caches.
bool wasWholeLineWrite
Track if we sent this as a whole line write or not.
bool inService
True if the entry has been sent downstream.
void allocateTarget(PacketPtr target, Tick when, Counter order, bool alloc_on_fill)
Add a request to the list of targets.
#define panic_if(cond,...)
Conditional panic macro that checks the supplied condition and only panics if the condition is true a...
bool hasPostDowngrade() const
bool sendPacket(BaseCache &cache) override
Send this queue entry as a downstream packet, with the exact behaviour depending on the specific entr...
void deallocate()
Mark this MSHR as free.
void print(std::ostream &os, int verbosity, const std::string &prefix) const
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
void ccprintf(cp::Print &print)
A queue entry base class, to be used by both the MSHRs and write-queue entries.
bool hasPostInvalidate() const
bool isWholeLineWrite() const
Check if this MSHR contains only compatible writes, and if they span the entire cache line.
bool isForward
True if the entry is just a simple forward from an upper level.
void allocate()
Allocate memory for the packet.
@ LLSC
The request is a Load locked/store conditional.
A coherent cache that can be arranged in flexible topologies.
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.
bool trySatisfyFunctional(PacketPtr other)
Check a functional request against a memory value stored in another packet (i.e.
void promoteReadable()
Promotes deferred targets that do not require writable.
bool pendingModified
Here we use one flag to track both if:
MSHR()
A simple constructor.
bool isReset() const
Tests if the flags of this TargetList have their default values.
Miss Status and handling Register.
Tick curTick()
The current simulated tick.
Generated on Wed Sep 30 2020 14:02:12 for gem5 by doxygen 1.8.17