Corrected an issue with non-Manhattan tiles, caused by the fact that

the "width" rule is assumed to be symmetric, and not checked in all
four directions, as that would be redundant.  But non-Manhattan tiles
are not symmetric and must be checked all four directions.  Implemented
in a way that does not increase the DRC processing time.
This commit is contained in:
Tim Edwards 2022-04-20 17:12:58 -04:00
parent 55128d3437
commit a1adfaaa09
3 changed files with 45 additions and 23 deletions

View File

@ -646,7 +646,11 @@ drcTile (tile, arg)
for (cptr = DRCCurStyle->DRCRulesTbl[to][tt]; cptr != (DRCCookie *) NULL; for (cptr = DRCCurStyle->DRCRulesTbl[to][tt]; cptr != (DRCCookie *) NULL;
cptr = cptr->drcc_next) cptr = cptr->drcc_next)
{ {
if (cptr->drcc_flags & DRC_ANGLES_90) continue; /* DRC_ANGLES_90 and DRC_SPLITTILE rules are handled by */
/* the code above for non-Manhattan shapes and do not */
/* need to be processed again. */
if (cptr->drcc_flags & (DRC_ANGLES_90 | DRC_SPLITTILE))
continue;
/* Find the rule distances according to the scale factor */ /* Find the rule distances according to the scale factor */
dist = cptr->drcc_dist; dist = cptr->drcc_dist;
@ -1044,7 +1048,11 @@ drcTile (tile, arg)
for (cptr = DRCCurStyle->DRCRulesTbl[to][tt]; cptr != (DRCCookie *) NULL; for (cptr = DRCCurStyle->DRCRulesTbl[to][tt]; cptr != (DRCCookie *) NULL;
cptr = cptr->drcc_next) cptr = cptr->drcc_next)
{ {
if (cptr->drcc_flags & DRC_ANGLES_90) continue; /* DRC_ANGLES_90 and DRC_SPLITTILE rules are handled by */
/* the code above for non-Manhattan shapes and do not */
/* need to be processed again. */
if (cptr->drcc_flags & (DRC_ANGLES_90 | DRC_SPLITTILE))
continue;
/* Find the rule distances according to the scale factor */ /* Find the rule distances according to the scale factor */
dist = cptr->drcc_dist; dist = cptr->drcc_dist;

View File

@ -1290,13 +1290,6 @@ drcExtend(argc, argv)
* *
* width poly,pmc 2 "poly width must be at least 2" * width poly,pmc 2 "poly width must be at least 2"
* *
* Optional "from layers2" is useful when defining a device width;
* effectively, it represents an overhang rule where the presence of
* the overhanging material is optional. The equivalent rule is:
*
* edge4way layers2 layers distance layers 0 0 why
*
*
* Results: * Results:
* Returns distance. * Returns distance.
* *
@ -1354,6 +1347,26 @@ drcWidth(argc, argv)
why, distance, DRC_FORWARD, plane, plane); why, distance, DRC_FORWARD, plane, plane);
dp->drcc_next = dpnew; dp->drcc_next = dpnew;
} }
/* Width checks are symmetric and so need to be checked */
/* in only one direction. However, split tiles are */
/* not symmetric, so apply the reverse case with a flag */
/* that will allow the rule to be applied only in the */
/* case of a split tile. */
if (TTMaskHasType(&set, i) && TTMaskHasType(&setC, j))
{
plane = LowestMaskBit(pset);
/* Find bucket preceding the new one we wish to insert */
dp = drcFindBucket(i, j, distance);
dpnew = (DRCCookie *)mallocMagic(sizeof (DRCCookie));
drcAssign(dpnew, distance, dp->drcc_next, &set, &set,
why, distance, DRC_REVERSE | DRC_SPLITTILE,
plane, plane);
dp->drcc_next = dpnew;
}
} }
} }
} }

View File

@ -64,24 +64,25 @@ typedef struct drccookie
* edge processing. * edge processing.
*/ */
#define DRC_FORWARD 0x000 #define DRC_FORWARD 0x0000
#define DRC_REVERSE 0x001 #define DRC_REVERSE 0x0001
#define DRC_BOTHCORNERS 0x002 #define DRC_BOTHCORNERS 0x0002
#define DRC_TRIGGER 0x004 #define DRC_TRIGGER 0x0004
#define DRC_BENDS 0x008 #define DRC_BENDS 0x0008
#define DRC_OUTSIDE 0x010 #define DRC_OUTSIDE 0x0010
#define DRC_AREA 0x020 #define DRC_AREA 0x0020
#define DRC_OFFGRID 0x040 #define DRC_OFFGRID 0x0040
#define DRC_MAXWIDTH 0x080 #define DRC_MAXWIDTH 0x0080
#define DRC_MAXWIDTH_BOTH 0x100 #define DRC_MAXWIDTH_BOTH 0x0100
#define DRC_RECTSIZE 0x200 #define DRC_RECTSIZE 0x0200
#define DRC_ANGLES_45 0x400 #define DRC_ANGLES_45 0x0400
#define DRC_ANGLES_90 0x800 #define DRC_ANGLES_90 0x0800
#define DRC_SPLITTILE 0x1000
#define DRC_NONSTANDARD (DRC_AREA|DRC_MAXWIDTH|DRC_RECTSIZE\ #define DRC_NONSTANDARD (DRC_AREA|DRC_MAXWIDTH|DRC_RECTSIZE\
|DRC_ANGLES_90|DRC_OFFGRID) |DRC_ANGLES_90|DRC_OFFGRID)
/* More flags for indicating what the rule type represents */ /* More flags for indicating what the rule type represents */
#define DRC_CIFRULE 0x400 #define DRC_CIFRULE 0x2000
#define DRC_PENDING 0 #define DRC_PENDING 0
#define DRC_UNPROCESSED CLIENTDEFAULT #define DRC_UNPROCESSED CLIENTDEFAULT