gem5  v20.0.0.2
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
indirect_memory.hh
Go to the documentation of this file.
1 
39 #ifndef __MEM_CACHE_PREFETCH_INDIRECT_MEMORY_HH__
40 #define __MEM_CACHE_PREFETCH_INDIRECT_MEMORY_HH__
41 
42 #include <vector>
43 
44 #include "base/sat_counter.hh"
47 
48 struct IndirectMemoryPrefetcherParams;
49 
50 namespace Prefetcher {
51 
52 class IndirectMemory : public Queued
53 {
55  const unsigned int maxPrefetchDistance;
59  const unsigned int prefetchThreshold;
63  const int streamingDistance;
64 
67  {
68  /* Stream table fields */
69 
73  bool secure;
75  unsigned int streamCounter;
76 
77  /* Indirect table fields */
78 
80  bool enabled;
82  int64_t index;
86  int shift;
96 
97  PrefetchTableEntry(unsigned indirect_counter_bits)
98  : TaggedEntry(), address(0), secure(false), streamCounter(0),
99  enabled(false), index(0), baseAddr(0), shift(0),
100  indirectCounter(indirect_counter_bits),
101  increasedIndirectCounter(false)
102  {}
103 
104  void
105  invalidate() override
106  {
108  address = 0;
109  secure = false;
110  streamCounter = 0;
111  enabled = false;
112  index = 0;
113  baseAddr = 0;
114  shift = 0;
115  indirectCounter.reset();
116  increasedIndirectCounter = false;
117  }
118  };
121 
124  {
126  int64_t idx1;
128  int64_t idx2;
139 
140  IndirectPatternDetectorEntry(unsigned int num_addresses,
141  unsigned int num_shifts)
142  : TaggedEntry(), idx1(0), idx2(0), secondIndexSet(false),
143  numMisses(0),
144  baseAddr(num_addresses, std::vector<Addr>(num_shifts))
145  {
146  }
147 
148  void
149  invalidate() override
150  {
152  idx1 = 0;
153  idx2 = 0;
154  secondIndexSet = false;
155  numMisses = 0;
156  }
157  };
160 
163 
166 
172  void allocateOrUpdateIPDEntry(const PrefetchTableEntry *pt_entry,
173  int64_t index);
179  void trackMissIndex1(Addr miss_addr);
180 
186  void trackMissIndex2(Addr miss_addr);
187 
194 
195  public:
196  IndirectMemory(const IndirectMemoryPrefetcherParams *p);
197  ~IndirectMemory() = default;
198 
199  void calculatePrefetch(const PrefetchInfo &pfi,
200  std::vector<AddrPriority> &addresses) override;
201 };
202 
203 } // namespace Prefetcher
204 
205 #endif//__MEM_CACHE_PREFETCH_INDIRECT_MEMORY_HH__
bool increasedIndirectCounter
This variable is set to indicate that there has been at least one match with the current index value...
void checkAccessMatchOnActiveEntries(Addr addr)
Checks if an access to the cache matches any active PT entry, if so, the indirect confidence counter ...
std::vector< std::vector< Addr > > baseAddr
Potential BaseAddr candidates for each recorded miss.
SatCounter indirectCounter
Confidence counter of the indirect fields.
ip6_addr_t addr
Definition: inet.hh:330
void invalidate() override
Invalidates the entry.
PrefetchTableEntry(unsigned indirect_counter_bits)
const unsigned int maxPrefetchDistance
Maximum number of prefetches generated per event.
Overload hash function for BasicBlockRange type.
Definition: vec_reg.hh:587
AssociativeSet< IndirectPatternDetectorEntry > ipd
Indirect Pattern Detector (IPD) table.
IndirectMemory(const IndirectMemoryPrefetcherParams *p)
Class containing the information needed by the prefetch to train and generate new prefetch requests...
Definition: base.hh:91
const unsigned int prefetchThreshold
Counter threshold to start prefetching.
bool enabled
Enable bit of the indirect fields.
const int streamingDistance
Number of prefetches generated when using the streaming prefetcher.
unsigned int streamCounter
Confidence counter of the stream.
bool secondIndexSet
Valid bit for the second index.
IndirectPatternDetectorEntry * ipdEntryTrackingMisses
Entry currently tracking misses.
Implements an n bit saturating counter and provides methods to increment, decrement, and read it.
Definition: sat_counter.hh:54
void trackMissIndex2(Addr miss_addr)
Update an IPD entry with a detected miss address, when the second index is being tracked.
ByteOrder
Definition: types.hh:245
void reset()
Reset the counter to its initial value.
Definition: sat_counter.hh:228
void invalidate() override
Invalidates the entry.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition: types.hh:140
Associative container based on the previosuly defined Entry type Each element is indexed by a key of ...
Bitfield< 15, 8 > vector
Definition: intmessage.hh:44
void calculatePrefetch(const PrefetchInfo &pfi, std::vector< AddrPriority > &addresses) override
void trackMissIndex1(Addr miss_addr)
Update an IPD entry with a detected miss address, when the first index is being tracked.
const int streamCounterThreshold
streamCounter value to trigger the streaming prefetcher
const std::vector< int > shiftValues
Shift values considered.
int numMisses
Number of misses currently recorded.
const ByteOrder byteOrder
Byte order used to access the cache.
void allocateOrUpdateIPDEntry(const PrefetchTableEntry *pt_entry, int64_t index)
Allocate or update an entry in the IPD.
AssociativeSet< PrefetchTableEntry > prefetchTable
Prefetch table.
Copyright (c) 2018 Metempsy Technology Consulting All rights reserved.
bool secure
Whether this address is in the secure region.
virtual void invalidate()
Invalidates the entry.
Copyright (c) 2018 Metempsy Technology Consulting All rights reserved.
Definition: base.hh:78
Bitfield< 0 > p
IndirectPatternDetectorEntry(unsigned int num_addresses, unsigned int num_shifts)

Generated on Mon Jun 8 2020 15:45:11 for gem5 by doxygen 1.8.13