summaryrefslogtreecommitdiff
path: root/src/SConscript
diff options
context:
space:
mode:
authorAndreas Sandberg <andreas.sandberg@arm.com>2017-01-27 12:40:01 +0000
committerAndreas Sandberg <andreas.sandberg@arm.com>2017-01-27 12:40:01 +0000
commit2974dc7a3771e34542ed5bd1baf88e4ced8cf139 (patch)
treec60e4620b2ac61d0790c07fabdd802b1107a8976 /src/SConscript
parente3875215270220e5142a93848f74ccde9d61b244 (diff)
downloadgem5-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/SConscript')
-rwxr-xr-xsrc/SConscript20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/SConscript b/src/SConscript
index 115ce24eb..521d73bac 100755
--- a/src/SConscript
+++ b/src/SConscript
@@ -483,7 +483,7 @@ class DictImporter(object):
if fullname == 'm5.objects':
return self
- if fullname.startswith('m5.internal'):
+ if fullname.startswith('_m5'):
return None
source = self.modules.get(fullname, None)
@@ -588,14 +588,14 @@ def makeDefinesPyFile(target, source, env):
code = code_formatter()
code("""
-import m5.internal
+import _m5.core
import m5.util
buildEnv = m5.util.SmartDict($build_env)
-compileDate = m5.internal.core.compileDate
+compileDate = _m5.core.compileDate
_globals = globals()
-for key,val in m5.internal.core.__dict__.iteritems():
+for key,val in _m5.core.__dict__.iteritems():
if key.startswith('flag_'):
flag = key[5:]
_globals[flag] = val
@@ -773,13 +773,13 @@ if GetOption('with_cxx_config'):
# Generate any needed param SWIG wrapper files
params_i_files = []
for name,param in sorted(params_to_swig.iteritems()):
- i_file = File('python/m5/internal/%s.i' % (param.swig_module_name()))
+ i_file = File('python/_m5/%s.i' % (param.swig_module_name()))
params_i_files.append(i_file)
env.Command(i_file, Value(name),
MakeAction(createParamSwigWrapper, Transform("SW PARAM")))
env.Depends(i_file, depends)
env.Depends(SWIG, i_file)
- SwigSource('m5.internal', i_file)
+ SwigSource('_m5', i_file)
# Generate all enum header files
for name,enum in sorted(all_enums.iteritems()):
@@ -799,22 +799,22 @@ for name,enum in sorted(all_enums.iteritems()):
env.Depends(hh_file, depends + extra_deps)
env.Depends(SWIG, hh_file)
- i_file = File('python/m5/internal/enum_%s.i' % name)
+ i_file = File('python/_m5/enum_%s.i' % name)
env.Command(i_file, Value(name),
MakeAction(createEnumSwigWrapper, Transform("ENUMSWIG")))
env.Depends(i_file, depends + extra_deps)
env.Depends(SWIG, i_file)
- SwigSource('m5.internal', i_file)
+ SwigSource('_m5', i_file)
# Generate SimObject SWIG wrapper files
for name,simobj in sorted(sim_objects.iteritems()):
py_source = PySource.modules[simobj.__module__]
extra_deps = [ py_source.tnode ]
- i_file = File('python/m5/internal/param_%s.i' % name)
+ i_file = File('python/_m5/param_%s.i' % name)
env.Command(i_file, Value(name),
MakeAction(createSimObjectSwigWrapper, Transform("SO SWIG")))
env.Depends(i_file, depends + extra_deps)
- SwigSource('m5.internal', i_file)
+ SwigSource('_m5', i_file)
# Generate the main swig init file
def makeEmbeddedSwigInit(package):