diff options
author | Nilay Vaish <nilay@cs.wisc.edu> | 2013-01-14 10:05:10 -0600 |
---|---|---|
committer | Nilay Vaish <nilay@cs.wisc.edu> | 2013-01-14 10:05:10 -0600 |
commit | 20129837186a5eb28a1b1e2f8dcd441934af68a6 (patch) | |
tree | ab8daf1e72d64ec8ffadc6bdce4129c891dd3c8d /src/mem/slicc/symbols/Type.py | |
parent | cf232de4615f0fe9435d6e92a1d6319c972a8c88 (diff) | |
download | gem5-20129837186a5eb28a1b1e2f8dcd441934af68a6.tar.xz |
Ruby: remove reference to g_system_ptr from class Message
This patch was initiated so as to remove reference to g_system_ptr,
the pointer to Ruby System that is used for getting the current time.
That simple change actual requires changing a lot many things in slicc and
garnet. All these changes are related to how time is handled.
In most of the places, g_system_ptr has been replaced by another clock
object. The changes have been done under the assumption that all the
components in the memory system are on the same clock frequency, but the
actual clocks might be distributed.
Diffstat (limited to 'src/mem/slicc/symbols/Type.py')
-rw-r--r-- | src/mem/slicc/symbols/Type.py | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/src/mem/slicc/symbols/Type.py b/src/mem/slicc/symbols/Type.py index 19c144048..ebf187630 100644 --- a/src/mem/slicc/symbols/Type.py +++ b/src/mem/slicc/symbols/Type.py @@ -226,7 +226,7 @@ class Type(Symbol): #include <iostream> -#include "mem/ruby/common/Global.hh" +#include "mem/ruby/slicc_interface/RubySlicc_Util.hh" ''') for dm in self.data_members.values(): @@ -242,10 +242,14 @@ class Type(Symbol): $klass ${{self.c_ident}}$parent { public: - ${{self.c_ident}}() - { + ${{self.c_ident}} ''', klass="class") + if self.isMessage: + code('(Time curTime) : %s(curTime) {' % self["interface"]) + else: + code('()\n\t\t{') + code.indent() if not self.isGlobal: code.indent() @@ -284,13 +288,19 @@ $klass ${{self.c_ident}}$parent if not self.isGlobal: params = [ 'const %s& local_%s' % (dm.type.c_ident, dm.ident) \ for dm in self.data_members.itervalues() ] - params = ', '.join(params) + + if self.isMessage: + params = "const Time curTime, " + params + code('${{self.c_ident}}($params)') # Call superclass constructor if "interface" in self: - code(' : ${{self["interface"]}}()') + if self.isMessage: + code(' : ${{self["interface"]}}(curTime)') + else: + code(' : ${{self["interface"]}}()') code('{') code.indent() @@ -302,14 +312,8 @@ $klass ${{self.c_ident}}$parent code.dedent() code('}') - # create a static factory method and a clone member + # create a clone member code(''' -static ${{self.c_ident}}* -create() -{ - return new ${{self.c_ident}}(); -} - ${{self.c_ident}}* clone() const { @@ -419,7 +423,6 @@ operator<<(std::ostream& out, const ${{self.c_ident}}& obj) #include <iostream> #include "mem/protocol/${{self.c_ident}}.hh" -#include "mem/ruby/slicc_interface/RubySlicc_Util.hh" using namespace std; ''') |