gem5  v21.1.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 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__
gem5::prefetch::IndirectMemory::shiftValues
const std::vector< int > shiftValues
Shift values considered.
Definition: indirect_memory.hh:62
gem5::prefetch::IndirectMemory::PrefetchTableEntry::baseAddr
Addr baseAddr
BaseAddr detected.
Definition: indirect_memory.hh:89
gem5::prefetch::IndirectMemory::IndirectMemory
IndirectMemory(const IndirectMemoryPrefetcherParams &p)
Definition: indirect_memory.cc:42
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:91
gem5::prefetch::IndirectMemory::streamingDistance
const int streamingDistance
Number of prefetches generated when using the streaming prefetcher.
Definition: indirect_memory.hh:68
gem5::prefetch::IndirectMemory::IndirectPatternDetectorEntry::idx2
int64_t idx2
Second index.
Definition: indirect_memory.hh:133
gem5::prefetch::IndirectMemory::PrefetchTableEntry::PrefetchTableEntry
PrefetchTableEntry(unsigned indirect_counter_bits)
Definition: indirect_memory.hh:102
gem5::prefetch::IndirectMemory::prefetchThreshold
const unsigned int prefetchThreshold
Counter threshold to start prefetching.
Definition: indirect_memory.hh:64
gem5::prefetch::IndirectMemory::prefetchTable
AssociativeSet< PrefetchTableEntry > prefetchTable
Prefetch table.
Definition: indirect_memory.hh:125
std::vector< int >
gem5::prefetch::IndirectMemory::ipdEntryTrackingMisses
IndirectPatternDetectorEntry * ipdEntryTrackingMisses
Entry currently tracking misses.
Definition: indirect_memory.hh:167
gem5::prefetch::IndirectMemory::PrefetchTableEntry::streamCounter
unsigned int streamCounter
Confidence counter of the stream.
Definition: indirect_memory.hh:80
sat_counter.hh
gem5::prefetch::IndirectMemory::IndirectPatternDetectorEntry::secondIndexSet
bool secondIndexSet
Valid bit for the second index.
Definition: indirect_memory.hh:135
queued.hh
gem5::prefetch::IndirectMemory::streamCounterThreshold
const int streamCounterThreshold
streamCounter value to trigger the streaming prefetcher
Definition: indirect_memory.hh:66
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:216
gem5::prefetch::IndirectMemory::PrefetchTableEntry::invalidate
void invalidate() override
Invalidate the block.
Definition: indirect_memory.hh:110
gem5::GenericSatCounter< uint8_t >
gem5::prefetch::IndirectMemory::ipd
AssociativeSet< IndirectPatternDetectorEntry > ipd
Indirect Pattern Detector (IPD) table.
Definition: indirect_memory.hh:164
gem5::TaggedEntry
A tagged entry is an entry containing a tag.
Definition: tagged_entry.hh:46
gem5::prefetch::IndirectMemory::PrefetchTableEntry::address
Addr address
Accessed address.
Definition: indirect_memory.hh:76
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:57
gem5::prefetch::IndirectMemory::PrefetchTableEntry::enabled
bool enabled
Enable bit of the indirect fields.
Definition: indirect_memory.hh:85
gem5::MipsISA::p
Bitfield< 0 > p
Definition: pra_constants.hh:326
gem5::prefetch::IndirectMemory::IndirectPatternDetectorEntry
Indirect Pattern Detector entrt.
Definition: indirect_memory.hh:128
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:131
gem5::prefetch::IndirectMemory::PrefetchTableEntry
Prefetch Table Entry.
Definition: indirect_memory.hh:71
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:60
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:167
gem5::GEM5_DEPRECATED_NAMESPACE
GEM5_DEPRECATED_NAMESPACE(GuestABI, guest_abi)
gem5::prefetch::IndirectMemory::PrefetchTableEntry::indirectCounter
SatCounter8 indirectCounter
Confidence counter of the indirect fields.
Definition: indirect_memory.hh:93
gem5::prefetch::Queued
Definition: queued.hh:60
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:100
gem5::prefetch::IndirectMemory::IndirectPatternDetectorEntry::invalidate
void invalidate() override
Invalidate the block.
Definition: indirect_memory.hh:154
std
Overload hash function for BasicBlockRange type.
Definition: types.hh:111
gem5::prefetch::IndirectMemory::PrefetchTableEntry::secure
bool secure
Whether this address is in the secure region.
Definition: indirect_memory.hh:78
gem5::prefetch::IndirectMemory::PrefetchTableEntry::index
int64_t index
Current index value.
Definition: indirect_memory.hh:87
gem5::prefetch::IndirectMemory::IndirectPatternDetectorEntry::numMisses
int numMisses
Number of misses currently recorded.
Definition: indirect_memory.hh:137
associative_set.hh
gem5::context_switch_task_id::Prefetcher
@ Prefetcher
Definition: request.hh:83
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:249
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:197
gem5::prefetch::IndirectMemory::~IndirectMemory
~IndirectMemory()=default
gem5
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
Definition: decoder.cc:40
gem5::prefetch::IndirectMemory::IndirectPatternDetectorEntry::baseAddr
std::vector< std::vector< Addr > > baseAddr
Potential BaseAddr candidates for each recorded miss.
Definition: indirect_memory.hh:143
gem5::prefetch::IndirectMemory::byteOrder
const ByteOrder byteOrder
Byte order used to access the cache.
Definition: indirect_memory.hh:170
gem5::prefetch::IndirectMemory::IndirectPatternDetectorEntry::IndirectPatternDetectorEntry
IndirectPatternDetectorEntry(unsigned int num_addresses, unsigned int num_shifts)
Definition: indirect_memory.hh:145
gem5::prefetch::IndirectMemory::calculatePrefetch
void calculatePrefetch(const PrefetchInfo &pfi, std::vector< AddrPriority > &addresses) override
Definition: indirect_memory.cc:59
gem5::prefetch::Base::PrefetchInfo
Class containing the information needed by the prefetch to train and generate new prefetch requests.
Definition: base.hh:97
gem5::X86ISA::addr
Bitfield< 3 > addr
Definition: types.hh:84

Generated on Tue Sep 21 2021 12:25:29 for gem5 by doxygen 1.8.17