Deleted Added
sdiff udiff text old ( 8656:44203702a57a ) new ( 8664:42052d5bb793 )
full compact
1# Copyright (c) 2004-2006 The Regents of The University of Michigan
2# Copyright (c) 2010-2011 Advanced Micro Devices, Inc.
3# All rights reserved.
4#
5# Redistribution and use in source and binary forms, with or without
6# modification, are permitted provided that the following conditions are
7# met: redistributions of source code must retain the above copyright
8# notice, this list of conditions and the following disclaimer;

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

223 # we can nicely handle iterating over all a SimObject's children
224 # without having to provide lots of special functions on
225 # SimObjectVector directly.
226 def descendants(self):
227 for v in self:
228 for obj in v.descendants():
229 yield obj
230
231class VectorParamDesc(ParamDesc):
232 # Convert assigned value to appropriate type. If the RHS is not a
233 # list or tuple, it generates a single-element list.
234 def convert(self, value):
235 if isinstance(value, (list, tuple)):
236 # list: coerce each element into new list
237 tmp_list = [ ParamDesc.convert(self, v) for v in value ]
238 else:

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

959 return c_time
960
961 def __str__(self):
962 return time.asctime(self.value)
963
964 def ini_str(self):
965 return str(self)
966
967# Enumerated types are a little more complex. The user specifies the
968# type as Enum(foo) where foo is either a list or dictionary of
969# alternatives (typically strings, but not necessarily so). (In the
970# long run, the integer value of the parameter will be the list index
971# or the corresponding dictionary value. For now, since we only check
972# that the alternative is valid and then spit it into a .ini file,
973# there's not much point in using the dictionary.)
974

--- 574 unchanged lines hidden ---