diff options
author | Jason Power <power.jg@gmail.com> | 2012-09-12 14:52:04 -0500 |
---|---|---|
committer | Jason Power <power.jg@gmail.com> | 2012-09-12 14:52:04 -0500 |
commit | aa8bcd15ec1ba916f3e750f41697a65e06b3c2ac (patch) | |
tree | ef66477d4b1904699ab751a841ff465768ab158e /src/mem/slicc/symbols/StateMachine.py | |
parent | c6927ed13868c096a60df6a217f92857799b5be6 (diff) | |
download | gem5-aa8bcd15ec1ba916f3e750f41697a65e06b3c2ac.tar.xz |
Ruby: Modify Scons so that we can put .sm files in extras
Also allows for header files which are required in slicc generated
code to be in a directory other than src/mem/ruby/slicc_interface.
Diffstat (limited to 'src/mem/slicc/symbols/StateMachine.py')
-rw-r--r-- | src/mem/slicc/symbols/StateMachine.py | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/src/mem/slicc/symbols/StateMachine.py b/src/mem/slicc/symbols/StateMachine.py index 83ad88e8b..47f7daa00 100644 --- a/src/mem/slicc/symbols/StateMachine.py +++ b/src/mem/slicc/symbols/StateMachine.py @@ -162,12 +162,12 @@ class StateMachine(Symbol): action.warning(error_msg) self.table = table - def writeCodeFiles(self, path): + def writeCodeFiles(self, path, includes): self.printControllerPython(path) self.printControllerHH(path) - self.printControllerCC(path) + self.printControllerCC(path, includes) self.printCSwitch(path) - self.printCWakeup(path) + self.printCWakeup(path, includes) self.printProfilerCC(path) self.printProfilerHH(path) self.printProfileDumperCC(path) @@ -399,7 +399,7 @@ void unset_tbe(${{self.TBEType.c_ident}}*& m_tbe_ptr); code('#endif // __${ident}_CONTROLLER_H__') code.write(path, '%s.hh' % c_ident) - def printControllerCC(self, path): + def printControllerCC(self, path, includes): '''Output the actions for performing the actions''' code = self.symtab.codeFormatter() @@ -429,8 +429,12 @@ void unset_tbe(${{self.TBEType.c_ident}}*& m_tbe_ptr); #include "mem/protocol/${ident}_State.hh" #include "mem/protocol/Types.hh" #include "mem/ruby/common/Global.hh" -#include "mem/ruby/slicc_interface/RubySlicc_includes.hh" #include "mem/ruby/system/System.hh" +''') + for include_path in includes: + code('#include "${{include_path}}"') + + code(''' using namespace std; ''') @@ -988,7 +992,7 @@ $c_ident::${{action.ident}}(const Address& addr) code.write(path, "%s.cc" % c_ident) - def printCWakeup(self, path): + def printCWakeup(self, path, includes): '''Output the wakeup loop for the events''' code = self.symtab.codeFormatter() @@ -1020,8 +1024,14 @@ $c_ident::${{action.ident}}(const Address& addr) code(''' #include "mem/protocol/Types.hh" #include "mem/ruby/common/Global.hh" -#include "mem/ruby/slicc_interface/RubySlicc_includes.hh" #include "mem/ruby/system/System.hh" +''') + + + for include_path in includes: + code('#include "${{include_path}}"') + + code(''' using namespace std; |