diff options
author | Brandon Potter <brandon.potter@amd.com> | 2015-07-10 16:05:23 -0500 |
---|---|---|
committer | Brandon Potter <brandon.potter@amd.com> | 2015-07-10 16:05:23 -0500 |
commit | f9a370f1728fe5d752fa6962ba23774eec8c883e (patch) | |
tree | a81a0331b75c72ec801d1ecf1ce62a8bc6f3d112 /src/mem/ruby/system/System.cc | |
parent | c38f5098b152ea1e1dde96220d3f9e50d3411780 (diff) | |
download | gem5-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/System.cc')
-rw-r--r-- | src/mem/ruby/system/System.cc | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/src/mem/ruby/system/System.cc b/src/mem/ruby/system/System.cc index 1cdc3879e..128d16003 100644 --- a/src/mem/ruby/system/System.cc +++ b/src/mem/ruby/system/System.cc @@ -58,9 +58,6 @@ bool RubySystem::m_cooldown_enabled = false; RubySystem::RubySystem(const Params *p) : ClockedObject(p), m_access_backing_store(p->access_backing_store) { - if (g_system_ptr != NULL) - fatal("Only one RubySystem object currently allowed.\n"); - m_random_seed = p->random_seed; srandom(m_random_seed); m_randomization = p->randomization; @@ -70,9 +67,6 @@ RubySystem::RubySystem(const Params *p) m_block_size_bits = floorLog2(m_block_size_bytes); m_memory_size_bits = p->memory_size_bits; - // Setup the global variables used in Ruby - g_system_ptr = this; - // Resize to the size of different machine types g_abs_controls.resize(MachineType_NUM); @@ -329,9 +323,9 @@ void RubySystem::RubyEvent::process() { if (RubySystem::getWarmupEnabled()) { - ruby_system->m_cache_recorder->enqueueNextFetchRequest(); + m_ruby_system->m_cache_recorder->enqueueNextFetchRequest(); } else if (RubySystem::getCooldownEnabled()) { - ruby_system->m_cache_recorder->enqueueNextFlushRequest(); + m_ruby_system->m_cache_recorder->enqueueNextFlushRequest(); } } |