From 37dfe07edfb6db663faff7af3f7cfe5988f10b05 Mon Sep 17 00:00:00 2001 From: Tim Edwards Date: Sun, 8 Dec 2024 12:14:38 -0500 Subject: [PATCH] Extended the "cifmaxwidth" function to include the option "both", which has the same meaning as the "maxwidth" function ("both" checks either tile dimension to see if it exceeds the maximum). This is a simple per-tile check and assumes that violations do not occur across multiple tiles. This should be sufficient for most checks. --- VERSION | 2 +- drc/DRCcif.c | 42 +++++++++++++++++++++++++++++++++++------- 2 files changed, 36 insertions(+), 8 deletions(-) diff --git a/VERSION b/VERSION index b30ad93f..add683c6 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -8.3.504 +8.3.505 diff --git a/drc/DRCcif.c b/drc/DRCcif.c index 54a359f3..ddb60521 100644 --- a/drc/DRCcif.c +++ b/drc/DRCcif.c @@ -1268,11 +1268,12 @@ drcCifMaxwidth(argc, argv) return (0); } - if (strcmp(bends,"bend_illegal") == 0) bend =0; - else if (strcmp(bends,"bend_ok") == 0) bend =DRC_BENDS; + if (strcmp(bends, "bend_illegal") == 0) bend = 0; + else if (strcmp(bends, "bend_ok") == 0) bend = DRC_BENDS; + else if (strcmp(bends, "both") == 0) bend = DRC_MAXWIDTH_BOTH; else { - TechError("unknown bend option %s\n",bends); + TechError("unknown bend option %s\n", bends); return (0); } @@ -1447,10 +1448,35 @@ drcCheckCifMaxwidth(starttile,arg,cptr) if (DRCstack == (Stack *) NULL) DRCstack = StackNew(64); - /* if bends are allowed, just check on a tile-by-tile basis that - one dimension is the max. This is pretty stupid, but it correctly - calculates the trench width rule. dcs 12.06.89 */ - if (cptr->drcc_flags & DRC_BENDS) + /* If bends are allowed, just check on a tile-by-tile basis that + * both dimensions exceed the max. This is pretty stupid, but it + * correctly calculates, e.g., the trench width rule. dcs 12.06.89 + * + * Do the same for the "both" case, checking on a tile-by-tile basis + * that either dimension exceeds the max. + */ + + if (cptr->drcc_flags & DRC_MAXWIDTH_BOTH) + { + Rect rect; + TiToRect(starttile,&rect); + if ((rect.r_xtop-rect.r_xbot > edgelimit) || + (rect.r_ytop-rect.r_ybot > edgelimit)) + { + rect.r_xbot /= scale; + rect.r_xtop /= scale; + rect.r_ybot /= scale; + rect.r_ytop /= scale; + GeoClip(&rect, arg->dCD_clip); + if (!GEO_RECTNULL(&rect)) { + (*(arg->dCD_function)) (arg->dCD_celldef, &rect, + arg->dCD_cptr, arg->dCD_clientData); + (*(arg->dCD_errors))++; + } + } + return; + } + else if (cptr->drcc_flags & DRC_BENDS) { Rect rect; TiToRect(starttile,&rect); @@ -1470,7 +1496,9 @@ drcCheckCifMaxwidth(starttile,arg,cptr) } return; } + /* Mark this tile as pending and push it */ + PUSHTILE(starttile); TiToRect(starttile,&boundrect);