45 #ifndef __MEM_SNOOP_FILTER_HH__ 46 #define __MEM_SNOOP_FILTER_HH__ 49 #include <unordered_map> 55 #include "params/SnoopFilter.hh" 113 for (
const auto&
p : slave_ports) {
115 if (
p->isSnooping()) {
123 "Snoop filter only supports %d snooping ports, got %d\n",
124 SNOOP_MASK_SIZE,
id);
234 return std::make_pair(slave_ports, latency);
239 return std::make_pair(empty , latency);
273 SnoopFilterCache::iterator
it;
289 : it(end_it), retryItem{0, 0}
343 #endif // __MEM_SNOOP_FILTER_HH__ A MasterPort is a specialisation of a BaseMasterPort, which implements the default protocol for the t...
std::pair< SnoopList, Cycles > snoopAll(Cycles latency) const
Simple factory methods for standard return values.
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
Cycles is a wrapper class for representing cycle counts, i.e.
Stats::Scalar hitMultiSnoops
SnoopMask portToMask(const SlavePort &port) const
Convert a single port to a corresponding, one-hot bitmask.
const PortID InvalidPortID
void finishRequest(bool will_retry, Addr addr, bool is_secure)
For an un-successful request, revert the change to the snoop filter.
PortID getId() const
Get the port id.
const unsigned maxEntryCount
Max capacity in terms of cache blocks tracked, for sanity checking.
A request lookup must be followed by a call to finishRequest to inform the operation's success...
void setSlavePorts(const SnoopList &slave_ports)
Init a new snoop filter and tell it about all the slave ports of the enclosing bus.
SnoopList slavePorts
List of all attached snooping slave ports.
std::bitset< SNOOP_MASK_SIZE > SnoopMask
The underlying type for the bitmask we use for tracking.
std::pair< SnoopList, Cycles > snoopDown(Cycles latency) const
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.
ReqLookupResult(SnoopFilterCache::iterator end_it)
The constructor must be informed of the internal cache's end iterator, so do not allow the compiler t...
This is a simple scalar statistic, like a counter.
std::vector< PortID > localSlavePortIds
Track the mapping from port ids to the local mask ids.
Stats::Scalar hitSingleSnoops
SnoopFilterCache::iterator it
Iterator used to store the result from lookupRequest.
std::pair< SnoopList, Cycles > lookupSnoop(const Packet *cpkt)
Handle an incoming snoop from below (the master port).
SnoopFilter(const SnoopFilterParams *p)
Declaration of the queued port.
struct SnoopFilter::ReqLookupResult reqLookupResult
Stats::Scalar hitSingleRequests
const Cycles lookupLatency
Latency for doing a lookup in the filter.
const unsigned linesize
Cache line size.
LineStatus
Use the lower bits of the address to keep track of the line status.
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
#define fatal_if(cond,...)
Conditional fatal macro that checks the supplied condition and only causes a fatal error if the condi...
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.
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.
std::vector< QueuedSlavePort * > SnoopList
virtual void regStats()
Callback to set stat parameters.
Declaration of the Packet class.
Per cache line item tracking a bitmask of SlavePorts who have an outstanding request to this line (re...
int16_t PortID
Port index/ID type, and a symbolic name for an invalid port id.
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.
std::unordered_map< Addr, SnoopItem > SnoopFilterCache
HashMap of SnoopItems indexed by line address.
Abstract superclass for simulation objects.
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 ...