gem5  v19.0.0.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
pif.hh
Go to the documentation of this file.
1 
39 #ifndef __MEM_CACHE_PREFETCH_PIF_HH__
40 #define __MEM_CACHE_PREFETCH_PIF_HH__
41 
42 #include <deque>
43 #include <vector>
44 
47 
48 struct PIFPrefetcherParams;
49 
51 {
52  private:
54  const unsigned int precSize;
55  const unsigned int succSize;
57  const unsigned int maxCompactorEntries;
59  const unsigned int maxStreamAddressBufferEntries;
60 
75  struct CompactorEntry {
80  CompactorEntry(Addr, unsigned int, unsigned int);
81 
91  bool inSameSpatialRegion(Addr addr, unsigned int log_blk_size,
92  bool update);
100  bool hasAddress(Addr target, unsigned int log_blk_size) const;
101 
109  void getPredictedAddresses(unsigned int log_blk_size,
110  std::vector<AddrPriority> &addresses) const;
111  private:
120  unsigned int log_blk_size) const;
121  };
122 
125 
131  unsigned int historyBufferTail;
132 
133  struct IndexEntry : public TaggedEntry
134  {
135  unsigned int historyIndex;
136  };
142 
150 
155  void notifyRetiredInst(const Addr pc);
156 
161  {
162  public:
164  const std::string &name)
165  : ProbeListenerArgBase(pm, name),
166  parent(_parent) {}
167  void notify(const Addr& pc) override;
168  protected:
170  };
171 
174 
175 
176  public:
177  PIFPrefetcher(const PIFPrefetcherParams *p);
179 
180  void calculatePrefetch(const PrefetchInfo &pfi,
181  std::vector<AddrPriority> &addresses);
182 
188  void addEventProbeRetiredInsts(SimObject *obj, const char *name);
189 };
190 
191 #endif // __MEM_CACHE_PREFETCH_PIF_HH__
PIFPrefetcher(const PIFPrefetcherParams *p)
Copyright (c) 2019 Metempsy Technology Consulting All rights reserved.
Definition: pif.cc:39
void addEventProbeRetiredInsts(SimObject *obj, const char *name)
Add a SimObject and a probe name to monitor the retired instructions.
Definition: pif.cc:250
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:73
std::deque< CompactorEntry > temporalCompactor
Definition: pif.hh:124
std::vector< bool > succ
Definition: pif.hh:78
ip6_addr_t addr
Definition: inet.hh:335
Probe Listener to handle probe events from the CPU.
Definition: pif.hh:160
PrefetchListenerPC(PIFPrefetcher &_parent, ProbeManager *pm, const std::string &name)
Definition: pif.hh:163
const unsigned int maxStreamAddressBufferEntries
Max number of entries to be used in the Stream Address Buffer.
Definition: pif.hh:59
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:62
ProbeManager is a conduit class that lives on each SimObject, and is used to match up probe listeners...
Definition: probe.hh:152
const unsigned int maxCompactorEntries
Number of entries used for the temporal compactor.
Definition: pif.hh:57
std::deque< CompactorEntry * > streamAddressBuffer
A Stream Address Buffer (SAB) tracks a window of consecutive spatial regions.
Definition: pif.hh:149
unsigned int historyIndex
Definition: pif.hh:135
PIFPrefetcher & parent
Definition: pif.hh:169
std::vector< PrefetchListenerPC * > listenersPC
Array of probe listeners.
Definition: pif.hh:173
std::vector< bool > prec
Definition: pif.hh:77
Bitfield< 4 > pc
Class containing the information needed by the prefetch to train and generate new prefetch requests...
Definition: base.hh:92
ProbeListenerArgBase is used to define the base interface to a ProbeListenerArg (i.e the notify method on specific type).
Definition: probe.hh:200
const unsigned int succSize
Definition: pif.hh:55
void notifyRetiredInst(const Addr pc)
Updates the prefetcher structures upon an instruction retired.
Definition: pif.cc:133
The compactor tracks retired instructions addresses, leveraging the spatial and temporal locality amo...
Definition: pif.hh:75
unsigned int historyBufferTail
Definition: pif.hh:131
std::vector< CompactorEntry > historyBuffer
History buffer is a circular buffer that stores the sequence of retired instructions in FIFO order...
Definition: pif.hh:130
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition: types.hh:142
void notify(const PacketPtr &pkt, const PrefetchInfo &pfi) override
Notify prefetcher of cache access (may be any access or just misses, depending on cache parameters...
Definition: queued.cc:143
virtual const std::string name() const
Definition: sim_object.hh:120
Associative container based on the previosuly defined Entry type Each element is indexed by a key of ...
CompactorEntry spatialCompactor
Definition: pif.hh:123
STL deque class.
Definition: stl.hh:47
void calculatePrefetch(const PrefetchInfo &pfi, std::vector< AddrPriority > &addresses)
Definition: pif.cc:200
~PIFPrefetcher()
Definition: pif.hh:178
const unsigned int precSize
Number of preceding and subsequent spatial addresses to compact.
Definition: pif.hh:54
Copyright (c) 2018 Metempsy Technology Consulting All rights reserved.
AssociativeSet< IndexEntry > index
The index table is a small cache-like structure that facilitates fast search of the history buffer...
Definition: pif.hh:141
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:91
Bitfield< 0 > p
void update() const
Align cycle and tick to the next clock edge if not already done.
Abstract superclass for simulation objects.
Definition: sim_object.hh:96
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:107

Generated on Fri Feb 28 2020 16:27:01 for gem5 by doxygen 1.8.13