gem5  v22.1.0.0
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 
43 #include "base/circular_queue.hh"
46 
47 namespace gem5
48 {
49 
50 struct PIFPrefetcherParams;
51 
53 namespace prefetch
54 {
55 
56 class 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  {
140  HistoryBuffer::iterator historyIt;
141  };
147 
155 
160  void notifyRetiredInst(const Addr pc);
161 
166  {
167  public:
169  const std::string &name)
170  : ProbeListenerArgBase(pm, 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 
193  void addEventProbeRetiredInsts(SimObject *obj, const char *name);
194 };
195 
196 } // namespace prefetch
197 } // namespace gem5
198 
199 #endif // __MEM_CACHE_PREFETCH_PIF_HH__
Associative container based on the previosuly defined Entry type Each element is indexed by a key of ...
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.
Definition: sim_object.hh:148
A tagged entry is an entry containing a tag.
Definition: tagged_entry.hh:47
Class containing the information needed by the prefetch to train and generate new prefetch requests.
Definition: base.hh:98
Probe Listener to handle probe events from the CPU.
Definition: pif.hh:166
void notify(const Addr &pc) override
Definition: pif.cc:239
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:63
void calculatePrefetch(const PrefetchInfo &pfi, std::vector< AddrPriority > &addresses)
Definition: pif.cc:201
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:60
void addEventProbeRetiredInsts(SimObject *obj, const char *name)
Add a SimObject and a probe name to monitor the retired instructions.
Definition: pif.cc:245
CircularQueue< HistoryBuffer::iterator > streamAddressBuffer
A Stream Address Buffer (SAB) tracks a window of consecutive spatial regions.
Definition: pif.hh:154
AssociativeSet< 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:61
CompactorEntry spatialCompactor
Definition: pif.hh:128
std::deque< CompactorEntry > temporalCompactor
Definition: pif.hh:129
PIF(const PIFPrefetcherParams &p)
Definition: pif.cc:44
HistoryBuffer historyBuffer
Definition: pif.hh:136
STL deque class.
Definition: stl.hh:44
Bitfield< 4 > pc
Bitfield< 54 > p
Definition: pagetable.hh:70
Bitfield< 3 > addr
Definition: types.hh:84
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition: types.hh:147
GEM5_DEPRECATED_NAMESPACE(GuestABI, guest_abi)
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
HistoryBuffer::iterator historyIt
Definition: pif.hh:140

Generated on Wed Dec 21 2022 10:22:36 for gem5 by doxygen 1.9.1