Deleted Added
sdiff udiff text old ( 8999:6f306dd5cee0 ) new ( 9017:a20f46ccb9ce )
full compact
1# Copyright (c) 2012 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

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

926 # instantiated system for use by scripts that want to do power, thermal
927 # visualization, and other similar tasks
928 def get_config_as_dict(self):
929 d = attrdict()
930 if hasattr(self, 'type'):
931 d.type = self.type
932 if hasattr(self, 'cxx_class'):
933 d.cxx_class = self.cxx_class
934
935 for param in sorted(self._params.keys()):
936 value = self._values.get(param)
937 if value != None:
938 try:
939 # Use native type for those supported by JSON and
940 # strings for everything else. skipkeys=True seems
941 # to not work as well as one would hope
942 if type(self._values[param].value) in \
943 [str, unicode, int, long, float, bool, None]:
944 d[param] = self._values[param].value
945 else:
946 d[param] = str(self._values[param])
947
948 except AttributeError:
949 pass
950
951 for n in sorted(self._children.keys()):
952 d[self._children[n].get_name()] = self._children[n].get_config_as_dict()
953
954 for port_name in sorted(self._ports.keys()):
955 port = self._port_refs.get(port_name, None)
956 if port != None:
957 # Might want to actually make this reference the object
958 # in the future, although execing the string problem would
959 # get some of the way there
960 d[port_name] = port.ini_str()
961
962 return d
963
964 def getCCParams(self):
965 if self._ccParams:
966 return self._ccParams
967
968 cc_params_struct = getattr(m5.internal.params, '%sParams' % self.type)

--- 149 unchanged lines hidden ---