gem5  v22.1.0.0
bop.hh
Go to the documentation of this file.
1 
36 #ifndef __MEM_CACHE_PREFETCH_BOP_HH__
37 #define __MEM_CACHE_PREFETCH_BOP_HH__
38 
39 #include <queue>
40 
42 #include "mem/packet.hh"
43 
44 namespace gem5
45 {
46 
47 struct BOPPrefetcherParams;
48 
50 namespace prefetch
51 {
52 
53 class BOP : public Queued
54 {
55  private:
56 
57  enum RRWay
58  {
60  Right
61  };
62 
64  const unsigned int scoreMax;
65  const unsigned int roundMax;
66  const unsigned int badScore;
68  const unsigned int rrEntries;
69  const unsigned int tagMask;
71  const bool delayQueueEnabled;
72  const unsigned int delayQueueSize;
73  const unsigned int delayTicks;
74 
77 
81 
89  {
92 
94  {}
95  };
96 
98 
100  void delayQueueEventWrapper();
102 
112  unsigned int bestScore;
114  unsigned int round;
115 
120  unsigned int hash(Addr addr, unsigned int way) const;
121 
126  void insertIntoRR(Addr addr, unsigned int way);
127 
133 
135  void resetScores();
136 
141  Addr tag(Addr addr) const;
142 
145  bool testRR(Addr) const;
146 
149  void bestOffsetLearning(Addr);
150 
152  void notifyFill(const PacketPtr& pkt) override;
153 
154  public:
155 
156  BOP(const BOPPrefetcherParams &p);
157  ~BOP() = default;
158 
159  void calculatePrefetch(const PrefetchInfo &pfi,
160  std::vector<AddrPriority> &addresses) override;
161 };
162 
163 } // namespace prefetch
164 } // namespace gem5
165 
166 #endif /* __MEM_CACHE_PREFETCH_BOP_HH__ */
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
Definition: packet.hh:294
std::deque< DelayQueueEntry > delayQueue
Definition: bop.hh:97
void calculatePrefetch(const PrefetchInfo &pfi, std::vector< AddrPriority > &addresses) override
Definition: bop.cc:230
unsigned int round
Current round.
Definition: bop.hh:114
std::vector< Addr > rrLeft
Definition: bop.hh:75
unsigned int bestScore
Max score found so far.
Definition: bop.hh:112
const unsigned int delayQueueSize
Definition: bop.hh:72
void insertIntoDelayQueue(Addr addr)
Insert the specified address into the delay queue.
Definition: bop.cc:139
BOP(const BOPPrefetcherParams &p)
Definition: bop.cc:41
unsigned int hash(Addr addr, unsigned int way) const
Generate a hash for the specified address to index the RR table.
Definition: bop.cc:118
const unsigned int rrEntries
Recent requests table parameteres.
Definition: bop.hh:68
const unsigned int tagMask
Definition: bop.hh:69
std::vector< OffsetListEntry >::iterator offsetsListIterator
Current test offset index.
Definition: bop.hh:110
const unsigned int badScore
Definition: bop.hh:66
const bool delayQueueEnabled
Delay queue parameters.
Definition: bop.hh:71
const unsigned int scoreMax
Learning phase parameters.
Definition: bop.hh:64
std::pair< int16_t, uint8_t > OffsetListEntry
Structure to save the offset and the score.
Definition: bop.hh:79
std::vector< Addr > rrRight
Definition: bop.hh:76
bool issuePrefetchRequests
Hardware prefetcher enabled.
Definition: bop.hh:104
Addr tag(Addr addr) const
Generate the tag for the specified address based on the tag bits and the block size.
Definition: bop.cc:165
void delayQueueEventWrapper()
Event to handle the delay queue processing.
Definition: bop.cc:101
void bestOffsetLearning(Addr)
Learning phase of the BOP.
Definition: bop.cc:189
const unsigned int roundMax
Definition: bop.hh:65
void insertIntoRR(Addr addr, unsigned int way)
Insert the specified address into the RR table.
Definition: bop.cc:126
Addr phaseBestOffset
Current best offset found in the learning phase.
Definition: bop.hh:108
EventFunctionWrapper delayQueueEvent
Definition: bop.hh:101
void notifyFill(const PacketPtr &pkt) override
Update the RR right table after a prefetch fill.
Definition: bop.cc:256
std::vector< OffsetListEntry > offsetsList
Definition: bop.hh:80
bool testRR(Addr) const
Test if @X-O is hitting in the RR table to update the offset score.
Definition: bop.cc:171
void resetScores()
Reset all the scores from the offset list.
Definition: bop.cc:157
Addr bestOffset
Current best offset to issue prefetches.
Definition: bop.hh:106
const unsigned int delayTicks
Definition: bop.hh:73
Class containing the information needed by the prefetch to train and generate new prefetch requests.
Definition: base.hh:98
STL deque class.
Definition: stl.hh:44
STL pair class.
Definition: stl.hh:58
Bitfield< 4 > x
Definition: pagetable.hh:61
Bitfield< 51 > t
Definition: pagetable.hh:56
Bitfield< 54 > p
Definition: pagetable.hh:70
Bitfield< 3 > addr
Definition: types.hh:84
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.
In a first implementation of the BO prefetcher, both banks of the RR were written simultaneously when...
Definition: bop.hh:89
DelayQueueEntry(Addr x, Tick t)
Definition: bop.hh:93

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