diff options
author | Andreas Sandberg <andreas.sandberg@arm.com> | 2017-01-27 12:40:01 +0000 |
---|---|---|
committer | Andreas Sandberg <andreas.sandberg@arm.com> | 2017-01-27 12:40:01 +0000 |
commit | 2974dc7a3771e34542ed5bd1baf88e4ced8cf139 (patch) | |
tree | c60e4620b2ac61d0790c07fabdd802b1107a8976 /src/python/m5/params.py | |
parent | e3875215270220e5142a93848f74ccde9d61b244 (diff) | |
download | gem5-2974dc7a3771e34542ed5bd1baf88e4ced8cf139.tar.xz |
python: Move native wrappers to the _m5 namespace
Swig wrappers for native objects currently share the _m5.internal name
space with Python code. This is undesirable if we ever want to switch
from Swig to some other framework for native binding (e.g., PyBind11
or Boost::Python). This changeset moves all of such wrappers to the
_m5 namespace, which is now reserved for native code.
Change-Id: I2d2bc12dbc05b57b7c5a75f072e08124413d77f3
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Curtis Dunham <curtis.dunham@arm.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
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 ac777fad2..ae2b74a23 100644 --- a/src/python/m5/params.py +++ b/src/python/m5/params.py @@ -386,7 +386,7 @@ class VectorParamDesc(ParamDesc): code('%import "${{self.swig_module_name()}}.i"') def swig_decl(self, code): - code('%module(package="m5.internal") ${{self.swig_module_name()}}') + code('%module(package="_m5") ${{self.swig_module_name()}}') code('%{') self.ptype.cxx_predecls(code) code('%}') @@ -619,7 +619,7 @@ class Cycles(CheckedInt): unsigned = True def getValue(self): - from m5.internal.core import Cycles + from _m5.core import Cycles return Cycles(self.value) @classmethod @@ -828,7 +828,7 @@ class AddrRange(ParamValue): def getValue(self): # Go from the Python class to the wrapped C++ class generated # by swig - from m5.internal.range import AddrRange + from _m5.range import AddrRange return AddrRange(long(self.start), long(self.end), int(self.intlvHighBit), int(self.xorHighBit), @@ -1378,7 +1378,7 @@ $wrapper $wrapper_name { def swig_decl(cls, code): name = cls.__name__ code('''\ -%module(package="m5.internal") enum_$name +%module(package="_m5") enum_$name %{ #include "enums/$name.hh" @@ -1419,7 +1419,7 @@ class Enum(ParamValue): @classmethod def swig_predecls(cls, code): - code('%import "python/m5/internal/enum_$0.i"', cls.__name__) + code('%import "python/_m5/enum_$0.i"', cls.__name__) @classmethod def cxx_ini_parse(cls, code, src, dest, ret): @@ -1909,7 +1909,7 @@ class PortRef(object): # Call C++ to create corresponding port connection between C++ objects def ccConnect(self): - from m5.internal.pyobject import connectPorts + from _m5.pyobject import connectPorts if self.role == 'SLAVE': # do nothing and let the master take care of it |