Skip to content

Commit

Permalink
Fixed problem where pins added to one interconnected net were not sho…
Browse files Browse the repository at this point in the history
…wing up on the other net.
  • Loading branch information
xesscorp committed Apr 3, 2020
1 parent 990ed20 commit 8608380
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions skidl/Net.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,13 @@ def _traverse(self):
# Remove any phantom pins that may have existed for tieing nets together.
pins = set([p for p in pins if not isinstance(p, PhantomPin)])

# Store the traversal.
self.traversal = Traversal(nets=list(nets), pins=list(pins))

# Every net connected to this one should have the same traversal.
for n in self.traversal.nets:
n.traversal = self.traversal

return self.traversal

def get_pins(self):
Expand Down Expand Up @@ -520,12 +526,13 @@ def connect_pin(pin):
),
)

# If something has been connected to a net, then remove any existing traversal
# so it will be recomputed the next time it is needed.
# If something has been connected to a net, then recompute its traversal so the
# correct number of connected pins and nets is recorded.
try:
del self.traversal
except AttributeError:
pass # No traversal to delete.
self._traverse()

# Add the net to the global netlist. (It won't be added again
# if it's already there.)
Expand Down

0 comments on commit 8608380

Please sign in to comment.