feat(precheck): fail on overlapping pins

This commit is contained in:
htfab
2024-05-08 20:08:10 +03:00
committed by Uri Shaked
parent 0bc5812f9d
commit 39162225ce
+15
View File
@@ -1,5 +1,6 @@
import logging
import re
from itertools import combinations
import gdstk
from precheck_failure import PrecheckFailure
@@ -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)