jobfile.py (5618:1abb23c038d5) | jobfile.py (6654:4c84e771cca7) |
---|---|
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 | 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 |
31from attrdict import optiondict 32from misc import crossproduct 33 | |
34class Data(object): 35 def __init__(self, name, desc, **kwargs): 36 self.name = name 37 self.desc = desc 38 self.__dict__.update(kwargs) 39 40 def update(self, obj): 41 if not isinstance(obj, Data): --- 61 unchanged lines hidden (view full) --- 103 def __iter__(self): 104 keys = self.__dict__.keys() 105 keys.sort() 106 for key in keys: 107 if not key.startswith('_'): 108 yield key 109 110 def optiondict(self): | 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): |
111 result = optiondict() | 108 import m5.util 109 result = m5.util.optiondict() |
112 for key in self: 113 result[key] = self[key] 114 return result 115 116 def __repr__(self): 117 d = {} 118 for key,value in self.__dict__.iteritems(): 119 if not key.startswith('_'): --- 203 unchanged lines hidden (view full) --- 323 groups = self.sortgroups(groups) 324 if checkpoint: 325 groups = [ grp for grp in groups if grp._checkpoint ] 326 optgroups = [ g.options() for g in groups ] 327 else: 328 optgroups = [ g.subopts() for g in groups ] 329 if not optgroups: 330 return | 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 |
331 for options in crossproduct(optgroups): | 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 --- | 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 --- |