Go to the documentation of this file.
47 #include "debug/RubyPrefetcher.hh"
59 m_array(
p.num_streams), m_train_misses(
p.train_misses),
60 m_num_startup_pfs(
p.num_startup_pfs),
61 unitFilter(
p.unit_filter),
62 negativeFilter(
p.unit_filter),
63 nonUnitFilter(
p.nonunit_filter),
64 m_prefetch_cross_pages(
p.cross_page),
65 pageShift(
p.page_shift),
66 rubyPrefetcherStats(this)
74 : statistics::
Group(parent,
"RubyPrefetcher"),
75 ADD_STAT(numMissObserved,
"Number of misses observed"),
76 ADD_STAT(numAllocatedStreams,
"Number of streams allocated for "
78 ADD_STAT(numPrefetchRequested,
"Number of prefetch requests made"),
79 ADD_STAT(numHits,
"Number of prefetched blocks accessed "
80 "(for the first time)"),
81 ADD_STAT(numPartialHits,
"Number of misses observed for a block being "
83 ADD_STAT(numPagesCrossed,
"Number of prefetches across pages"),
84 ADD_STAT(numMissedPrefetchedBlocks,
"Number of misses for blocks that "
85 "were prefetched, yet missed")
99 if (pfEntry != NULL) {
155 if (stream == NULL) {
161 if (stream == NULL) {
193 uint32_t lru_index = 0;
200 if (
m_array[
i].m_use_time < lru_access) {
211 uint32_t
index,
const RubyRequestType&
type)
272 for (
auto& entry : *filter) {
273 if (entry.addr == line_addr) {
293 const RubyRequestType&
type)
302 int delta = line_addr - entry.addr;
307 if (delta == entry.stride) {
315 const int stride = entry.stride /
330 entry.addr = line_addr;
331 entry.stride = delta;
348 out <<
name() <<
" Prefetcher State\n";
350 out <<
"unit table:\n";
352 out << entry.addr << std::endl;
355 out <<
"negative table:\n";
357 out << entry.addr << std::endl;
361 out <<
"non-unit table:\n";
363 out << entry.addr <<
" "
364 << entry.stride <<
" "
365 << entry.hits << std::endl;
374 <<
m_array[
i].m_use_time << std::endl;
void observePfHit(Addr address)
Implement the prefetch hit(miss) callback interface.
Addr m_address
The base address for the stream prefetch.
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...
void observePfMiss(Addr address)
std::bitset< MAX_PF_INFLIGHT > requestCompleted
Cycles curCycle() const
Determine the current cycle, corresponding to a tick aligned to a clock edge.
uint32_t getLRUindex(void)
Returns an unused stream buffer (or if all are used, returns the least recently used (accessed) strea...
int m_stride
stride distance to get next address from
uint32_t m_num_streams
number of prefetch streams available
static uint32_t getBlockSizeBytes()
RubyRequestType m_type
L1D prefetches loads and stores.
uint32_t m_num_startup_pfs
number of initial prefetches to startup a stream
bool m_is_valid
valid bit for each stream
void initializeStream(Addr address, int stride, uint32_t index, const RubyRequestType &type)
allocate a new stream buffer at a specific index
Addr makeLineAddress(Addr addr)
virtual void enqueuePrefetch(const Addr &, const RubyRequestType &)
Function for enqueuing a prefetch request.
uint32_t m_train_misses
number of misses I must see before allocating a stream
Cycles is a wrapper class for representing cycle counts, i.e.
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.
std::vector< PrefetchEntry > m_array
an array of the active prefetch streams
statistics::Scalar numHits
Count of successful prefetches.
CircularQueue< NonUnitFilterEntry > nonUnitFilter
A non-unit stride filter array: helps reduce BW requirement of prefetching.
void observeMiss(Addr address, const RubyRequestType &type)
Observe a memory miss from the cache.
Addr pageAddress(Addr addr) const
determine the page aligned address
virtual std::string name() const
#define ADD_STAT(n,...)
Convenience macro to add a stat to a statistics group.
statistics::Scalar numPagesCrossed
Count of pages crossed.
Cycles m_use_time
the last time that any prefetched request was used
std::bitset< MAX_PF_INFLIGHT > requestIssued
Bitset for tracking prefetches for which addresses have been issued, which ones have completed.
statistics::Scalar numMissObserved
Count of accesses to the prefetcher.
CircularQueue< UnitFilterEntry > unitFilter
A unit stride filter array: helps reduce BW requirement of prefetching.
Abstract superclass for simulation objects.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
void issueNextPrefetch(Addr address, PrefetchEntry *stream)
statistics::Scalar numMissedPrefetchedBlocks
Count of misses incurred for blocks that were prefetched.
RubyPrefetcherStats(statistics::Group *parent)
bool m_prefetch_cross_pages
Used for allowing prefetches across pages.
statistics::Scalar numAllocatedStreams
Count of prefetch streams allocated.
statistics::Scalar numPartialHits
Count of partial successful prefetches.
CircularQueue< UnitFilterEntry > negativeFilter
A negative unit stride filter array: helps reduce BW requirement of prefetching.
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.
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
Bitfield< 21, 20 > stride
Addr makeNextStrideAddress(Addr addr, int stride)
gem5::ruby::RubyPrefetcher::RubyPrefetcherStats rubyPrefetcherStats
statistics::Scalar numPrefetchRequested
Count of prefetch requests made.
AbstractController * m_controller
void print(std::ostream &out) const
Print out some statistics.
RubyPrefetcherParams Params
RubyPrefetcher(const Params &p)
Generated on Sun Jul 30 2023 01:56:59 for gem5 by doxygen 1.8.17