Go to the documentation of this file.
55 #include "debug/HWPrefetch.hh"
58 #include "params/StridePrefetcher.hh"
82 pcTableInfo(
p->table_assoc,
p->table_entries,
p->table_indexing_policy,
83 p->table_replacement_policy)
103 auto insertion_result =
pcTables.insert(std::make_pair(context,
108 DPRINTF(HWPrefetch,
"Adding context %i with stride entries\n", context);
111 return &(insertion_result.first->second);
119 DPRINTF(HWPrefetch,
"Ignoring request with no PC.\n");
135 if (entry !=
nullptr) {
139 int new_stride = pf_addr - entry->
lastAddr;
140 bool stride_match = (new_stride == entry->
stride);
143 if (stride_match && new_stride != 0) {
149 entry->
stride = new_stride;
153 DPRINTF(HWPrefetch,
"Hit: PC %x pkt_addr %x (%s) stride %d (%s), "
154 "conf %d\n",
pc, pf_addr, is_secure ?
"s" :
"ns",
155 new_stride, stride_match ?
"match" :
"change",
168 int prefetch_stride = new_stride;
169 if (abs(new_stride) <
blkSize) {
173 Addr new_addr = pf_addr +
d * prefetch_stride;
178 DPRINTF(HWPrefetch,
"Miss: PC %x pkt_addr %x (%s)\n",
pc, pf_addr,
179 is_secure ?
"s" :
"ns");
192 const Addr hash1 =
pc >> 1;
194 return (hash1 ^ hash2) &
setMask;
206 StridePrefetcherHashedSetAssociativeParams::create()
212 StridePrefetcherParams::create()
std::pair< Addr, int32_t > AddrPriority
const bool useRequestorId
const unsigned setMask
Mask out all bits that aren't part of the set index.
BaseReplacementPolicy *const replacementPolicy
unsigned blkSize
The block size of the parent cache.
Copyright (c) 2018 Metempsy Technology Consulting All rights reserved.
Addr getPC() const
Returns the program counter that generated this request.
Associative container based on the previosuly defined Entry type Each element is indexed by a key of ...
PCTable * allocateNewContext(int context)
Create a PC table for the given context.
AssociativeSet< StrideEntry > PCTable
std::unordered_map< int, PCTable > pcTables
const double threshConf
Confidence threshold for prefetch generation.
void calculatePrefetch(const PrefetchInfo &pfi, std::vector< AddrPriority > &addresses) override
Entry * findEntry(Addr addr, bool is_secure) const
Find an entry within the set.
Stride(const StridePrefetcherParams *p)
void accessEntry(Entry *entry)
Do an access to the entry, this is required to update the replacement information data.
uint32_t extractSet(const Addr addr) const override
Apply a hash function to calculate address set.
RequestorID getRequestorId() const
Gets the requestor ID that generated this address.
StrideEntry(const SatCounter &init_confidence)
double calcSaturation() const
Calculate saturation percentile of the current counter's value with regard to its maximum possible va...
Copyright (c) 2018 Metempsy Technology Consulting All rights reserved.
void insertEntry(Addr addr, bool is_secure, Entry *entry)
Indicate that an entry has just been inserted.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Entry * findVictim(Addr addr)
Find a victim to be replaced.
PCTable * findTable(int context)
Try to find a table of entries for the given context.
const SatCounter initConfidence
Initial confidence counter value for the pc tables.
bool isSecure() const
Returns true if the address targets the secure memory space.
Implements an n bit saturating counter and provides methods to increment, decrement,...
const int tagShift
The amount to shift the address to get the tag.
Override the default set associative to apply a specific hash function when extracting a set.
Addr extractTag(const Addr addr) const override
Generate the tag from the given address.
const struct Prefetcher::Stride::PCTableInfo pcTableInfo
Class containing the information needed by the prefetch to train and generate new prefetch requests.
Bitfield< 21, 20 > stride
void invalidate() override
Invalidates the entry.
Addr getAddr() const
Obtains the address value of this Prefetcher address.
bool hasPC() const
Returns true if the associated program counter is valid.
BaseIndexingPolicy *const indexingPolicy
Generated on Wed Sep 30 2020 14:02:12 for gem5 by doxygen 1.8.17