gem5  v22.1.0.0
sbooe.hh
Go to the documentation of this file.
1 
35 #ifndef __MEM_CACHE_PREFETCH_SBOOE_HH__
36 #define __MEM_CACHE_PREFETCH_SBOOE_HH__
37 
38 #include <unordered_map>
39 #include <vector>
40 
41 #include "base/circular_queue.hh"
43 #include "mem/packet.hh"
44 
45 namespace gem5
46 {
47 
48 struct SBOOEPrefetcherParams;
49 
51 namespace prefetch
52 {
53 
54 class SBOOE : public Queued
55 {
56  private:
57 
60 
62  const unsigned int scoreThreshold;
63 
69  std::unordered_map<Addr, Tick> demandAddresses;
70 
78 
81 
84 
85  struct SandboxEntry
86  {
92  bool valid;
93 
95  : valid(false)
96  {}
97  };
98 
99  class Sandbox
100  {
101  private:
104 
109  unsigned int sandboxScore;
110 
112  unsigned int lateScore;
113 
114  public:
116  const int stride;
117 
118  Sandbox(unsigned int max_entries, int _stride)
119  : entries(max_entries), sandboxScore(0), lateScore(0),
120  stride(_stride)
121  {
122  }
123 
131  void access(Addr line, Tick tick);
132 
137  unsigned int score() const { return (sandboxScore - lateScore); }
138  };
139 
141 
144 
146  unsigned int accesses;
147 
154  bool access(Addr line);
155 
157  void notifyFill(const PacketPtr& pkt) override;
158 
159  public:
160  SBOOE(const SBOOEPrefetcherParams &p);
161 
162  void calculatePrefetch(const PrefetchInfo &pfi,
163  std::vector<AddrPriority> &addresses) override;
164 };
165 
166 } // namespace prefetch
167 } // namespace gem5
168 
169 #endif // __MEM_CACHE_PREFETCH_SBOOE_HH__
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
Definition: packet.hh:294
Class containing the information needed by the prefetch to train and generate new prefetch requests.
Definition: base.hh:98
unsigned int sandboxScore
Accesses during the eval period that were present in the sandbox.
Definition: sbooe.hh:109
const int stride
Sequential stride for this prefetcher.
Definition: sbooe.hh:116
CircularQueue< SandboxEntry > entries
FIFO queue containing the sandbox entries.
Definition: sbooe.hh:103
Sandbox(unsigned int max_entries, int _stride)
Definition: sbooe.hh:118
void access(Addr line, Tick tick)
Update score and insert the line address being accessed into the FIFO queue of the sandbox.
Definition: sbooe.cc:58
unsigned int score() const
Calculate the useful score.
Definition: sbooe.hh:137
unsigned int lateScore
Hits in the sandbox that wouldn't have been filled on time.
Definition: sbooe.hh:112
bool access(Addr line)
Process an access to the specified line address and update the sandbox counters counters.
Definition: sbooe.cc:79
const int sequentialPrefetchers
Prefetcher parameters.
Definition: sbooe.hh:59
void notifyFill(const PacketPtr &pkt) override
Update the latency buffer after a prefetch fill.
Definition: sbooe.cc:95
unsigned int accesses
Number of accesses notified to the prefetcher.
Definition: sbooe.hh:146
std::vector< Sandbox > sandboxes
Definition: sbooe.hh:140
CircularQueue< Tick > latencyBuffer
The latency buffer holds the elapsed ticks between the demand and the fill in the cache for the lates...
Definition: sbooe.hh:77
std::unordered_map< Addr, Tick > demandAddresses
Holds the current demand addresses and tick.
Definition: sbooe.hh:69
Tick latencyBufferSum
Holds the current sum of the latency buffer latency.
Definition: sbooe.hh:83
SBOOE(const SBOOEPrefetcherParams &p)
Definition: sbooe.cc:41
Tick averageAccessLatency
Holds the current average access latency.
Definition: sbooe.hh:80
const Sandbox * bestSandbox
Current best sandbox.
Definition: sbooe.hh:143
void calculatePrefetch(const PrefetchInfo &pfi, std::vector< AddrPriority > &addresses) override
Definition: sbooe.cc:120
const unsigned int scoreThreshold
Threshold used to issue prefetchers.
Definition: sbooe.hh:62
STL vector class.
Definition: stl.hh:37
Bitfield< 54 > p
Definition: pagetable.hh:70
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
uint64_t Tick
Tick count type.
Definition: types.hh:58
GEM5_DEPRECATED_NAMESPACE(GuestABI, guest_abi)
Declaration of the Packet class.
Tick expectedArrivalTick
Tick when the simulated prefetch is expected to be filled.
Definition: sbooe.hh:90
Addr line
Cache line predicted by the candidate prefetcher.
Definition: sbooe.hh:88
bool valid
To indicate if it was initialized.
Definition: sbooe.hh:92

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