31#include "debug/HWPrefetch.hh"
33#include "params/IrregularStreamBufferPrefetcher.hh"
42 const IrregularStreamBufferPrefetcherParams &
p)
44 chunkSize(
p.chunk_size),
45 prefetchCandidatesPerEntry(
p.prefetch_candidates_per_entry),
47 trainingUnit((
name() +
".TrainingUnit").c_str(),
48 p.training_unit_entries,
49 p.training_unit_assoc,
50 p.training_unit_replacement_policy,
51 p.training_unit_indexing_policy),
52 psAddressMappingCache((
name() +
".PSAddressMappingCache").c_str(),
53 p.address_map_cache_entries,
54 p.address_map_cache_assoc,
55 p.ps_address_map_cache_replacement_policy,
56 p.ps_address_map_cache_indexing_policy,
59 spAddressMappingCache((
name() +
".SPAddressMappingCache").c_str(),
60 p.address_map_cache_entries,
61 p.address_map_cache_assoc,
62 p.sp_address_map_cache_replacement_policy,
63 p.sp_address_map_cache_indexing_policy,
66 structuralAddressCounter(0)
88 bool correlated_addr_found =
false;
89 Addr correlated_addr_A = 0;
90 Addr correlated_addr_B = 0;
93 correlated_addr_found =
true;
95 correlated_addr_B =
addr;
98 assert(entry !=
nullptr);
106 if (correlated_addr_found) {
133 is_secure, correlated_addr_A);
153 if (ps_am !=
nullptr) {
160 if (sp_am ==
nullptr) {
186 if (ps_entry !=
nullptr) {
191 assert(ps_entry !=
nullptr);
195 return ps_entry->
mappings[map_index];
200 Addr structural_address,
bool is_secure,
Addr physical_address)
206 if (sp_entry !=
nullptr) {
210 assert(sp_entry !=
nullptr);
215 mapping.
address = physical_address;
Class containing the information needed by the prefetch to train and generate new prefetch requests.
Addr getPC() const
Returns the program counter that generated this request.
bool isSecure() const
Returns true if the address targets the secure memory space.
Addr getAddr() const
Obtains the address value of this Prefetcher address.
bool hasPC() const
Returns true if the associated program counter is valid.
unsigned lBlkSize
log_2(block size of the parent cache).
Addr blockIndex(Addr a) const
Determine the address of a at block granularity.
const unsigned prefetchCandidatesPerEntry
Number of prefetch candidates per Physical-to-Structural entry.
const size_t chunkSize
Size in bytes of a temporal stream.
uint64_t structuralAddressCounter
Counter of allocated structural addresses, increased by "chunkSize", each time a new structured addre...
AddressMapping & getPSMapping(Addr paddr, bool is_secure)
Obtain the Physical-to-Structured mapping entry of the given physical address.
void calculatePrefetch(const PrefetchInfo &pfi, std::vector< AddrPriority > &addresses, const CacheAccessor &cache) override
IrregularStreamBuffer(const IrregularStreamBufferPrefetcherParams &p)
AssociativeSet< AddressMappingEntry > spAddressMappingCache
Structured-to-Physical mappings table.
void addStructuralToPhysicalEntry(Addr structuralAddress, bool is_secure, Addr physical_address)
Add a mapping to the Structured-to-Physica mapping table.
const unsigned degree
Number of maximum prefetches requests created when predicting.
AssociativeSet< TrainingUnitEntry > trainingUnit
Map of PCs to Training unit entries.
AssociativeSet< AddressMappingEntry > psAddressMappingCache
Physical-to-Structured mappings table.
std::pair< Addr, int32_t > AddrPriority
static constexpr bool isPowerOf2(const T &n)
void reset()
Reset the counter to its initial value.
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Provides generic cache lookup functions.
Maps a set of contiguous addresses to another set of (not necessarily contiguos) addresses,...
std::vector< AddressMapping > mappings
Address Mapping entry, holds an address and a confidence counter.
Training Unit Entry datatype, it holds the last accessed address and its secure flag.
const std::string & name()