Go to the documentation of this file.
43 #ifndef __MEM_SNOOP_FILTER_HH__
44 #define __MEM_SNOOP_FILTER_HH__
47 #include <unordered_map>
53 #include "params/SnoopFilter.hh"
111 for (
const auto&
p : _cpu_side_ports) {
113 if (
p->isSnooping()) {
121 "Snoop filter only supports %d snooping ports, got %d\n",
230 _cpu_side_ports,
Cycles latency)
const
232 return std::make_pair(_cpu_side_ports, latency);
237 return std::make_pair(empty , latency);
271 SnoopFilterCache::iterator
it;
341 #endif // __MEM_SNOOP_FILTER_HH__
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...
A ResponsePort is a specialization of a port.
void setCPUSidePorts(const SnoopList &_cpu_side_ports)
Init a new snoop filter and tell it about all the cpu_sideports of the enclosing bus.
std::bitset< SNOOP_MASK_SIZE > SnoopMask
The underlying type for the bitmask we use for tracking.
const PortID InvalidPortID
SnoopItem retryItem
Variable to temporarily store value of snoopfilter entry in case finishRequest needs to undo changes ...
std::pair< SnoopList, Cycles > snoopDown(Cycles latency) const
std::vector< QueuedResponsePort * > SnoopList
Stats::Scalar hitMultiSnoops
Per cache line item tracking a bitmask of ResponsePorts who have an outstanding request to this line ...
int16_t PortID
Port index/ID type, and a symbolic name for an invalid port id.
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.
std::pair< SnoopList, Cycles > lookupSnoop(const Packet *cpkt)
Handle an incoming snoop from below (the memory-side port).
SnoopFilter(const SnoopFilterParams *p)
Stats::Scalar hitSingleRequests
This is a simple scalar statistic, like a counter.
const unsigned linesize
Cache line size.
SnoopList maskToPortList(SnoopMask ports) const
Converts a bitmask of ports into the corresponing list of ports.
Stats::Scalar totRequests
Statistics.
SnoopFilterCache::iterator it
Iterator used to store the result from lookupRequest.
void eraseIfNullEntry(SnoopFilterCache::iterator &sf_it)
Removes snoop filter items which have no requestors and no holders.
Stats::Scalar hitSingleSnoops
static const int SNOOP_MASK_SIZE
A request lookup must be followed by a call to finishRequest to inform the operation's success.
bool isSnooping() const
Find out if the peer request port is snooping or not.
const Cycles lookupLatency
Latency for doing a lookup in the filter.
A RequestPort is a specialisation of a Port, which implements the default protocol for the three diff...
LineStatus
Use the lower bits of the address to keep track of the line status.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
@ LineSecure
block holds data from the secure memory space
This snoop filter keeps track of which connected port has a particular line of data.
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...
SnoopList cpuSidePorts
List of all attached snooping CPU-side ports.
SnoopFilterCache cachedLocations
Simple hash set of cached addresses.
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...
SnoopMask portToMask(const ResponsePort &port) const
Convert a single port to a corresponding, one-hot bitmask.
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
virtual void regStats()
Callback to set stat parameters.
struct SnoopFilter::ReqLookupResult reqLookupResult
Cycles is a wrapper class for representing cycle counts, i.e.
std::unordered_map< Addr, SnoopItem > SnoopFilterCache
HashMap of SnoopItems indexed by line address.
std::vector< PortID > localResponsePortIds
Track the mapping from port ids to the local mask ids.
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...
PortID getId() const
Get the port id.
#define fatal_if(cond,...)
Conditional fatal macro that checks the supplied condition and only causes a fatal error if the condi...
std::pair< SnoopList, Cycles > snoopAll(Cycles latency) const
Simple factory methods for standard return values.
ReqLookupResult(SnoopFilterCache::iterator end_it)
The constructor must be informed of the internal cache's end iterator, so do not allow the compiler t...
Stats::Scalar hitMultiRequests
std::pair< SnoopList, Cycles > snoopSelected(const SnoopList &_cpu_side_ports, Cycles latency) const
Abstract superclass for simulation objects.
Generated on Wed Sep 30 2020 14:02:14 for gem5 by doxygen 1.8.17