gem5  v20.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 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),
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;
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 
165  const ByteOrder byteOrder;
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__
Prefetcher::IndirectMemory::ipd
AssociativeSet< IndirectPatternDetectorEntry > ipd
Indirect Pattern Detector (IPD) table.
Definition: indirect_memory.hh:159
SatCounter::reset
void reset()
Reset the counter to its initial value.
Definition: sat_counter.hh:286
Prefetcher::IndirectMemory::streamCounterThreshold
const int streamCounterThreshold
streamCounter value to trigger the streaming prefetcher
Definition: indirect_memory.hh:61
Prefetcher::IndirectMemory::IndirectPatternDetectorEntry::invalidate
void invalidate() override
Invalidates the entry.
Definition: indirect_memory.hh:149
MipsISA::index
Bitfield< 30, 0 > index
Definition: pra_constants.hh:44
Prefetcher::IndirectMemory::PrefetchTableEntry
Prefetch Table Entry.
Definition: indirect_memory.hh:66
Prefetcher::IndirectMemory::IndirectPatternDetectorEntry::secondIndexSet
bool secondIndexSet
Valid bit for the second index.
Definition: indirect_memory.hh:130
TaggedEntry
Copyright (c) 2018 Metempsy Technology Consulting All rights reserved.
Definition: associative_set.hh:39
Prefetcher::IndirectMemory::trackMissIndex2
void trackMissIndex2(Addr miss_addr)
Update an IPD entry with a detected miss address, when the second index is being tracked.
Definition: indirect_memory.cc:211
Prefetcher::IndirectMemory::prefetchTable
AssociativeSet< PrefetchTableEntry > prefetchTable
Prefetch table.
Definition: indirect_memory.hh:120
AssociativeSet
Associative container based on the previosuly defined Entry type Each element is indexed by a key of ...
Definition: associative_set.hh:117
Prefetcher::IndirectMemory::IndirectPatternDetectorEntry::numMisses
int numMisses
Number of misses currently recorded.
Definition: indirect_memory.hh:132
std::vector< int >
Prefetcher::IndirectMemory::IndirectPatternDetectorEntry::idx2
int64_t idx2
Second index.
Definition: indirect_memory.hh:128
Prefetcher::IndirectMemory::PrefetchTableEntry::address
Addr address
Accessed address.
Definition: indirect_memory.hh:71
sat_counter.hh
queued.hh
Prefetcher::IndirectMemory::IndirectPatternDetectorEntry
Indirect Pattern Detector entrt.
Definition: indirect_memory.hh:123
Prefetcher::IndirectMemory
Definition: indirect_memory.hh:52
Prefetcher::IndirectMemory::calculatePrefetch
void calculatePrefetch(const PrefetchInfo &pfi, std::vector< AddrPriority > &addresses) override
Definition: indirect_memory.cc:54
Prefetcher::IndirectMemory::PrefetchTableEntry::index
int64_t index
Current index value.
Definition: indirect_memory.hh:82
Prefetcher::IndirectMemory::PrefetchTableEntry::shift
int shift
Shift detected.
Definition: indirect_memory.hh:86
Prefetcher::IndirectMemory::trackMissIndex1
void trackMissIndex1(Addr miss_addr)
Update an IPD entry with a detected miss address, when the first index is being tracked.
Definition: indirect_memory.cc:192
Prefetcher::IndirectMemory::byteOrder
const ByteOrder byteOrder
Byte order used to access the cache.
Definition: indirect_memory.hh:165
Prefetcher::IndirectMemory::PrefetchTableEntry::secure
bool secure
Whether this address is in the secure region.
Definition: indirect_memory.hh:73
Prefetcher::IndirectMemory::PrefetchTableEntry::invalidate
void invalidate() override
Invalidates the entry.
Definition: indirect_memory.hh:105
Prefetcher::IndirectMemory::~IndirectMemory
~IndirectMemory()=default
Prefetcher::IndirectMemory::PrefetchTableEntry::PrefetchTableEntry
PrefetchTableEntry(unsigned indirect_counter_bits)
Definition: indirect_memory.hh:97
Prefetcher::IndirectMemory::allocateOrUpdateIPDEntry
void allocateOrUpdateIPDEntry(const PrefetchTableEntry *pt_entry, int64_t index)
Allocate or update an entry in the IPD.
Definition: indirect_memory.cc:162
Prefetcher
Copyright (c) 2018 Metempsy Technology Consulting All rights reserved.
Definition: base.hh:78
Prefetcher::IndirectMemory::IndirectPatternDetectorEntry::IndirectPatternDetectorEntry
IndirectPatternDetectorEntry(unsigned int num_addresses, unsigned int num_shifts)
Definition: indirect_memory.hh:140
Prefetcher::IndirectMemory::IndirectMemory
IndirectMemory(const IndirectMemoryPrefetcherParams *p)
Definition: indirect_memory.cc:37
Prefetcher::IndirectMemory::PrefetchTableEntry::streamCounter
unsigned int streamCounter
Confidence counter of the stream.
Definition: indirect_memory.hh:75
Prefetcher::IndirectMemory::PrefetchTableEntry::increasedIndirectCounter
bool increasedIndirectCounter
This variable is set to indicate that there has been at least one match with the current index value.
Definition: indirect_memory.hh:95
Addr
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition: types.hh:142
Prefetcher::Queued
Definition: queued.hh:54
Prefetcher::IndirectMemory::PrefetchTableEntry::baseAddr
Addr baseAddr
BaseAddr detected.
Definition: indirect_memory.hh:84
Prefetcher::IndirectMemory::ipdEntryTrackingMisses
IndirectPatternDetectorEntry * ipdEntryTrackingMisses
Entry currently tracking misses.
Definition: indirect_memory.hh:162
SatCounter
Implements an n bit saturating counter and provides methods to increment, decrement,...
Definition: sat_counter.hh:54
Prefetcher::IndirectMemory::streamingDistance
const int streamingDistance
Number of prefetches generated when using the streaming prefetcher.
Definition: indirect_memory.hh:63
Prefetcher::IndirectMemory::prefetchThreshold
const unsigned int prefetchThreshold
Counter threshold to start prefetching.
Definition: indirect_memory.hh:59
TaggedEntry::invalidate
virtual void invalidate()
Invalidates the entry.
Definition: associative_set.hh:69
std
Overload hash function for BasicBlockRange type.
Definition: vec_reg.hh:587
X86ISA::vector
Bitfield< 15, 8 > vector
Definition: intmessage.hh:44
Prefetcher::IndirectMemory::checkAccessMatchOnActiveEntries
void checkAccessMatchOnActiveEntries(Addr addr)
Checks if an access to the cache matches any active PT entry, if so, the indirect confidence counter ...
Definition: indirect_memory.cc:244
addr
ip6_addr_t addr
Definition: inet.hh:423
Prefetcher::Base::PrefetchInfo
Class containing the information needed by the prefetch to train and generate new prefetch requests.
Definition: base.hh:90
associative_set.hh
MipsISA::p
Bitfield< 0 > p
Definition: pra_constants.hh:323
Prefetcher::IndirectMemory::IndirectPatternDetectorEntry::idx1
int64_t idx1
First index.
Definition: indirect_memory.hh:126
Prefetcher::IndirectMemory::PrefetchTableEntry::enabled
bool enabled
Enable bit of the indirect fields.
Definition: indirect_memory.hh:80
Prefetcher::IndirectMemory::IndirectPatternDetectorEntry::baseAddr
std::vector< std::vector< Addr > > baseAddr
Potential BaseAddr candidates for each recorded miss.
Definition: indirect_memory.hh:138
Prefetcher::IndirectMemory::PrefetchTableEntry::indirectCounter
SatCounter indirectCounter
Confidence counter of the indirect fields.
Definition: indirect_memory.hh:88
Prefetcher::IndirectMemory::maxPrefetchDistance
const unsigned int maxPrefetchDistance
Maximum number of prefetches generated per event.
Definition: indirect_memory.hh:55
Prefetcher::IndirectMemory::shiftValues
const std::vector< int > shiftValues
Shift values considered.
Definition: indirect_memory.hh:57

Generated on Wed Sep 30 2020 14:02:12 for gem5 by doxygen 1.8.17