diff options
Diffstat (limited to 'src/python')
-rw-r--r-- | src/python/m5/params.py | 12 |
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' |