33 #include "debug/HWPrefetch.hh" 35 #include "params/IrregularStreamBufferPrefetcher.hh" 38 const IrregularStreamBufferPrefetcherParams *
p)
40 chunkSize(p->chunk_size),
41 prefetchCandidatesPerEntry(p->prefetch_candidates_per_entry),
43 trainingUnit(p->training_unit_assoc, p->training_unit_entries,
44 p->training_unit_indexing_policy,
45 p->training_unit_replacement_policy),
46 psAddressMappingCache(p->address_map_cache_assoc,
47 p->address_map_cache_entries,
48 p->ps_address_map_cache_indexing_policy,
49 p->ps_address_map_cache_replacement_policy,
51 p->num_counter_bits)),
52 spAddressMappingCache(p->address_map_cache_assoc,
53 p->address_map_cache_entries,
54 p->sp_address_map_cache_indexing_policy,
55 p->sp_address_map_cache_replacement_policy,
57 p->num_counter_bits)),
58 structuralAddressCounter(0)
79 bool correlated_addr_found =
false;
80 Addr correlated_addr_A = 0;
81 Addr correlated_addr_B = 0;
82 if (entry !=
nullptr && entry->lastAddressSecure == is_secure) {
84 correlated_addr_found =
true;
85 correlated_addr_A = entry->lastAddress;
86 correlated_addr_B =
addr;
89 assert(entry !=
nullptr);
94 entry->lastAddress =
addr;
95 entry->lastAddressSecure = is_secure;
97 if (correlated_addr_found) {
124 is_secure, correlated_addr_A);
144 if (ps_am !=
nullptr) {
151 if (sp_am ==
nullptr) {
177 if (ps_entry !=
nullptr) {
182 assert(ps_entry !=
nullptr);
186 return ps_entry->
mappings[map_index];
191 Addr structural_address,
bool is_secure,
Addr physical_address)
197 if (sp_entry !=
nullptr) {
201 assert(sp_entry !=
nullptr);
206 mapping.
address = physical_address;
212 IrregularStreamBufferPrefetcherParams::create()
const unsigned degree
Number of maximum prefetches requests created when predicting.
std::vector< AddressMapping > mappings
const size_t chunkSize
Size in bytes of a temporal stream.
Addr blockIndex(Addr a) const
Determine the address of a at block granularity.
Training Unit Entry datatype, it holds the last accessed address and its secure flag.
void calculatePrefetch(const PrefetchInfo &pfi, std::vector< AddrPriority > &addresses) override
Address Mapping entry, holds an address and a confidence counter.
AssociativeSet< AddressMappingEntry > spAddressMappingCache
Structured-to-Physical mappings table.
bool isSecure() const
Returns true if the address targets the secure memory space.
unsigned lBlkSize
log_2(block size of the parent cache).
void addStructuralToPhysicalEntry(Addr structuralAddress, bool is_secure, Addr physical_address)
Add a mapping to the Structured-to-Physica mapping table.
Addr getAddr() const
Obtains the address value of this Prefetcher address.
Class containing the information needed by the prefetch to train and generate new prefetch requests...
std::pair< Addr, int32_t > AddrPriority
AssociativeSet< AddressMappingEntry > psAddressMappingCache
Physical-to-Structured mappings table.
Addr getPC() const
Returns the program counter that generated this request.
AssociativeSet< TrainingUnitEntry > trainingUnit
Map of PCs to Training unit entries.
void reset()
Reset the counter to its initial value.
bool isPowerOf2(const T &n)
IrregularStreamBufferPrefetcher(const IrregularStreamBufferPrefetcherParams *p)
Copyright (c) 2018 Metempsy Technology Consulting All rights reserved.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
AddressMapping & getPSMapping(Addr paddr, bool is_secure)
Obtain the Physical-to-Structured mapping entry of the given physical address.
const unsigned prefetchCandidatesPerEntry
Number of prefetch candidates per Physical-to-Structural entry.
Maps a set of contiguous addresses to another set of (not necessarily contiguos) addresses, with their corresponding confidence counters.
uint64_t structuralAddressCounter
Counter of allocated structural addresses, increased by "chunkSize", each time a new structured addre...
bool hasPC() const
Returns true if the associated program counter is valid.