Go to the documentation of this file.
31 #include "debug/HWPrefetch.hh"
32 #include "params/BOPPrefetcher.hh"
38 scoreMax(
p->score_max), roundMax(
p->round_max),
39 badScore(
p->bad_score), rrEntries(
p->rr_size),
40 tagMask((1 <<
p->tag_bits) - 1),
41 delayQueueEnabled(
p->delay_queue_enable),
42 delayQueueSize(
p->delay_queue_size),
43 delayTicks(cyclesToTicks(
p->delay_queue_cycles)),
45 issuePrefetchRequests(
false), bestOffset(1), phaseBestOffset(0),
46 bestScore(0), round(0)
49 fatal(
"%s: number of RR entries is not power of 2\n",
name());
52 fatal(
"%s: cache line size is not power of 2\n",
name());
54 if (!(
p->negative_offsets_enable && (
p->offset_list_size % 2 == 0))) {
55 fatal(
"%s: negative offsets enabled with odd offset list size\n",
59 rrLeft.resize(rrEntries);
60 rrRight.resize(rrEntries);
64 const int factors[] = { 2, 3, 5 };
68 while (i < p->offset_list_size)
72 for (
int n : factors) {
79 offsetsList.push_back(OffsetListEntry(offset_i, 0));
83 if (
p->negative_offsets_enable) {
84 offsetsList.push_back(OffsetListEntry(-offset_i, 0));
92 offsetsListIterator = offsetsList.begin();
186 Addr offset_addr = (*offsetsListIterator).first;
187 Addr lookup_addr =
x - offset_addr;
190 if (
testRR(lookup_addr)) {
191 DPRINTF(HWPrefetch,
"Address %#lx found in the RR table\n",
x);
192 (*offsetsListIterator).second++;
193 if ((*offsetsListIterator).second >
bestScore) {
194 bestScore = (*offsetsListIterator).second;
246 DPRINTF(HWPrefetch,
"Generated prefetch %#lx\n", prefetch_addr);
266 BOPPrefetcherParams::create()
#define fatal(...)
This implements a cprintf based fatal() function.
std::pair< Addr, int32_t > AddrPriority
bool scheduled() const
Determine if the current event is scheduled.
void delayQueueEventWrapper()
Event to handle the delay queue processing.
Addr tag(Addr addr) const
Generate the tag for the specified address based on the tag bits and the block size.
std::vector< OffsetListEntry > offsetsList
unsigned blkSize
The block size of the parent cache.
Addr bestOffset
Current best offset to issue prefetches.
const unsigned int roundMax
EventFunctionWrapper delayQueueEvent
const unsigned int delayQueueSize
void calculatePrefetch(const PrefetchInfo &pfi, std::vector< AddrPriority > &addresses) override
unsigned int hash(Addr addr, unsigned int way) const
Generate a hash for the specified address to index the RR table.
uint64_t Tick
Tick count type.
const unsigned int delayTicks
bool issuePrefetchRequests
Hardware prefetcher enabled.
std::enable_if< std::is_integral< T >::value, int >::type floorLog2(T x)
void insertIntoRR(Addr addr, unsigned int way)
Insert the specified address into the RR table.
void schedule(Event &event, Tick when)
const unsigned int tagMask
unsigned lBlkSize
log_2(block size of the parent cache).
bool testRR(Addr) const
Test if @X-O is hitting in the RR table to update the offset score.
std::vector< Addr > rrRight
Copyright (c) 2018 Metempsy Technology Consulting All rights reserved.
unsigned int round
Current round.
void bestOffsetLearning(Addr)
Learning phase of the BOP.
const unsigned int scoreMax
Learning phase parameters.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
In a first implementation of the BO prefetcher, both banks of the RR were written simultaneously when...
const std::string & name()
const unsigned int badScore
MemCmd cmd
The command field of the packet.
void notifyFill(const PacketPtr &pkt) override
Update the RR right table after a prefetch fill.
std::vector< OffsetListEntry >::iterator offsetsListIterator
Current test offset index.
unsigned int bestScore
Max score found so far.
const unsigned int rrEntries
Recent requests table parameteres.
Addr phaseBestOffset
Current best offset found in the learning phase.
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
Class containing the information needed by the prefetch to train and generate new prefetch requests.
std::deque< DelayQueueEntry > delayQueue
bool isHWPrefetch() const
const bool delayQueueEnabled
Delay queue parameters.
void resetScores()
Reset all the scores from the offset list.
BOP(const BOPPrefetcherParams *p)
Addr getAddr() const
Obtains the address value of this Prefetcher address.
bool isPowerOf2(const T &n)
std::vector< Addr > rrLeft
void insertIntoDelayQueue(Addr addr)
Insert the specified address into the delay queue.
Tick curTick()
The current simulated tick.
Generated on Wed Sep 30 2020 14:02:12 for gem5 by doxygen 1.8.17