Make overriding port assignments in Python work,

and print better error messages when it doesn't.
This commit is contained in:
Steve Reinhardt
2008-09-29 23:30:14 -07:00
parent 45cba35fc1
commit 7bf6a219db
2 changed files with 9 additions and 3 deletions

View File

@@ -1004,6 +1004,7 @@ class PortRef(object):
if self.peer and not proxy.isproxy(self.peer):
print "warning: overwriting port", self, \
"value", self.peer, "with", other
self.peer.peer = None
self.peer = other
if proxy.isproxy(other):
other.set_param_desc(PortParamDesc())
@@ -1046,6 +1047,8 @@ class PortRef(object):
if self.ccConnected: # already done this
return
peer = self.peer
if not self.peer: # nothing to connect to
return
connectPorts(self.simobj.getCCObject(), self.name, self.index,
peer.simobj.getCCObject(), peer.name, peer.index)
self.ccConnected = True