gem5  v19.0.0.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
indirect_memory.hh
Go to the documentation of this file.
1 
41 #ifndef __MEM_CACHE_PREFETCH_INDIRECT_MEMORY_HH__
42 #define __MEM_CACHE_PREFETCH_INDIRECT_MEMORY_HH__
43 
44 #include <vector>
45 
46 #include "base/sat_counter.hh"
49 
50 struct IndirectMemoryPrefetcherParams;
51 
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  IndirectMemoryPrefetcher(const IndirectMemoryPrefetcherParams *p);
198 
199  void calculatePrefetch(const PrefetchInfo &pfi,
200  std::vector<AddrPriority> &addresses) override;
201 };
202 #endif//__MEM_CACHE_PREFETCH_INDIRECT_MEMORY_HH__
IndirectMemoryPrefetcher(const IndirectMemoryPrefetcherParams *p)
Copyright (c) 2018 Metempsy Technology Consulting All rights reserved.
bool secondIndexSet
Valid bit for the second index.
void invalidate() override
Invalidates the entry.
IndirectPatternDetectorEntry * ipdEntryTrackingMisses
Entry currently tracking misses.
void trackMissIndex1(Addr miss_addr)
Update an IPD entry with a detected miss address, when the first index is being tracked.
void checkAccessMatchOnActiveEntries(Addr addr)
Checks if an access to the cache matches any active PT entry, if so, the indirect confidence counter ...
const int streamingDistance
Number of prefetches generated when using the streaming prefetcher.
ip6_addr_t addr
Definition: inet.hh:335
const unsigned int maxPrefetchDistance
Maximum number of prefetches generated per event.
const ByteOrder byteOrder
Byte order used to access the cache.
bool increasedIndirectCounter
This variable is set to indicate that there has been at least one match with the current index value...
void invalidate() override
Invalidates the entry.
AssociativeSet< IndirectPatternDetectorEntry > ipd
Indirect Pattern Detector (IPD) table.
Overload hash function for BasicBlockRange type.
Definition: vec_reg.hh:586
std::vector< std::vector< Addr > > baseAddr
Potential BaseAddr candidates for each recorded miss.
PrefetchTableEntry(unsigned indirect_counter_bits)
bool secure
Whether this address is in the secure region.
const unsigned int prefetchThreshold
Counter threshold to start prefetching.
Class containing the information needed by the prefetch to train and generate new prefetch requests...
Definition: base.hh:92
unsigned int streamCounter
Confidence counter of the stream.
Implements an n bit saturating counter and provides methods to increment, decrement, and read it.
Definition: sat_counter.hh:57
ByteOrder
Definition: types.hh:247
SatCounter indirectCounter
Confidence counter of the indirect fields.
const int streamCounterThreshold
streamCounter value to trigger the streaming prefetcher
void reset()
Reset the counter to its initial value.
Definition: sat_counter.hh:231
bool enabled
Enable bit of the indirect fields.
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 ...
Bitfield< 15, 8 > vector
Definition: intmessage.hh:46
IndirectPatternDetectorEntry(unsigned int num_addresses, unsigned int num_shifts)
int numMisses
Number of misses currently recorded.
void trackMissIndex2(Addr miss_addr)
Update an IPD entry with a detected miss address, when the second index is being tracked.
Copyright (c) 2018 Metempsy Technology Consulting All rights reserved.
void allocateOrUpdateIPDEntry(const PrefetchTableEntry *pt_entry, int64_t index)
Allocate or update an entry in the IPD.
const std::vector< int > shiftValues
Shift values considered.
virtual void invalidate()
Invalidates the entry.
void calculatePrefetch(const PrefetchInfo &pfi, std::vector< AddrPriority > &addresses) override
Bitfield< 0 > p
AssociativeSet< PrefetchTableEntry > prefetchTable
Prefetch table.

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