Deleted Added
sdiff udiff text old ( 7738:e2e8ca8d9640 ) new ( 7742:611fe187288e )
full compact
1# Copyright (c) 2004-2006 The Regents of The University of Michigan
2# Copyright (c) 2010 Advanced Micro Devices, Inc.
3# All rights reserved.
4#
5# Redistribution and use in source and binary forms, with or without
6# modification, are permitted provided that the following conditions are
7# met: redistributions of source code must retain the above copyright
8# notice, this list of conditions and the following disclaimer;

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

647 def get_name(self):
648 return self._name
649
650 # use this rather than directly accessing _parent for symmetry
651 # with SimObjectVector
652 def get_parent(self):
653 return self._parent
654
655 # clear out child with given name
656 def clear_child(self, name):
657 child = self._children[name]
658 child.clear_parent(self)
659 del self._children[name]
660
661 # Add a new child to this object.
662 def add_child(self, name, child):
663 child = coerceSimObjectOrVector(child)
664 if child.get_parent():
665 raise RuntimeError, \
666 "add_child('%s'): child '%s' already has parent '%s'" % \
667 (name, child._name, child._parent)
668 if self._children.has_key(name):
669 self.clear_child(name)
670 child.set_parent(self, name)
671 self._children[name] = child
672
673 # Take SimObject-valued parameters that haven't been explicitly
674 # assigned as children and make them children of the object that
675 # they were assigned to as a parameter value. This guarantees
676 # that when we instantiate all the parameter objects we're still

--- 295 unchanged lines hidden ---