52a53
> protected:
99c100,103
< PatternEntry(size_t num_strides) : strideEntries(num_strides)
---
> /** use counter, used by SPPv2 */
> uint8_t counter;
> PatternEntry(size_t num_strides) : strideEntries(num_strides),
> counter(0)
108a113
> counter = 0;
160,163c165,172
< * @param block block number within the page, this value can be negative,
< * which means that the block refered is actualy in the previous
< * page (ppn-1), if the value is greater than (pageBytes/blkSize-1)
< * then the block refers to a block within the next page (ppn+1)
---
> * @param last_block last accessed block within the page ppn
> * @param delta difference, in number of blocks, from the last_block
> * accessed to the block to prefetch. The block to prefetch is
> * computed by this formula:
> * ppn * pageBytes + (last_block + delta) * blkSize
> * This value can be negative.
> * @param path_confidence the confidence factor of this prefetch
> * @param signature the current path signature
165c174
< * @param addresses if allowed, the address will be added to this vector
---
> * @param addresses addresses to prefetch will be added to this vector
167,168c176,179
< void addPrefetch(Addr ppn, stride_t block, bool is_secure,
< std::vector<AddrPriority> &addresses);
---
> void addPrefetch(Addr ppn, stride_t last_block, stride_t delta,
> double path_confidence, signature_t signature,
> bool is_secure,
> std::vector<AddrPriority> &addresses);
172a184,185
> * It also provides the stride of the current block and the initial
> * path confidence of the corresponding entry
176c189,191
< * @param miss output, if the entry is not found, this will be set to true
---
> * @param miss if the entry is not found, this will be set to true
> * @param stride set to the computed stride
> * @param initial_confidence set to the initial confidence value
179,180c194,195
< SignatureEntry & getSignatureEntry(Addr ppn, bool is_secure,
< stride_t block, bool &miss);
---
> SignatureEntry &getSignatureEntry(Addr ppn, bool is_secure, stride_t block,
> bool &miss, stride_t &stride, double &initial_confidence);
187c202
< PatternEntry & getPatternEntry(Addr signature);
---
> PatternEntry& getPatternEntry(Addr signature);
196a212,281
> /**
> * Computes the lookahead path confidence of the provided pattern entry
> * @param sig the PatternEntry to use
> * @param lookahead PatternStrideEntry within the provided PatternEntry
> * @return the computed confidence factor
> */
> virtual double calculateLookaheadConfidence(PatternEntry const &sig,
> PatternStrideEntry const &lookahead) const;
>
> /**
> * Computes the prefetch confidence of the provided pattern entry
> * @param sig the PatternEntry to use
> * @param entry PatternStrideEntry within the provided PatternEntry
> * @return the computed confidence factor
> */
> virtual double calculatePrefetchConfidence(PatternEntry const &sig,
> PatternStrideEntry const &entry) const;
>
> /**
> * Increases the counter of a given PatternEntry/PatternStrideEntry
> * @param pattern_entry the corresponding PatternEntry
> * @param pstride_entry the PatternStrideEntry within the PatternEntry
> */
> virtual void increasePatternEntryCounter(PatternEntry &pattern_entry,
> PatternStrideEntry &pstride_entry);
>
> /**
> * Whenever a new SignatureEntry is allocated, it computes the new
> * signature to be used with the new entry, the resulting stride and the
> * initial path confidence of the new entry.
> * @param current_block accessed block within the page of the associated
> entry
> * @param new_signature new signature of the allocated entry
> * @param new_conf the initial path confidence of this entry
> * @param new_stride the resulting current stride
> */
> virtual void handleSignatureTableMiss(stride_t current_block,
> signature_t &new_signature, double &new_conf,
> stride_t &new_stride);
>
> /**
> * Auxiliar prefetch mechanism used at the end of calculatePrefetch.
> * This prefetcher uses this to activate the next line prefetcher if
> * no prefetch candidates have been found.
> * @param ppn physical page number of the current accessed page
> * @param current_block last accessed block within the page ppn
> * @param is_secure whether this page is inside the secure memory area
> * @param addresses the addresses to be prefetched are added to this vector
> * @param updated_filter_entries set of addresses containing these that
> * their filter has been updated, if this call updates a new entry
> */
> virtual void auxiliaryPrefetcher(Addr ppn, stride_t current_block,
> bool is_secure, std::vector<AddrPriority> &addresses);
>
> /**
> * Handles the situation when the lookahead process has crossed the
> * boundaries of the current page. This is not fully described in the
> * paper that was used to implement this code, however, the article
> * describing the upgraded version of this prefetcher provides some
> * details. For this prefetcher, there are no specific actions to be
> * done.
> * @param signature the lookahead signature that crossed the page
> * @param delta the current stride that caused it
> * @param last_offset the last accessed block within the page
> * @param path_confidence the path confidence at the moment of crossing
> */
> virtual void handlePageCrossingLookahead(signature_t signature,
> stride_t last_offset, stride_t delta, double path_confidence) {
> }
>