Go to the documentation of this file.
31 #include "debug/HWPrefetch.hh"
33 #include "params/DCPTPrefetcher.hh"
34 #include "params/DeltaCorrelatingPredictionTables.hh"
44 const DeltaCorrelatingPredictionTablesParams &
p) :
SimObject(
p),
45 deltaBits(
p.delta_bits), deltaMaskBits(
p.delta_mask_bits),
46 table(
p.table_assoc,
p.table_entries,
p.table_indexing_policy,
47 p.table_replacement_policy,
DCPTEntry(
p.deltas_per_entry))
65 unsigned int delta_bits)
67 if ((address - lastAddress) != 0) {
68 Addr delta = address - lastAddress;
70 Addr max_positive_delta = (1 << (delta_bits-1)) - 1;
71 if (address > lastAddress) {
73 if (delta > max_positive_delta) {
78 if (lastAddress - address > (max_positive_delta + 1)) {
82 deltas.push_back(delta);
83 lastAddress = address;
91 assert(deltas.full());
94 const int delta_penultimate = *(deltas.end() - 2);
95 const int delta_last = *(deltas.end() - 1);
98 if (delta_last == 0 || delta_penultimate == 0) {
106 auto it = deltas.begin();
107 for (; it != (deltas.end() - 2); ++it) {
108 const int prev_delta_penultimate = *it;
109 const int prev_delta_last = *(it + 1);
110 if ((prev_delta_penultimate >>
mask) == (delta_penultimate >>
mask) &&
111 (prev_delta_last >>
mask) == (delta_last >>
mask)) {
116 while (it != deltas.end()) {
117 const int pf_delta = *(it++);
132 DPRINTF(HWPrefetch,
"Ignoring request with no PC.\n");
140 if (entry !=
nullptr) {
147 table.insertEntry(
pc,
false , entry);
Addr getAddr() const
Obtains the address value of this Prefetcher address.
AssociativeSet< DCPTEntry > table
The main table.
const unsigned int deltaMaskBits
Number of lower bits to ignore from the deltas.
void invalidate() override
Invalidate the block.
void push_back(typename std::vector< T >::value_type val)
Pushes an element at the end of the queue.
bool full() const
Is the queue full? A queue is full if the head is the 0^{th} element and the tail is the (size-1)^{th...
DCPT(const DCPTPrefetcherParams &p)
DCPT Table entry datatype.
void calculatePrefetch(const Base::PrefetchInfo &pfi, std::vector< Queued::AddrPriority > &addresses)
Computes the prefetch candidates given a prefetch event.
constexpr uint64_t mask(unsigned nbits)
Generate a 64-bit mask of 'nbits' 1s, right justified.
const unsigned int deltaBits
Number of bits of each delta.
Addr getPC() const
Returns the program counter that generated this request.
void flush()
Remove all the elements in the queue.
virtual void invalidate()
Invalidate the block.
Abstract superclass for simulation objects.
void addAddress(Addr address, unsigned int delta_num_bits)
Adds an address to the entry, if the entry already existed, a delta will be generated.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
DeltaCorrelatingPredictionTables(const DeltaCorrelatingPredictionTablesParams &p)
GEM5_DEPRECATED_NAMESPACE(GuestABI, guest_abi)
CircularQueue< Addr > deltas
Stored deltas.
DeltaCorrelatingPredictionTables & dcpt
DCPT object.
void getCandidates(std::vector< Queued::AddrPriority > &pfs, unsigned int mask_bits) const
Attempt to generate prefetch candidates using the two most recent deltas.
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
Addr lastAddress
Last accessed address.
Class containing the information needed by the prefetch to train and generate new prefetch requests.
void calculatePrefetch(const PrefetchInfo &pfi, std::vector< AddrPriority > &addresses) override
bool hasPC() const
Returns true if the associated program counter is valid.
Generated on Sat Jun 18 2022 08:12:27 for gem5 by doxygen 1.8.17