Go to the documentation of this file.
33 #include "params/IndirectMemoryPrefetcher.hh"
44 maxPrefetchDistance(
p.max_prefetch_distance),
45 shiftValues(
p.shift_values), prefetchThreshold(
p.prefetch_threshold),
46 streamCounterThreshold(
p.stream_counter_threshold),
47 streamingDistance(
p.streaming_distance),
48 prefetchTable(
p.pt_table_assoc,
p.pt_table_entries,
49 p.pt_table_indexing_policy,
p.pt_table_replacement_policy,
51 ipd(
p.ipd_table_assoc,
p.ipd_table_entries,
p.ipd_table_indexing_policy,
52 p.ipd_table_replacement_policy,
54 ipdEntryTrackingMisses(nullptr),
byteOrder(
p.sys->getGuestByteOrder())
86 if (pt_entry !=
nullptr) {
99 pt_entry->
secure = is_secure;
109 bool read_index =
true;
111 case sizeof(uint8_t):
114 case sizeof(uint16_t):
117 case sizeof(uint32_t):
120 case sizeof(uint64_t):
127 if (read_index && !pt_entry->
enabled) {
132 }
else if (read_index) {
147 for (
int delta = 1; delta < distance; delta += 1) {
158 assert(pt_entry !=
nullptr);
161 pt_entry->
secure = is_secure;
171 Addr ipd_entry_addr = (
Addr) pt_entry;
174 if (ipd_entry !=
nullptr) {
175 ipd.accessEntry(ipd_entry);
184 ipd.invalidate(ipd_entry);
188 ipd_entry =
ipd.findVictim(ipd_entry_addr);
189 assert(ipd_entry !=
nullptr);
190 ipd.insertEntry(ipd_entry_addr,
false , ipd_entry);
206 ba_array[idx] = miss_addr - (entry->
idx1 <<
shift);
223 for (
int midx = 0; midx < entry->
numMisses; midx += 1)
228 if (ba_array[idx] == (miss_addr - (entry->
idx2 <<
shift))) {
238 ipd.invalidate(entry);
252 if (pt_entry.enabled) {
253 if (
addr == pt_entry.baseAddr +
254 (pt_entry.index << pt_entry.shift)) {
255 pt_entry.indirectCounter++;
256 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.
GEM5_DEPRECATED_NAMESPACE(GuestABI, guest_abi)
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 Tue Feb 8 2022 11:47:10 for gem5 by doxygen 1.8.17