Go to the documentation of this file.
33 #include "params/IndirectMemoryPrefetcher.hh"
39 maxPrefetchDistance(
p->max_prefetch_distance),
40 shiftValues(
p->shift_values), prefetchThreshold(
p->prefetch_threshold),
41 streamCounterThreshold(
p->stream_counter_threshold),
42 streamingDistance(
p->streaming_distance),
43 prefetchTable(
p->pt_table_assoc,
p->pt_table_entries,
44 p->pt_table_indexing_policy,
p->pt_table_replacement_policy,
46 ipd(
p->ipd_table_assoc,
p->ipd_table_entries,
p->ipd_table_indexing_policy,
47 p->ipd_table_replacement_policy,
49 ipdEntryTrackingMisses(nullptr),
byteOrder(
p->sys->getGuestByteOrder())
81 if (pt_entry !=
nullptr) {
94 pt_entry->
secure = is_secure;
104 bool read_index =
true;
106 case sizeof(uint8_t):
109 case sizeof(uint16_t):
112 case sizeof(uint32_t):
115 case sizeof(uint64_t):
122 if (read_index && !pt_entry->
enabled) {
127 }
else if (read_index) {
142 for (
int delta = 1; delta < distance; delta += 1) {
153 assert(pt_entry !=
nullptr);
156 pt_entry->
secure = is_secure;
166 Addr ipd_entry_addr = (
Addr) pt_entry;
169 if (ipd_entry !=
nullptr) {
170 ipd.accessEntry(ipd_entry);
179 ipd.invalidate(ipd_entry);
183 ipd_entry =
ipd.findVictim(ipd_entry_addr);
184 assert(ipd_entry !=
nullptr);
185 ipd.insertEntry(ipd_entry_addr,
false , ipd_entry);
201 ba_array[idx] = miss_addr - (entry->
idx1 <<
shift);
218 for (
int midx = 0; midx < entry->
numMisses; midx += 1)
223 if (ba_array[idx] == (miss_addr - (entry->
idx2 <<
shift))) {
233 ipd.invalidate(entry);
247 if (pt_entry.enabled) {
248 if (
addr == pt_entry.baseAddr +
249 (pt_entry.index << pt_entry.shift)) {
250 pt_entry.indirectCounter++;
251 pt_entry.increasedIndirectCounter =
true;
260 IndirectMemoryPrefetcherParams::create()
std::pair< Addr, int32_t > AddrPriority
AssociativeSet< IndirectPatternDetectorEntry > ipd
Indirect Pattern Detector (IPD) table.
void reset()
Reset the counter to its initial value.
const int streamCounterThreshold
streamCounter value to trigger the streaming prefetcher
ByteOrder byteOrder(const ThreadContext *tc)
bool secondIndexSet
Valid bit for the second index.
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< PrefetchTableEntry > prefetchTable
Prefetch table.
int numMisses
Number of misses currently recorded.
Addr getTag() const
Obtain the entry tag.
int64_t idx2
Second index.
Addr address
Accessed address.
Indirect Pattern Detector entrt.
void calculatePrefetch(const PrefetchInfo &pfi, std::vector< AddrPriority > &addresses) override
int64_t index
Current index value.
void trackMissIndex1(Addr miss_addr)
Update an IPD entry with a detected miss address, when the first index is being tracked.
const ByteOrder byteOrder
Byte order used to access the cache.
bool isWrite() const
Checks if the request that caused this prefetch event was a write request.
bool secure
Whether this address is in the secure region.
double calcSaturation() const
Calculate saturation percentile of the current counter's value with regard to its maximum possible va...
bool isCacheMiss() const
Check if this event comes from a cache miss.
void allocateOrUpdateIPDEntry(const PrefetchTableEntry *pt_entry, int64_t index)
Allocate or update an entry in the IPD.
Copyright (c) 2018 Metempsy Technology Consulting All rights reserved.
unsigned int getSize() const
Gets the size of the request triggering this event.
IndirectMemory(const IndirectMemoryPrefetcherParams *p)
unsigned int streamCounter
Confidence counter of the stream.
bool increasedIndirectCounter
This variable is set to indicate that there has been at least one match with the current index value.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Addr baseAddr
BaseAddr detected.
IndirectPatternDetectorEntry * ipdEntryTrackingMisses
Entry currently tracking misses.
bool isSecure() const
Returns true if the address targets the secure memory space.
const unsigned int prefetchThreshold
Counter threshold to start prefetching.
const int streamingDistance
Number of prefetches generated when using the streaming prefetcher.
void checkAccessMatchOnActiveEntries(Addr addr)
Checks if an access to the cache matches any active PT entry, if so, the indirect confidence counter ...
Class containing the information needed by the prefetch to train and generate new prefetch requests.
T get(ByteOrder endian) const
Gets the associated data of the request triggering the event.
bool enabled
Enable bit of the indirect fields.
Addr getAddr() const
Obtains the address value of this Prefetcher address.
std::vector< std::vector< Addr > > baseAddr
Potential BaseAddr candidates for each recorded miss.
bool hasPC() const
Returns true if the associated program counter is valid.
SatCounter indirectCounter
Confidence counter of the indirect fields.
const unsigned int maxPrefetchDistance
Maximum number of prefetches generated per event.
const std::vector< int > shiftValues
Shift values considered.
Generated on Wed Sep 30 2020 14:02:12 for gem5 by doxygen 1.8.17