Hello Gabe Black,
I'd like you to do a code review. Please visit
https://gem5-review.googlesource.com/c/public/gem5/+/27949
to review the following change.
Change subject: mem: Rename the ruby Prefetcher class RubyPrefetcher.
......................................................................
mem: Rename the ruby Prefetcher class RubyPrefetcher.
A new Prefetcher namespace was added which holds the gem5 prefetchers
and means they don't all need a "Prefetcher" in their name. Unfortunately
that means that there is now both a Prefetcher namespace and a
Prefetcher class which conflict with each other.
This change tries to resolve the conflict with as little disruption as
possible by simply renaming the c++ ruby Pretcher class RubyPrefetcher,
leaving the python name alone so that configs aren't affected.
Issue-on: https://gem5.atlassian.net/browse/GEM5-447
Change-Id: I7afdf5dbc57dbf46d82552113c52f3a9207870f2
---
M src/mem/ruby/structures/Prefetcher.cc
M src/mem/ruby/structures/Prefetcher.hh
M src/mem/ruby/structures/RubyPrefetcher.py
3 files changed, 21 insertions(+), 21 deletions(-)
diff --git a/src/mem/ruby/structures/Prefetcher.cc
b/src/mem/ruby/structures/Prefetcher.cc
index a8b2d85..0602115 100644
--- a/src/mem/ruby/structures/Prefetcher.cc
+++ b/src/mem/ruby/structures/Prefetcher.cc
@@ -45,13 +45,13 @@
#include "mem/ruby/slicc_interface/RubySlicc_ComponentMapping.hh"
#include "mem/ruby/system/RubySystem.hh"
-Prefetcher*
+RubyPrefetcher*
PrefetcherParams::create()
{
- return new Prefetcher(this);
+ return new RubyPrefetcher(this);
}
-Prefetcher::Prefetcher(const Params *p)
+RubyPrefetcher::RubyPrefetcher(const Params *p)
: SimObject(p), m_num_streams(p->num_streams),
m_array(p->num_streams), m_train_misses(p->train_misses),
m_num_startup_pfs(p->num_startup_pfs),
m_num_unit_filters(p->unit_filter),
@@ -89,7 +89,7 @@
}
}
-Prefetcher::~Prefetcher()
+RubyPrefetcher::~RubyPrefetcher()
{
delete m_unit_filter_hit;
delete m_negative_filter_hit;
@@ -98,7 +98,7 @@
}
void
-Prefetcher::regStats()
+RubyPrefetcher::regStats()
{
SimObject::regStats();
@@ -139,7 +139,7 @@
}
void
-Prefetcher::observeMiss(Addr address, const RubyRequestType& type)
+RubyPrefetcher::observeMiss(Addr address, const RubyRequestType& type)
{
DPRINTF(RubyPrefetcher, "Observed miss for %#x\n", address);
Addr line_addr = makeLineAddress(address);
@@ -207,7 +207,7 @@
}
void
-Prefetcher::observePfMiss(Addr address)
+RubyPrefetcher::observePfMiss(Addr address)
{
numPartialHits++;
DPRINTF(RubyPrefetcher, "Observed partial hit for %#x\n", address);
@@ -215,7 +215,7 @@
}
void
-Prefetcher::observePfHit(Addr address)
+RubyPrefetcher::observePfHit(Addr address)
{
numHits++;
DPRINTF(RubyPrefetcher, "Observed hit for %#x\n", address);
@@ -223,7 +223,7 @@
}
void
-Prefetcher::issueNextPrefetch(Addr address, PrefetchEntry *stream)
+RubyPrefetcher::issueNextPrefetch(Addr address, PrefetchEntry *stream)
{
// get our corresponding stream fetcher
if (stream == NULL) {
@@ -262,7 +262,7 @@
}
uint32_t
-Prefetcher::getLRUindex(void)
+RubyPrefetcher::getLRUindex(void)
{
uint32_t lru_index = 0;
Cycles lru_access = m_array[lru_index].m_use_time;
@@ -281,7 +281,7 @@
}
void
-Prefetcher::clearNonunitEntry(uint32_t index)
+RubyPrefetcher::clearNonunitEntry(uint32_t index)
{
m_nonunit_filter[index] = 0;
m_nonunit_stride[index] = 0;
@@ -289,7 +289,7 @@
}
void
-Prefetcher::initializeStream(Addr address, int stride,
+RubyPrefetcher::initializeStream(Addr address, int stride,
uint32_t index, const RubyRequestType& type)
{
numAllocatedStreams++;
@@ -330,7 +330,7 @@
}
PrefetchEntry *
-Prefetcher::getPrefetchEntry(Addr address, uint32_t &index)
+RubyPrefetcher::getPrefetchEntry(Addr address, uint32_t &index)
{
// search all streams for a match
for (int i = 0; i < m_num_streams; i++) {
@@ -348,7 +348,7 @@
}
bool
-Prefetcher::accessUnitFilter(std::vector<Addr>& filter_table,
+RubyPrefetcher::accessUnitFilter(std::vector<Addr>& filter_table,
uint32_t *filter_hit, uint32_t &index, Addr address,
int stride, bool &alloc)
{
@@ -381,7 +381,7 @@
}
bool
-Prefetcher::accessNonunitFilter(Addr address, int *stride,
+RubyPrefetcher::accessNonunitFilter(Addr address, int *stride,
bool &alloc)
{
//reset the alloc flag
@@ -444,7 +444,7 @@
}
void
-Prefetcher::print(std::ostream& out) const
+RubyPrefetcher::print(std::ostream& out) const
{
out << name() << " Prefetcher State\n";
// print out unit filter
@@ -477,7 +477,7 @@
}
Addr
-Prefetcher::pageAddress(Addr addr) const
+RubyPrefetcher::pageAddress(Addr addr) const
{
return mbits<Addr>(addr, 63, m_page_shift);
}
diff --git a/src/mem/ruby/structures/Prefetcher.hh
b/src/mem/ruby/structures/Prefetcher.hh
index 89c0186..4d2513f 100644
--- a/src/mem/ruby/structures/Prefetcher.hh
+++ b/src/mem/ruby/structures/Prefetcher.hh
@@ -90,12 +90,12 @@
std::bitset<MAX_PF_INFLIGHT> requestCompleted;
};
-class Prefetcher : public SimObject
+class RubyPrefetcher : public SimObject
{
public:
typedef PrefetcherParams Params;
- Prefetcher(const Params *p);
- ~Prefetcher();
+ RubyPrefetcher(const Params *p);
+ ~RubyPrefetcher();
void issueNextPrefetch(Addr address, PrefetchEntry *stream);
/**
diff --git a/src/mem/ruby/structures/RubyPrefetcher.py
b/src/mem/ruby/structures/RubyPrefetcher.py
index 9d2803b..d762ba5 100644
--- a/src/mem/ruby/structures/RubyPrefetcher.py
+++ b/src/mem/ruby/structures/RubyPrefetcher.py
@@ -44,7 +44,7 @@
class Prefetcher(SimObject):
type = 'Prefetcher'
- cxx_class = 'Prefetcher'
+ cxx_class = 'RubyPrefetcher'
cxx_header = "mem/ruby/structures/Prefetcher.hh"
num_streams = Param.UInt32(4,
--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/27949
To unsubscribe, or for help writing mail filters, visit
https://gem5-review.googlesource.com/settings
Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: I7afdf5dbc57dbf46d82552113c52f3a9207870f2
Gerrit-Change-Number: 27949
Gerrit-PatchSet: 1
Gerrit-Owner: Gabe Black <[email protected]>
Gerrit-Reviewer: Gabe Black <[email protected]>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev