From c38f5098b152ea1e1dde96220d3f9e50d3411780 Mon Sep 17 00:00:00 2001 From: Brandon Potter Date: Fri, 10 Jul 2015 16:05:23 -0500 Subject: ruby: replace g_ruby_start with per-RubySystem m_start_cycle This patch begins the process of removing global variables from the Ruby source with the goal of eventually allowing users to create multiple Ruby instances in a single simulation. Currently, users cannot do so because several global variables and static members are referenced by the RubySystem object in a way that assumes that there will only ever be a single RubySystem. These need to be replaced with per-RubySystem equivalents. This specific patch replaces the global var g_ruby_start, which is used to calculate throughput statistics for Throttles in simple networks and links in Garnet networks, with a RubySystem instance var m_start_cycle. --- src/mem/ruby/system/System.cc | 2 +- src/mem/ruby/system/System.hh | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'src/mem/ruby/system') diff --git a/src/mem/ruby/system/System.cc b/src/mem/ruby/system/System.cc index 2f1d9013c..1cdc3879e 100644 --- a/src/mem/ruby/system/System.cc +++ b/src/mem/ruby/system/System.cc @@ -338,7 +338,7 @@ RubySystem::RubyEvent::process() void RubySystem::resetStats() { - g_ruby_start = curCycle(); + m_start_cycle = curCycle(); } bool diff --git a/src/mem/ruby/system/System.hh b/src/mem/ruby/system/System.hh index a59ade398..0030b5033 100644 --- a/src/mem/ruby/system/System.hh +++ b/src/mem/ruby/system/System.hh @@ -78,6 +78,7 @@ class RubySystem : public ClockedObject static bool getCooldownEnabled() { return m_cooldown_enabled; } SimpleMemory *getPhysMem() { return m_phys_mem; } + Cycles getStartCycle() { return m_start_cycle; } const bool getAccessBackingStore() { return m_access_backing_store; } // Public Methods @@ -135,6 +136,7 @@ class RubySystem : public ClockedObject Network* m_network; std::vector m_abs_cntrl_vec; + Cycles m_start_cycle; public: Profiler* m_profiler; -- cgit v1.2.3