summaryrefslogtreecommitdiff
path: root/src/mem/ruby/system/System.hh
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/System.hh
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/System.hh')
-rw-r--r--src/mem/ruby/system/System.hh11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/mem/ruby/system/System.hh b/src/mem/ruby/system/System.hh
index 0030b5033..57a1b7cfb 100644
--- a/src/mem/ruby/system/System.hh
+++ b/src/mem/ruby/system/System.hh
@@ -54,12 +54,12 @@ class RubySystem : public ClockedObject
public:
RubyEvent(RubySystem* _ruby_system)
{
- ruby_system = _ruby_system;
+ m_ruby_system = _ruby_system;
}
private:
void process();
- RubySystem* ruby_system;
+ RubySystem* m_ruby_system;
};
friend class RubyEvent;
@@ -128,6 +128,7 @@ class RubySystem : public ClockedObject
static uint32_t m_block_size_bytes;
static uint32_t m_block_size_bits;
static uint32_t m_memory_size_bits;
+
static bool m_warmup_enabled;
static unsigned m_systems_to_warmup;
static bool m_cooldown_enabled;
@@ -146,12 +147,12 @@ class RubySystem : public ClockedObject
class RubyStatsCallback : public Callback
{
private:
- RubySystem *ruby_system;
+ RubySystem *m_ruby_system;
public:
virtual ~RubyStatsCallback() {}
- RubyStatsCallback(RubySystem *system) : ruby_system(system) {}
- void process() { ruby_system->collateStats(); }
+ RubyStatsCallback(RubySystem *system) : m_ruby_system(system) {}
+ void process() { m_ruby_system->collateStats(); }
};
#endif // __MEM_RUBY_SYSTEM_SYSTEM_HH__