From 2974dc7a3771e34542ed5bd1baf88e4ced8cf139 Mon Sep 17 00:00:00 2001 From: Andreas Sandberg Date: Fri, 27 Jan 2017 12:40:01 +0000 Subject: 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 Reviewed-by: Curtis Dunham Reviewed-by: Jason Lowe-Power --- src/python/m5/stats/__init__.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src/python/m5/stats') diff --git a/src/python/m5/stats/__init__.py b/src/python/m5/stats/__init__.py index f3d394311..56036e040 100644 --- a/src/python/m5/stats/__init__.py +++ b/src/python/m5/stats/__init__.py @@ -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, -- cgit v1.2.3