gem5  v20.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 struct SBOOEPrefetcherParams;
46 
47 namespace Prefetcher {
48 
49 class SBOOE : public Queued
50 {
51  private:
52 
55 
57  const unsigned int scoreThreshold;
58 
64  std::unordered_map<Addr, Tick> demandAddresses;
65 
73 
76 
79 
80  struct SandboxEntry {
86  bool valid;
87 
89  : valid(false)
90  {}
91  };
92 
93  class Sandbox
94  {
95  private:
98 
103  unsigned int sandboxScore;
104 
106  unsigned int lateScore;
107 
108  public:
110  const int stride;
111 
112  Sandbox(unsigned int max_entries, int _stride)
113  : entries(max_entries), sandboxScore(0), lateScore(0),
114  stride(_stride)
115  {
116  }
117 
125  void access(Addr line, Tick tick);
126 
131  unsigned int score() const { return (sandboxScore - lateScore); }
132  };
133 
135 
138 
140  unsigned int accesses;
141 
148  bool access(Addr line);
149 
151  void notifyFill(const PacketPtr& pkt) override;
152 
153  public:
154  SBOOE(const SBOOEPrefetcherParams *p);
155 
156  void calculatePrefetch(const PrefetchInfo &pfi,
157  std::vector<AddrPriority> &addresses) override;
158 };
159 
160 } // namespace Prefetcher
161 
162 #endif // __MEM_CACHE_PREFETCH_SBOOE_HH__
Prefetcher::SBOOE::SBOOE
SBOOE(const SBOOEPrefetcherParams *p)
Definition: sbooe.cc:36
Prefetcher::SBOOE::accesses
unsigned int accesses
Number of accesses notified to the prefetcher.
Definition: sbooe.hh:140
Prefetcher::SBOOE::Sandbox::entries
CircularQueue< SandboxEntry > entries
FIFO queue containing the sandbox entries.
Definition: sbooe.hh:97
Prefetcher::SBOOE::Sandbox::stride
const int stride
Sequential stride for this prefetcher.
Definition: sbooe.hh:110
Clocked::tick
Tick tick
Definition: clocked_object.hh:65
CircularQueue< Tick >
Tick
uint64_t Tick
Tick count type.
Definition: types.hh:63
Prefetcher::SBOOE::bestSandbox
const Sandbox * bestSandbox
Current best sandbox.
Definition: sbooe.hh:137
std::vector
STL vector class.
Definition: stl.hh:37
Prefetcher::SBOOE::scoreThreshold
const unsigned int scoreThreshold
Threshold used to issue prefetchers.
Definition: sbooe.hh:57
Prefetcher::SBOOE::Sandbox::lateScore
unsigned int lateScore
Hits in the sandbox that wouldn't have been filled on time.
Definition: sbooe.hh:106
queued.hh
packet.hh
Prefetcher::SBOOE::Sandbox
Definition: sbooe.hh:93
Prefetcher::SBOOE::averageAccessLatency
Tick averageAccessLatency
Holds the current average access latency.
Definition: sbooe.hh:75
Prefetcher::SBOOE::notifyFill
void notifyFill(const PacketPtr &pkt) override
Update the latency buffer after a prefetch fill.
Definition: sbooe.cc:90
Prefetcher::SBOOE::sandboxes
std::vector< Sandbox > sandboxes
Definition: sbooe.hh:134
Prefetcher::SBOOE
Definition: sbooe.hh:49
circular_queue.hh
Prefetcher::SBOOE::sequentialPrefetchers
const int sequentialPrefetchers
Prefetcher parameters.
Definition: sbooe.hh:54
Prefetcher
Copyright (c) 2018 Metempsy Technology Consulting All rights reserved.
Definition: base.hh:78
Prefetcher::SBOOE::SandboxEntry::expectedArrivalTick
Tick expectedArrivalTick
Tick when the simulated prefetch is expected to be filled.
Definition: sbooe.hh:84
Prefetcher::SBOOE::SandboxEntry
Definition: sbooe.hh:80
Prefetcher::SBOOE::Sandbox::access
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:53
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::SBOOE::Sandbox::score
unsigned int score() const
Calculate the useful score.
Definition: sbooe.hh:131
Prefetcher::SBOOE::demandAddresses
std::unordered_map< Addr, Tick > demandAddresses
Holds the current demand addresses and tick.
Definition: sbooe.hh:64
Prefetcher::SBOOE::access
bool access(Addr line)
Process an access to the specified line address and update the sandbox counters counters.
Definition: sbooe.cc:74
Prefetcher::SBOOE::latencyBufferSum
Tick latencyBufferSum
Holds the current sum of the latency buffer latency.
Definition: sbooe.hh:78
Prefetcher::SBOOE::calculatePrefetch
void calculatePrefetch(const PrefetchInfo &pfi, std::vector< AddrPriority > &addresses) override
Definition: sbooe.cc:115
Prefetcher::SBOOE::SandboxEntry::valid
bool valid
To indicate if it was initialized.
Definition: sbooe.hh:86
Packet
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
Definition: packet.hh:257
Prefetcher::SBOOE::SandboxEntry::line
Addr line
Cache line predicted by the candidate prefetcher.
Definition: sbooe.hh:82
Prefetcher::Base::PrefetchInfo
Class containing the information needed by the prefetch to train and generate new prefetch requests.
Definition: base.hh:90
Prefetcher::SBOOE::SandboxEntry::SandboxEntry
SandboxEntry()
Definition: sbooe.hh:88
Prefetcher::SBOOE::Sandbox::Sandbox
Sandbox(unsigned int max_entries, int _stride)
Definition: sbooe.hh:112
MipsISA::p
Bitfield< 0 > p
Definition: pra_constants.hh:323
Prefetcher::SBOOE::latencyBuffer
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:72
Prefetcher::SBOOE::Sandbox::sandboxScore
unsigned int sandboxScore
Accesses during the eval period that were present in the sandbox.
Definition: sbooe.hh:103

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