gem5  v22.0.0.2
access_map_pattern_matching.hh
Go to the documentation of this file.
1 
38 #ifndef __MEM_CACHE_PREFETCH_ACCESS_MAP_PATTERN_MATCHING_HH__
39 #define __MEM_CACHE_PREFETCH_ACCESS_MAP_PATTERN_MATCHING_HH__
40 
43 #include "mem/packet.hh"
44 #include "sim/clocked_object.hh"
45 
46 namespace gem5
47 {
48 
49 struct AccessMapPatternMatchingParams;
50 struct AMPMPrefetcherParams;
51 
53 namespace prefetch
54 {
55 
57 {
59  const unsigned blkSize;
61  const unsigned limitStride;
63  const unsigned startDegree;
65  const uint64_t hotZoneSize;
67  const double highCoverageThreshold;
69  const double lowCoverageThreshold;
71  const double highAccuracyThreshold;
73  const double lowAccuracyThreshold;
75  const double highCacheHitThreshold;
77  const double lowCacheHitThreshold;
82 
85  {
90  };
91 
93  struct AccessMapEntry : public TaggedEntry
94  {
97 
98  AccessMapEntry(size_t num_entries)
99  : TaggedEntry(), states(num_entries, AM_INIT)
100  {
101  }
102 
103  void
104  invalidate() override
105  {
107  for (auto &entry : states) {
108  entry = AM_INIT;
109  }
110  }
111  };
114 
134  uint64_t numRawCacheHits;
136  unsigned degree;
138  unsigned usefulDegree;
139 
149  inline bool checkCandidate(std::vector<AccessMapState> const &states,
150  Addr current, int stride) const
151  {
152  enum AccessMapState tgt = states[current - stride];
153  enum AccessMapState s = states[current + stride];
154  enum AccessMapState s2 = states[current + 2 * stride];
155  enum AccessMapState s2_p1 = states[current + 2 * stride + 1];
156  return (tgt != AM_INVALID &&
157  ((s == AM_ACCESS && s2 == AM_ACCESS) ||
158  (s == AM_ACCESS && s2_p1 == AM_ACCESS)));
159  }
160 
168  AccessMapEntry *getAccessMapEntry(Addr am_addr, bool is_secure);
169 
177  void setEntryState(AccessMapEntry &entry, Addr block,
178  enum AccessMapState state);
179 
185  void processEpochEvent();
187 
188  public:
189  AccessMapPatternMatching(const AccessMapPatternMatchingParams &p);
190  ~AccessMapPatternMatching() = default;
191 
192  void startup() override;
193  void calculatePrefetch(const Base::PrefetchInfo &pfi,
195 };
196 
197 class AMPM : public Queued
198 {
200  public:
201  AMPM(const AMPMPrefetcherParams &p);
202  ~AMPM() = default;
203 
204  void calculatePrefetch(const PrefetchInfo &pfi,
205  std::vector<AddrPriority> &addresses) override;
206 };
207 
208 } // namespace prefetch
209 } // namespace gem5
210 
211 #endif//__MEM_CACHE_PREFETCH_ACCESS_MAP_PATTERN_MATCHING_HH__
gem5::prefetch::AccessMapPatternMatching::lowAccuracyThreshold
const double lowAccuracyThreshold
A prefetch accuracy factor smaller than this is considered low.
Definition: access_map_pattern_matching.hh:73
gem5::VegaISA::s
Bitfield< 1 > s
Definition: pagetable.hh:64
gem5::prefetch::AMPM::ampm
AccessMapPatternMatching & ampm
Definition: access_map_pattern_matching.hh:199
gem5::prefetch::AccessMapPatternMatching::hotZoneSize
const uint64_t hotZoneSize
Amount of memory covered by a hot zone.
Definition: access_map_pattern_matching.hh:65
gem5::prefetch::AccessMapPatternMatching::AccessMapEntry
AccessMapEntry data type.
Definition: access_map_pattern_matching.hh:93
gem5::prefetch::AccessMapPatternMatching::accessMapTable
AssociativeSet< AccessMapEntry > accessMapTable
Access map table.
Definition: access_map_pattern_matching.hh:113
gem5::prefetch::AccessMapPatternMatching::lowCoverageThreshold
const double lowCoverageThreshold
A prefetch coverage factor smaller than this is considered low.
Definition: access_map_pattern_matching.hh:69
gem5::prefetch::AccessMapPatternMatching::processEpochEvent
void processEpochEvent()
This event constitues the epoch of the statistics that keep track of the prefetcher accuracy,...
Definition: access_map_pattern_matching.cc:74
gem5::prefetch::AccessMapPatternMatching::AM_INVALID
@ AM_INVALID
Definition: access_map_pattern_matching.hh:89
gem5::prefetch::AccessMapPatternMatching::epochCycles
const Cycles epochCycles
Cycles in an epoch period.
Definition: access_map_pattern_matching.hh:79
gem5::prefetch::AccessMapPatternMatching::AM_ACCESS
@ AM_ACCESS
Definition: access_map_pattern_matching.hh:88
gem5::prefetch::AMPM
Definition: access_map_pattern_matching.hh:197
gem5::prefetch::AccessMapPatternMatching::calculatePrefetch
void calculatePrefetch(const Base::PrefetchInfo &pfi, std::vector< Queued::AddrPriority > &addresses)
Definition: access_map_pattern_matching.cc:159
std::vector< AccessMapState >
gem5::prefetch::AccessMapPatternMatching::blkSize
const unsigned blkSize
Cacheline size used by the prefetcher using this object.
Definition: access_map_pattern_matching.hh:59
gem5::prefetch::AccessMapPatternMatching::AccessMapEntry::invalidate
void invalidate() override
Invalidate the block.
Definition: access_map_pattern_matching.hh:104
gem5::prefetch::AccessMapPatternMatching::startDegree
const unsigned startDegree
Maximum number of prefetch generated.
Definition: access_map_pattern_matching.hh:63
gem5::prefetch::AccessMapPatternMatching::AccessMapPatternMatching
AccessMapPatternMatching(const AccessMapPatternMatchingParams &p)
Definition: access_map_pattern_matching.cc:43
gem5::prefetch::AccessMapPatternMatching::limitStride
const unsigned limitStride
Limit the stride checking to -limitStride/+limitStride.
Definition: access_map_pattern_matching.hh:61
queued.hh
packet.hh
gem5::Cycles
Cycles is a wrapper class for representing cycle counts, i.e.
Definition: types.hh:78
gem5::prefetch::AccessMapPatternMatching::AccessMapEntry::states
std::vector< AccessMapState > states
vector containing the state of the cachelines in this zone
Definition: access_map_pattern_matching.hh:96
gem5::prefetch::AccessMapPatternMatching::getAccessMapEntry
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 ...
Definition: access_map_pattern_matching.cc:108
gem5::prefetch::AccessMapPatternMatching::checkCandidate
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...
Definition: access_map_pattern_matching.hh:149
gem5::TaggedEntry
A tagged entry is an entry containing a tag.
Definition: tagged_entry.hh:46
gem5::VegaISA::p
Bitfield< 54 > p
Definition: pagetable.hh:70
gem5::AssociativeSet
Associative container based on the previosuly defined Entry type Each element is indexed by a key of ...
Definition: associative_set.hh:45
gem5::prefetch::AccessMapPatternMatching::degree
unsigned degree
Current degree.
Definition: access_map_pattern_matching.hh:136
gem5::Tick
uint64_t Tick
Tick count type.
Definition: types.hh:58
gem5::prefetch::AccessMapPatternMatching::AccessMapState
AccessMapState
Data type representing the state of a cacheline in the access map.
Definition: access_map_pattern_matching.hh:84
gem5::prefetch::AccessMapPatternMatching::highCacheHitThreshold
const double highCacheHitThreshold
A cache hit ratio bigger than this is considered high.
Definition: access_map_pattern_matching.hh:75
gem5::prefetch::AccessMapPatternMatching::usefulDegree
unsigned usefulDegree
Current useful degree.
Definition: access_map_pattern_matching.hh:138
gem5::prefetch::AccessMapPatternMatching::numRawCacheHits
uint64_t numRawCacheHits
Number of raw cache hits.
Definition: access_map_pattern_matching.hh:134
gem5::prefetch::AMPM::~AMPM
~AMPM()=default
gem5::TaggedEntry::invalidate
virtual void invalidate()
Invalidate the block.
Definition: tagged_entry.hh:103
gem5::prefetch::AccessMapPatternMatching::numGoodPrefetches
uint64_t numGoodPrefetches
Number of good prefetches.
Definition: access_map_pattern_matching.hh:119
gem5::prefetch::AccessMapPatternMatching::numRawCacheMisses
uint64_t numRawCacheMisses
Number of raw cache misses.
Definition: access_map_pattern_matching.hh:129
gem5::Addr
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition: types.hh:147
gem5::prefetch::AccessMapPatternMatching::AccessMapEntry::AccessMapEntry
AccessMapEntry(size_t num_entries)
Definition: access_map_pattern_matching.hh:98
gem5::prefetch::AccessMapPatternMatching::numTotalPrefetches
uint64_t numTotalPrefetches
Number of prefetches issued.
Definition: access_map_pattern_matching.hh:124
gem5::GEM5_DEPRECATED_NAMESPACE
GEM5_DEPRECATED_NAMESPACE(GuestABI, guest_abi)
gem5::ClockedObject
The ClockedObject class extends the SimObject with a clock and accessor functions to relate ticks to ...
Definition: clocked_object.hh:234
gem5::prefetch::AccessMapPatternMatching::AM_INIT
@ AM_INIT
Definition: access_map_pattern_matching.hh:86
gem5::prefetch::Queued
Definition: queued.hh:60
gem5::EventFunctionWrapper
Definition: eventq.hh:1115
gem5::prefetch::AMPM::AMPM
AMPM(const AMPMPrefetcherParams &p)
Definition: access_map_pattern_matching.cc:259
state
atomic_var_t state
Definition: helpers.cc:188
gem5::prefetch::AccessMapPatternMatching::setEntryState
void setEntryState(AccessMapEntry &entry, Addr block, enum AccessMapState state)
Updates the state of a block within an AccessMapEntry, also updates the prefetcher metrics.
Definition: access_map_pattern_matching.cc:124
gem5::prefetch::AccessMapPatternMatching::lowCacheHitThreshold
const double lowCacheHitThreshold
A cache hit ratio smaller than this is considered low.
Definition: access_map_pattern_matching.hh:77
clocked_object.hh
gem5::prefetch::AccessMapPatternMatching::AM_PREFETCH
@ AM_PREFETCH
Definition: access_map_pattern_matching.hh:87
gem5::prefetch::AccessMapPatternMatching::offChipMemoryLatency
const Tick offChipMemoryLatency
Off chip memory latency to use for the epoch bandwidth calculation.
Definition: access_map_pattern_matching.hh:81
gem5::prefetch::AccessMapPatternMatching::highAccuracyThreshold
const double highAccuracyThreshold
A prefetch accuracy factor bigger than this is considered high.
Definition: access_map_pattern_matching.hh:71
associative_set.hh
gem5::prefetch::AMPM::calculatePrefetch
void calculatePrefetch(const PrefetchInfo &pfi, std::vector< AddrPriority > &addresses) override
Definition: access_map_pattern_matching.cc:265
gem5::context_switch_task_id::Prefetcher
@ Prefetcher
Definition: request.hh:83
gem5::prefetch::AccessMapPatternMatching::epochEvent
EventFunctionWrapper epochEvent
Definition: access_map_pattern_matching.hh:186
gem5
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
Definition: gpu_translation_state.hh:37
gem5::ArmISA::stride
Bitfield< 21, 20 > stride
Definition: misc_types.hh:447
gem5::prefetch::AccessMapPatternMatching::~AccessMapPatternMatching
~AccessMapPatternMatching()=default
gem5::prefetch::Base::PrefetchInfo
Class containing the information needed by the prefetch to train and generate new prefetch requests.
Definition: base.hh:97
gem5::prefetch::AccessMapPatternMatching
Definition: access_map_pattern_matching.hh:56
gem5::prefetch::AccessMapPatternMatching::startup
void startup() override
startup() is the final initialization call before simulation.
Definition: access_map_pattern_matching.cc:68
gem5::prefetch::AccessMapPatternMatching::highCoverageThreshold
const double highCoverageThreshold
A prefetch coverage factor bigger than this is considered high.
Definition: access_map_pattern_matching.hh:67

Generated on Thu Jul 28 2022 13:32:33 for gem5 by doxygen 1.8.17