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;
397 .
desc(
"Total number of requests made to the snoop filter.");
400 .
name(
name() +
".hit_single_requests")
401 .
desc(
"Number of requests hitting in the snoop filter with a single "\
402 "holder of the requested data.");
405 .
name(
name() +
".hit_multi_requests")
406 .
desc(
"Number of requests hitting in the snoop filter with multiple "\
407 "(>1) holders of the requested data.");
411 .
desc(
"Total number of snoops made to the snoop filter.");
414 .
name(
name() +
".hit_single_snoops")
415 .
desc(
"Number of snoops hitting in the snoop filter with a single "\
416 "holder of the requested data.");
420 .
desc(
"Number of snoops hitting in the snoop filter with multiple "\
421 "(>1) holders of the requested data.");
425 SnoopFilterParams::create()
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.
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 ...
std::pair< SnoopList, Cycles > snoopDown(Cycles latency) const
Stats::Scalar hitMultiSnoops
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
Stats::Scalar hitSingleRequests
const unsigned linesize
Cache line size.
SnoopList maskToPortList(SnoopMask ports) const
Converts a bitmask of ports into the corresponing list of ports.
Stats::Scalar totRequests
Statistics.
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.
Stats::Scalar hitSingleSnoops
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).
Derived & name(const std::string &name)
Set the name and marks this stat to print at the end of simulation.
@ LineSecure
block holds data from the secure memory space
virtual const std::string name() const
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
Derived & desc(const std::string &_desc)
Set the description and marks this stat to print at the end of simulation.
Stats::Scalar hitMultiRequests
std::pair< SnoopList, Cycles > snoopSelected(const SnoopList &_cpu_side_ports, Cycles latency) const
Generated on Wed Sep 30 2020 14:02:14 for gem5 by doxygen 1.8.17