Go to the documentation of this file.
47 #include "debug/SnoopFilter.hh"
71 bool allocate = !cpkt->
req->isUncacheable() && cpu_side_port.
isSnooping()
84 if (!is_hit && !allocate)
102 if (interested.count() == 1)
120 "double request :( SF value %x.%x\n",
133 "Need to hold the value!");
135 "%s: not marking request. SF value %x.%x\n",
141 panic_if((sf_item.
holder & req_port).none(),
"requestor %x is not a " \
142 "holder :( SF value %x.%x\n", req_port,
147 sf_item.
holder &= ~req_port;
197 "snoop filter exceeded capacity of %d cache blocks\n",
212 if (interested.count() == 1)
226 cpkt->
req->isCacheMaintenance());
273 "SF value %x.%x does not have the line\n",
285 "%s: dropping %x because non-shared snoop "
286 "response SF val: %x.%x\n", __func__, rsp_mask,
292 sf_item.
holder |= req_mask;
341 __func__, cpu_side_port.
name(), cpkt->
print());
347 if (cpkt->
req->isUncacheable() || !cpu_side_port.
isSnooping())
367 "SF value %x.%x missing request bit\n",
373 if (cpkt->
req->isCacheMaintenance()) {
377 sf_item.
holder &= ~response_mask;
383 sf_item.
holder |= response_mask;
391 :
Stats::Group(parent),
393 "Total number of requests made to the snoop filter."),
395 "Number of requests hitting in the snoop filter with a single "
396 "holder of the requested data."),
398 "Number of requests hitting in the snoop filter with multiple "
399 "(>1) holders of the requested data."),
401 "Total number of snoops made to the snoop filter."),
403 "Number of snoops hitting in the snoop filter with a single "
404 "holder of the requested data."),
406 "Number of snoops hitting in the snoop filter with multiple "
407 "(>1) holders of the requested data.")
void updateSnoopForward(const Packet *cpkt, const ResponsePort &rsp_port, const RequestPort &req_port)
Pass snoop responses that travel downward through the snoop filter and let them update the snoop filt...
virtual void regStats()
Callback to set stat parameters.
A ResponsePort is a specialization of a port.
Stats::Scalar hitSingleRequests
bool cacheResponding() const
std::bitset< SNOOP_MASK_SIZE > SnoopMask
The underlying type for the bitmask we use for tracking.
SnoopItem retryItem
Variable to temporarily store value of snoopfilter entry in case finishRequest needs to undo changes ...
Stats::Scalar hitMultiRequests
std::pair< SnoopList, Cycles > snoopDown(Cycles latency) const
Stats::Scalar hitMultiSnoops
SnoopFilter::SnoopFilterStats stats
Per cache line item tracking a bitmask of ResponsePorts who have an outstanding request to this line ...
bool needsWritable() const
bool isInvalidate() const
void finishRequest(bool will_retry, Addr addr, bool is_secure)
For an un-successful request, revert the change to the snoop filter.
RequestPtr req
A pointer to the original request.
const unsigned maxEntryCount
Max capacity in terms of cache blocks tracked, for sanity checking.
std::pair< SnoopList, Cycles > lookupSnoop(const Packet *cpkt)
Handle an incoming snoop from below (the memory-side port).
void print(std::ostream &o, int verbosity=0, const std::string &prefix="") const
const unsigned linesize
Cache line size.
SnoopList maskToPortList(SnoopMask ports) const
Converts a bitmask of ports into the corresponing list of ports.
SnoopFilterCache::iterator it
Iterator used to store the result from lookupRequest.
void eraseIfNullEntry(SnoopFilterCache::iterator &sf_it)
Removes snoop filter items which have no requestors and no holders.
#define ADD_STAT(n,...)
Convenience macro to add a stat to a statistics group.
Addr getBlockAddr(unsigned int blk_size) const
static const int SNOOP_MASK_SIZE
bool needsResponse() const
bool isSnooping() const
Find out if the peer request port is snooping or not.
const Cycles lookupLatency
Latency for doing a lookup in the filter.
A RequestPort is a specialisation of a Port, which implements the default protocol for the three diff...
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
const std::string name() const
Return port name (for DPRINTF).
SnoopFilterStats(Stats::Group *parent)
Stats::Scalar totRequests
@ LineSecure
block holds data from the secure memory space
This snoop filter keeps track of which connected port has a particular line of data.
std::pair< SnoopList, Cycles > lookupRequest(const Packet *cpkt, const ResponsePort &cpu_side_port)
Lookup a request (from a CPU-side port) in the snoop filter and return a list of other CPU-side ports...
#define panic_if(cond,...)
Conditional panic macro that checks the supplied condition and only panics if the condition is true a...
SnoopFilterCache cachedLocations
Simple hash set of cached addresses.
void updateSnoopResponse(const Packet *cpkt, const ResponsePort &rsp_port, const ResponsePort &req_port)
Let the snoop filter see any snoop responses that turn into request responses and indicate cache to c...
SnoopMask portToMask(const ResponsePort &port) const
Convert a single port to a corresponding, one-hot bitmask.
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
virtual void regStats()
Callback to set stat parameters.
struct SnoopFilter::ReqLookupResult reqLookupResult
void updateResponse(const Packet *cpkt, const ResponsePort &cpu_side_port)
Update the snoop filter with a response from below (outer / other cache, or memory) and update the tr...
bool isBlockCached() const
Stats::Scalar hitSingleSnoops
std::pair< SnoopList, Cycles > snoopSelected(const SnoopList &_cpu_side_ports, Cycles latency) const
Generated on Tue Mar 23 2021 19:41:28 for gem5 by doxygen 1.8.17