gem5 v24.1.0.1
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
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:
176 const std::string &name)
178 parent(_parent) {}
179 void notify(const Addr& pc) override;
180 protected:
182 };
183
186
187
188 public:
189 PIF(const PIFPrefetcherParams &p);
190 ~PIF() = default;
191
192 void calculatePrefetch(const PrefetchInfo &pfi,
193 std::vector<AddrPriority> &addresses,
194 const CacheAccessor &cache);
195
201 void addEventProbeRetiredInsts(SimObject *obj, const char *name);
202};
203
204} // namespace prefetch
205} // namespace gem5
206
207#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.
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:111
Probe Listener to handle probe events from the CPU.
Definition pif.hh:173
void notify(const Addr &pc) override
Definition pif.cc:240
PrefetchListenerPC(PIF &_parent, ProbeManager *pm, const std::string &name)
Definition pif.hh:175
const unsigned int maxCompactorEntries
Number of entries used for the temporal compactor.
Definition pif.hh:63
std::vector< PrefetchListenerPC * > listenersPC
Array of probe listeners.
Definition pif.hh:185
const unsigned int precSize
Number of preceding and subsequent spatial addresses to compact.
Definition pif.hh:60
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
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
HistoryBuffer historyBuffer
Definition pif.hh:136
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
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 Jan 13 2025 04:28:38 for gem5 by doxygen 1.9.8