params.py (13714:35636064b7a1) params.py (13716:950f9a2ffb78)
1# Copyright (c) 2012-2014, 2017, 2018 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

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

68import time
69import math
70
71from . import proxy
72from . import ticks
73from .util import *
74
75def isSimObject(*args, **kwargs):
1# Copyright (c) 2012-2014, 2017, 2018 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

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

68import time
69import math
70
71from . import proxy
72from . import ticks
73from .util import *
74
75def isSimObject(*args, **kwargs):
76 from . import SimObject
76 return SimObject.isSimObject(*args, **kwargs)
77
78def isSimObjectSequence(*args, **kwargs):
77 return SimObject.isSimObject(*args, **kwargs)
78
79def isSimObjectSequence(*args, **kwargs):
80 from . import SimObject
79 return SimObject.isSimObjectSequence(*args, **kwargs)
80
81def isSimObjectClass(*args, **kwargs):
81 return SimObject.isSimObjectSequence(*args, **kwargs)
82
83def isSimObjectClass(*args, **kwargs):
84 from . import SimObject
82 return SimObject.isSimObjectClass(*args, **kwargs)
83
84allParams = {}
85
86class MetaParamValue(type):
87 def __new__(mcls, name, bases, dct):
88 cls = super(MetaParamValue, mcls).__new__(mcls, name, bases, dct)
89 assert name not in allParams

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

170 if kwargs:
171 raise TypeError('extra unknown kwargs %s' % kwargs)
172
173 if not hasattr(self, 'desc'):
174 raise TypeError('desc attribute missing')
175
176 def __getattr__(self, attr):
177 if attr == 'ptype':
85 return SimObject.isSimObjectClass(*args, **kwargs)
86
87allParams = {}
88
89class MetaParamValue(type):
90 def __new__(mcls, name, bases, dct):
91 cls = super(MetaParamValue, mcls).__new__(mcls, name, bases, dct)
92 assert name not in allParams

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

173 if kwargs:
174 raise TypeError('extra unknown kwargs %s' % kwargs)
175
176 if not hasattr(self, 'desc'):
177 raise TypeError('desc attribute missing')
178
179 def __getattr__(self, attr):
180 if attr == 'ptype':
181 from . import SimObject
178 ptype = SimObject.allClasses[self.ptype_str]
179 assert isSimObjectClass(ptype)
180 self.ptype = ptype
181 return ptype
182
183 raise AttributeError("'%s' object has no attribute '%s'" % \
184 (type(self).__name__, attr))
185

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

2153 'Latency', 'Frequency', 'Clock', 'Voltage', 'Current', 'Energy',
2154 'NetworkBandwidth', 'MemoryBandwidth',
2155 'AddrRange',
2156 'MaxAddr', 'MaxTick', 'AllMemory',
2157 'Time',
2158 'NextEthernetAddr', 'NULL',
2159 'MasterPort', 'SlavePort',
2160 'VectorMasterPort', 'VectorSlavePort']
182 ptype = SimObject.allClasses[self.ptype_str]
183 assert isSimObjectClass(ptype)
184 self.ptype = ptype
185 return ptype
186
187 raise AttributeError("'%s' object has no attribute '%s'" % \
188 (type(self).__name__, attr))
189

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

2157 'Latency', 'Frequency', 'Clock', 'Voltage', 'Current', 'Energy',
2158 'NetworkBandwidth', 'MemoryBandwidth',
2159 'AddrRange',
2160 'MaxAddr', 'MaxTick', 'AllMemory',
2161 'Time',
2162 'NextEthernetAddr', 'NULL',
2163 'MasterPort', 'SlavePort',
2164 'VectorMasterPort', 'VectorSlavePort']
2161
2162from . import SimObject