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.
This commit is contained in:
@@ -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'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user