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

@@ -29,22 +29,22 @@
import m5
from m5 import internal
import _m5.stats
from m5.objects import Root
from m5.util import attrdict, fatal
# Stat exports
from m5.internal.stats import schedStatEvent as schedEvent
from m5.internal.stats import periodicStatDump
from _m5.stats import schedStatEvent as schedEvent
from _m5.stats import periodicStatDump
outputList = []
def initText(filename, desc=True):
output = internal.stats.initText(filename, desc)
output = _m5.stats.initText(filename, desc)
outputList.append(output)
def initSimStats():
internal.stats.initSimStats()
internal.stats.registerPythonStatsHandlers()
_m5.stats.initSimStats()
_m5.stats.registerPythonStatsHandlers()
names = []
stats_dict = {}
@@ -55,7 +55,7 @@ def enable():
the package is enabled, no more statistics can be created.'''
global stats_list
stats_list = list(internal.stats.statsList())
stats_list = list(_m5.stats.statsList())
for stat in stats_list:
if not stat.check() or not stat.baseCheck():
@@ -75,7 +75,7 @@ def enable():
stats_dict[stat.name] = stat
stat.enable()
internal.stats.enable();
_m5.stats.enable();
def prepare():
'''Prepare all stats for data access. This must be done before
@@ -96,7 +96,7 @@ def dump():
return
lastDump = curTick
internal.stats.processDumpQueue()
_m5.stats.processDumpQueue()
prepare()
@@ -119,7 +119,7 @@ def reset():
for stat in stats_list:
stat.reset()
internal.stats.processResetQueue()
_m5.stats.processResetQueue()
flags = attrdict({
'none' : 0x0000,