Go to the documentation of this file.
44 #include "debug/RubyPrefetcher.hh"
49 RubyPrefetcherParams::create()
56 m_array(
p->num_streams), m_train_misses(
p->train_misses),
57 m_num_startup_pfs(
p->num_startup_pfs), m_num_unit_filters(
p->unit_filter),
58 m_num_nonunit_filters(
p->nonunit_filter),
59 m_unit_filter(
p->unit_filter, 0),
60 m_negative_filter(
p->unit_filter, 0),
61 m_nonunit_filter(
p->nonunit_filter, 0),
62 m_prefetch_cross_pages(
p->cross_page),
63 m_page_shift(
p->sys->getPageShift())
107 .
desc(
"number of misses observed")
111 .
name(
name() +
".allocated_streams")
112 .
desc(
"number of streams allocated for prefetching")
116 .
name(
name() +
".prefetches_requested")
117 .
desc(
"number of prefetch requests made")
122 .
desc(
"number of prefetched blocks accessed (for the first time)")
127 .
desc(
"number of misses observed for a block being prefetched")
132 .
desc(
"number of prefetches across pages")
136 .
name(
name() +
".misses_on_prefetched_blocks")
137 .
desc(
"number of misses for blocks that were prefetched, yet missed")
151 if (pfEntry != NULL) {
229 if (stream == NULL) {
235 if (stream == NULL) {
267 uint32_t lru_index = 0;
274 if (
m_array[
i].m_use_time < lru_access) {
293 uint32_t
index,
const RubyRequestType&
type)
352 uint32_t *filter_hit, uint32_t &
index,
Addr address,
360 if (filter_table[
i] == line_addr) {
371 int local_index =
index;
373 filter_hit[local_index] = 0;
374 local_index = local_index + 1;
449 out <<
name() <<
" Prefetcher State\n";
451 out <<
"unit table:\n";
456 out <<
"negative table:\n";
462 out <<
"non-unit table:\n";
475 <<
m_array[
i].m_use_time << std::endl;
RubyRequestType m_type
L1D prefetches loads and stores.
virtual void regStats()
Callback to set stat parameters.
Addr pageAddress(Addr addr) const
determine the page aligned address
Stats::Scalar numPartialHits
Count of partial successful prefetches.
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()
int * m_nonunit_stride
An array of strides (in # of cache lines) for the filter entries.
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 numHits
Count of 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.
bool accessUnitFilter(std::vector< Addr > &filter_table, uint32_t *hit_table, uint32_t &index, Addr address, int stride, bool &alloc)
access a unit stride filter to determine if there is a hit
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.
Addr makeNextStrideAddress(Addr addr, int stride)
void observePfHit(Addr address)
Implement the prefetch hit(miss) callback interface.
uint32_t m_negative_filter_index
a round robin pointer into the negative filter group
uint32_t m_num_nonunit_filters
number of non-stride filters
RubyPrefetcher(const Params *p)
Cycles curCycle() const
Determine the current cycle, corresponding to a tick aligned to a clock edge.
AbstractController * m_controller
Stats::Scalar numPagesCrossed
Count of pages crossed.
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.
Derived & name(const std::string &name)
Set the name and marks this stat to print at the end of simulation.
bool accessNonunitFilter(Addr address, int *stride, bool &alloc)
access a unit stride filter to determine if there is a hit
virtual const std::string name() const
uint32_t * m_nonunit_hit
An array used to count the of times particular filter entries have been hit.
std::vector< Addr > m_unit_filter
a 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
Stats::Scalar numAllocatedStreams
Count of prefetch streams allocated.
std::vector< Addr > m_nonunit_filter
a non-unit stride filter array: helps reduce BW requirement of prefetching
void regStats()
Callback to set stat parameters.
std::vector< PrefetchEntry > m_array
an array of the active prefetch streams
uint32_t * m_unit_filter_hit
An array used to count the of times particular filter entries have been hit.
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.
std::vector< Addr > m_negative_filter
a negative unit stride filter array: helps reduce BW requirement of prefetching
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
uint32_t m_unit_filter_index
a round robin pointer into the unit filter group
Stats::Scalar numMissedPrefetchedBlocks
Count of misses incurred for blocks that were prefetched.
Stats::Scalar numPrefetchRequested
Count of prefetch requests made.
virtual void enqueuePrefetch(const Addr &, const RubyRequestType &)
Function for enqueuing a prefetch request.
bool m_prefetch_cross_pages
Used for allowing prefetches across pages.
uint32_t m_nonunit_index
a round robin pointer into the unit filter group
Derived & desc(const std::string &_desc)
Set the description and marks this stat to print at the end of simulation.
void clearNonunitEntry(uint32_t index)
clear a non-unit stride prefetcher entry
uint32_t m_num_unit_filters
number of stride filters
Stats::Scalar numMissObserved
Count of accesses to the prefetcher.
uint32_t * m_negative_filter_hit
An array used to count the of times particular filter entries have been hit.
Abstract superclass for simulation objects.
Generated on Wed Sep 30 2020 14:02:13 for gem5 by doxygen 1.8.17