From ef71a987c1987f7543d3bf76ed9e5ce62f4d1daa Mon Sep 17 00:00:00 2001 From: Andreas Sandberg Date: Fri, 25 Jan 2019 14:26:21 +0000 Subject: python: Don't assume SimObjects live in the global namespace The importer in Python 3 doesn't like the way we import SimObjects from the global namespace. Convert the existing SimObject declarations to import from m5.objects. As a side-effect, this makes these files consistent with configuration files. Change-Id: I11153502b430822130722839e1fa767b82a027aa Signed-off-by: Andreas Sandberg Reviewed-on: https://gem5-review.googlesource.com/c/15981 Reviewed-by: Jason Lowe-Power Reviewed-by: Giacomo Travaglini --- src/sim/System.py | 4 ++-- src/sim/TickedObject.py | 2 +- src/sim/power/MathExprPowerModel.py | 2 +- src/sim/power/ThermalModel.py | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src/sim') diff --git a/src/sim/System.py b/src/sim/System.py index f45decb6b..51b1a743f 100644 --- a/src/sim/System.py +++ b/src/sim/System.py @@ -45,8 +45,8 @@ from m5.defines import buildEnv from m5.params import * from m5.proxy import * -from DVFSHandler import * -from SimpleMemory import * +from m5.objects.DVFSHandler import * +from m5.objects.SimpleMemory import * class MemoryMode(Enum): vals = ['invalid', 'atomic', 'timing', 'atomic_noncaching'] diff --git a/src/sim/TickedObject.py b/src/sim/TickedObject.py index a566aac92..8746e3775 100644 --- a/src/sim/TickedObject.py +++ b/src/sim/TickedObject.py @@ -35,7 +35,7 @@ # # Authors: Andrew Bardsley -from ClockedObject import ClockedObject +from m5.objects.ClockedObject import ClockedObject class TickedObject(ClockedObject): type = 'TickedObject' diff --git a/src/sim/power/MathExprPowerModel.py b/src/sim/power/MathExprPowerModel.py index 85132d22c..e462fa120 100644 --- a/src/sim/power/MathExprPowerModel.py +++ b/src/sim/power/MathExprPowerModel.py @@ -37,7 +37,7 @@ from m5.SimObject import SimObject from m5.params import * -from PowerModelState import PowerModelState +from m5.objects.PowerModelState import PowerModelState # Represents a power model for a simobj class MathExprPowerModel(PowerModelState): diff --git a/src/sim/power/ThermalModel.py b/src/sim/power/ThermalModel.py index e6a01b2be..ef9548a76 100644 --- a/src/sim/power/ThermalModel.py +++ b/src/sim/power/ThermalModel.py @@ -36,7 +36,7 @@ # Authors: David Guillen Fandos from m5.SimObject import * -from ClockedObject import ClockedObject +from m5.objects.ClockedObject import ClockedObject from m5.params import * from m5.objects import ThermalDomain -- cgit v1.2.3