gem5 [DEVELOP-FOR-25.0]
Loading...
Searching...
No Matches
pif.hh
Go to the documentation of this file.
1
28
36
37#ifndef __MEM_CACHE_PREFETCH_PIF_HH__
38#define __MEM_CACHE_PREFETCH_PIF_HH__
39
40#include <deque>
41#include <vector>
42
47
48namespace gem5
49{
50
51struct PIFPrefetcherParams;
52
53namespace prefetch
54{
55
56class PIF : public Queued
57{
58 private:
60 const unsigned int precSize;
61 const unsigned int succSize;
63 const unsigned int maxCompactorEntries;
64
80 {
85 CompactorEntry(Addr, unsigned int, unsigned int);
86
96 bool inSameSpatialRegion(Addr addr, unsigned int log_blk_size,
97 bool update);
105 bool hasAddress(Addr target, unsigned int log_blk_size) const;
106
114 void getPredictedAddresses(unsigned int log_blk_size,
115 std::vector<AddrPriority> &addresses) const;
116 private:
125 unsigned int log_blk_size) const;
126 };
127
130
137
138 struct IndexEntry : public TaggedEntry
139 {
145
146 HistoryBuffer::iterator historyIt;
147 };
148
154
162
167 void notifyRetiredInst(const Addr pc);
168
173 {
174 public:
175 PrefetchListenerPC(PIF &_parent, std::string name)
176 : ProbeListenerArgBase(std::move(name)), parent(_parent)
177 {}
178 void notify(const Addr& pc) override;
179 protected:
181 };
182
185
186
187 public:
188 PIF(const PIFPrefetcherParams &p);
189 ~PIF() = default;
190
191 void calculatePrefetch(const PrefetchInfo &pfi,
192 std::vector<AddrPriority> &addresses,
193 const CacheAccessor &cache);
194
200 void addEventProbeRetiredInsts(SimObject *obj, const char *name);
201};
202
203} // namespace prefetch
204} // namespace gem5
205
206#endif // __MEM_CACHE_PREFETCH_PIF_HH__
Circular queue.
void update() const
Align cycle and tick to the next clock edge if not already done.
virtual std::string name() const
Definition named.hh:60
ProbeListenerArgBase(std::string name)
Definition probe.hh:226
const std::string name
Definition probe.hh:114
Abstract superclass for simulation objects.
void registerTagExtractor(TagExtractor ext)
std::function< Addr(Addr)> TagExtractor
Class containing the information needed by the prefetch to train and generate new prefetch requests.
Definition base.hh:113
void notify(const Addr &pc) override
Definition pif.cc:240
PrefetchListenerPC(PIF &_parent, std::string name)
Definition pif.hh:175
const unsigned int maxCompactorEntries
Number of entries used for the temporal compactor.
Definition pif.hh:63
const unsigned int precSize
Number of preceding and subsequent spatial addresses to compact.
Definition pif.hh:60
CircularQueue< CompactorEntry > HistoryBuffer
History buffer is a circular buffer that stores the sequence of retired instructions in FIFO order.
Definition pif.hh:135
void addEventProbeRetiredInsts(SimObject *obj, const char *name)
Add a SimObject and a probe name to monitor the retired instructions.
Definition pif.cc:246
CircularQueue< HistoryBuffer::iterator > streamAddressBuffer
A Stream Address Buffer (SAB) tracks a window of consecutive spatial regions.
Definition pif.hh:161
std::vector< ProbeListenerPtr< PrefetchListenerPC > > listenersPC
Array of probe listeners.
Definition pif.hh:184
void calculatePrefetch(const PrefetchInfo &pfi, std::vector< AddrPriority > &addresses, const CacheAccessor &cache)
Definition pif.cc:200
AssociativeCache< IndexEntry > index
The index table is a small cache-like structure that facilitates fast search of the history buffer.
Definition pif.hh:153
void notifyRetiredInst(const Addr pc)
Updates the prefetcher structures upon an instruction retired.
Definition pif.cc:137
const unsigned int succSize
Definition pif.hh:61
CompactorEntry spatialCompactor
Definition pif.hh:128
std::deque< CompactorEntry > temporalCompactor
Definition pif.hh:129
PIF(const PIFPrefetcherParams &p)
Definition pif.cc:42
HistoryBuffer historyBuffer
Definition pif.hh:136
Queued(const QueuedPrefetcherParams &p)
Definition queued.cc:100
STL deque class.
Definition stl.hh:44
STL vector class.
Definition stl.hh:37
Bitfield< 12 > ext
Bitfield< 4 > pc
Bitfield< 0 > p
Bitfield< 3 > addr
Definition types.hh:84
Copyright (c) 2024 Arm Limited All rights reserved.
Definition binary32.hh:36
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition types.hh:147
Overload hash function for BasicBlockRange type.
Definition binary32.hh:81
Provides generic cache lookup functions.
The compactor tracks retired instructions addresses, leveraging the spatial and temporal locality amo...
Definition pif.hh:80
std::vector< bool > prec
Definition pif.hh:82
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...
Definition pif.cc:95
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.
Definition pif.cc:77
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.
Definition pif.cc:111
std::vector< bool > succ
Definition pif.hh:83
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.
Definition pif.cc:66
IndexEntry(TagExtractor ext)
Definition pif.hh:140
HistoryBuffer::iterator historyIt
Definition pif.hh:146

Generated on Mon May 26 2025 09:19:11 for gem5 by doxygen 1.13.2