gem5  v22.1.0.0
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 namespace gem5
49 {
50 
51 struct IndirectMemoryPrefetcherParams;
52 
54 namespace prefetch
55 {
56 
57 class IndirectMemory : public Queued
58 {
60  const unsigned int maxPrefetchDistance;
64  const unsigned int prefetchThreshold;
68  const int streamingDistance;
69 
72  {
73  /* Stream table fields */
74 
78  bool secure;
80  unsigned int streamCounter;
81 
82  /* Indirect table fields */
83 
85  bool enabled;
87  int64_t index;
91  int shift;
101 
102  PrefetchTableEntry(unsigned indirect_counter_bits)
103  : TaggedEntry(), address(0), secure(false), streamCounter(0),
104  enabled(false), index(0), baseAddr(0), shift(0),
105  indirectCounter(indirect_counter_bits),
107  {}
108 
109  void
110  invalidate() override
111  {
113  address = 0;
114  secure = false;
115  streamCounter = 0;
116  enabled = false;
117  index = 0;
118  baseAddr = 0;
119  shift = 0;
121  increasedIndirectCounter = false;
122  }
123  };
126 
129  {
131  int64_t idx1;
133  int64_t idx2;
144 
145  IndirectPatternDetectorEntry(unsigned int num_addresses,
146  unsigned int num_shifts)
147  : TaggedEntry(), idx1(0), idx2(0), secondIndexSet(false),
148  numMisses(0),
149  baseAddr(num_addresses, std::vector<Addr>(num_shifts))
150  {
151  }
152 
153  void
154  invalidate() override
155  {
157  idx1 = 0;
158  idx2 = 0;
159  secondIndexSet = false;
160  numMisses = 0;
161  }
162  };
165 
168 
170  const ByteOrder byteOrder;
171 
177  void allocateOrUpdateIPDEntry(const PrefetchTableEntry *pt_entry,
178  int64_t index);
184  void trackMissIndex1(Addr miss_addr);
185 
191  void trackMissIndex2(Addr miss_addr);
192 
199 
200  public:
201  IndirectMemory(const IndirectMemoryPrefetcherParams &p);
202  ~IndirectMemory() = 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_INDIRECT_MEMORY_HH__
Associative container based on the previosuly defined Entry type Each element is indexed by a key of ...
A tagged entry is an entry containing a tag.
Definition: tagged_entry.hh:47
virtual void invalidate()
Invalidate the block.
Class containing the information needed by the prefetch to train and generate new prefetch requests.
Definition: base.hh:98
const int streamCounterThreshold
streamCounter value to trigger the streaming prefetcher
void trackMissIndex1(Addr miss_addr)
Update an IPD entry with a detected miss address, when the first index is being tracked.
AssociativeSet< PrefetchTableEntry > prefetchTable
Prefetch table.
void trackMissIndex2(Addr miss_addr)
Update an IPD entry with a detected miss address, when the second index is being tracked.
const ByteOrder byteOrder
Byte order used to access the cache.
void checkAccessMatchOnActiveEntries(Addr addr)
Checks if an access to the cache matches any active PT entry, if so, the indirect confidence counter ...
const unsigned int maxPrefetchDistance
Maximum number of prefetches generated per event.
const std::vector< int > shiftValues
Shift values considered.
void calculatePrefetch(const PrefetchInfo &pfi, std::vector< AddrPriority > &addresses) override
AssociativeSet< IndirectPatternDetectorEntry > ipd
Indirect Pattern Detector (IPD) table.
IndirectPatternDetectorEntry * ipdEntryTrackingMisses
Entry currently tracking misses.
const int streamingDistance
Number of prefetches generated when using the streaming prefetcher.
const unsigned int prefetchThreshold
Counter threshold to start prefetching.
IndirectMemory(const IndirectMemoryPrefetcherParams &p)
void allocateOrUpdateIPDEntry(const PrefetchTableEntry *pt_entry, int64_t index)
Allocate or update an entry in the IPD.
void reset()
Reset the counter to its initial value.
Definition: sat_counter.hh:292
Bitfield< 30, 0 > index
Bitfield< 54 > p
Definition: pagetable.hh:70
Bitfield< 3 > addr
Definition: types.hh:84
Bitfield< 15, 8 > vector
Definition: intmessage.hh:48
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition: types.hh:147
GEM5_DEPRECATED_NAMESPACE(GuestABI, guest_abi)
Overload hash function for BasicBlockRange type.
Definition: misc.hh:2826
std::vector< std::vector< Addr > > baseAddr
Potential BaseAddr candidates for each recorded miss.
IndirectPatternDetectorEntry(unsigned int num_addresses, unsigned int num_shifts)
void invalidate() override
Invalidate the block.
bool increasedIndirectCounter
This variable is set to indicate that there has been at least one match with the current index value.
bool enabled
Enable bit of the indirect fields.
PrefetchTableEntry(unsigned indirect_counter_bits)
bool secure
Whether this address is in the secure region.
SatCounter8 indirectCounter
Confidence counter of the indirect fields.
unsigned int streamCounter
Confidence counter of the stream.

Generated on Wed Dec 21 2022 10:22:36 for gem5 by doxygen 1.9.1