+ cxx_header = "sim/sim_object.hh"
+ cxx_bases = [ "Drainable", "Serializable" ]
+ eventq_index = Param.UInt32(Parent.eventq_index, "Event Queue Index")
+
+ cxx_exports = [
+ PyBindMethod("init"),
+ PyBindMethod("initState"),
+ PyBindMethod("memInvalidate"),
+ PyBindMethod("memWriteback"),
+ PyBindMethod("regStats"),
+ PyBindMethod("resetStats"),
+ PyBindMethod("regProbePoints"),
+ PyBindMethod("regProbeListeners"),
+ PyBindMethod("startup"),
+ ]
+
+ cxx_param_exports = [
+ PyBindProperty("name"),
+ ]
+
+ @cxxMethod
+ def loadState(self, cp):
+ """Load SimObject state from a checkpoint"""
+ pass
+
+ # 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