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>
This commit is contained in:
Andreas Sandberg
2017-01-27 12:40:01 +00:00
parent e387521527
commit 2974dc7a37
27 changed files with 129 additions and 102 deletions

View File

@@ -656,7 +656,7 @@ class MetaSimObject(type):
# See ParamValue.swig_predecls for description.
def swig_predecls(cls, code):
code('%import "python/m5/internal/param_$cls.i"')
code('%import "python/_m5/param_$cls.i"')
# Hook for exporting additional C++ methods to Python via SWIG.
# Default is none, override using @classmethod in class definition.
@@ -686,7 +686,7 @@ class MetaSimObject(type):
params = map(lambda (k, v): v, sorted(cls._params.local.items()))
ports = cls._ports.local
code('%module(package="m5.internal") param_$cls')
code('%module(package="_m5") param_$cls')
code()
code('%{')
code('#include "sim/sim_object.hh"')
@@ -716,7 +716,7 @@ using std::ptrdiff_t;
code()
if cls._base:
code('%import "python/m5/internal/param_${{cls._base}}.i"')
code('%import "python/_m5/param_${{cls._base}}.i"')
code()
for ns in namespaces: