31#include "debug/HWPrefetch.hh"
32#include "params/IrregularStreamBufferPrefetcher.hh"
41 const IrregularStreamBufferPrefetcherParams &
p)
43 chunkSize(
p.chunk_size),
44 prefetchCandidatesPerEntry(
p.prefetch_candidates_per_entry),
46 trainingUnit((
name() +
".TrainingUnit").c_str(),
47 p.training_unit_entries,
48 p.training_unit_assoc,
49 p.training_unit_replacement_policy,
50 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,
60 spAddressMappingCache((
name() +
".SPAddressMappingCache").c_str(),
61 p.address_map_cache_entries,
62 p.address_map_cache_assoc,
63 p.sp_address_map_cache_replacement_policy,
64 p.sp_address_map_cache_indexing_policy,
68 structuralAddressCounter(0)
91 bool correlated_addr_found =
false;
92 Addr correlated_addr_A = 0;
93 Addr correlated_addr_B = 0;
96 correlated_addr_found =
true;
98 correlated_addr_B =
addr;
101 assert(entry !=
nullptr);
109 if (correlated_addr_found) {
136 is_secure, correlated_addr_A);
155 {amc_address, is_secure});
156 if (ps_am !=
nullptr) {
163 if (sp_am ==
nullptr) {
189 if (ps_entry !=
nullptr) {
194 assert(ps_entry !=
nullptr);
198 return ps_entry->
mappings[map_index];
203 Addr structural_address,
bool is_secure,
Addr physical_address)
209 if (sp_entry !=
nullptr) {
213 assert(sp_entry !=
nullptr);
218 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.
AssociativeCache< TrainingUnitEntry > trainingUnit
Map of PCs to Training unit entries.
const size_t chunkSize
Size in bytes of a temporal stream.
AssociativeCache< AddressMappingEntry > psAddressMappingCache
Physical-to-Structured mappings table.
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
AssociativeCache< AddressMappingEntry > spAddressMappingCache
Structured-to-Physical mappings table.
IrregularStreamBuffer(const IrregularStreamBufferPrefetcherParams &p)
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.
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 Arm Limited All rights reserved.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
static constexpr auto genTagExtractor(BTBIndexingPolicy *ip)
This helper generates a tag extractor function object which will be typically used by Replaceable ent...
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()