params.py (9953:9caba3b84a9b) params.py (10019:a14f92150d3f)
1# Copyright (c) 2012-2013 ARM Limited
2# All rights reserved.
3#
4# The license below extends only to copyright in the software and shall
5# not be construed as granting a license to any other intellectual
6# property including but not limited to intellectual property relating
7# to a hardware implementation of the functionality of the software
8# licensed hereunder. You may use the software subject to the license

--- 1206 unchanged lines hidden (view full) ---

1215 value = self.value
1216 else:
1217 value = ticks.fromSeconds(1.0 / self.value)
1218 return long(value)
1219
1220 def ini_str(self):
1221 return '%d' % self.getValue()
1222
1# Copyright (c) 2012-2013 ARM Limited
2# All rights reserved.
3#
4# The license below extends only to copyright in the software and shall
5# not be construed as granting a license to any other intellectual
6# property including but not limited to intellectual property relating
7# to a hardware implementation of the functionality of the software
8# licensed hereunder. You may use the software subject to the license

--- 1206 unchanged lines hidden (view full) ---

1215 value = self.value
1216 else:
1217 value = ticks.fromSeconds(1.0 / self.value)
1218 return long(value)
1219
1220 def ini_str(self):
1221 return '%d' % self.getValue()
1222
1223# A generic frequency and/or Latency value. Value is stored as a
1224# latency, and any manipulation using a multiplier thus scales the
1225# clock period, i.e. a 2x multiplier doubles the clock period and thus
1226# halves the clock frequency.
1227class Clock(ParamValue):
1228 cxx_type = 'Tick'
1229
1230 @classmethod
1231 def cxx_predecls(cls, code):
1232 code('#include "base/types.hh"')
1233
1234 @classmethod
1235 def swig_predecls(cls, code):
1236 code('%import "stdint.i"')
1237 code('%import "base/types.hh"')
1238
1223# A generic Frequency and/or Latency value. Value is stored as a
1224# latency, just like Latency and Frequency.
1225class Clock(TickParamValue):
1239 def __init__(self, value):
1240 if isinstance(value, (Latency, Clock)):
1241 self.ticks = value.ticks
1242 self.value = value.value
1243 elif isinstance(value, Frequency):
1244 self.ticks = value.ticks
1245 self.value = 1.0 / value.value
1246 elif value.endswith('t'):

--- 433 unchanged lines hidden ---
1226 def __init__(self, value):
1227 if isinstance(value, (Latency, Clock)):
1228 self.ticks = value.ticks
1229 self.value = value.value
1230 elif isinstance(value, Frequency):
1231 self.ticks = value.ticks
1232 self.value = 1.0 / value.value
1233 elif value.endswith('t'):

--- 433 unchanged lines hidden ---