45 #ifndef __MEM_SNOOP_FILTER_HH__
46 #define __MEM_SNOOP_FILTER_HH__
48 #include <unordered_map>
54 #include "params/SnoopFilter.hh"
108 for (
const auto&
p : slave_ports) {
110 if (
p->isSnooping()) {
118 "Snoop filter only supports %d snooping ports, got %d\n",
233 return std::make_pair(slave_ports, latency);
238 return std::make_pair(empty , latency);
322 #endif // __MEM_SNOOP_FILTER_HH__
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
PortID getId() const
Get the port id.
Cycles is a wrapper class for representing cycle counts, i.e.
Stats::Scalar hitMultiSnoops
SnoopFilterCache::iterator reqLookupResult
Iterator used to store the result from lookupRequest until we call finishRequest. ...
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.
const unsigned maxEntryCount
Max capacity in terms of cache blocks tracked, for sanity checking.
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.
A SlavePort is a specialisation of a port.
block holds data from the secure memory space
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
std::pair< SnoopList, Cycles > lookupSnoop(const Packet *cpkt)
Handle an incoming snoop from below (the master port).
SnoopFilter(const SnoopFilterParams *p)
bool isSnooping() const
Find out if the peer master port is snooping or not.
Declaration of the queued port.
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.
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.
uint64_t SnoopMask
The underlying type for the bitmask we use for tracking.
std::pair< SnoopList, Cycles > snoopDown(Cycles latency) const
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
SnoopList maskToPortList(SnoopMask ports) const
Converts a bitmask of ports into the corresponing list of ports.
virtual void regStats()
Register statistics for this object.
std::pair< SnoopList, Cycles > snoopSelected(const SnoopList &slave_ports, Cycles latency) const
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.
std::pair< SnoopList, Cycles > snoopAll(Cycles latency) const
Simple factory methods for standard return values.
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...
fatal_if(p->js_features.size() > 16,"Too many job slot feature registers specified (%i)\n", p->js_features.size())
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 ...
SnoopItem retryItem
Variable to temporarily store value of snoopfilter entry incase finishRequest needs to undo changes m...