gem5 v24.1.0.1
Loading...
Searching...
No Matches
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
45#include "base/sat_counter.hh"
48
49namespace gem5
50{
51
52struct IndirectMemoryPrefetcherParams;
53
54namespace prefetch
55{
56
57class IndirectMemory : public Queued
58{
60 const unsigned int maxPrefetchDistance;
64 const unsigned int prefetchThreshold;
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, TagExtractor ext)
103 : TaggedEntry(), address(0), secure(false), streamCounter(0),
104 enabled(false), index(0), baseAddr(0), shift(0),
105 indirectCounter(indirect_counter_bits),
107 {
109 }
110
111 void
112 invalidate() override
113 {
115 address = 0;
116 secure = false;
117 streamCounter = 0;
118 enabled = false;
119 index = 0;
120 baseAddr = 0;
121 shift = 0;
124 }
125 };
128
131 {
133 int64_t idx1;
135 int64_t idx2;
146
147 IndirectPatternDetectorEntry(unsigned int num_addresses,
148 unsigned int num_shifts,
150 : TaggedEntry(), idx1(0), idx2(0), secondIndexSet(false),
151 numMisses(0),
152 baseAddr(num_addresses, std::vector<Addr>(num_shifts))
153 {
155 }
156
157 void
158 invalidate() override
159 {
161 idx1 = 0;
162 idx2 = 0;
163 secondIndexSet = false;
164 numMisses = 0;
165 }
166 };
169
172
174 const ByteOrder byteOrder;
175
181 void allocateOrUpdateIPDEntry(const PrefetchTableEntry *pt_entry,
182 int64_t index);
188 void trackMissIndex1(Addr miss_addr);
189
195 void trackMissIndex2(Addr miss_addr);
196
203
204 public:
205 IndirectMemory(const IndirectMemoryPrefetcherParams &p);
206 ~IndirectMemory() = default;
207
208 void calculatePrefetch(const PrefetchInfo &pfi,
209 std::vector<AddrPriority> &addresses,
210 const CacheAccessor &cache) override;
211};
212
213} // namespace prefetch
214} // namespace gem5
215
216#endif//__MEM_CACHE_PREFETCH_INDIRECT_MEMORY_HH__
A tagged entry is an entry containing a tag.
void registerTagExtractor(TagExtractor ext)
virtual void invalidate()
Invalidate the block.
std::function< Addr(Addr)> TagExtractor
Class containing the information needed by the prefetch to train and generate new prefetch requests.
Definition base.hh:111
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.
AssociativeCache< IndirectPatternDetectorEntry > ipd
Indirect Pattern Detector (IPD) 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.
IndirectPatternDetectorEntry * ipdEntryTrackingMisses
Entry currently tracking misses.
const int streamingDistance
Number of prefetches generated when using the streaming prefetcher.
AssociativeCache< PrefetchTableEntry > prefetchTable
Prefetch table.
const unsigned int prefetchThreshold
Counter threshold to start prefetching.
void calculatePrefetch(const PrefetchInfo &pfi, std::vector< AddrPriority > &addresses, const CacheAccessor &cache) override
void allocateOrUpdateIPDEntry(const PrefetchTableEntry *pt_entry, int64_t index)
Allocate or update an entry in the IPD.
STL vector class.
Definition stl.hh:37
void reset()
Reset the counter to its initial value.
Bitfield< 12 > ext
Bitfield< 30, 0 > index
Bitfield< 0 > p
Bitfield< 3 > addr
Definition types.hh:84
Bitfield< 15, 8 > vector
Definition intmessage.hh:48
Copyright (c) 2024 Arm Limited All rights reserved.
Definition binary32.hh:36
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition types.hh:147
Overload hash function for BasicBlockRange type.
Definition binary32.hh:81
Provides generic cache lookup functions.
std::vector< std::vector< Addr > > baseAddr
Potential BaseAddr candidates for each recorded miss.
IndirectPatternDetectorEntry(unsigned int num_addresses, unsigned int num_shifts, TagExtractor ext)
void invalidate() override
Invalidate the block.
PrefetchTableEntry(unsigned indirect_counter_bits, TagExtractor ext)
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.
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 Mon Jan 13 2025 04:28:38 for gem5 by doxygen 1.9.8