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/Sequencer.cc | 1 - src/mem/ruby/system/System.cc | 6 +++--- src/mem/ruby/system/System.hh | 2 ++ 3 files changed, 5 insertions(+), 4 deletions(-) (limited to 'src/mem/ruby/system') diff --git a/src/mem/ruby/system/Sequencer.cc b/src/mem/ruby/system/Sequencer.cc index f64e24fdd..e2be52083 100644 --- a/src/mem/ruby/system/Sequencer.cc +++ b/src/mem/ruby/system/Sequencer.cc @@ -36,7 +36,6 @@ #include "debug/RubyStats.hh" #include "mem/protocol/PrefetchBit.hh" #include "mem/protocol/RubyAccessMode.hh" -#include "mem/ruby/common/Global.hh" #include "mem/ruby/profiler/Profiler.hh" #include "mem/ruby/slicc_interface/RubyRequest.hh" #include "mem/ruby/system/Sequencer.hh" 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() diff --git a/src/mem/ruby/system/System.hh b/src/mem/ruby/system/System.hh index 57a1b7cfb..fdb5fc881 100644 --- a/src/mem/ruby/system/System.hh +++ b/src/mem/ruby/system/System.hh @@ -45,6 +45,7 @@ #include "sim/clocked_object.hh" class Network; +class AbstractController; class RubySystem : public ClockedObject { @@ -142,6 +143,7 @@ class RubySystem : public ClockedObject public: Profiler* m_profiler; CacheRecorder* m_cache_recorder; + std::vector > m_abstract_controls; }; class RubyStatsCallback : public Callback -- cgit v1.2.3