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 <andreas.sandberg@arm.com> Reviewed-on: https://gem5-review.googlesource.com/c/15981 Reviewed-by: Jason Lowe-Power <jason@lowepower.com> Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
This commit is contained in:
@@ -39,8 +39,8 @@
|
||||
# Authors: Nathan Binkert
|
||||
|
||||
from m5.params import *
|
||||
from BaseSimpleCPU import BaseSimpleCPU
|
||||
from SimPoint import SimPoint
|
||||
from m5.objects.BaseSimpleCPU import BaseSimpleCPU
|
||||
from m5.objects.SimPoint import SimPoint
|
||||
|
||||
class AtomicSimpleCPU(BaseSimpleCPU):
|
||||
"""Simple CPU model executing a configurable number of
|
||||
|
||||
@@ -30,9 +30,10 @@ from __future__ import print_function
|
||||
|
||||
from m5.defines import buildEnv
|
||||
from m5.params import *
|
||||
from BaseCPU import BaseCPU
|
||||
from DummyChecker import DummyChecker
|
||||
from BranchPredictor import *
|
||||
|
||||
from m5.objects.BaseCPU import BaseCPU
|
||||
from m5.objects.DummyChecker import DummyChecker
|
||||
from m5.objects.BranchPredictor import *
|
||||
|
||||
class BaseSimpleCPU(BaseCPU):
|
||||
type = 'BaseSimpleCPU'
|
||||
@@ -41,7 +42,7 @@ class BaseSimpleCPU(BaseCPU):
|
||||
|
||||
def addCheckerCpu(self):
|
||||
if buildEnv['TARGET_ISA'] in ['arm']:
|
||||
from ArmTLB import ArmTLB
|
||||
from m5.objects.ArmTLB import ArmTLB
|
||||
|
||||
self.checker = DummyChecker(workload = self.workload)
|
||||
self.checker.itb = ArmTLB(size = self.itb.size)
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
# Authors: Andreas Sandberg
|
||||
|
||||
from m5.params import *
|
||||
from AtomicSimpleCPU import AtomicSimpleCPU
|
||||
from m5.objects.AtomicSimpleCPU import AtomicSimpleCPU
|
||||
|
||||
class NonCachingSimpleCPU(AtomicSimpleCPU):
|
||||
"""Simple CPU model based on the atomic CPU. Unlike the atomic CPU,
|
||||
|
||||
@@ -27,7 +27,8 @@
|
||||
# Authors: Nathan Binkert
|
||||
|
||||
from m5.params import *
|
||||
from BaseSimpleCPU import BaseSimpleCPU
|
||||
|
||||
from m5.objects.BaseSimpleCPU import BaseSimpleCPU
|
||||
|
||||
class TimingSimpleCPU(BaseSimpleCPU):
|
||||
type = 'TimingSimpleCPU'
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
# Authors: Curtis Dunham
|
||||
|
||||
from m5.params import *
|
||||
from Probe import ProbeListenerObject
|
||||
from m5.objects.Probe import ProbeListenerObject
|
||||
|
||||
class SimPoint(ProbeListenerObject):
|
||||
"""Probe for collecting SimPoint Basic Block Vectors (BBVs)."""
|
||||
|
||||
Reference in New Issue
Block a user