33 #include "debug/HWPrefetch.hh" 34 #include "params/SBOOEPrefetcher.hh" 38 latencyBufferSize(p->latency_buffer_size),
39 sequentialPrefetchers(p->sequential_prefetchers),
40 scoreThreshold((p->sandbox_entries*p->score_threshold_pct)/100),
41 averageAccessLatency(0), latencyBufferSum(0),
45 if (!(p->score_threshold_pct >= 0 && p->score_threshold_pct <= 100)) {
46 fatal(
"%s: the score threshold should be between 0 and 100\n",
name());
59 entries[
index].valid =
true;
61 entries[
index].expectedArrivalTick =
tick;
65 if (
index == entries.size()) {
76 if (entry.
valid && entry.
line == access_line) {
93 return (
accesses >= sandboxes.size());
136 const bool evaluationFinished =
access(pfi_line);
140 addresses.push_back(
AddrPriority(pref_line << lBlkSize, 0));
145 SBOOEPrefetcherParams::create()
Tick expectedArrivalTick
Tick when the simulated prefetch is expected to be filled.
std::unordered_map< Addr, Tick > demandAddresses
Holds the current demand addresses and tick.
void insert(Addr line, Tick tick)
Insert the line address being accessed to the cache into the FIFO queue of the sandbox.
#define fatal(...)
This implements a cprintf based fatal() function.
bool access(Addr line)
Process an access to the specified line address and update the sandbox counters counters.
Bitfield< 21, 20 > stride
void notifyFill(const PacketPtr &pkt) override
Update the latency buffer after a prefetch fill.
Addr line
Cache line predicted by the candidate prefetcher.
Sandbox * bestSandbox
Current best sandbox.
unsigned lBlkSize
log_2(block size of the parent cache).
const int stride
Sequential stride for this prefetcher.
Addr getAddr() const
Obtains the address value of this Prefetcher address.
Tick curTick()
The current simulated tick.
Class containing the information needed by the prefetch to train and generate new prefetch requests...
std::pair< Addr, int32_t > AddrPriority
std::vector< Sandbox > sandboxes
Tick latencyBufferSum
Holds the current sum of the latency buffer latency.
uint64_t Tick
Tick count type.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
virtual const std::string name() const
void calculatePrefetch(const PrefetchInfo &pfi, std::vector< AddrPriority > &addresses) override
A Packet is used to encapsulate a transfer between two objects in the memory system (e...
bool valid
To indicate if it was initialized.
unsigned int score() const
Calculate the useful score.
std::deque< Tick > latencyBuffer
The latency buffer holds the elapsed ticks between the demand and the fill in the cache for the lates...
Tick averageAccessLatency
Holds the current average access latency.
SBOOEPrefetcher(const SBOOEPrefetcherParams *p)
Copyright (c) 2018 Metempsy Technology Consulting All rights reserved.
unsigned int accesses
Number of accesses notified to the prefetcher.
const unsigned int scoreThreshold
Threshold used to issue prefetchers.
const int sequentialPrefetchers
const int latencyBufferSize
Prefetcher parameters.