Go to the documentation of this file.
33 #include "debug/HWPrefetch.hh"
35 #include "params/PIFPrefetcher.hh"
41 precSize(
p->prec_spatial_region_bits),
42 succSize(
p->succ_spatial_region_bits),
43 maxCompactorEntries(
p->compactor_entries),
44 historyBuffer(
p->history_buffer_size),
45 index(
p->index_assoc,
p->index_entries,
p->index_indexing_policy,
46 p->index_replacement_policy),
47 streamAddressBuffer(
p->stream_address_buffer_entries),
53 unsigned int prec_size,
unsigned int succ_size)
56 prec.resize(prec_size,
false);
57 succ.resize(succ_size,
false);
62 unsigned int log_blk_size)
const
64 const Addr target_blk = target >> log_blk_size;
67 return target_blk > trigger_blk ?
68 target_blk - trigger_blk : trigger_blk - target_blk;
73 unsigned int log_blk_size,
bool update)
75 Addr blk_distance = distanceFromTrigger(
pc, log_blk_size);
78 (succ.size() > blk_distance) : (prec.size() > blk_distance);
81 succ[blk_distance] =
true;
83 prec[blk_distance] =
true;
91 unsigned int log_blk_size)
const
93 Addr blk_distance = distanceFromTrigger(target, log_blk_size);
96 hit = blk_distance < succ.size() && succ[blk_distance];
98 hit = blk_distance < prec.size() && prec[blk_distance];
115 for (
int i = prec.size()-1;
i >= 0;
i--) {
118 const Addr prec_addr = (trigger_blk - (
i+1)) << log_blk_size;
122 for (
int i = 0;
i < succ.size();
i++) {
125 const Addr succ_addr = (trigger_blk + (
i+1)) << log_blk_size;
147 bool is_in_temporal_compactor =
false;
153 if (it->inSameSpatialRegion(
pc,
lBlkSize,
false)) {
156 is_in_temporal_compactor =
true;
170 if (!is_in_temporal_compactor) {
177 if (idx_entry !=
nullptr) {
178 index.accessEntry(idx_entry);
181 assert(idx_entry !=
nullptr);
210 sabEntry->getPredictedAddresses(
lBlkSize, addresses);
220 if (idx_entry !=
nullptr) {
221 index.accessEntry(idx_entry);
229 entry->getPredictedAddresses(
lBlkSize, addresses);
236 parent.notifyRetiredInst(
pc);
249 PIFPrefetcherParams::create()
std::pair< Addr, int32_t > AddrPriority
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...
iterator getIterator(size_t idx)
Return an iterator to an index in the vector.
Addr getPC() const
Returns the program counter that generated this request.
Probe Listener to handle probe events from the CPU.
const unsigned int maxCompactorEntries
Number of entries used for the temporal compactor.
const unsigned int precSize
Number of preceding and subsequent spatial addresses to compact.
CircularQueue< HistoryBuffer::iterator > streamAddressBuffer
A Stream Address Buffer (SAB) tracks a window of consecutive spatial regions.
void addEventProbeRetiredInsts(SimObject *obj, const char *name)
Add a SimObject and a probe name to monitor the retired instructions.
const unsigned int succSize
std::vector< PrefetchListenerPC * > listenersPC
Array of probe listeners.
void update() const
Align cycle and tick to the next clock edge if not already done.
HistoryBuffer::iterator historyIt
CompactorEntry spatialCompactor
unsigned lBlkSize
log_2(block size of the parent cache).
Copyright (c) 2018 Metempsy Technology Consulting All rights reserved.
PIF(const PIFPrefetcherParams *p)
AssociativeSet< IndexEntry > index
The index table is a small cache-like structure that facilitates fast search of the history buffer.
HistoryBuffer historyBuffer
void push_back(typename Base::value_type val)
Pushes an element at the end of the queue.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
ProbeManager * getProbeManager()
Get the probe manager for this object.
void calculatePrefetch(const PrefetchInfo &pfi, std::vector< AddrPriority > &addresses)
virtual const std::string name() const
void notify(const Addr &pc) override
ProbeManager is a conduit class that lives on each SimObject, and is used to match up probe listeners...
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.
std::deque< CompactorEntry > temporalCompactor
Class containing the information needed by the prefetch to train and generate new prefetch requests.
The compactor tracks retired instructions addresses, leveraging the spatial and temporal locality amo...
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.
void notifyRetiredInst(const Addr pc)
Updates the prefetcher structures upon an instruction retired.
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.
bool hasPC() const
Returns true if the associated program counter is valid.
Abstract superclass for simulation objects.
Generated on Wed Sep 30 2020 14:02:12 for gem5 by doxygen 1.8.17