gem5  [DEVELOP-FOR-23.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 
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 
53 namespace prefetch
54 {
55 
56 class IndirectMemory : public Queued
57 {
59  const unsigned int maxPrefetchDistance;
63  const unsigned int prefetchThreshold;
67  const int streamingDistance;
68 
71  {
72  /* Stream table fields */
73 
77  bool secure;
79  unsigned int streamCounter;
80 
81  /* Indirect table fields */
82 
84  bool enabled;
86  int64_t index;
90  int shift;
100 
101  PrefetchTableEntry(unsigned indirect_counter_bits)
102  : TaggedEntry(), address(0), secure(false), streamCounter(0),
103  enabled(false), index(0), baseAddr(0), shift(0),
104  indirectCounter(indirect_counter_bits),
106  {}
107 
108  void
109  invalidate() override
110  {
112  address = 0;
113  secure = false;
114  streamCounter = 0;
115  enabled = false;
116  index = 0;
117  baseAddr = 0;
118  shift = 0;
120  increasedIndirectCounter = false;
121  }
122  };
125 
128  {
130  int64_t idx1;
132  int64_t idx2;
143 
144  IndirectPatternDetectorEntry(unsigned int num_addresses,
145  unsigned int num_shifts)
146  : TaggedEntry(), idx1(0), idx2(0), secondIndexSet(false),
147  numMisses(0),
148  baseAddr(num_addresses, std::vector<Addr>(num_shifts))
149  {
150  }
151 
152  void
153  invalidate() override
154  {
156  idx1 = 0;
157  idx2 = 0;
158  secondIndexSet = false;
159  numMisses = 0;
160  }
161  };
164 
167 
169  const ByteOrder byteOrder;
170 
176  void allocateOrUpdateIPDEntry(const PrefetchTableEntry *pt_entry,
177  int64_t index);
183  void trackMissIndex1(Addr miss_addr);
184 
190  void trackMissIndex2(Addr miss_addr);
191 
198 
199  public:
200  IndirectMemory(const IndirectMemoryPrefetcherParams &p);
201  ~IndirectMemory() = 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_INDIRECT_MEMORY_HH__
gem5::prefetch::IndirectMemory::shiftValues
const std::vector< int > shiftValues
Shift values considered.
Definition: indirect_memory.hh:61
gem5::prefetch::IndirectMemory::PrefetchTableEntry::baseAddr
Addr baseAddr
BaseAddr detected.
Definition: indirect_memory.hh:88
gem5::prefetch::IndirectMemory::IndirectMemory
IndirectMemory(const IndirectMemoryPrefetcherParams &p)
Definition: indirect_memory.cc:41
gem5::X86ISA::vector
Bitfield< 15, 8 > vector
Definition: intmessage.hh:48
gem5::MipsISA::index
Bitfield< 30, 0 > index
Definition: pra_constants.hh:47
gem5::prefetch::IndirectMemory::PrefetchTableEntry::shift
int shift
Shift detected.
Definition: indirect_memory.hh:90
gem5::prefetch::IndirectMemory::streamingDistance
const int streamingDistance
Number of prefetches generated when using the streaming prefetcher.
Definition: indirect_memory.hh:67
gem5::prefetch::IndirectMemory::IndirectPatternDetectorEntry::idx2
int64_t idx2
Second index.
Definition: indirect_memory.hh:132
gem5::prefetch::IndirectMemory::PrefetchTableEntry::PrefetchTableEntry
PrefetchTableEntry(unsigned indirect_counter_bits)
Definition: indirect_memory.hh:101
gem5::prefetch::IndirectMemory::prefetchThreshold
const unsigned int prefetchThreshold
Counter threshold to start prefetching.
Definition: indirect_memory.hh:63
gem5::prefetch::IndirectMemory::prefetchTable
AssociativeSet< PrefetchTableEntry > prefetchTable
Prefetch table.
Definition: indirect_memory.hh:124
std::vector< int >
gem5::prefetch::IndirectMemory::ipdEntryTrackingMisses
IndirectPatternDetectorEntry * ipdEntryTrackingMisses
Entry currently tracking misses.
Definition: indirect_memory.hh:166
gem5::prefetch::IndirectMemory::PrefetchTableEntry::streamCounter
unsigned int streamCounter
Confidence counter of the stream.
Definition: indirect_memory.hh:79
sat_counter.hh
gem5::prefetch::IndirectMemory::IndirectPatternDetectorEntry::secondIndexSet
bool secondIndexSet
Valid bit for the second index.
Definition: indirect_memory.hh:134
queued.hh
gem5::prefetch::IndirectMemory::streamCounterThreshold
const int streamCounterThreshold
streamCounter value to trigger the streaming prefetcher
Definition: indirect_memory.hh:65
gem5::prefetch::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:215
gem5::prefetch::IndirectMemory::PrefetchTableEntry::invalidate
void invalidate() override
Invalidate the block.
Definition: indirect_memory.hh:109
gem5::GenericSatCounter< uint8_t >
gem5::prefetch::IndirectMemory::ipd
AssociativeSet< IndirectPatternDetectorEntry > ipd
Indirect Pattern Detector (IPD) table.
Definition: indirect_memory.hh:163
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::prefetch::IndirectMemory::PrefetchTableEntry::address
Addr address
Accessed address.
Definition: indirect_memory.hh:75
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::IndirectMemory
Definition: indirect_memory.hh:56
gem5::prefetch::IndirectMemory::PrefetchTableEntry::enabled
bool enabled
Enable bit of the indirect fields.
Definition: indirect_memory.hh:84
gem5::prefetch::IndirectMemory::IndirectPatternDetectorEntry
Indirect Pattern Detector entrt.
Definition: indirect_memory.hh:127
gem5::GenericSatCounter::reset
void reset()
Reset the counter to its initial value.
Definition: sat_counter.hh:292
gem5::TaggedEntry::invalidate
virtual void invalidate()
Invalidate the block.
Definition: tagged_entry.hh:103
gem5::prefetch::IndirectMemory::IndirectPatternDetectorEntry::idx1
int64_t idx1
First index.
Definition: indirect_memory.hh:130
gem5::prefetch::IndirectMemory::PrefetchTableEntry
Prefetch Table Entry.
Definition: indirect_memory.hh:70
gem5::Addr
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition: types.hh:147
gem5::prefetch::IndirectMemory::maxPrefetchDistance
const unsigned int maxPrefetchDistance
Maximum number of prefetches generated per event.
Definition: indirect_memory.hh:59
gem5::prefetch::IndirectMemory::allocateOrUpdateIPDEntry
void allocateOrUpdateIPDEntry(const PrefetchTableEntry *pt_entry, int64_t index)
Allocate or update an entry in the IPD.
Definition: indirect_memory.cc:166
gem5::prefetch::IndirectMemory::PrefetchTableEntry::indirectCounter
SatCounter8 indirectCounter
Confidence counter of the indirect fields.
Definition: indirect_memory.hh:92
gem5::prefetch::Queued
Definition: queued.hh:59
gem5::prefetch::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:99
gem5::prefetch::IndirectMemory::IndirectPatternDetectorEntry::invalidate
void invalidate() override
Invalidate the block.
Definition: indirect_memory.hh:153
std
Overload hash function for BasicBlockRange type.
Definition: misc.hh:2909
gem5::prefetch::IndirectMemory::PrefetchTableEntry::secure
bool secure
Whether this address is in the secure region.
Definition: indirect_memory.hh:77
gem5::prefetch::IndirectMemory::PrefetchTableEntry::index
int64_t index
Current index value.
Definition: indirect_memory.hh:86
gem5::prefetch::IndirectMemory::IndirectPatternDetectorEntry::numMisses
int numMisses
Number of misses currently recorded.
Definition: indirect_memory.hh:136
associative_set.hh
gem5::prefetch::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:248
gem5::prefetch::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:196
gem5::prefetch::IndirectMemory::~IndirectMemory
~IndirectMemory()=default
gem5
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
Definition: gpu_translation_state.hh:37
gem5::prefetch::IndirectMemory::IndirectPatternDetectorEntry::baseAddr
std::vector< std::vector< Addr > > baseAddr
Potential BaseAddr candidates for each recorded miss.
Definition: indirect_memory.hh:142
gem5::prefetch::IndirectMemory::byteOrder
const ByteOrder byteOrder
Byte order used to access the cache.
Definition: indirect_memory.hh:169
gem5::prefetch::IndirectMemory::IndirectPatternDetectorEntry::IndirectPatternDetectorEntry
IndirectPatternDetectorEntry(unsigned int num_addresses, unsigned int num_shifts)
Definition: indirect_memory.hh:144
gem5::prefetch::IndirectMemory::calculatePrefetch
void calculatePrefetch(const PrefetchInfo &pfi, std::vector< AddrPriority > &addresses) override
Definition: indirect_memory.cc:58
gem5::prefetch::Base::PrefetchInfo
Class containing the information needed by the prefetch to train and generate new prefetch requests.
Definition: base.hh:96
gem5::X86ISA::addr
Bitfield< 3 > addr
Definition: types.hh:84

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