Go to the documentation of this file.
33 #include "debug/HWPrefetch.hh"
35 #include "params/PIFPrefetcher.hh"
45 precSize(
p.prec_spatial_region_bits),
46 succSize(
p.succ_spatial_region_bits),
47 maxCompactorEntries(
p.compactor_entries),
48 historyBuffer(
p.history_buffer_size),
49 index(
p.index_assoc,
p.index_entries,
p.index_indexing_policy,
50 p.index_replacement_policy),
51 streamAddressBuffer(
p.stream_address_buffer_entries),
57 unsigned int prec_size,
unsigned int succ_size)
60 prec.resize(prec_size,
false);
61 succ.resize(succ_size,
false);
66 unsigned int log_blk_size)
const
68 const Addr target_blk = target >> log_blk_size;
71 return target_blk > trigger_blk ?
72 target_blk - trigger_blk : trigger_blk - target_blk;
77 unsigned int log_blk_size,
bool update)
79 Addr blk_distance = distanceFromTrigger(
pc, log_blk_size);
82 (
succ.size() > blk_distance) : (prec.size() > blk_distance);
85 succ[blk_distance] =
true;
87 prec[blk_distance] =
true;
95 unsigned int log_blk_size)
const
97 Addr blk_distance = distanceFromTrigger(target, log_blk_size);
100 hit = blk_distance <
succ.size() &&
succ[blk_distance];
102 hit = blk_distance < prec.size() && prec[blk_distance];
119 for (
int i = prec.size()-1;
i >= 0;
i--) {
122 const Addr prec_addr = (trigger_blk - (
i+1)) << log_blk_size;
126 for (
int i = 0;
i <
succ.size();
i++) {
129 const Addr succ_addr = (trigger_blk + (
i+1)) << log_blk_size;
151 bool is_in_temporal_compactor =
false;
157 if (it->inSameSpatialRegion(
pc,
lBlkSize,
false)) {
160 is_in_temporal_compactor =
true;
174 if (!is_in_temporal_compactor) {
181 if (idx_entry !=
nullptr) {
182 index.accessEntry(idx_entry);
185 assert(idx_entry !=
nullptr);
214 sabEntry->getPredictedAddresses(
lBlkSize, addresses);
224 if (idx_entry !=
nullptr) {
225 index.accessEntry(idx_entry);
233 entry->getPredictedAddresses(
lBlkSize, addresses);
240 parent.notifyRetiredInst(
pc);
std::pair< Addr, int32_t > AddrPriority
Probe Listener to handle probe events from the CPU.
void notify(const Addr &pc) override
HistoryBuffer::iterator historyIt
void push_back(typename std::vector< T >::value_type val)
Pushes an element at the end of the queue.
const unsigned int maxCompactorEntries
Number of entries used for the temporal compactor.
CompactorEntry spatialCompactor
void update() const
Align cycle and tick to the next clock edge if not already done.
void notifyRetiredInst(const Addr pc)
Updates the prefetcher structures upon an instruction retired.
bool hasAddress(Addr target, unsigned int log_blk_size) const
Checks if the provided address is contained in this spatial region and if its corresponding bit vecto...
Addr getPC() const
Returns the program counter that generated this request.
virtual std::string name() const
Addr distanceFromTrigger(Addr addr, unsigned int log_blk_size) const
Computes the distance, in cache blocks, from an address to the trigger of the entry.
const unsigned int succSize
Abstract superclass for simulation objects.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
ProbeManager is a conduit class that lives on each SimObject, and is used to match up probe listeners...
HistoryBuffer historyBuffer
const unsigned int precSize
Number of preceding and subsequent spatial addresses to compact.
ProbeManager * getProbeManager()
Get the probe manager for this object.
unsigned lBlkSize
log_2(block size of the parent cache).
void calculatePrefetch(const PrefetchInfo &pfi, std::vector< AddrPriority > &addresses)
void addEventProbeRetiredInsts(SimObject *obj, const char *name)
Add a SimObject and a probe name to monitor the retired instructions.
void getPredictedAddresses(unsigned int log_blk_size, std::vector< AddrPriority > &addresses) const
Fills the provided vector with the predicted addresses using the recorded bit vectors of the entry.
std::deque< CompactorEntry > temporalCompactor
The compactor tracks retired instructions addresses, leveraging the spatial and temporal locality amo...
CircularQueue< HistoryBuffer::iterator > streamAddressBuffer
A Stream Address Buffer (SAB) tracks a window of consecutive spatial regions.
PIF(const PIFPrefetcherParams &p)
iterator getIterator(size_t idx)
Return an iterator to an index in the queue.
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
AssociativeSet< IndexEntry > index
The index table is a small cache-like structure that facilitates fast search of the history buffer.
bool inSameSpatialRegion(Addr addr, unsigned int log_blk_size, bool update)
Checks if a given address is in the same defined spatial region as the compactor entry.
Class containing the information needed by the prefetch to train and generate new prefetch requests.
std::vector< PrefetchListenerPC * > listenersPC
Array of probe listeners.
bool hasPC() const
Returns true if the associated program counter is valid.
Generated on Sun Jul 30 2023 01:56:57 for gem5 by doxygen 1.8.17