1# Copyright (c) 2004-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 --- 13 unchanged lines hidden (view full) --- 22# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 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: Steve Reinhardt 28# Nathan Binkert 29 |
30import math 31import sys 32import types |
33 34import proxy 35import m5 36from util import * 37 38# These utility functions have to come first because they're 39# referenced in params.py... otherwise they won't be defined when we 40# import params below, and the recursive import of this file from --- 583 unchanged lines hidden (view full) --- 624 625 if isSimObject(value): 626 value._maybe_set_parent(self, attr) 627 elif isSimObjectSequence(value): 628 value = SimObjVector(value) 629 if len(value) == 1: 630 value[0]._maybe_set_parent(self, attr) 631 else: |
632 width = int(math.ceil(math.log(len(value))/math.log(10))) |
633 for i,v in enumerate(value): |
634 v._maybe_set_parent(self, "%s%0*d" % (attr, width, i)) |
635 636 self._values[attr] = value 637 638 def path(self): 639 if not self._parent: 640 return 'root' 641 ppath = self._parent.path() 642 if ppath == 'root': --- 248 unchanged lines hidden --- |