diff options
author | Brandon Potter <brandon.potter@amd.com> | 2015-07-10 16:05:24 -0500 |
---|---|---|
committer | Brandon Potter <brandon.potter@amd.com> | 2015-07-10 16:05:24 -0500 |
commit | bfe7ee96ad5abec40639d47dc2b0512d6baa0f81 (patch) | |
tree | bf731166c1e2d1e1fb6a98fe3916700a4104671d /src/mem/slicc/symbols | |
parent | f9a370f1728fe5d752fa6962ba23774eec8c883e (diff) | |
download | gem5-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/slicc/symbols')
-rw-r--r-- | src/mem/slicc/symbols/StateMachine.py | 14 | ||||
-rw-r--r-- | src/mem/slicc/symbols/Type.py | 1 |
2 files changed, 6 insertions, 9 deletions
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<uint32_t, AbstractController *>::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<uint32_t, AbstractController *>::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 <memory> #include "mem/protocol/${{self.c_ident}}.hh" -#include "mem/ruby/common/Global.hh" #include "mem/ruby/system/System.hh" using namespace std; |