gem5 v24.0.0.0
Loading...
Searching...
No Matches
pif.hh
Go to the documentation of this file.
1
37#ifndef __MEM_CACHE_PREFETCH_PIF_HH__
38#define __MEM_CACHE_PREFETCH_PIF_HH__
39
40#include <deque>
41#include <vector>
42
46
47namespace gem5
48{
49
50struct PIFPrefetcherParams;
51
52namespace prefetch
53{
54
55class PIF : public Queued
56{
57 private:
59 const unsigned int precSize;
60 const unsigned int succSize;
62 const unsigned int maxCompactorEntries;
63
79 {
84 CompactorEntry(Addr, unsigned int, unsigned int);
85
95 bool inSameSpatialRegion(Addr addr, unsigned int log_blk_size,
96 bool update);
104 bool hasAddress(Addr target, unsigned int log_blk_size) const;
105
113 void getPredictedAddresses(unsigned int log_blk_size,
114 std::vector<AddrPriority> &addresses) const;
115 private:
124 unsigned int log_blk_size) const;
125 };
126
129
136
137 struct IndexEntry : public TaggedEntry
138 {
139 HistoryBuffer::iterator historyIt;
140 };
141
147
155
160 void notifyRetiredInst(const Addr pc);
161
166 {
167 public:
169 const std::string &name)
171 parent(_parent) {}
172 void notify(const Addr& pc) override;
173 protected:
175 };
176
179
180
181 public:
182 PIF(const PIFPrefetcherParams &p);
183 ~PIF() = default;
184
185 void calculatePrefetch(const PrefetchInfo &pfi,
186 std::vector<AddrPriority> &addresses,
187 const CacheAccessor &cache);
188
194 void addEventProbeRetiredInsts(SimObject *obj, const char *name);
195};
196
197} // namespace prefetch
198} // namespace gem5
199
200#endif // __MEM_CACHE_PREFETCH_PIF_HH__
void update() const
Align cycle and tick to the next clock edge if not already done.
virtual std::string name() const
Definition named.hh:47
ProbeListenerArgBase is used to define the base interface to a ProbeListenerArg (i....
Definition probe.hh:212
const std::string name
Definition probe.hh:138
ProbeManager is a conduit class that lives on each SimObject, and is used to match up probe listeners...
Definition probe.hh:164
Abstract superclass for simulation objects.
A tagged entry is an entry containing a tag.
Class containing the information needed by the prefetch to train and generate new prefetch requests.
Definition base.hh:111
Probe Listener to handle probe events from the CPU.
Definition pif.hh:166
void notify(const Addr &pc) override
Definition pif.cc:238
PrefetchListenerPC(PIF &_parent, ProbeManager *pm, const std::string &name)
Definition pif.hh:168
const unsigned int maxCompactorEntries
Number of entries used for the temporal compactor.
Definition pif.hh:62
std::vector< PrefetchListenerPC * > listenersPC
Array of probe listeners.
Definition pif.hh:178
const unsigned int precSize
Number of preceding and subsequent spatial addresses to compact.
Definition pif.hh:59
void addEventProbeRetiredInsts(SimObject *obj, const char *name)
Add a SimObject and a probe name to monitor the retired instructions.
Definition pif.cc:244
CircularQueue< HistoryBuffer::iterator > streamAddressBuffer
A Stream Address Buffer (SAB) tracks a window of consecutive spatial regions.
Definition pif.hh:154
void calculatePrefetch(const PrefetchInfo &pfi, std::vector< AddrPriority > &addresses, const CacheAccessor &cache)
Definition pif.cc:199
AssociativeCache< IndexEntry > index
The index table is a small cache-like structure that facilitates fast search of the history buffer.
Definition pif.hh:146
void notifyRetiredInst(const Addr pc)
Updates the prefetcher structures upon an instruction retired.
Definition pif.cc:137
const unsigned int succSize
Definition pif.hh:60
CompactorEntry spatialCompactor
Definition pif.hh:127
std::deque< CompactorEntry > temporalCompactor
Definition pif.hh:128
PIF(const PIFPrefetcherParams &p)
Definition pif.cc:43
HistoryBuffer historyBuffer
Definition pif.hh:135
STL deque class.
Definition stl.hh:44
STL vector class.
Definition stl.hh:37
Bitfield< 4 > pc
Bitfield< 0 > p
Bitfield< 3 > addr
Definition types.hh:84
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria 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
Provides generic cache lookup functions.
The compactor tracks retired instructions addresses, leveraging the spatial and temporal locality amo...
Definition pif.hh:79
std::vector< bool > prec
Definition pif.hh:81
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:82
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
HistoryBuffer::iterator historyIt
Definition pif.hh:139

Generated on Tue Jun 18 2024 16:24:05 for gem5 by doxygen 1.11.0