Deleted Added
sdiff udiff text old ( 11988:665cd5f8b52b ) new ( 11991:d3f19484145f )
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

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

505
506 cls._value_dict['cxx_type'] = '%s *' % cls._value_dict['cxx_class']
507
508 if 'cxx_header' not in cls._value_dict:
509 global noCxxHeader
510 noCxxHeader = True
511 warn("No header file specified for SimObject: %s", name)
512
513 # Now process the _value_dict items. They could be defining
514 # new (or overriding existing) parameters or ports, setting
515 # class keywords (e.g., 'abstract'), or setting parameter
516 # values or port bindings. The first 3 can only be set when
517 # the class is defined, so we handle them here. The others
518 # can be set later too, so just emulate that by calling
519 # setattr().
520 for key,val in cls._value_dict.items():

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

658
659 # See ParamValue.cxx_predecls for description.
660 def cxx_predecls(cls, code):
661 code('#include "params/$cls.hh"')
662
663 def pybind_predecls(cls, code):
664 code('#include "${{cls.cxx_header}}"')
665
666 def pybind_decl(cls, code):
667 class_path = cls.cxx_class.split('::')
668 namespaces, classname = class_path[:-1], class_path[-1]
669 py_class_name = '_COLONS_'.join(class_path) if namespaces else \
670 classname;
671
672 # The 'local' attribute restricts us to the params declared in
673 # the object itself, not including inherited params (which

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

916 __metaclass__ = MetaSimObject
917 type = 'SimObject'
918 abstract = True
919
920 cxx_header = "sim/sim_object.hh"
921 cxx_bases = [ "Drainable", "Serializable" ]
922 eventq_index = Param.UInt32(Parent.eventq_index, "Event Queue Index")
923
924 cxx_exports = [
925 PyBindMethod("init"),
926 PyBindMethod("initState"),
927 PyBindMethod("memInvalidate"),
928 PyBindMethod("memWriteback"),
929 PyBindMethod("regStats"),
930 PyBindMethod("resetStats"),
931 PyBindMethod("regProbePoints"),

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

1095 if self._values.has_key(attr):
1096 return self._values[attr]
1097
1098 if self._children.has_key(attr):
1099 return self._children[attr]
1100
1101 # If the attribute exists on the C++ object, transparently
1102 # forward the reference there. This is typically used for
1103 # methods exported to Python (e.g., init(), and startup())
1104 if self._ccObject and hasattr(self._ccObject, attr):
1105 return getattr(self._ccObject, attr)
1106
1107 err_string = "object '%s' has no attribute '%s'" \
1108 % (self.__class__.__name__, attr)
1109
1110 if not self._ccObject:
1111 err_string += "\n (C++ object is not yet constructed," \

--- 431 unchanged lines hidden ---