Go to the documentation of this file.
47 #include "debug/RubyPrefetcher.hh"
53 m_array(
p.num_streams), m_train_misses(
p.train_misses),
54 m_num_startup_pfs(
p.num_startup_pfs),
55 unitFilter(
p.unit_filter),
56 negativeFilter(
p.unit_filter),
57 nonUnitFilter(
p.nonunit_filter),
58 m_prefetch_cross_pages(
p.cross_page),
59 m_page_shift(
p.sys->getPageShift()),
60 rubyPrefetcherStats(this)
68 :
Stats::Group(parent,
"RubyPrefetcher"),
69 ADD_STAT(numMissObserved,
"Number of misses observed"),
70 ADD_STAT(numAllocatedStreams,
"Number of streams allocated for "
72 ADD_STAT(numPrefetchRequested,
"Number of prefetch requests made"),
73 ADD_STAT(numHits,
"Number of prefetched blocks accessed "
74 "(for the first time)"),
75 ADD_STAT(numPartialHits,
"Number of misses observed for a block being "
77 ADD_STAT(numPagesCrossed,
"Number of prefetches across pages"),
78 ADD_STAT(numMissedPrefetchedBlocks,
"Number of misses for blocks that "
79 "were prefetched, yet missed")
93 if (pfEntry != NULL) {
149 if (stream == NULL) {
155 if (stream == NULL) {
187 uint32_t lru_index = 0;
194 if (
m_array[
i].m_use_time < lru_access) {
205 uint32_t
index,
const RubyRequestType&
type)
266 for (
auto& entry : *filter) {
267 if (entry.addr == line_addr) {
287 const RubyRequestType&
type)
296 int delta = line_addr - entry.addr;
301 if (delta == entry.stride) {
309 const int stride = entry.stride /
324 entry.addr = line_addr;
325 entry.stride = delta;
342 out <<
name() <<
" Prefetcher State\n";
344 out <<
"unit table:\n";
346 out << entry.addr << std::endl;
349 out <<
"negative table:\n";
351 out << entry.addr << std::endl;
355 out <<
"non-unit table:\n";
357 out << entry.addr <<
" "
358 << entry.stride <<
" "
359 << entry.hits << std::endl;
368 <<
m_array[
i].m_use_time << std::endl;
RubyRequestType m_type
L1D prefetches loads and stores.
Addr pageAddress(Addr addr) const
determine the page aligned address
void print(std::ostream &out) const
Print out some statistics.
uint32_t m_num_startup_pfs
number of initial prefetches to startup a stream
static uint32_t getBlockSizeBytes()
CircularQueue< UnitFilterEntry > unitFilter
A unit stride filter array: helps reduce BW requirement of prefetching.
Addr makeLineAddress(Addr addr)
Cycles m_use_time
the last time that any prefetched request was used
void issueNextPrefetch(Addr address, PrefetchEntry *stream)
int m_stride
stride distance to get next address from
Stats::Scalar numPartialHits
Count of partial successful prefetches.
uint32_t m_num_streams
number of prefetch streams available
std::bitset< MAX_PF_INFLIGHT > requestCompleted
void observeMiss(Addr address, const RubyRequestType &type)
Observe a memory miss from the cache.
Stats::Scalar numPrefetchRequested
Count of prefetch requests made.
bool m_is_valid
valid bit for each stream
std::bitset< MAX_PF_INFLIGHT > requestIssued
Bitset for tracking prefetches for which addresses have been issued, which ones have completed.
RubyPrefetcherStats(Stats::Group *parent)
Addr makeNextStrideAddress(Addr addr, int stride)
void observePfHit(Addr address)
Implement the prefetch hit(miss) callback interface.
Stats::Scalar numPagesCrossed
Count of pages crossed.
#define ADD_STAT(n,...)
Convenience macro to add a stat to a statistics group.
Cycles curCycle() const
Determine the current cycle, corresponding to a tick aligned to a clock edge.
AbstractController * m_controller
Stats::Scalar numHits
Count of successful prefetches.
uint32_t getLRUindex(void)
Returns an unused stream buffer (or if all are used, returns the least recently used (accessed) strea...
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Stats::Scalar numAllocatedStreams
Count of prefetch streams allocated.
Stats::Scalar numMissedPrefetchedBlocks
Count of misses incurred for blocks that were prefetched.
virtual const std::string name() const
CircularQueue< UnitFilterEntry > negativeFilter
A negative unit stride filter array: helps reduce BW requirement of prefetching.
void observePfMiss(Addr address)
void initializeStream(Addr address, int stride, uint32_t index, const RubyRequestType &type)
allocate a new stream buffer at a specific index
std::vector< PrefetchEntry > m_array
an array of the active prefetch streams
RubyPrefetcher::RubyPrefetcherStats rubyPrefetcherStats
bool accessNonunitFilter(Addr line_addr, const RubyRequestType &type)
Access a non-unit stride filter to determine if there is a hit, and update it otherwise.
Addr m_address
The base address for the stream prefetch.
Bitfield< 21, 20 > stride
RubyPrefetcherParams Params
Cycles is a wrapper class for representing cycle counts, i.e.
PrefetchEntry * getPrefetchEntry(Addr address, uint32_t &index)
get pointer to the matching stream entry, returns NULL if not found index holds the multiple of the s...
uint32_t m_train_misses
number of misses I must see before allocating a stream
Stats::Scalar numMissObserved
Count of accesses to the prefetcher.
bool accessUnitFilter(CircularQueue< UnitFilterEntry > *const filter, Addr line_addr, int stride, const RubyRequestType &type)
Access a unit stride filter to determine if there is a hit, and update it otherwise.
virtual void enqueuePrefetch(const Addr &, const RubyRequestType &)
Function for enqueuing a prefetch request.
bool m_prefetch_cross_pages
Used for allowing prefetches across pages.
RubyPrefetcher(const Params &p)
CircularQueue< NonUnitFilterEntry > nonUnitFilter
A non-unit stride filter array: helps reduce BW requirement of prefetching.
Abstract superclass for simulation objects.
Generated on Tue Mar 23 2021 19:41:28 for gem5 by doxygen 1.8.17