95a96
> cmd_line_settable = False
97d97
<
121a122,125
> # Produce a human readable version of the stored value
> def pretty_print(self, value):
> return str(value)
>
164a169,181
> def example_str(self):
> if hasattr(self.ptype, "ex_str"):
> return self.ptype.ex_str
> else:
> return self.ptype_str
>
> # Is the param available to be exposed on the command line
> def isCmdLineSettable(self):
> if hasattr(self.ptype, "cmd_line_settable"):
> return self.ptype.cmd_line_settable
> else:
> return False
>
178a196,202
> def pretty_print(self, value):
> if isinstance(value, proxy.BaseProxy):
> return str(value)
> if isNullPointer(value):
> return NULL
> return self.ptype(value).pretty_print(value)
>
262a287,306
> # Enumerate the params of each member of the SimObject vector. Creates
> # strings that will allow indexing into the vector by the python code and
> # allow it to be specified on the command line.
> def enumerateParams(self, flags_dict = {},
> cmd_line_str = "",
> access_str = ""):
> if hasattr(self, "_paramEnumed"):
> print "Cycle detected enumerating params at %s?!" % (cmd_line_str)
> else:
> x = 0
> for vals in self:
> # Each entry in the SimObjectVector should be an
> # instance of a SimObject
> flags_dict = vals.enumerateParams(flags_dict,
> cmd_line_str + "%d." % x,
> access_str + "[%d]." % x)
> x = x + 1
>
> return flags_dict
>
278a323,355
> # Produce a human readable example string that describes
> # how to set this vector parameter in the absence of a default
> # value.
> def example_str(self):
> s = super(VectorParamDesc, self).example_str()
> help_str = "[" + s + "," + s + ", ...]"
> return help_str
>
> # Produce a human readable representation of the value of this vector param.
> def pretty_print(self, value):
> if isinstance(value, (list, tuple)):
> tmp_list = [ ParamDesc.pretty_print(self, v) for v in value ]
> elif isinstance(value, str):
> tmp_list = [ ParamDesc.pretty_print(self, v) for v in value.split(',') ]
> else:
> tmp_list = [ ParamDesc.pretty_print(self, value) ]
>
> return tmp_list
>
> # This is a helper function for the new config system
> def __call__(self, value):
> if isinstance(value, (list, tuple)):
> # list: coerce each element into new list
> tmp_list = [ ParamDesc.convert(self, v) for v in value ]
> elif isinstance(value, str):
> # If input is a csv string
> tmp_list = [ ParamDesc.convert(self, v) for v in value.split(',') ]
> else:
> # singleton: coerce to a single-element list
> tmp_list = [ ParamDesc.convert(self, value) ]
>
> return VectorParamValue(tmp_list)
>
351a429
> cmd_line_settable = True
360a439,442
> def __call__(self, value):
> self = value
> return value
>
432a515
> cmd_line_settable = True
448a532,535
> def __call__(self, value):
> self.__init__(value)
> return value
>
492a580
> cmdLineSettable = True
495c583
< if isinstance(value, (int, long, float, NumericParamValue, Float)):
---
> if isinstance(value, (int, long, float, NumericParamValue, Float, str)):
500a589,592
> def __call__(self, value):
> self.__init__(value)
> return value
>
505a598
> ex_str = '512MB'
516a610
> ex_str = '512MB'
543a638,643
> def pretty_print(self, value):
> try:
> val = convert.toMemorySize(value)
> except TypeError:
> val = long(value)
> return "0x%x" % long(val)
626a727,728
> cmd_line_settable = True
>
632a735,738
> def __call__(self, value):
> self.__init__(value)
> return value
>
670a777,778
> ex_str = "00:90:00:00:00:01"
> cmd_line_settable = True
697a806,809
> def __call__(self, value):
> self.__init__(value)
> return value
>
713a826,827
> ex_str = "127.0.0.1"
> cmd_line_settable = True
732a847,850
> def __call__(self, value):
> self.__init__(value)
> return value
>
763a882,883
> ex_str = "127.0.0.0/24"
> cmd_line_settable = True
808a929,932
> def __call__(self, value):
> self.__init__(value)
> return value
>
835a960,961
> ex_str = "127.0.0.1:80"
> cmd_line_settable = True
880a1007,1010
> def __call__(self, value):
> self.__init__(value)
> return value
>
955a1086,1089
> def __call__(self, value):
> self.__init__(value)
> return value
>
1113a1248
> cmd_line_settable = True
1129a1265,1268
> def __call__(self, value):
> self.__init__(value)
> return value
>
1148a1288,1289
> ex_str = "1MHz"
> cmd_line_settable = True
1158a1300,1303
> def __call__(self, value):
> self.__init__(value)
> return value
>
1162a1308,1309
> ex_str = "100ns"
>
1176a1324,1327
> def __call__(self, value):
> self.__init__(value)
> return value
>
1195a1347,1348
> ex_str = "1GHz"
>
1209a1363,1366
> def __call__(self, value):
> self.__init__(value)
> return value
>
1244a1402,1408
> def __call__(self, value):
> self.__init__(value)
> return value
>
> def __str__(self):
> return "%s" % Latency(self)
>
1259a1424,1426
> ex_str = "1V"
> cmd_line_settable = False
>
1264a1432,1436
> def __call__(self, value):
> val = convert.toVoltage(value)
> self.__init__(val)
> return value
>
1266c1438
< return str(self.val)
---
> return str(self.getValue())
1276a1449,1451
> ex_str = "1Gbps"
> cmd_line_settable = True
>
1284a1460,1464
> def __call__(self, value):
> val = convert.toNetworkBandwidth(value)
> self.__init__(val)
> return value
>
1296a1477,1479
> ex_str = "1GB/s"
> cmd_line_settable = True
>
1302,1303c1485,1488
< def __str__(self):
< return str(self.val)
---
> def __call__(self, value):
> val = convert.toMemoryBandwidth(value)
> self.__init__(val)
> return value