params.py (10317:19f5df7ac6a1) params.py (10355:7565dcd505a4)
1# Copyright (c) 2012-2013 ARM Limited
1# Copyright (c) 2012-2014 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
9# terms below provided that you ensure that this notice is replicated

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

1611 elif isinstance(other, PortRef):
1612 if other.peer is not self:
1613 other.connect(self)
1614 else:
1615 raise TypeError, \
1616 "assigning non-port reference '%s' to port '%s'" \
1617 % (other, self)
1618
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
9# terms below provided that you ensure that this notice is replicated

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

1611 elif isinstance(other, PortRef):
1612 if other.peer is not self:
1613 other.connect(self)
1614 else:
1615 raise TypeError, \
1616 "assigning non-port reference '%s' to port '%s'" \
1617 % (other, self)
1618
1619 # Allow a master/slave port pair to be spliced between
1620 # a port and its connected peer. Useful operation for connecting
1621 # instrumentation structures into a system when it is necessary
1622 # to connect the instrumentation after the full system has been
1623 # constructed.
1624 def splice(self, new_master_peer, new_slave_peer):
1625 if self.peer and not proxy.isproxy(self.peer):
1626 if isinstance(new_master_peer, PortRef) and \
1627 isinstance(new_slave_peer, PortRef):
1628 old_peer = self.peer
1629 if self.role == 'SLAVE':
1630 self.peer = new_master_peer
1631 old_peer.peer = new_slave_peer
1632 new_master_peer.connect(self)
1633 new_slave_peer.connect(old_peer)
1634 elif self.role == 'MASTER':
1635 self.peer = new_slave_peer
1636 old_peer.peer = new_master_peer
1637 new_slave_peer.connect(self)
1638 new_master_peer.connect(old_peer)
1639 else:
1640 panic("Port %s has unknown role, "+\
1641 "cannot splice in new peers\n", self)
1642 else:
1643 raise TypeError, \
1644 "Splicing non-port references '%s','%s' to port '%s'"\
1645 % (new_peer, peers_new_peer, self)
1646 else:
1647 fatal("Port %s not connected, cannot splice in new peers\n", self)
1648
1619 def clone(self, simobj, memo):
1620 if memo.has_key(self):
1621 return memo[self]
1622 newRef = copy.copy(self)
1623 memo[self] = newRef
1624 newRef.simobj = simobj
1625 assert(isSimObject(newRef.simobj))
1626 if self.peer and not proxy.isproxy(self.peer):

--- 238 unchanged lines hidden ---
1649 def clone(self, simobj, memo):
1650 if memo.has_key(self):
1651 return memo[self]
1652 newRef = copy.copy(self)
1653 memo[self] = newRef
1654 newRef.simobj = simobj
1655 assert(isSimObject(newRef.simobj))
1656 if self.peer and not proxy.isproxy(self.peer):

--- 238 unchanged lines hidden ---