params.py (9794:0236a478a92d) params.py (9827:f47274776aa0)
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

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

1245 raise AttributeError, "Frequency object has no attribute '%s'" % attr
1246
1247 def getValue(self):
1248 return self.period.getValue()
1249
1250 def ini_str(self):
1251 return self.period.ini_str()
1252
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

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

1245 raise AttributeError, "Frequency object has no attribute '%s'" % attr
1246
1247 def getValue(self):
1248 return self.period.getValue()
1249
1250 def ini_str(self):
1251 return self.period.ini_str()
1252
1253class Voltage(float,ParamValue):
1254 cxx_type = 'double'
1255 def __new__(cls, value):
1256 # convert to voltage
1257 val = convert.toVoltage(value)
1258 return super(cls, Voltage).__new__(cls, val)
1259
1260 def __str__(self):
1261 return str(self.val)
1262
1263 def getValue(self):
1264 value = float(self)
1265 return value
1266
1267 def ini_str(self):
1268 return '%f' % self.getValue()
1269
1253class NetworkBandwidth(float,ParamValue):
1254 cxx_type = 'float'
1255 def __new__(cls, value):
1256 # convert to bits per second
1257 val = convert.toNetworkBandwidth(value)
1258 return super(cls, NetworkBandwidth).__new__(cls, val)
1259
1260 def __str__(self):

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

1632__all__ = ['Param', 'VectorParam',
1633 'Enum', 'Bool', 'String', 'Float',
1634 'Int', 'Unsigned', 'Int8', 'UInt8', 'Int16', 'UInt16',
1635 'Int32', 'UInt32', 'Int64', 'UInt64',
1636 'Counter', 'Addr', 'Tick', 'Percent',
1637 'TcpPort', 'UdpPort', 'EthernetAddr',
1638 'IpAddress', 'IpNetmask', 'IpWithPort',
1639 'MemorySize', 'MemorySize32',
1270class NetworkBandwidth(float,ParamValue):
1271 cxx_type = 'float'
1272 def __new__(cls, value):
1273 # convert to bits per second
1274 val = convert.toNetworkBandwidth(value)
1275 return super(cls, NetworkBandwidth).__new__(cls, val)
1276
1277 def __str__(self):

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

1649__all__ = ['Param', 'VectorParam',
1650 'Enum', 'Bool', 'String', 'Float',
1651 'Int', 'Unsigned', 'Int8', 'UInt8', 'Int16', 'UInt16',
1652 'Int32', 'UInt32', 'Int64', 'UInt64',
1653 'Counter', 'Addr', 'Tick', 'Percent',
1654 'TcpPort', 'UdpPort', 'EthernetAddr',
1655 'IpAddress', 'IpNetmask', 'IpWithPort',
1656 'MemorySize', 'MemorySize32',
1640 'Latency', 'Frequency', 'Clock',
1657 'Latency', 'Frequency', 'Clock', 'Voltage',
1641 'NetworkBandwidth', 'MemoryBandwidth',
1642 'AddrRange',
1643 'MaxAddr', 'MaxTick', 'AllMemory',
1644 'Time',
1645 'NextEthernetAddr', 'NULL',
1646 'MasterPort', 'SlavePort',
1647 'VectorMasterPort', 'VectorSlavePort']
1648
1649import SimObject
1658 'NetworkBandwidth', 'MemoryBandwidth',
1659 'AddrRange',
1660 'MaxAddr', 'MaxTick', 'AllMemory',
1661 'Time',
1662 'NextEthernetAddr', 'NULL',
1663 'MasterPort', 'SlavePort',
1664 'VectorMasterPort', 'VectorSlavePort']
1665
1666import SimObject