python: Fix params/proxy import loop
There is a circular dependency between params and proxy at import time. This causes issues for Python 3. Add the imports to the specific methods with the dependencies to make the import happen when the method is executed instead. Change-Id: I770112fd3c07c395459e204976942bda3dc7236f Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com> Reviewed-on: https://gem5-review.googlesource.com/c/15993 Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com> Reviewed-by: Juha Jäykkä <juha.jaykka@arm.com>
This commit is contained in:
@@ -73,12 +73,15 @@ from . import ticks
|
||||
from .util import *
|
||||
|
||||
def isSimObject(*args, **kwargs):
|
||||
from . import SimObject
|
||||
return SimObject.isSimObject(*args, **kwargs)
|
||||
|
||||
def isSimObjectSequence(*args, **kwargs):
|
||||
from . import SimObject
|
||||
return SimObject.isSimObjectSequence(*args, **kwargs)
|
||||
|
||||
def isSimObjectClass(*args, **kwargs):
|
||||
from . import SimObject
|
||||
return SimObject.isSimObjectClass(*args, **kwargs)
|
||||
|
||||
allParams = {}
|
||||
@@ -175,6 +178,7 @@ class ParamDesc(object):
|
||||
|
||||
def __getattr__(self, attr):
|
||||
if attr == 'ptype':
|
||||
from . import SimObject
|
||||
ptype = SimObject.allClasses[self.ptype_str]
|
||||
assert isSimObjectClass(ptype)
|
||||
self.ptype = ptype
|
||||
@@ -2158,5 +2162,3 @@ __all__ = ['Param', 'VectorParam',
|
||||
'NextEthernetAddr', 'NULL',
|
||||
'MasterPort', 'SlavePort',
|
||||
'VectorMasterPort', 'VectorSlavePort']
|
||||
|
||||
from . import SimObject
|
||||
|
||||
Reference in New Issue
Block a user