params.py (13542:5e914b841659) params.py (13543:98421d757922)
1# Copyright (c) 2012-2014, 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

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

1780 % (other, self)
1781
1782 # Allow a master/slave port pair to be spliced between
1783 # a port and its connected peer. Useful operation for connecting
1784 # instrumentation structures into a system when it is necessary
1785 # to connect the instrumentation after the full system has been
1786 # constructed.
1787 def splice(self, new_master_peer, new_slave_peer):
1# Copyright (c) 2012-2014, 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

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

1780 % (other, self)
1781
1782 # Allow a master/slave port pair to be spliced between
1783 # a port and its connected peer. Useful operation for connecting
1784 # instrumentation structures into a system when it is necessary
1785 # to connect the instrumentation after the full system has been
1786 # constructed.
1787 def splice(self, new_master_peer, new_slave_peer):
1788 if self.peer and not proxy.isproxy(self.peer):
1789 if isinstance(new_master_peer, PortRef) and \
1790 isinstance(new_slave_peer, PortRef):
1791 old_peer = self.peer
1792 if self.role == 'SLAVE':
1793 self.peer = new_master_peer
1794 old_peer.peer = new_slave_peer
1795 new_master_peer.connect(self)
1796 new_slave_peer.connect(old_peer)
1797 elif self.role == 'MASTER':
1798 self.peer = new_slave_peer
1799 old_peer.peer = new_master_peer
1800 new_slave_peer.connect(self)
1801 new_master_peer.connect(old_peer)
1802 else:
1803 panic("Port %s has unknown role, "+\
1804 "cannot splice in new peers\n", self)
1805 else:
1806 raise TypeError, \
1807 "Splicing non-port references '%s','%s' to port '%s'"\
1808 % (new_master_peer, new_slave_peer, self)
1809 else:
1788 if not self.peer or proxy.isproxy(self.peer):
1810 fatal("Port %s not connected, cannot splice in new peers\n", self)
1811
1789 fatal("Port %s not connected, cannot splice in new peers\n", self)
1790
1791 if not isinstance(new_master_peer, PortRef) or \
1792 not isinstance(new_slave_peer, PortRef):
1793 raise TypeError, \
1794 "Splicing non-port references '%s','%s' to port '%s'" % \
1795 (new_master_peer, new_slave_peer, self)
1796
1797 old_peer = self.peer
1798 if self.role == 'SLAVE':
1799 self.peer = new_master_peer
1800 old_peer.peer = new_slave_peer
1801 new_master_peer.connect(self)
1802 new_slave_peer.connect(old_peer)
1803 elif self.role == 'MASTER':
1804 self.peer = new_slave_peer
1805 old_peer.peer = new_master_peer
1806 new_slave_peer.connect(self)
1807 new_master_peer.connect(old_peer)
1808 else:
1809 panic("Port %s has unknown role, "+\
1810 "cannot splice in new peers\n", self)
1811
1812 def clone(self, simobj, memo):
1813 if memo.has_key(self):
1814 return memo[self]
1815 newRef = copy.copy(self)
1816 memo[self] = newRef
1817 newRef.simobj = simobj
1818 assert(isSimObject(newRef.simobj))
1819 if self.peer and not proxy.isproxy(self.peer):

--- 241 unchanged lines hidden ---
1812 def clone(self, simobj, memo):
1813 if memo.has_key(self):
1814 return memo[self]
1815 newRef = copy.copy(self)
1816 memo[self] = newRef
1817 newRef.simobj = simobj
1818 assert(isSimObject(newRef.simobj))
1819 if self.peer and not proxy.isproxy(self.peer):

--- 241 unchanged lines hidden ---