summaryrefslogtreecommitdiff
path: root/src/mem/ruby/system
diff options
context:
space:
mode:
authorBrandon Potter <brandon.potter@amd.com>2015-07-10 16:05:24 -0500
committerBrandon Potter <brandon.potter@amd.com>2015-07-10 16:05:24 -0500
commitbfe7ee96ad5abec40639d47dc2b0512d6baa0f81 (patch)
treebf731166c1e2d1e1fb6a98fe3916700a4104671d /src/mem/ruby/system
parentf9a370f1728fe5d752fa6962ba23774eec8c883e (diff)
downloadgem5-bfe7ee96ad5abec40639d47dc2b0512d6baa0f81.tar.xz
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.
Diffstat (limited to 'src/mem/ruby/system')
-rw-r--r--src/mem/ruby/system/Sequencer.cc1
-rw-r--r--src/mem/ruby/system/System.cc6
-rw-r--r--src/mem/ruby/system/System.hh2
3 files changed, 5 insertions, 4 deletions
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<std::map<uint32_t, AbstractController *> > m_abstract_controls;
};
class RubyStatsCallback : public Callback