Go to the documentation of this file.
33 #include "params/IndirectMemoryPrefetcher.hh"
43 maxPrefetchDistance(
p.max_prefetch_distance),
44 shiftValues(
p.shift_values), prefetchThreshold(
p.prefetch_threshold),
45 streamCounterThreshold(
p.stream_counter_threshold),
46 streamingDistance(
p.streaming_distance),
47 prefetchTable(
p.pt_table_assoc,
p.pt_table_entries,
48 p.pt_table_indexing_policy,
p.pt_table_replacement_policy,
50 ipd(
p.ipd_table_assoc,
p.ipd_table_entries,
p.ipd_table_indexing_policy,
51 p.ipd_table_replacement_policy,
53 ipdEntryTrackingMisses(nullptr),
byteOrder(
p.sys->getGuestByteOrder())
85 if (pt_entry !=
nullptr) {
98 pt_entry->
secure = is_secure;
108 bool read_index =
true;
110 case sizeof(uint8_t):
113 case sizeof(uint16_t):
116 case sizeof(uint32_t):
119 case sizeof(uint64_t):
126 if (read_index && !pt_entry->
enabled) {
131 }
else if (read_index) {
146 for (
int delta = 1; delta < distance; delta += 1) {
157 assert(pt_entry !=
nullptr);
160 pt_entry->
secure = is_secure;
170 Addr ipd_entry_addr = (
Addr) pt_entry;
173 if (ipd_entry !=
nullptr) {
174 ipd.accessEntry(ipd_entry);
183 ipd.invalidate(ipd_entry);
187 ipd_entry =
ipd.findVictim(ipd_entry_addr);
188 assert(ipd_entry !=
nullptr);
189 ipd.insertEntry(ipd_entry_addr,
false , ipd_entry);
205 ba_array[idx] = miss_addr - (entry->
idx1 <<
shift);
222 for (
int midx = 0; midx < entry->
numMisses; midx += 1)
227 if (ba_array[idx] == (miss_addr - (entry->
idx2 <<
shift))) {
237 ipd.invalidate(entry);
251 if (pt_entry.enabled) {
252 if (
addr == pt_entry.baseAddr +
253 (pt_entry.index << pt_entry.shift)) {
254 pt_entry.indirectCounter++;
255 pt_entry.increasedIndirectCounter =
true;
Addr getAddr() const
Obtains the address value of this Prefetcher address.
const std::vector< int > shiftValues
Shift values considered.
double calcSaturation() const
Calculate saturation percentile of the current counter's value with regard to its maximum possible va...
Addr baseAddr
BaseAddr detected.
std::pair< Addr, int32_t > AddrPriority
IndirectMemory(const IndirectMemoryPrefetcherParams &p)
bool isSecure() const
Returns true if the address targets the secure memory space.
const int streamingDistance
Number of prefetches generated when using the streaming prefetcher.
int64_t idx2
Second index.
const unsigned int prefetchThreshold
Counter threshold to start prefetching.
AssociativeSet< PrefetchTableEntry > prefetchTable
Prefetch table.
bool isCacheMiss() const
Check if this event comes from a cache miss.
ByteOrder byteOrder(const ThreadContext *tc)
virtual Addr getTag() const
Get tag associated to this block.
IndirectPatternDetectorEntry * ipdEntryTrackingMisses
Entry currently tracking misses.
T get(ByteOrder endian) const
Gets the associated data of the request triggering the event.
unsigned int streamCounter
Confidence counter of the stream.
bool secondIndexSet
Valid bit for the second index.
const int streamCounterThreshold
streamCounter value to trigger the streaming prefetcher
void trackMissIndex2(Addr miss_addr)
Update an IPD entry with a detected miss address, when the second index is being tracked.
Addr getPC() const
Returns the program counter that generated this request.
AssociativeSet< IndirectPatternDetectorEntry > ipd
Indirect Pattern Detector (IPD) table.
Addr address
Accessed address.
bool enabled
Enable bit of the indirect fields.
Indirect Pattern Detector entrt.
void reset()
Reset the counter to its initial value.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
const unsigned int maxPrefetchDistance
Maximum number of prefetches generated per event.
void allocateOrUpdateIPDEntry(const PrefetchTableEntry *pt_entry, int64_t index)
Allocate or update an entry in the IPD.
bool isWrite() const
Checks if the request that caused this prefetch event was a write request.
SatCounter8 indirectCounter
Confidence counter of the indirect fields.
unsigned int getSize() const
Gets the size of the request triggering this event.
bool increasedIndirectCounter
This variable is set to indicate that there has been at least one match with the current index value.
bool secure
Whether this address is in the secure region.
int64_t index
Current index value.
int numMisses
Number of misses currently recorded.
void checkAccessMatchOnActiveEntries(Addr addr)
Checks if an access to the cache matches any active PT entry, if so, the indirect confidence counter ...
void trackMissIndex1(Addr miss_addr)
Update an IPD entry with a detected miss address, when the first index is being tracked.
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
std::vector< std::vector< Addr > > baseAddr
Potential BaseAddr candidates for each recorded miss.
const ByteOrder byteOrder
Byte order used to access the cache.
void calculatePrefetch(const PrefetchInfo &pfi, std::vector< AddrPriority > &addresses) override
Class containing the information needed by the prefetch to train and generate new prefetch requests.
bool hasPC() const
Returns true if the associated program counter is valid.
Generated on Sun Jul 30 2023 01:56:57 for gem5 by doxygen 1.8.17