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