icache = Param.BaseMem(NULL, "L1 instruction cache object")
dcache = Param.BaseMem(NULL, "L1 data cache object")
- dtb = Param.AlphaDTB("Data TLB")
- itb = Param.AlphaITB("Instruction TLB")
- mem = Param.FunctionalMemory("memory")
- system = Param.BaseSystem(Super, "system object")
- workload = VectorParam.Process("processes to run")
+ if Bool._convert(env.get('FULL_SYSTEM', 'False')):
+ dtb = Param.AlphaDTB("Data TLB")
+ itb = Param.AlphaITB("Instruction TLB")
+ mem = Param.FunctionalMemory("memory")
+ system = Param.BaseSystem(Super, "system object")
+ else:
+ workload = VectorParam.Process("processes to run")
max_insts_all_threads = Param.Counter(0,
"terminate when all threads have reached this inst count")
defer_registration = Param.Bool(False,
"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
cls._params = {}
cls._values = {}
cls._enums = {}
- cls._disable = {}
cls._bases = [c for c in cls.__mro__ if isConfigNode(c)]
cls._anon_subclass_counter = 0
def _setvalue(cls, 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):
if cls._isvalue(attr):
return Value(cls, attr)
cls.check()
for key,value in cls._getvalues().iteritems():
- if cls._getdisable(key):
- continue
-
if isConfigNode(value):
cls.add_child(instance, key, value)
if issequence(value):
for pname,param in cls._getparams().iteritems():
try:
- if cls._getdisable(pname):
- continue
-
- try:
- value = cls._getvalue(pname)
- except:
- print 'Error getting %s' % pname
- raise
+ value = cls._getvalue(pname)
+ except:
+ panic('Error getting %s' % pname)
+ try:
if isConfigNode(value):
value = instance.child_objects[value]
elif issequence(value):
return self.obj._getvalue(self.attr)
def __setattr__(self, attr, value):
- if attr == 'disable':
- self.obj._setdisable(self.attr, value)
- else:
- setattr(self._getattr(), attr, value)
+ setattr(self._getattr(), attr, value)
def __getattr__(self, attr):
- if attr == 'disable':
- return self.obj._getdisable(self.attr)
- else:
- return getattr(self._getattr(), attr)
+ return getattr(self._getattr(), attr)
def __getitem__(self, index):
return self._getattr().__getitem__(index)