49 #include "debug/SnoopFilter.hh"
83 if (!is_hit && !allocate)
129 panic_if(!(sf_item.
holder & req_port),
"Need to hold the value!");
131 "%s: not marking request. SF value %x.%x\n",
138 "holder :( SF value %x.%x\n", req_port,
143 sf_item.
holder &= ~req_port;
192 "snoop filter exceeded capacity of %d cache blocks\n",
266 panic_if(!(sf_item.
holder & rsp_mask),
"SF value %x.%x does not have "\
278 "%s: dropping %x because non-shared snoop "
279 "response SF val: %x.%x\n", __func__, rsp_mask,
285 sf_item.
holder |= req_mask;
334 __func__, slave_port.
name(), cpkt->
print());
363 sf_item.
holder |= slave_mask;
377 .
desc(
"Total number of requests made to the snoop filter.");
380 .
name(
name() +
".hit_single_requests")
381 .
desc(
"Number of requests hitting in the snoop filter with a single "\
382 "holder of the requested data.");
385 .
name(
name() +
".hit_multi_requests")
386 .
desc(
"Number of requests hitting in the snoop filter with multiple "\
387 "(>1) holders of the requested data.");
391 .
desc(
"Total number of snoops made to the snoop filter.");
394 .
name(
name() +
".hit_single_snoops")
395 .
desc(
"Number of snoops hitting in the snoop filter with a single "\
396 "holder of the requested data.");
400 .
desc(
"Number of snoops hitting in the snoop filter with multiple "\
401 "(>1) holders of the requested data.");
405 SnoopFilterParams::create()
A MasterPort is a specialisation of a BaseMasterPort, which implements the default protocol for the t...
bool isUncacheable() const
Accessor functions for flags.
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
bool isBlockCached() const
Stats::Scalar hitMultiSnoops
SnoopFilterCache::iterator reqLookupResult
Iterator used to store the result from lookupRequest until we call finishRequest. ...
void finishRequest(bool will_retry, Addr addr, bool is_secure)
For an un-successful request, revert the change to the snoop filter.
const std::string name() const
Return port name (for DPRINTF).
const unsigned maxEntryCount
Max capacity in terms of cache blocks tracked, for sanity checking.
Addr getBlockAddr(unsigned int blk_size) const
panic_if(!root,"Invalid expression\n")
Definition of a snoop filter.
A SlavePort is a specialisation of a port.
block holds data from the secure memory space
virtual void regStats()
Register statistics for this object.
Stats::Scalar hitSingleSnoops
std::pair< SnoopList, Cycles > lookupSnoop(const Packet *cpkt)
Handle an incoming snoop from below (the master port).
bool isSnooping() const
Find out if the peer master port is snooping or not.
SnoopMask portToMask(const SlavePort &port) const
Convert a single port to a corresponding, one-hot bitmask.
Stats::Scalar hitSingleRequests
const Cycles lookupLatency
Latency for doing a lookup in the filter.
const unsigned linesize
Cache line size.
Stats::Scalar totRequests
Statistics.
const RequestPtr req
A pointer to the original request.
void eraseIfNullEntry(SnoopFilterCache::iterator &sf_it)
Removes snoop filter items which have no requesters and no holders.
bool needsResponse() const
uint64_t SnoopMask
The underlying type for the bitmask we use for tracking.
std::pair< SnoopList, Cycles > snoopDown(Cycles latency) const
bool needsWritable() const
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
bool cacheResponding() const
void print(std::ostream &o, int verbosity=0, const std::string &prefix="") 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.
SnoopList maskToPortList(SnoopMask ports) const
Converts a bitmask of ports into the corresponing list of ports.
virtual void regStats()
Register statistics for this object.
Derived & name(const std::string &name)
Set the name and marks this stat to print at the end of simulation.
std::pair< SnoopList, Cycles > snoopSelected(const SnoopList &slave_ports, Cycles latency) const
virtual const std::string name() const
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...
bool isInvalidate() const
This snoop filter keeps track of which connected port has a particular line of data.
bool isPow2(T v)
Checks if a number is a power of two, or zero.
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 ...
SnoopItem retryItem
Variable to temporarily store value of snoopfilter entry incase finishRequest needs to undo changes m...