summaryrefslogtreecommitdiff
path: root/src/mem/ruby/system/Sequencer.cc
diff options
context:
space:
mode:
authorBrandon Potter <brandon.potter@amd.com>2015-07-10 16:05:23 -0500
committerBrandon Potter <brandon.potter@amd.com>2015-07-10 16:05:23 -0500
commitf9a370f1728fe5d752fa6962ba23774eec8c883e (patch)
treea81a0331b75c72ec801d1ecf1ce62a8bc6f3d112 /src/mem/ruby/system/Sequencer.cc
parentc38f5098b152ea1e1dde96220d3f9e50d3411780 (diff)
downloadgem5-f9a370f1728fe5d752fa6962ba23774eec8c883e.tar.xz
ruby: replace global g_system_ptr with per-object pointers
This is another step in the process of removing global variables from Ruby to enable multiple RubySystem instances in a single simulation. With possibly multiple RubySystem objects, we can no longer use a global variable to find "the" RubySystem object. Instead, each Ruby component has to carry a pointer to the RubySystem object to which it belongs.
Diffstat (limited to 'src/mem/ruby/system/Sequencer.cc')
-rw-r--r--src/mem/ruby/system/Sequencer.cc9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/mem/ruby/system/Sequencer.cc b/src/mem/ruby/system/Sequencer.cc
index a5e26b800..f64e24fdd 100644
--- a/src/mem/ruby/system/Sequencer.cc
+++ b/src/mem/ruby/system/Sequencer.cc
@@ -160,7 +160,7 @@ Sequencer::printProgress(ostream& out) const
#if 0
int total_demand = 0;
out << "Sequencer Stats Version " << m_version << endl;
- out << "Current time = " << g_system_ptr->getTime() << endl;
+ out << "Current time = " << m_ruby_system->getTime() << endl;
out << "---------------" << endl;
out << "outstanding requests" << endl;
@@ -557,14 +557,15 @@ Sequencer::hitCallback(SequencerRequest* srequest, DataBlock& data,
delete srequest;
+ RubySystem *rs = m_ruby_system;
if (RubySystem::getWarmupEnabled()) {
assert(pkt->req);
delete pkt->req;
delete pkt;
- g_system_ptr->m_cache_recorder->enqueueNextFetchRequest();
+ rs->m_cache_recorder->enqueueNextFetchRequest();
} else if (RubySystem::getCooldownEnabled()) {
delete pkt;
- g_system_ptr->m_cache_recorder->enqueueNextFlushRequest();
+ rs->m_cache_recorder->enqueueNextFlushRequest();
} else {
ruby_hit_callback(pkt);
}
@@ -737,7 +738,7 @@ void
Sequencer::checkCoherence(const Address& addr)
{
#ifdef CHECK_COHERENCE
- g_system_ptr->checkGlobalCoherenceInvariant(addr);
+ m_ruby_system->checkGlobalCoherenceInvariant(addr);
#endif
}