summaryrefslogtreecommitdiff
path: root/src/python
diff options
context:
space:
mode:
authorAndreas Hansson <andreas.hansson@arm.com>2012-09-07 12:34:38 -0400
committerAndreas Hansson <andreas.hansson@arm.com>2012-09-07 12:34:38 -0400
commit287ea1a081c5dd3213069755dbbd3d7bf736bacc (patch)
treee48487569786a562138445d746354b610cf5011f /src/python
parent4124ea09f8e2f6934fe746ff7c244dba7230cac9 (diff)
downloadgem5-287ea1a081c5dd3213069755dbbd3d7bf736bacc.tar.xz
Param: Transition to Cycles for relevant parameters
This patch is a first step to using Cycles as a parameter type. The main affected modules are the CPUs and the Ruby caches. There are definitely plenty more places that are affected, but this patch serves as a starting point to making the transition. An important part of this patch is to actually enable parameters to be specified as Param.Cycles which involves some changes to params.py.
Diffstat (limited to 'src/python')
-rw-r--r--src/python/m5/params.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/python/m5/params.py b/src/python/m5/params.py
index 5c40a9c64..c2da6171e 100644
--- a/src/python/m5/params.py
+++ b/src/python/m5/params.py
@@ -463,8 +463,6 @@ class CheckedInt(NumericParamValue):
# most derived types require this, so we just do it here once
code('%import "stdint.i"')
code('%import "base/types.hh"')
- # ignore the case operator for Cycles
- code('%ignore *::operator uint64_t() const;')
def getValue(self):
return long(self.value)
@@ -482,13 +480,21 @@ class Int64(CheckedInt): cxx_type = 'int64_t'; size = 64; unsigned = False
class UInt64(CheckedInt): cxx_type = 'uint64_t'; size = 64; unsigned = True
class Counter(CheckedInt): cxx_type = 'Counter'; size = 64; unsigned = True
-class Cycles(CheckedInt): cxx_type = 'Cycles'; size = 64; unsigned = True
class Tick(CheckedInt): cxx_type = 'Tick'; size = 64; unsigned = True
class TcpPort(CheckedInt): cxx_type = 'uint16_t'; size = 16; unsigned = True
class UdpPort(CheckedInt): cxx_type = 'uint16_t'; size = 16; unsigned = True
class Percent(CheckedInt): cxx_type = 'int'; min = 0; max = 100
+class Cycles(CheckedInt):
+ cxx_type = 'Cycles'
+ size = 64
+ unsigned = True
+
+ def getValue(self):
+ from m5.internal.core import Cycles
+ return Cycles(self.value)
+
class Float(ParamValue, float):
cxx_type = 'double'