1# Copyright (c) 2005-2006 The Regents of The University of Michigan 2# All rights reserved. 3# 4# Redistribution and use in source and binary forms, with or without 5# modification, are permitted provided that the following conditions are 6# met: redistributions of source code must retain the above copyright 7# notice, this list of conditions and the following disclaimer; 8# redistributions in binary form must reproduce the above copyright --- 14 unchanged lines hidden (view full) --- 23# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26# 27# Authors: Nathan Binkert 28 29import sys 30 |
31class Data(object): 32 def __init__(self, name, desc, **kwargs): 33 self.name = name 34 self.desc = desc 35 self.__dict__.update(kwargs) 36 37 def update(self, obj): 38 if not isinstance(obj, Data): --- 61 unchanged lines hidden (view full) --- 100 def __iter__(self): 101 keys = self.__dict__.keys() 102 keys.sort() 103 for key in keys: 104 if not key.startswith('_'): 105 yield key 106 107 def optiondict(self): |
108 import m5.util 109 result = m5.util.optiondict() |
110 for key in self: 111 result[key] = self[key] 112 return result 113 114 def __repr__(self): 115 d = {} 116 for key,value in self.__dict__.iteritems(): 117 if not key.startswith('_'): --- 203 unchanged lines hidden (view full) --- 321 groups = self.sortgroups(groups) 322 if checkpoint: 323 groups = [ grp for grp in groups if grp._checkpoint ] 324 optgroups = [ g.options() for g in groups ] 325 else: 326 optgroups = [ g.subopts() for g in groups ] 327 if not optgroups: 328 return |
329 330 import m5.util 331 for options in m5.util.crossproduct(optgroups): |
332 for opt in options: 333 cpt = opt._group._checkpoint 334 if not isinstance(cpt, bool) and cpt != opt: 335 if checkpoint: 336 break 337 else: 338 yield options 339 else: --- 133 unchanged lines hidden --- |