42 #ifndef __MEM_CACHE_PREFETCH_SIGNATURE_PATH_HH__ 43 #define __MEM_CACHE_PREFETCH_SIGNATURE_PATH_HH__ 50 struct SignaturePathPrefetcherParams;
102 :
TaggedEntry(), strideEntries(num_strides, counter_bits),
103 counter(counter_bits)
112 for (
auto &entry : strideEntries) {
113 entry.counter.reset();
128 for (
auto &entry : strideEntries) {
129 if (entry.stride == stride) {
130 found_entry = &entry;
157 sig &=
mask(signatureBits);
176 double path_confidence, signature_t
signature,
194 bool &miss, stride_t &
stride,
double &initial_confidence);
248 signature_t &new_signature,
double &new_conf,
249 stride_t &new_stride);
278 stride_t last_offset, stride_t delta,
double path_confidence) {
288 #endif//__MEM_CACHE_PREFETCH_SIGNATURE_PATH_HH__ PatternStrideEntry(unsigned bits)
Signature entry data type.
const signature_t signatureBits
Size of the signature, in bits.
const uint8_t signatureShift
Number of bits to shift when generating a new signature.
void invalidate() override
Reset the entries to their initial values.
AssociativeSet< PatternEntry > patternTable
Pattern table.
virtual void increasePatternEntryCounter(PatternEntry &pattern_entry, PatternStrideEntry &pstride_entry)
Increases the counter of a given PatternEntry/PatternStrideEntry.
stride_t stride
stride in a page in blkSize increments
A stride entry with its counter.
Bitfield< 21, 20 > stride
const double prefetchConfidenceThreshold
Minimum confidence to issue a prefetch.
SignaturePathPrefetcher(const SignaturePathPrefetcherParams *p)
Copyright (c) 2018 Metempsy Technology Consulting All rights reserved.
void addPrefetch(Addr ppn, stride_t last_block, stride_t delta, double path_confidence, signature_t signature, bool is_secure, std::vector< AddrPriority > &addresses)
Generates an address to be prefetched.
virtual double calculateLookaheadConfidence(PatternEntry const &sig, PatternStrideEntry const &lookahead) const
Computes the lookahead path confidence of the provided pattern entry.
const unsigned stridesPerPatternEntry
Number of strides stored in each pattern entry.
void calculatePrefetch(const PrefetchInfo &pfi, std::vector< AddrPriority > &addresses) override
signature_t signature
Path signature.
virtual void handleSignatureTableMiss(stride_t current_block, signature_t &new_signature, double &new_conf, stride_t &new_stride)
Whenever a new SignatureEntry is allocated, it computes the new signature to be used with the new ent...
SatCounter counter
use counter, used by SPPv2
std::vector< PatternStrideEntry > strideEntries
group of stides
~SignaturePathPrefetcher()
Class containing the information needed by the prefetch to train and generate new prefetch requests...
virtual void handlePageCrossingLookahead(signature_t signature, stride_t last_offset, stride_t delta, double path_confidence)
Handles the situation when the lookahead process has crossed the boundaries of the current page...
SignatureEntry & getSignatureEntry(Addr ppn, bool is_secure, stride_t block, bool &miss, stride_t &stride, double &initial_confidence)
Obtains the SignatureEntry of the given page, if the page is not found, it allocates a new one...
const double lookaheadConfidenceThreshold
Minimum confidence to keep navigating lookahead entries.
int16_t stride_t
Stride type.
Implements an n bit saturating counter and provides methods to increment, decrement, and read it.
void updatePatternTable(Addr signature, stride_t stride)
Updates the pattern table with the provided signature and stride.
void reset()
Reset the counter to its initial value.
PatternEntry & getPatternEntry(Addr signature)
Obtains the PatternEntry of the given signature, if the signature is not found, it allocates a new on...
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Associative container based on the previosuly defined Entry type Each element is indexed by a key of ...
Declaration of the Packet class.
PatternStrideEntry * findStride(stride_t stride)
Returns the entry with the desired stride.
virtual void auxiliaryPrefetcher(Addr ppn, stride_t current_block, bool is_secure, std::vector< AddrPriority > &addresses)
Auxiliar prefetch mechanism used at the end of calculatePrefetch.
Copyright (c) 2018 Metempsy Technology Consulting All rights reserved.
AssociativeSet< SignatureEntry > signatureTable
Signature table.
signature_t updateSignature(signature_t sig, stride_t str) const
Generates a new signature from an existing one and a new stride.
SatCounter counter
Saturating counter.
virtual double calculatePrefetchConfidence(PatternEntry const &sig, PatternStrideEntry const &entry) const
Computes the prefetch confidence of the provided pattern entry.
T bits(T val, int first, int last)
Extract the bitfield from position 'first' to 'last' (inclusive) from 'val' and right justify it...
virtual void invalidate()
Invalidates the entry.
PatternEntry(size_t num_strides, unsigned counter_bits)
uint16_t signature_t
Signature type.
stride_t lastBlock
Last accessed block within a page.
Pattern entry data type, a set of stride and counter entries.