Skip to content

Commit

Permalink
feat(precheck): fail on overlapping pins
Browse files Browse the repository at this point in the history
  • Loading branch information
htfab committed May 8, 2024
1 parent 0bc5812 commit f36b751
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions precheck/pin_check.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import logging
import re
from itertools import combinations

import gdstk
from precheck_failure import PrecheckFailure
Expand Down Expand Up @@ -234,6 +235,20 @@ def pin_check(gds: str, lef: str, template_def: str, toplevel: str):
)
lef_errors += 1

# check for overlapping pins

for (pin1, rects1), (pin2, rects2) in combinations(sorted(lef_ports.items()), 2):
for layer1, lx1, by1, rx1, ty1 in rects1:
for layer2, lx2, by2, rx2, ty2 in rects2:
if layer1 != layer2:
continue
if rx1 < lx2 or rx2 < lx1:
continue
if ty1 < by2 or ty2 < by1:
continue
logging.error(f"Overlapping pins in {lef}: {pin1} and {pin2}")
lef_errors += 1

# check gds for the ports being present

lib = gdstk.read_gds(gds)
Expand Down

0 comments on commit f36b751

Please sign in to comment.