49 #include "debug/SnoopFilter.hh" 72 bool allocate = !cpkt->
req->isUncacheable() && slave_port.
isSnooping() &&
85 if (!is_hit && !allocate)
103 if (interested.count() == 1)
121 "double request :( SF value %x.%x\n",
134 "Need to hold the value!");
136 "%s: not marking request. SF value %x.%x\n",
142 panic_if((sf_item.
holder & req_port).none(),
"requester %x is not a " \
143 "holder :( SF value %x.%x\n", req_port,
148 sf_item.
holder &= ~req_port;
198 "snoop filter exceeded capacity of %d cache blocks\n",
213 if (interested.count() == 1)
227 cpkt->
req->isCacheMaintenance());
274 "SF value %x.%x does not have the line\n",
286 "%s: dropping %x because non-shared snoop " 287 "response SF val: %x.%x\n", __func__, rsp_mask,
293 sf_item.
holder |= req_mask;
341 __func__, slave_port.
name(), cpkt->
print());
367 "SF value %x.%x missing request bit\n",
373 if (cpkt->
req->isCacheMaintenance()) {
377 sf_item.
holder &= ~slave_mask;
383 sf_item.
holder |= slave_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()
A MasterPort is a specialisation of a BaseMasterPort, which implements the default protocol for the t...
void updateSnoopForward(const Packet *cpkt, const SlavePort &rsp_port, const MasterPort &req_port)
Pass snoop responses that travel downward through the snoop filter and let them update the snoop filt...
Stats::Scalar hitMultiRequests
Stats::Scalar hitMultiSnoops
SnoopMask portToMask(const SlavePort &port) const
Convert a single port to a corresponding, one-hot bitmask.
void finishRequest(bool will_retry, Addr addr, bool is_secure)
For an un-successful request, revert the change to the snoop filter.
const unsigned maxEntryCount
Max capacity in terms of cache blocks tracked, for sanity checking.
bool cacheResponding() const
std::bitset< SNOOP_MASK_SIZE > SnoopMask
The underlying type for the bitmask we use for tracking.
virtual void regStats()
Callback to set stat parameters.
std::pair< SnoopList, Cycles > snoopDown(Cycles latency) const
Definition of a snoop filter.
A SlavePort is a specialisation of a port.
block holds data from the secure memory space
SnoopList maskToPortList(SnoopMask ports) const
Converts a bitmask of ports into the corresponing list of ports.
bool isInvalidate() const
Stats::Scalar hitSingleSnoops
SnoopFilterCache::iterator it
Iterator used to store the result from lookupRequest.
bool needsWritable() const
Addr getBlockAddr(unsigned int blk_size) const
std::pair< SnoopList, Cycles > lookupSnoop(const Packet *cpkt)
Handle an incoming snoop from below (the master port).
RequestPtr req
A pointer to the original request.
SnoopFilter(const SnoopFilterParams *p)
bool isBlockCached() const
struct SnoopFilter::ReqLookupResult reqLookupResult
bool needsResponse() const
Stats::Scalar hitSingleRequests
const Cycles lookupLatency
Latency for doing a lookup in the filter.
const unsigned linesize
Cache line size.
Stats::Scalar totRequests
Statistics.
void eraseIfNullEntry(SnoopFilterCache::iterator &sf_it)
Removes snoop filter items which have no requesters and no holders.
std::pair< SnoopList, Cycles > snoopSelected(const SnoopList &slave_ports, Cycles latency) const
bool isSnooping() const
Find out if the peer master port is snooping or not.
static const int SNOOP_MASK_SIZE
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
virtual const std::string name() const
A Packet is used to encapsulate a transfer between two objects in the memory system (e...
void updateResponse(const Packet *cpkt, const SlavePort &slave_port)
Update the snoop filter with a response from below (outer / other cache, or memory) and update the tr...
SnoopFilterCache cachedLocations
Simple hash set of cached addresses.
virtual void regStats()
Callback to set stat parameters.
Derived & name(const std::string &name)
Set the name and marks this stat to print at the end of simulation.
void print(std::ostream &o, int verbosity=0, const std::string &prefix="") const
const std::string name() const
Return port name (for DPRINTF).
Per cache line item tracking a bitmask of SlavePorts who have an outstanding request to this line (re...
Derived & desc(const std::string &_desc)
Set the description and marks this stat to print at the end of simulation.
void updateSnoopResponse(const Packet *cpkt, const SlavePort &rsp_port, const SlavePort &req_port)
Let the snoop filter see any snoop responses that turn into request responses and indicate cache to c...
SnoopItem retryItem
Variable to temporarily store value of snoopfilter entry in case finishRequest needs to undo changes ...
This snoop filter keeps track of which connected port has a particular line of data.
#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 > lookupRequest(const Packet *cpkt, const SlavePort &slave_port)
Lookup a request (from a slave port) in the snoop filter and return a list of other slave ports that ...