gem5  v20.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 struct PIFPrefetcherParams;
48 
49 namespace Prefetcher {
50 
51 class PIF : public Queued
52 {
53  private:
55  const unsigned int precSize;
56  const unsigned int succSize;
58  const unsigned int maxCompactorEntries;
59 
74  struct CompactorEntry {
79  CompactorEntry(Addr, unsigned int, unsigned int);
80 
90  bool inSameSpatialRegion(Addr addr, unsigned int log_blk_size,
91  bool update);
99  bool hasAddress(Addr target, unsigned int log_blk_size) const;
100 
108  void getPredictedAddresses(unsigned int log_blk_size,
109  std::vector<AddrPriority> &addresses) const;
110  private:
119  unsigned int log_blk_size) const;
120  };
121 
124 
131 
132  struct IndexEntry : public TaggedEntry
133  {
134  HistoryBuffer::iterator historyIt;
135  };
141 
149 
154  void notifyRetiredInst(const Addr pc);
155 
160  {
161  public:
163  const std::string &name)
164  : ProbeListenerArgBase(pm, name),
165  parent(_parent) {}
166  void notify(const Addr& pc) override;
167  protected:
169  };
170 
173 
174 
175  public:
176  PIF(const PIFPrefetcherParams *p);
177  ~PIF() = default;
178 
179  void calculatePrefetch(const PrefetchInfo &pfi,
180  std::vector<AddrPriority> &addresses);
181 
187  void addEventProbeRetiredInsts(SimObject *obj, const char *name);
188 };
189 
190 } // namespace Prefetcher
191 
192 #endif // __MEM_CACHE_PREFETCH_PIF_HH__
Prefetcher::PIF::CompactorEntry::hasAddress
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:90
TaggedEntry
Copyright (c) 2018 Metempsy Technology Consulting All rights reserved.
Definition: associative_set.hh:39
Prefetcher::PIF::PrefetchListenerPC
Probe Listener to handle probe events from the CPU.
Definition: pif.hh:159
AssociativeSet
Associative container based on the previosuly defined Entry type Each element is indexed by a key of ...
Definition: associative_set.hh:117
Prefetcher::PIF::CompactorEntry::CompactorEntry
CompactorEntry()
Definition: pif.hh:78
Prefetcher::PIF::maxCompactorEntries
const unsigned int maxCompactorEntries
Number of entries used for the temporal compactor.
Definition: pif.hh:58
Prefetcher::PIF::precSize
const unsigned int precSize
Number of preceding and subsequent spatial addresses to compact.
Definition: pif.hh:55
CircularQueue< CompactorEntry >
std::vector< bool >
Prefetcher::PIF::streamAddressBuffer
CircularQueue< HistoryBuffer::iterator > streamAddressBuffer
A Stream Address Buffer (SAB) tracks a window of consecutive spatial regions.
Definition: pif.hh:148
Prefetcher::PIF::addEventProbeRetiredInsts
void addEventProbeRetiredInsts(SimObject *obj, const char *name)
Add a SimObject and a probe name to monitor the retired instructions.
Definition: pif.cc:240
queued.hh
Prefetcher::PIF::succSize
const unsigned int succSize
Definition: pif.hh:56
Prefetcher::PIF::PrefetchListenerPC::parent
PIF & parent
Definition: pif.hh:168
Prefetcher::PIF::listenersPC
std::vector< PrefetchListenerPC * > listenersPC
Array of probe listeners.
Definition: pif.hh:172
Clocked::update
void update() const
Align cycle and tick to the next clock edge if not already done.
Definition: clocked_object.hh:76
Prefetcher::PIF::IndexEntry::historyIt
HistoryBuffer::iterator historyIt
Definition: pif.hh:134
Prefetcher::PIF::CompactorEntry::succ
std::vector< bool > succ
Definition: pif.hh:77
Prefetcher::PIF
Definition: pif.hh:51
circular_queue.hh
Prefetcher::PIF::spatialCompactor
CompactorEntry spatialCompactor
Definition: pif.hh:122
MipsISA::pc
Bitfield< 4 > pc
Definition: pra_constants.hh:240
Prefetcher::PIF::~PIF
~PIF()=default
ProbeListener::name
const std::string name
Definition: probe.hh:125
Prefetcher::PIF::CompactorEntry::prec
std::vector< bool > prec
Definition: pif.hh:76
Prefetcher
Copyright (c) 2018 Metempsy Technology Consulting All rights reserved.
Definition: base.hh:78
Prefetcher::PIF::PIF
PIF(const PIFPrefetcherParams *p)
Definition: pif.cc:39
Prefetcher::PIF::index
AssociativeSet< IndexEntry > index
The index table is a small cache-like structure that facilitates fast search of the history buffer.
Definition: pif.hh:140
Prefetcher::PIF::historyBuffer
HistoryBuffer historyBuffer
Definition: pif.hh:130
Prefetcher::PIF::PrefetchListenerPC::PrefetchListenerPC
PrefetchListenerPC(PIF &_parent, ProbeManager *pm, const std::string &name)
Definition: pif.hh:162
Addr
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition: types.hh:142
Prefetcher::Queued
Definition: queued.hh:54
Prefetcher::PIF::calculatePrefetch
void calculatePrefetch(const PrefetchInfo &pfi, std::vector< AddrPriority > &addresses)
Definition: pif.cc:196
SimObject::name
virtual const std::string name() const
Definition: sim_object.hh:133
Prefetcher::PIF::PrefetchListenerPC::notify
void notify(const Addr &pc) override
Definition: pif.cc:234
ProbeManager
ProbeManager is a conduit class that lives on each SimObject, and is used to match up probe listeners...
Definition: probe.hh:150
Prefetcher::PIF::CompactorEntry::distanceFromTrigger
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:61
Prefetcher::PIF::IndexEntry
Definition: pif.hh:132
std::deque
STL deque class.
Definition: stl.hh:44
Prefetcher::PIF::temporalCompactor
std::deque< CompactorEntry > temporalCompactor
Definition: pif.hh:123
addr
ip6_addr_t addr
Definition: inet.hh:423
Prefetcher::Base::PrefetchInfo
Class containing the information needed by the prefetch to train and generate new prefetch requests.
Definition: base.hh:90
Prefetcher::PIF::CompactorEntry
The compactor tracks retired instructions addresses, leveraging the spatial and temporal locality amo...
Definition: pif.hh:74
Prefetcher::PIF::CompactorEntry::inSameSpatialRegion
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:72
Prefetcher::PIF::notifyRetiredInst
void notifyRetiredInst(const Addr pc)
Updates the prefetcher structures upon an instruction retired.
Definition: pif.cc:132
associative_set.hh
MipsISA::p
Bitfield< 0 > p
Definition: pra_constants.hh:323
Prefetcher::PIF::CompactorEntry::trigger
Addr trigger
Definition: pif.hh:75
Prefetcher::PIF::CompactorEntry::getPredictedAddresses
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:106
SimObject
Abstract superclass for simulation objects.
Definition: sim_object.hh:92
ProbeListenerArgBase
ProbeListenerArgBase is used to define the base interface to a ProbeListenerArg (i....
Definition: probe.hh:198

Generated on Wed Sep 30 2020 14:02:12 for gem5 by doxygen 1.8.17