Deleted Added
sdiff udiff text old ( 11991:d3f19484145f ) new ( 12023:272819f230c0 )
full compact
1# Copyright (c) 2017 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

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

472 # We don't support multiple inheritance of sim objects. If you want
473 # to, you must fix multidict to deal with it properly. Non sim-objects
474 # are ok, though
475 bTotal = 0
476 for c in bases:
477 if isinstance(c, MetaSimObject):
478 bTotal += 1
479 if bTotal > 1:
480 raise TypeError, "SimObjects do not support multiple inheritance"
481
482 base = bases[0]
483
484 # Set up general inheritance via multidicts. A subclass will
485 # inherit all its settings from the base class. The only time
486 # the following is not true is when we define the SimObject
487 # class itself (in which case the multidicts have no parent).
488 if isinstance(base, MetaSimObject):

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

674 # will also be inherited from the base class's param struct
675 # here). Sort the params based on their key
676 params = map(lambda (k, v): v, sorted(cls._params.local.items()))
677 ports = cls._ports.local
678
679 code('''#include "pybind11/pybind11.h"
680#include "pybind11/stl.h"
681
682#include "sim/sim_object.hh"
683#include "params/$cls.hh"
684#include "sim/init.hh"
685#include "${{cls.cxx_header}}"
686
687''')
688
689 for param in params:
690 param.pybind_predecls(code)
691
692 code('''namespace py = pybind11;

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

977 type_str = 'Vector_%s' % values.ptype_str
978 ptype = values
979 else:
980 type_str = '%s' % values.ptype_str
981 ptype = values.ptype
982
983 if keys in self._hr_values\
984 and keys in self._values\
985 and not isinstance(self._values[keys], m5.proxy.BaseProxy):
986 cmd_str = cmd_line_str + keys
987 acc_str = access_str + keys
988 flags_dict[cmd_str] = ParamInfo(ptype,
989 self._params[keys].desc, type_str, ex_str,
990 values.pretty_print(self._hr_values[keys]),
991 acc_str)
992 elif not keys in self._hr_values\
993 and not keys in self._values:

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

1177 assert self._parent is old_parent
1178 self._parent = None
1179
1180 # Also implemented by SimObjectVector
1181 def set_parent(self, parent, name):
1182 self._parent = parent
1183 self._name = name
1184
1185 # Return parent object of this SimObject, not implemented by SimObjectVector
1186 # because the elements in a SimObjectVector may not share the same parent
1187 def get_parent(self):
1188 return self._parent
1189
1190 # Also implemented by SimObjectVector
1191 def get_name(self):
1192 return self._name
1193
1194 # Also implemented by SimObjectVector

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

1270 (found_obj.path, child.path)
1271 found_obj = child
1272 # search param space
1273 for pname,pdesc in self._params.iteritems():
1274 if issubclass(pdesc.ptype, ptype):
1275 match_obj = self._values[pname]
1276 if found_obj != None and found_obj != match_obj:
1277 raise AttributeError, \
1278 'parent.any matched more than one: %s and %s' % (found_obj.path, match_obj.path)
1279 found_obj = match_obj
1280 return found_obj, found_obj != None
1281
1282 def find_all(self, ptype):
1283 all = {}
1284 # search children
1285 for child in self._children.itervalues():
1286 # a child could be a list, so ensure we visit each item

--- 256 unchanged lines hidden ---