gem5  v19.0.0.0
access_map_pattern_matching.hh
Go to the documentation of this file.
1 
40 #ifndef __MEM_CACHE_PREFETCH_ACCESS_MAP_PATTERN_MATCHING_HH__
41 #define __MEM_CACHE_PREFETCH_ACCESS_MAP_PATTERN_MATCHING_HH__
42 
45 #include "mem/packet.hh"
46 #include "sim/clocked_object.hh"
47 
48 struct AccessMapPatternMatchingParams;
49 
51 {
53  const unsigned blkSize;
55  const unsigned limitStride;
57  const unsigned startDegree;
59  const uint64_t hotZoneSize;
61  const double highCoverageThreshold;
63  const double lowCoverageThreshold;
65  const double highAccuracyThreshold;
67  const double lowAccuracyThreshold;
69  const double highCacheHitThreshold;
71  const double lowCacheHitThreshold;
76 
79  {
84  };
85 
87  struct AccessMapEntry : public TaggedEntry
88  {
91 
92  AccessMapEntry(size_t num_entries)
93  : TaggedEntry(), states(num_entries, AM_INIT)
94  {
95  }
96 
97  void
98  invalidate() override
99  {
101  for (auto &entry : states) {
102  entry = AM_INIT;
103  }
104  }
105  };
108 
128  uint64_t numRawCacheHits;
130  unsigned degree;
132  unsigned usefulDegree;
133 
144  Addr current, int stride) const
145  {
146  enum AccessMapState tgt = states[current - stride];
147  enum AccessMapState s = states[current + stride];
148  enum AccessMapState s2 = states[current + 2 * stride];
149  enum AccessMapState s2_p1 = states[current + 2 * stride + 1];
150  return (tgt != AM_INVALID &&
151  ((s == AM_ACCESS && s2 == AM_ACCESS) ||
152  (s == AM_ACCESS && s2_p1 == AM_ACCESS)));
153  }
154 
162  AccessMapEntry *getAccessMapEntry(Addr am_addr, bool is_secure);
163 
171  void setEntryState(AccessMapEntry &entry, Addr block,
172  enum AccessMapState state);
173 
179  void processEpochEvent();
181 
182  public:
183  AccessMapPatternMatching(const AccessMapPatternMatchingParams* p);
185  {}
186  void startup() override;
189 };
190 
191 struct AMPMPrefetcherParams;
192 
194 {
196  public:
197  AMPMPrefetcher(const AMPMPrefetcherParams* p);
199  {}
200  void calculatePrefetch(const PrefetchInfo &pfi,
201  std::vector<AddrPriority> &addresses) override;
202 };
203 #endif//__MEM_CACHE_PREFETCH_ACCESS_MAP_PATTERN_MATCHING_HH__
const Tick offChipMemoryLatency
Off chip memory latency to use for the epoch bandwidth calculation.
const double highAccuracyThreshold
A prefetch accuracy factor bigger than this is considered high.
Cycles is a wrapper class for representing cycle counts, i.e.
Definition: types.hh:83
void processEpochEvent()
This event constitues the epoch of the statistics that keep track of the prefetcher accuracy...
std::vector< AccessMapState > states
vector containing the state of the cachelines in this zone
Bitfield< 21, 20 > stride
AccessMapPatternMatching & ampm
void startup() override
startup() is the final initialization call before simulation.
const double lowCacheHitThreshold
A cache hit ratio smaller than this is considered low.
uint64_t numTotalPrefetches
Number of prefetches issued.
const double highCoverageThreshold
A prefetch coverage factor bigger than this is considered high.
void invalidate() override
Invalidates the entry.
unsigned usefulDegree
Current useful degree.
const double lowCoverageThreshold
A prefetch coverage factor smaller than this is considered low.
AccessMapEntry * getAccessMapEntry(Addr am_addr, bool is_secure)
Obtain an AccessMapEntry from the AccessMapTable, if the entry is not found a new one is initialized ...
uint64_t numGoodPrefetches
Number of good prefetches.
void calculatePrefetch(const BasePrefetcher::PrefetchInfo &pfi, std::vector< QueuedPrefetcher::AddrPriority > &addresses)
uint64_t numRawCacheHits
Number of raw cache hits.
Class containing the information needed by the prefetch to train and generate new prefetch requests...
Definition: base.hh:92
Bitfield< 4 > s
AccessMapState
Data type representing the state of a cacheline in the access map.
uint64_t Tick
Tick count type.
Definition: types.hh:63
The ClockedObject class extends the SimObject with a clock and accessor functions to relate ticks to ...
AssociativeSet< AccessMapEntry > accessMapTable
Access map table.
const unsigned limitStride
Limit the stride checking to -limitStride/+limitStride.
ClockedObject declaration and implementation.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition: types.hh:142
Associative container based on the previosuly defined Entry type Each element is indexed by a key of ...
AccessMapPatternMatching(const AccessMapPatternMatchingParams *p)
Copyright (c) 2018 Metempsy Technology Consulting All rights reserved.
const double highCacheHitThreshold
A cache hit ratio bigger than this is considered high.
Declaration of the Packet class.
const uint64_t hotZoneSize
Amount of memory covered by a hot zone.
Copyright (c) 2018 Metempsy Technology Consulting All rights reserved.
const unsigned blkSize
Cacheline size used by the prefetcher using this object.
virtual void invalidate()
Invalidates the entry.
const double lowAccuracyThreshold
A prefetch accuracy factor smaller than this is considered low.
Bitfield< 0 > p
uint64_t numRawCacheMisses
Number of raw cache misses.
const Cycles epochCycles
Cycles in an epoch period.
void setEntryState(AccessMapEntry &entry, Addr block, enum AccessMapState state)
Updates the state of a block within an AccessMapEntry, also updates the prefetcher metrics...
const unsigned startDegree
Maximum number of prefetch generated.
bool checkCandidate(std::vector< AccessMapState > const &states, Addr current, int stride) const
Given a target cacheline, this function checks if the cachelines that follow the provided stride have...

Generated on Fri Feb 28 2020 16:27:01 for gem5 by doxygen 1.8.13