gem5  v19.0.0.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
sbooe.hh
Go to the documentation of this file.
1 
37 #ifndef __MEM_CACHE_PREFETCH_SBOOE_HH__
38 #define __MEM_CACHE_PREFETCH_SBOOE_HH__
39 
40 #include <deque>
41 #include <unordered_map>
42 #include <vector>
43 
45 #include "mem/packet.hh"
46 
47 struct SBOOEPrefetcherParams;
48 
50 {
51  private:
52 
54  const int latencyBufferSize;
56 
58  const unsigned int scoreThreshold;
59 
65  std::unordered_map<Addr, Tick> demandAddresses;
66 
74 
77 
80 
81  struct SandboxEntry {
87  bool valid;
88 
90  : valid(false)
91  {}
92  };
93 
94  struct Sandbox {
101  unsigned int sandboxScore;
103  unsigned int lateScore;
105  unsigned int index;
107  const int stride;
108 
109  Sandbox(unsigned int max_entries, int _stride)
110  : sandboxScore(0), lateScore(0), index(0), stride(_stride)
111  {
112  entries.resize(max_entries);
113  }
114 
121  void insert(Addr line, Tick tick);
122 
127  unsigned int score() const {
128  return (sandboxScore - lateScore);
129  }
130  };
131 
133 
136 
138  unsigned int accesses;
139 
146  bool access(Addr line);
147 
149  void notifyFill(const PacketPtr& pkt) override;
150 
151  public:
152  SBOOEPrefetcher(const SBOOEPrefetcherParams *p);
153 
154  void calculatePrefetch(const PrefetchInfo &pfi,
155  std::vector<AddrPriority> &addresses) override;
156 };
157 
158 #endif // __MEM_CACHE_PREFETCH_SBOOE_HH__
Tick expectedArrivalTick
Tick when the simulated prefetch is expected to be filled.
Definition: sbooe.hh:85
std::unordered_map< Addr, Tick > demandAddresses
Holds the current demand addresses and tick.
Definition: sbooe.hh:65
bool access(Addr line)
Process an access to the specified line address and update the sandbox counters counters.
Definition: sbooe.cc:71
void notifyFill(const PacketPtr &pkt) override
Update the latency buffer after a prefetch fill.
Definition: sbooe.cc:97
Addr line
Cache line predicted by the candidate prefetcher.
Definition: sbooe.hh:83
Sandbox * bestSandbox
Current best sandbox.
Definition: sbooe.hh:135
STL vector class.
Definition: stl.hh:40
const int stride
Sequential stride for this prefetcher.
Definition: sbooe.hh:107
unsigned int sandboxScore
Accesses during the eval period that were present in the sandbox.
Definition: sbooe.hh:101
Class containing the information needed by the prefetch to train and generate new prefetch requests...
Definition: base.hh:92
std::vector< Sandbox > sandboxes
Definition: sbooe.hh:132
Tick latencyBufferSum
Holds the current sum of the latency buffer latency.
Definition: sbooe.hh:79
Sandbox(unsigned int max_entries, int _stride)
Definition: sbooe.hh:109
uint64_t Tick
Tick count type.
Definition: types.hh:63
unsigned int index
Index of the oldest entry in the FIFO.
Definition: sbooe.hh:105
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition: types.hh:142
void calculatePrefetch(const PrefetchInfo &pfi, std::vector< AddrPriority > &addresses) override
Definition: sbooe.cc:124
A Packet is used to encapsulate a transfer between two objects in the memory system (e...
Definition: packet.hh:255
bool valid
To indicate if it was initialized.
Definition: sbooe.hh:87
unsigned int score() const
Calculate the useful score.
Definition: sbooe.hh:127
std::deque< Tick > latencyBuffer
The latency buffer holds the elapsed ticks between the demand and the fill in the cache for the lates...
Definition: sbooe.hh:73
Tick averageAccessLatency
Holds the current average access latency.
Definition: sbooe.hh:76
Declaration of the Packet class.
SBOOEPrefetcher(const SBOOEPrefetcherParams *p)
Copyright (c) 2018 Metempsy Technology Consulting All rights reserved.
Definition: sbooe.cc:36
unsigned int accesses
Number of accesses notified to the prefetcher.
Definition: sbooe.hh:138
unsigned int lateScore
Hits in the sandbox that wouldn&#39;t have been filled on time.
Definition: sbooe.hh:103
const unsigned int scoreThreshold
Threshold used to issue prefetchers.
Definition: sbooe.hh:58
const int sequentialPrefetchers
Definition: sbooe.hh:55
std::vector< SandboxEntry > entries
FIFO queue.
Definition: sbooe.hh:96
Bitfield< 0 > p
void insert(const PacketPtr &pkt, PrefetchInfo &new_pfi, int32_t priority)
Definition: queued.cc:352
const int latencyBufferSize
Prefetcher parameters.
Definition: sbooe.hh:54

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