From dc87a8c6936e89a557a3a84e6acc4c8321b9079e Mon Sep 17 00:00:00 2001 From: Tim Edwards Date: Fri, 6 Dec 2024 21:45:02 -0500 Subject: [PATCH] Corrected two errors with the wiring tool: (1) Ignore "angles"-type width rules when calculating the default metal width DRC rule (this width when present will always be larger than the minimum metal width), and (2) If an exiting wire is larger than the contact size, then set the contact size such that the contact PLUS the surrounding metal is the width of the exiting wire. The existing code sets the contact size itself to the width of the exiting wire, such that when surrounding material is added, the contact is larger than it needs to be. The fix to (1) will also fix other places where the default DRC width rule is computed, which includes LEF and DEF handling and computing rendered text sizes when reading GDS. --- drc/DRCtech.c | 4 ++-- wiring/wireOps.c | 18 +++++++++++++++++- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/drc/DRCtech.c b/drc/DRCtech.c index c659d081..17ba586c 100644 --- a/drc/DRCtech.c +++ b/drc/DRCtech.c @@ -4237,8 +4237,8 @@ DRCGetDefaultLayerWidth(ttype) /* Skip area rule */ if (cptr->drcc_flags & DRC_AREA) continue; - /* FORWARD rules only, and no MAXWIDTH */ - if ((cptr->drcc_flags & (DRC_REVERSE | DRC_MAXWIDTH)) == 0) + /* FORWARD rules only, and no MAXWIDTH or SPLITTILE */ + if ((cptr->drcc_flags & (DRC_REVERSE | DRC_MAXWIDTH | DRC_SPLITTILE)) == 0) { set = &cptr->drcc_mask; if (TTMaskHasType(set, ttype) && TTMaskEqual(set, &cptr->drcc_corner)) diff --git a/wiring/wireOps.c b/wiring/wireOps.c index b36a38e9..a7260e9a 100644 --- a/wiring/wireOps.c +++ b/wiring/wireOps.c @@ -826,7 +826,23 @@ WireAddContact(newType, newWidth) gotContact: totalSize = conSize + 2 * oldOverlap; - if (totalSize < WireWidth) totalSize = WireWidth; + + /* If the contact size + overlap is less than the wire width, + * then make the contact size equal to the wire width - the + * overlap so that the full contact area isn't larger than + * the exiting wire width. + */ + if (updown == WIRING_CONTACT_UP) + { + if (totalSize < (WireWidth - 2 * conSurround2)) + totalSize = WireWidth - 2 * conSurround2; + } + else + { + if (totalSize < (WireWidth - 2 * conSurround1)) + totalSize = WireWidth - 2 * conSurround1; + } + contactArea = oldLeg; if ((contactArea.r_xtop - contactArea.r_xbot) < totalSize) {