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/slicc/symbols/StateMachine.py | 14 ++++++-------- src/mem/slicc/symbols/Type.py | 1 - 2 files changed, 6 insertions(+), 9 deletions(-) (limited to 'src/mem/slicc') diff --git a/src/mem/slicc/symbols/StateMachine.py b/src/mem/slicc/symbols/StateMachine.py index 24b429b28..437fc539c 100644 --- a/src/mem/slicc/symbols/StateMachine.py +++ b/src/mem/slicc/symbols/StateMachine.py @@ -250,7 +250,6 @@ class $py_ident(RubyController): #include "mem/protocol/TransitionResult.hh" #include "mem/protocol/Types.hh" #include "mem/ruby/common/Consumer.hh" -#include "mem/ruby/common/Global.hh" #include "mem/ruby/slicc_interface/AbstractController.hh" #include "params/$c_ident.hh" ''') @@ -438,7 +437,6 @@ void unset_tbe(${{self.TBEType.c_ident}}*& m_tbe_ptr); #include "mem/protocol/${ident}_Event.hh" #include "mem/protocol/${ident}_State.hh" #include "mem/protocol/Types.hh" -#include "mem/ruby/common/Global.hh" #include "mem/ruby/system/System.hh" ''') for include_path in includes: @@ -771,9 +769,10 @@ $c_ident::collateStats() for (${ident}_Event event = ${ident}_Event_FIRST; event < ${ident}_Event_NUM; ++event) { for (unsigned int i = 0; i < m_num_controllers; ++i) { + RubySystem *rs = params()->ruby_system; std::map::iterator it = - g_abs_controls[MachineType_${ident}].find(i); - assert(it != g_abs_controls[MachineType_${ident}].end()); + rs->m_abstract_controls[MachineType_${ident}].find(i); + assert(it != rs->m_abstract_controls[MachineType_${ident}].end()); (*eventVec[event])[i] = (($c_ident *)(*it).second)->getEventCount(event); } @@ -786,9 +785,10 @@ $c_ident::collateStats() event < ${ident}_Event_NUM; ++event) { for (unsigned int i = 0; i < m_num_controllers; ++i) { + RubySystem *rs = params()->ruby_system; std::map::iterator it = - g_abs_controls[MachineType_${ident}].find(i); - assert(it != g_abs_controls[MachineType_${ident}].end()); + rs->m_abstract_controls[MachineType_${ident}].find(i); + assert(it != rs->m_abstract_controls[MachineType_${ident}].end()); (*transVec[state][event])[i] = (($c_ident *)(*it).second)->getTransitionCount(state, event); } @@ -1044,7 +1044,6 @@ $c_ident::functionalWriteBuffers(PacketPtr& pkt) code(''' #include "mem/protocol/Types.hh" -#include "mem/ruby/common/Global.hh" #include "mem/ruby/system/System.hh" ''') @@ -1120,7 +1119,6 @@ ${ident}_Controller::wakeup() #include "mem/protocol/${ident}_Event.hh" #include "mem/protocol/${ident}_State.hh" #include "mem/protocol/Types.hh" -#include "mem/ruby/common/Global.hh" #include "mem/ruby/system/System.hh" #define HASH_FUN(state, event) ((int(state)*${ident}_Event_NUM)+int(event)) diff --git a/src/mem/slicc/symbols/Type.py b/src/mem/slicc/symbols/Type.py index eb1dead0f..73d6f9c69 100644 --- a/src/mem/slicc/symbols/Type.py +++ b/src/mem/slicc/symbols/Type.py @@ -399,7 +399,6 @@ operator<<(std::ostream& out, const ${{self.c_ident}}& obj) #include #include "mem/protocol/${{self.c_ident}}.hh" -#include "mem/ruby/common/Global.hh" #include "mem/ruby/system/System.hh" using namespace std; -- cgit v1.2.3