gem5  [DEVELOP-FOR-23.0]
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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 
52 namespace prefetch
53 {
54 
56 {
58  const unsigned blkSize;
60  const unsigned limitStride;
62  const unsigned startDegree;
64  const uint64_t hotZoneSize;
66  const double highCoverageThreshold;
68  const double lowCoverageThreshold;
70  const double highAccuracyThreshold;
72  const double lowAccuracyThreshold;
74  const double highCacheHitThreshold;
76  const double lowCacheHitThreshold;
81 
84  {
89  };
90 
92  struct AccessMapEntry : public TaggedEntry
93  {
96 
97  AccessMapEntry(size_t num_entries)
98  : TaggedEntry(), states(num_entries, AM_INIT)
99  {
100  }
101 
102  void
103  invalidate() override
104  {
106  for (auto &entry : states) {
107  entry = AM_INIT;
108  }
109  }
110  };
113 
133  uint64_t numRawCacheHits;
135  unsigned degree;
137  unsigned usefulDegree;
138 
148  inline bool checkCandidate(std::vector<AccessMapState> const &states,
149  Addr current, int stride) const
150  {
151  enum AccessMapState tgt = states[current - stride];
152  enum AccessMapState s = states[current + stride];
153  enum AccessMapState s2 = states[current + 2 * stride];
154  enum AccessMapState s2_p1 = states[current + 2 * stride + 1];
155  return (tgt != AM_INVALID &&
156  ((s == AM_ACCESS && s2 == AM_ACCESS) ||
157  (s == AM_ACCESS && s2_p1 == AM_ACCESS)));
158  }
159 
167  AccessMapEntry *getAccessMapEntry(Addr am_addr, bool is_secure);
168 
176  void setEntryState(AccessMapEntry &entry, Addr block,
177  enum AccessMapState state);
178 
184  void processEpochEvent();
186 
187  public:
188  AccessMapPatternMatching(const AccessMapPatternMatchingParams &p);
189  ~AccessMapPatternMatching() = default;
190 
191  void startup() override;
192  void calculatePrefetch(const Base::PrefetchInfo &pfi,
194 };
195 
196 class AMPM : public Queued
197 {
199  public:
200  AMPM(const AMPMPrefetcherParams &p);
201  ~AMPM() = default;
202 
203  void calculatePrefetch(const PrefetchInfo &pfi,
204  std::vector<AddrPriority> &addresses) override;
205 };
206 
207 } // namespace prefetch
208 } // namespace gem5
209 
210 #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:72
gem5::VegaISA::s
Bitfield< 1 > s
Definition: pagetable.hh:64
gem5::prefetch::AMPM::ampm
AccessMapPatternMatching & ampm
Definition: access_map_pattern_matching.hh:198
gem5::prefetch::AccessMapPatternMatching::hotZoneSize
const uint64_t hotZoneSize
Amount of memory covered by a hot zone.
Definition: access_map_pattern_matching.hh:64
gem5::prefetch::AccessMapPatternMatching::AccessMapEntry
AccessMapEntry data type.
Definition: access_map_pattern_matching.hh:92
gem5::prefetch::AccessMapPatternMatching::accessMapTable
AssociativeSet< AccessMapEntry > accessMapTable
Access map table.
Definition: access_map_pattern_matching.hh:112
gem5::prefetch::AccessMapPatternMatching::lowCoverageThreshold
const double lowCoverageThreshold
A prefetch coverage factor smaller than this is considered low.
Definition: access_map_pattern_matching.hh:68
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:73
gem5::prefetch::AccessMapPatternMatching::AM_INVALID
@ AM_INVALID
Definition: access_map_pattern_matching.hh:88
gem5::prefetch::AccessMapPatternMatching::epochCycles
const Cycles epochCycles
Cycles in an epoch period.
Definition: access_map_pattern_matching.hh:78
gem5::prefetch::AccessMapPatternMatching::AM_ACCESS
@ AM_ACCESS
Definition: access_map_pattern_matching.hh:87
gem5::prefetch::AMPM
Definition: access_map_pattern_matching.hh:196
gem5::prefetch::AccessMapPatternMatching::calculatePrefetch
void calculatePrefetch(const Base::PrefetchInfo &pfi, std::vector< Queued::AddrPriority > &addresses)
Definition: access_map_pattern_matching.cc:158
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:58
gem5::prefetch::AccessMapPatternMatching::AccessMapEntry::invalidate
void invalidate() override
Invalidate the block.
Definition: access_map_pattern_matching.hh:103
gem5::prefetch::AccessMapPatternMatching::startDegree
const unsigned startDegree
Maximum number of prefetch generated.
Definition: access_map_pattern_matching.hh:62
gem5::prefetch::AccessMapPatternMatching::AccessMapPatternMatching
AccessMapPatternMatching(const AccessMapPatternMatchingParams &p)
Definition: access_map_pattern_matching.cc:42
gem5::prefetch::AccessMapPatternMatching::limitStride
const unsigned limitStride
Limit the stride checking to -limitStride/+limitStride.
Definition: access_map_pattern_matching.hh:60
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:95
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:107
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:148
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:135
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:83
gem5::prefetch::AccessMapPatternMatching::highCacheHitThreshold
const double highCacheHitThreshold
A cache hit ratio bigger than this is considered high.
Definition: access_map_pattern_matching.hh:74
gem5::prefetch::AccessMapPatternMatching::usefulDegree
unsigned usefulDegree
Current useful degree.
Definition: access_map_pattern_matching.hh:137
gem5::prefetch::AccessMapPatternMatching::numRawCacheHits
uint64_t numRawCacheHits
Number of raw cache hits.
Definition: access_map_pattern_matching.hh:133
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:118
gem5::prefetch::AccessMapPatternMatching::numRawCacheMisses
uint64_t numRawCacheMisses
Number of raw cache misses.
Definition: access_map_pattern_matching.hh:128
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:97
gem5::prefetch::AccessMapPatternMatching::numTotalPrefetches
uint64_t numTotalPrefetches
Number of prefetches issued.
Definition: access_map_pattern_matching.hh:123
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:85
gem5::prefetch::Queued
Definition: queued.hh:59
gem5::EventFunctionWrapper
Definition: eventq.hh:1136
gem5::prefetch::AMPM::AMPM
AMPM(const AMPMPrefetcherParams &p)
Definition: access_map_pattern_matching.cc:258
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:123
gem5::prefetch::AccessMapPatternMatching::lowCacheHitThreshold
const double lowCacheHitThreshold
A cache hit ratio smaller than this is considered low.
Definition: access_map_pattern_matching.hh:76
clocked_object.hh
gem5::prefetch::AccessMapPatternMatching::AM_PREFETCH
@ AM_PREFETCH
Definition: access_map_pattern_matching.hh:86
gem5::prefetch::AccessMapPatternMatching::offChipMemoryLatency
const Tick offChipMemoryLatency
Off chip memory latency to use for the epoch bandwidth calculation.
Definition: access_map_pattern_matching.hh:80
gem5::prefetch::AccessMapPatternMatching::highAccuracyThreshold
const double highAccuracyThreshold
A prefetch accuracy factor bigger than this is considered high.
Definition: access_map_pattern_matching.hh:70
associative_set.hh
gem5::prefetch::AMPM::calculatePrefetch
void calculatePrefetch(const PrefetchInfo &pfi, std::vector< AddrPriority > &addresses) override
Definition: access_map_pattern_matching.cc:264
gem5::prefetch::AccessMapPatternMatching::epochEvent
EventFunctionWrapper epochEvent
Definition: access_map_pattern_matching.hh:185
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:504
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:96
gem5::prefetch::AccessMapPatternMatching
Definition: access_map_pattern_matching.hh:55
gem5::prefetch::AccessMapPatternMatching::startup
void startup() override
startup() is the final initialization call before simulation.
Definition: access_map_pattern_matching.cc:67
gem5::prefetch::AccessMapPatternMatching::highCoverageThreshold
const double highCoverageThreshold
A prefetch coverage factor bigger than this is considered high.
Definition: access_map_pattern_matching.hh:66

Generated on Sun Jul 30 2023 01:56:57 for gem5 by doxygen 1.8.17