From f36b751eb43f2e43b63c6cd7fe486fcdf37577d4 Mon Sep 17 00:00:00 2001 From: htfab Date: Wed, 8 May 2024 16:50:56 +0200 Subject: [PATCH] feat(precheck): fail on overlapping pins --- precheck/pin_check.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/precheck/pin_check.py b/precheck/pin_check.py index 6c35978..3a3681b 100644 --- a/precheck/pin_check.py +++ b/precheck/pin_check.py @@ -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)