From bfe7ee96ad5abec40639d47dc2b0512d6baa0f81 Mon Sep 17 00:00:00 2001 From: Brandon Potter Date: Fri, 10 Jul 2015 16:05:24 -0500 Subject: ruby: replace global g_abs_controls with per-RubySystem var This is another step in the process of removing global variables from Ruby to enable multiple RubySystem instances in a single simulation. The list of abstract controllers is per-RubySystem and should be represented that way, rather than as a global. Since this is the last remaining Ruby global variable, the src/mem/ruby/Common/Global.* files are also removed. --- src/mem/ruby/system/System.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/mem/ruby/system/System.cc') diff --git a/src/mem/ruby/system/System.cc b/src/mem/ruby/system/System.cc index 128d16003..815b89ee5 100644 --- a/src/mem/ruby/system/System.cc +++ b/src/mem/ruby/system/System.cc @@ -68,12 +68,12 @@ RubySystem::RubySystem(const Params *p) m_memory_size_bits = p->memory_size_bits; // Resize to the size of different machine types - g_abs_controls.resize(MachineType_NUM); + m_abstract_controls.resize(MachineType_NUM); // Collate the statistics before they are printed. Stats::registerDumpCallback(new RubyStatsCallback(this)); // Create the profiler - m_profiler = new Profiler(p); + m_profiler = new Profiler(p, this); m_phys_mem = p->phys_mem; } @@ -89,7 +89,7 @@ RubySystem::registerAbstractController(AbstractController* cntrl) m_abs_cntrl_vec.push_back(cntrl); MachineID id = cntrl->getMachineID(); - g_abs_controls[id.getType()][id.getNum()] = cntrl; + m_abstract_controls[id.getType()][id.getNum()] = cntrl; } RubySystem::~RubySystem() -- cgit v1.2.3