diff options
author | Nathan Binkert <nate@binkert.org> | 2010-09-12 15:41:34 -0700 |
---|---|---|
committer | Nathan Binkert <nate@binkert.org> | 2010-09-12 15:41:34 -0700 |
commit | 2edfcbbaee87c1a28351fc0dcd81d52d0d9102a4 (patch) | |
tree | 3436d2dad1d98f200566e719add526b135ae0e08 /src/python/m5/params.py | |
parent | afafaf1dcbab1fac3e3ba2f87dd5138d3ec08588 (diff) | |
download | gem5-2edfcbbaee87c1a28351fc0dcd81d52d0d9102a4.tar.xz |
swig: make all generated files go into the m5.internal package
This is necessary because versions of swig older than 1.3.39 fail to
do the right thing and try to do relative imports for everything (even
with the package= option to %module). Instead of putting params in
the m5.internal.params package, put params in the m5.internal package
and make all param modules start with param_. Same thing for
m5.internal.enums.
Also, stop importing all generated params into m5.objects. They are
not necessary and now with everything using relative imports we wound
up with pollution of the namespace (where builtin-range got overridden).
--HG--
rename : src/python/m5/internal/enums/__init__.py => src/python/m5/internal/enums.py
rename : src/python/m5/internal/params/__init__.py => src/python/m5/internal/params.py
Diffstat (limited to 'src/python/m5/params.py')
-rw-r--r-- | src/python/m5/params.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/python/m5/params.py b/src/python/m5/params.py index 0143fe2e7..ca75472b0 100644 --- a/src/python/m5/params.py +++ b/src/python/m5/params.py @@ -241,7 +241,7 @@ class VectorParamDesc(ParamDesc): return VectorParamValue(tmp_list) def swig_predecls(self, code): - code('%import "${{self.ptype_str}}_vptype.i"') + code('%import "vptype_${{self.ptype_str}}.i"') def swig_decl(self, code): code('%{') @@ -669,7 +669,7 @@ class EthernetAddr(ParamValue): return self def getValue(self): - from m5.objects.params import EthAddr + from m5.internal.params import EthAddr return EthAddr(self.value) def ini_str(self): @@ -728,7 +728,7 @@ class Time(ParamValue): self.value = parse_time(value) def getValue(self): - from m5.objects.params import tm + from m5.internal.params import tm c_time = tm() py_time = self.value @@ -835,7 +835,7 @@ extern const char *${name}Strings[Num_${name}]; def cxx_def(cls, code): name = cls.__name__ code('''\ -#include "enums/${name}.hh" +#include "enums/$name.hh" namespace Enums { const char *${name}Strings[Num_${name}] = { @@ -866,7 +866,7 @@ class Enum(ParamValue): @classmethod def swig_predecls(cls, code): - code('%import "enums/$0.i"', cls.__name__) + code('%import "python/m5/internal/enum_$0.i"', cls.__name__) def getValue(self): return int(self.map[self.value]) @@ -1168,7 +1168,7 @@ class PortRef(object): # Call C++ to create corresponding port connection between C++ objects def ccConnect(self): - from m5.objects.params import connectPorts + from m5.internal.params import connectPorts if self.ccConnected: # already done this return |