174a175
> cls._hr_values = multidict() # human readable param values
199a201
> cls._hr_values.parent = base._hr_values
275a278
> hr_value = value
286a290,294
> # update human-readable values of the param if it has a literal
> # value and is not an object or proxy.
> if not (isSimObjectOrVector(value) or\
> isinstance(value, m5.proxy.BaseProxy)):
> cls._hr_values[name] = hr_value
587a596,617
> # This class holds information about each simobject parameter
> # that should be displayed on the command line for use in the
> # configuration system.
> class ParamInfo(object):
> def __init__(self, type, desc, type_str, example, default_val, access_str):
> self.type = type
> self.desc = desc
> self.type_str = type_str
> self.example_str = example
> self.default_val = default_val
> # The string representation used to access this param through python.
> # The method to access this parameter presented on the command line may
> # be different, so this needs to be stored for later use.
> self.access_str = access_str
> self.created = True
>
> # Make it so we can only set attributes at initialization time
> # and effectively make this a const object.
> def __setattr__(self, name, value):
> if not "created" in self.__dict__:
> self.__dict__[name] = value
>
623a654,711
> # Returns a dict of all the option strings that can be
> # generated as command line options for this simobject instance
> # by tracing all reachable params in the top level instance and
> # any children it contains.
> def enumerateParams(self, flags_dict = {},
> cmd_line_str = "", access_str = ""):
> if hasattr(self, "_paramEnumed"):
> print "Cycle detected enumerating params"
> else:
> self._paramEnumed = True
> # Scan the children first to pick up all the objects in this SimObj
> for keys in self._children:
> child = self._children[keys]
> next_cmdline_str = cmd_line_str + keys
> next_access_str = access_str + keys
> if not isSimObjectVector(child):
> next_cmdline_str = next_cmdline_str + "."
> next_access_str = next_access_str + "."
> flags_dict = child.enumerateParams(flags_dict,
> next_cmdline_str,
> next_access_str)
>
> # Go through the simple params in the simobject in this level
> # of the simobject hierarchy and save information about the
> # parameter to be used for generating and processing command line
> # options to the simulator to set these parameters.
> for keys,values in self._params.items():
> if values.isCmdLineSettable():
> type_str = ''
> ex_str = values.example_str()
> ptype = None
> if isinstance(values, VectorParamDesc):
> type_str = 'Vector_%s' % values.ptype_str
> ptype = values
> else:
> type_str = '%s' % values.ptype_str
> ptype = values.ptype
>
> if keys in self._hr_values\
> and keys in self._values\
> and not isinstance(self._values[keys], m5.proxy.BaseProxy):
> cmd_str = cmd_line_str + keys
> acc_str = access_str + keys
> flags_dict[cmd_str] = ParamInfo(ptype,
> self._params[keys].desc, type_str, ex_str,
> values.pretty_print(self._hr_values[keys]),
> acc_str)
> elif not keys in self._hr_values\
> and not keys in self._values:
> # Empty param
> cmd_str = cmd_line_str + keys
> acc_str = access_str + keys
> flags_dict[cmd_str] = ParamInfo(ptype,
> self._params[keys].desc,
> type_str, ex_str, '', acc_str)
>
> return flags_dict
>
663a752
> self._hr_values = multidict(ancestor._hr_values)
753a843
> hr_value = value
763a854,860
> # set the human-readable value dict if this is a param
> # with a literal value and is not being set as an object
> # or proxy.
> if not (isSimObjectOrVector(value) or\
> isinstance(value, m5.proxy.BaseProxy)):
> self._hr_values[attr] = hr_value
>
781c878
< raise TypeError, "Non-zero index '%s' to SimObject" % key
---
> raise IndexError, "Non-zero index '%s' to SimObject" % key
782a880,885
> # this hack allows us to iterate over a SimObject that may
> # not be a vector, so we can call a loop over it and get just one
> # element.
> def __len__(self):
> return 1
>
1057,1058c1160,1162
< params = self.getCCParams()
< self._ccObject = params.create()
---
> if not self.abstract:
> params = self.getCCParams()
> self._ccObject = params.create()