From 4c0014a1871292ba2a78e131dcff3c96a4b70225 Mon Sep 17 00:00:00 2001 From: Steve Reinhardt Date: Sat, 2 Dec 2006 22:23:46 -0800 Subject: Fix help strings on GenRepl params. --HG-- extra : convert_revision : 520814e193b9e86b6410f3ab98d62ed131d295aa --- src/python/m5/objects/Repl.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/python') diff --git a/src/python/m5/objects/Repl.py b/src/python/m5/objects/Repl.py index 10892cf6f..b76aa1d6e 100644 --- a/src/python/m5/objects/Repl.py +++ b/src/python/m5/objects/Repl.py @@ -6,6 +6,6 @@ class Repl(SimObject): class GenRepl(Repl): type = 'GenRepl' - fresh_res = Param.Int("associativity") - num_pools = Param.Int("capacity in bytes") - pool_res = Param.Int("block size in bytes") + fresh_res = Param.Int("Fresh pool residency time") + num_pools = Param.Int("Number of priority pools") + pool_res = Param.Int("Pool residency time") -- cgit v1.2.3 From e6d7e8af2169ae77fe211c0e5141ebbc818acda5 Mon Sep 17 00:00:00 2001 From: Steve Reinhardt Date: Sat, 2 Dec 2006 22:24:52 -0800 Subject: Support better param conversions to/from numeric subclasses. --HG-- extra : convert_revision : 2ccb75b0912a384789458710fd9bbb65626f839e --- src/python/m5/params.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/python') diff --git a/src/python/m5/params.py b/src/python/m5/params.py index 9e5f985c3..d83d5f73f 100644 --- a/src/python/m5/params.py +++ b/src/python/m5/params.py @@ -237,6 +237,12 @@ class NumericParamValue(ParamValue): def __float__(self): return float(self.value) + def __long__(self): + return long(self.value) + + def __int__(self): + return int(self.value) + # hook for bounds checking def _check(self): return @@ -308,8 +314,11 @@ class CheckedInt(NumericParamValue): def __init__(self, value): if isinstance(value, str): self.value = convert.toInteger(value) - elif isinstance(value, (int, long, float)): + elif isinstance(value, (int, long, float, NumericParamValue)): self.value = long(value) + else: + raise TypeError, "Can't convert object of type %s to CheckedInt" \ + % type(value).__name__ self._check() class Int(CheckedInt): cxx_type = 'int'; size = 32; unsigned = False -- cgit v1.2.3