Add support for using the variables that m5 was compiled with for
determining which parameters belong to a class. This allows us to remove the disable flag since it is not the correct model for variable checking anyway. objects/BaseCPU.mpy: Use the FULL_SYSTEM environment variable to enable or disable parameters. sim/pyconfig/m5config.py: remove the disable flag since it is not the correct model for variable checking. --HG-- extra : convert_revision : a8ccb78ba16d23006225df282a09187d32557608
This commit is contained in:
parent
4a3ad218e1
commit
7d91bda6bf
2 changed files with 13 additions and 50 deletions
|
@ -4,11 +4,13 @@ simobj BaseCPU(SimObject):
|
||||||
icache = Param.BaseMem(NULL, "L1 instruction cache object")
|
icache = Param.BaseMem(NULL, "L1 instruction cache object")
|
||||||
dcache = Param.BaseMem(NULL, "L1 data cache object")
|
dcache = Param.BaseMem(NULL, "L1 data cache object")
|
||||||
|
|
||||||
dtb = Param.AlphaDTB("Data TLB")
|
if Bool._convert(env.get('FULL_SYSTEM', 'False')):
|
||||||
itb = Param.AlphaITB("Instruction TLB")
|
dtb = Param.AlphaDTB("Data TLB")
|
||||||
mem = Param.FunctionalMemory("memory")
|
itb = Param.AlphaITB("Instruction TLB")
|
||||||
system = Param.BaseSystem(Super, "system object")
|
mem = Param.FunctionalMemory("memory")
|
||||||
workload = VectorParam.Process("processes to run")
|
system = Param.BaseSystem(Super, "system object")
|
||||||
|
else:
|
||||||
|
workload = VectorParam.Process("processes to run")
|
||||||
|
|
||||||
max_insts_all_threads = Param.Counter(0,
|
max_insts_all_threads = Param.Counter(0,
|
||||||
"terminate when all threads have reached this inst count")
|
"terminate when all threads have reached this inst count")
|
||||||
|
@ -21,19 +23,3 @@ simobj BaseCPU(SimObject):
|
||||||
|
|
||||||
defer_registration = Param.Bool(False,
|
defer_registration = Param.Bool(False,
|
||||||
"defer registration with system (for sampling)")
|
"defer registration with system (for sampling)")
|
||||||
|
|
||||||
def check(self):
|
|
||||||
has_workload = self._hasvalue('workload')
|
|
||||||
has_dtb = self._hasvalue('dtb')
|
|
||||||
has_itb = self._hasvalue('itb')
|
|
||||||
has_mem = self._hasvalue('mem')
|
|
||||||
has_system = self._hasvalue('system')
|
|
||||||
|
|
||||||
if has_workload:
|
|
||||||
self.dtb.disable = True
|
|
||||||
self.itb.disable = True
|
|
||||||
self.mem.disable = True
|
|
||||||
self.system.disable = True
|
|
||||||
|
|
||||||
if has_dtb or has_itb or has_mem or has_system:
|
|
||||||
self.workload.disable = True
|
|
||||||
|
|
|
@ -246,7 +246,6 @@ class MetaConfigNode(type):
|
||||||
cls._params = {}
|
cls._params = {}
|
||||||
cls._values = {}
|
cls._values = {}
|
||||||
cls._enums = {}
|
cls._enums = {}
|
||||||
cls._disable = {}
|
|
||||||
cls._bases = [c for c in cls.__mro__ if isConfigNode(c)]
|
cls._bases = [c for c in cls.__mro__ if isConfigNode(c)]
|
||||||
cls._anon_subclass_counter = 0
|
cls._anon_subclass_counter = 0
|
||||||
|
|
||||||
|
@ -382,15 +381,6 @@ class MetaConfigNode(type):
|
||||||
def _setvalue(cls, name, value):
|
def _setvalue(cls, name, value):
|
||||||
cls._values[name] = value
|
cls._values[name] = value
|
||||||
|
|
||||||
def _getdisable(cls, name):
|
|
||||||
for c in cls._bases:
|
|
||||||
if c._disable.has_key(name):
|
|
||||||
return c._disable[name]
|
|
||||||
return False
|
|
||||||
|
|
||||||
def _setdisable(cls, name, value):
|
|
||||||
cls._disable[name] = value
|
|
||||||
|
|
||||||
def __getattr__(cls, attr):
|
def __getattr__(cls, attr):
|
||||||
if cls._isvalue(attr):
|
if cls._isvalue(attr):
|
||||||
return Value(cls, attr)
|
return Value(cls, attr)
|
||||||
|
@ -465,9 +455,6 @@ class MetaConfigNode(type):
|
||||||
cls.check()
|
cls.check()
|
||||||
|
|
||||||
for key,value in cls._getvalues().iteritems():
|
for key,value in cls._getvalues().iteritems():
|
||||||
if cls._getdisable(key):
|
|
||||||
continue
|
|
||||||
|
|
||||||
if isConfigNode(value):
|
if isConfigNode(value):
|
||||||
cls.add_child(instance, key, value)
|
cls.add_child(instance, key, value)
|
||||||
if issequence(value):
|
if issequence(value):
|
||||||
|
@ -477,15 +464,11 @@ class MetaConfigNode(type):
|
||||||
|
|
||||||
for pname,param in cls._getparams().iteritems():
|
for pname,param in cls._getparams().iteritems():
|
||||||
try:
|
try:
|
||||||
if cls._getdisable(pname):
|
value = cls._getvalue(pname)
|
||||||
continue
|
except:
|
||||||
|
panic('Error getting %s' % pname)
|
||||||
try:
|
|
||||||
value = cls._getvalue(pname)
|
|
||||||
except:
|
|
||||||
print 'Error getting %s' % pname
|
|
||||||
raise
|
|
||||||
|
|
||||||
|
try:
|
||||||
if isConfigNode(value):
|
if isConfigNode(value):
|
||||||
value = instance.child_objects[value]
|
value = instance.child_objects[value]
|
||||||
elif issequence(value):
|
elif issequence(value):
|
||||||
|
@ -814,16 +797,10 @@ class Value(object):
|
||||||
return self.obj._getvalue(self.attr)
|
return self.obj._getvalue(self.attr)
|
||||||
|
|
||||||
def __setattr__(self, attr, value):
|
def __setattr__(self, attr, value):
|
||||||
if attr == 'disable':
|
setattr(self._getattr(), attr, value)
|
||||||
self.obj._setdisable(self.attr, value)
|
|
||||||
else:
|
|
||||||
setattr(self._getattr(), attr, value)
|
|
||||||
|
|
||||||
def __getattr__(self, attr):
|
def __getattr__(self, attr):
|
||||||
if attr == 'disable':
|
return getattr(self._getattr(), attr)
|
||||||
return self.obj._getdisable(self.attr)
|
|
||||||
else:
|
|
||||||
return getattr(self._getattr(), attr)
|
|
||||||
|
|
||||||
def __getitem__(self, index):
|
def __getitem__(self, index):
|
||||||
return self._getattr().__getitem__(index)
|
return self._getattr().__getitem__(index)
|
||||||
|
|
Loading…
Reference in a new issue