Go to the documentation of this file.
47 #include "debug/SnoopFilter.hh"
74 bool allocate = !cpkt->
req->isUncacheable() && cpu_side_port.
isSnooping()
87 if (!is_hit && !allocate)
105 if (interested.count() == 1)
123 "double request :( SF value %x.%x\n",
136 "Need to hold the value!");
138 "%s: not marking request. SF value %x.%x\n",
144 panic_if((sf_item.
holder & req_port).none(),
"requestor %x is not a " \
145 "holder :( SF value %x.%x\n", req_port,
150 sf_item.
holder &= ~req_port;
200 "snoop filter exceeded capacity of %d cache blocks\n",
215 if (interested.count() == 1)
229 cpkt->
req->isCacheMaintenance());
276 "SF value %x.%x does not have the line\n",
288 "%s: dropping %x because non-shared snoop "
289 "response SF val: %x.%x\n", __func__, rsp_mask,
295 sf_item.
holder |= req_mask;
344 __func__, cpu_side_port.
name(), cpkt->
print());
350 if (cpkt->
req->isUncacheable() || !cpu_side_port.
isSnooping())
370 "SF value %x.%x missing request bit\n",
376 if (cpkt->
req->isCacheMaintenance()) {
380 sf_item.
holder &= ~response_mask;
386 sf_item.
holder |= response_mask;
394 : statistics::
Group(parent),
395 ADD_STAT(totRequests, statistics::units::Count::get(),
396 "Total number of requests made to the snoop filter."),
397 ADD_STAT(hitSingleRequests, statistics::units::Count::get(),
398 "Number of requests hitting in the snoop filter with a single "
399 "holder of the requested data."),
400 ADD_STAT(hitMultiRequests, statistics::units::Count::get(),
401 "Number of requests hitting in the snoop filter with multiple "
402 "(>1) holders of the requested data."),
403 ADD_STAT(totSnoops, statistics::units::Count::get(),
404 "Total number of snoops made to the snoop filter."),
405 ADD_STAT(hitSingleSnoops, statistics::units::Count::get(),
406 "Number of snoops hitting in the snoop filter with a single "
407 "holder of the requested data."),
408 ADD_STAT(hitMultiSnoops, statistics::units::Count::get(),
409 "Number of snoops hitting in the snoop filter with multiple "
410 "(>1) holders of the requested data.")
Addr getBlockAddr(unsigned int blk_size) const
const unsigned linesize
Cache line size.
struct gem5::SnoopFilter::ReqLookupResult reqLookupResult
const std::string name() const
Return port name (for DPRINTF).
SnoopFilterStats(statistics::Group *parent)
void finishRequest(bool will_retry, Addr addr, bool is_secure)
For an un-successful request, revert the change to the snoop filter.
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...
This snoop filter keeps track of which connected port has a particular line of data.
RequestPtr req
A pointer to the original request.
SnoopList maskToPortList(SnoopMask ports) const
Converts a bitmask of ports into the corresponing list of ports.
bool cacheResponding() const
std::pair< SnoopList, Cycles > lookupSnoop(const Packet *cpkt)
Handle an incoming snoop from below (the memory-side port).
const Cycles lookupLatency
Latency for doing a lookup in the filter.
virtual void regStats()
Callback to set stat parameters.
SnoopFilterCache::iterator it
Iterator used to store the result from lookupRequest.
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...
void eraseIfNullEntry(SnoopFilterCache::iterator &sf_it)
Removes snoop filter items which have no requestors and no holders.
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...
A RequestPort is a specialisation of a Port, which implements the default protocol for the three diff...
statistics::Scalar totSnoops
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...
bool needsWritable() const
static const int SNOOP_MASK_SIZE
void print(std::ostream &o, int verbosity=0, const std::string &prefix="") const
#define ADD_STAT(n,...)
Convenience macro to add a stat to a statistics group.
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
bool isSnooping() const
Find out if the peer request port is snooping or not.
std::pair< SnoopList, Cycles > snoopDown(Cycles latency) const
@ LineSecure
block holds data from the secure memory space
SnoopFilterCache cachedLocations
Simple hash set of cached addresses.
const unsigned maxEntryCount
Max capacity in terms of cache blocks tracked, for sanity checking.
bool needsResponse() const
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
virtual void regStats()
Callback to set stat parameters.
statistics::Scalar hitSingleRequests
Per cache line item tracking a bitmask of ResponsePorts who have an outstanding request to this line ...
A ResponsePort is a specialization of a port.
#define panic_if(cond,...)
Conditional panic macro that checks the supplied condition and only panics if the condition is true a...
std::pair< SnoopList, Cycles > snoopSelected(const SnoopList &_cpu_side_ports, Cycles latency) const
std::bitset< SNOOP_MASK_SIZE > SnoopMask
The underlying type for the bitmask we use for tracking.
SnoopMask portToMask(const ResponsePort &port) const
Convert a single port to a corresponding, one-hot bitmask.
gem5::SnoopFilter::SnoopFilterStats stats
SnoopItem retryItem
Variable to temporarily store value of snoopfilter entry in case finishRequest needs to undo changes ...
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
statistics::Scalar totRequests
statistics::Scalar hitMultiRequests
bool isBlockCached() const
statistics::Scalar hitMultiSnoops
bool isInvalidate() const
statistics::Scalar hitSingleSnoops
Generated on Wed May 4 2022 12:14:02 for gem5 by doxygen 1.8.17