Skip to content

Commit

Permalink
Corrected the run-length wide-spacing rule so that it correctly
Browse files Browse the repository at this point in the history
identifies areas which meet the proper definition of run-length
(both edges are parallel for the run-length distance or more).
Previously, errors were getting triggered for geometry where
only one edge exceeded the run-length distance.
  • Loading branch information
RTimothyEdwards committed Dec 12, 2024
1 parent 37dfe07 commit 5ebbed4
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 18 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
8.3.505
8.3.506
13 changes: 10 additions & 3 deletions drc/DRCbasic.c
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,15 @@ areaCheck(tile, arg)
if ((rect.r_xbot >= rect.r_xtop) || (rect.r_ybot >= rect.r_ytop))
return 0;

/* Run-length rules are ignored unless the width of the error
* exceeds the run-length distance (which is held in the
* drcc_cdist entry for the rule).
*/
if (arg->dCD_cptr->drcc_flags & DRC_RUNLENGTH)
if (((rect.r_xtop - rect.r_xbot) < arg->dCD_cptr->drcc_cdist) &&
((rect.r_ytop - rect.r_ybot) < arg->dCD_cptr->drcc_cdist))
return 0;

/*
* When Euclidean distance checks are enabled, check for error tiles
* outside of the perimeter of the circle in the corner extension area
Expand Down Expand Up @@ -716,7 +725,6 @@ drcTile (tile, arg)
for (i = 0; i < mrd->entries; i++)
{
lr = &mrd->rlist[i];
GeoClip(lr, arg->dCD_clip);
if ((lr->r_ytop - lr->r_ybot) > cptr->drcc_cdist)
{
triggered = mrd->entries;
Expand Down Expand Up @@ -1067,7 +1075,7 @@ drcTile (tile, arg)

/* Find the rule distances according to the scale factor */
dist = cptr->drcc_dist;
cdist = cptr->drcc_cdist;
cdist = (cptr->drcc_flags & DRC_RUNLENGTH) ? 0 : cptr->drcc_cdist;
trigpending = (cptr->drcc_flags & DRC_TRIGGER) ? TRUE : FALSE;

/* drcc_edgeplane is used to avoid checks on edges */
Expand Down Expand Up @@ -1119,7 +1127,6 @@ drcTile (tile, arg)
for (i = 0; i < mrd->entries; i++)
{
lr = &mrd->rlist[i];
GeoClip(lr, arg->dCD_clip);
if ((lr->r_xtop - lr->r_xbot) > cptr->drcc_cdist)
{
triggered = mrd->entries;
Expand Down
54 changes: 41 additions & 13 deletions drc/DRCtech.c
Original file line number Diff line number Diff line change
Expand Up @@ -2135,13 +2135,27 @@ drcMaskSpacing(set1, set2, pmask1, pmask2, wwidth, distance, adjacency,
/* reverse order due to the stack property of */
/* the linked list. */

drcAssign(dpnew, distance, dp->drcc_next, &tmp1, &tmp2,
why, distance, DRC_FORWARD, plane2, plane);
dptrig = (DRCCookie *) mallocMagic((unsigned)
(sizeof (DRCCookie)));
drcAssign(dptrig, wwidth, dpnew, set1, set1, why,
runlength, DRC_REVERSE | DRC_MAXWIDTH |
DRC_TRIGGER | DRC_BENDS, plane2, plane);
if (runlength > 0)
{
drcAssign(dpnew, distance, dp->drcc_next, &tmp1, &tmp2,
why, runlength, DRC_RUNLENGTH |
DRC_FORWARD, plane2, plane);
dptrig = (DRCCookie *) mallocMagic((unsigned)
(sizeof (DRCCookie)));
drcAssign(dptrig, wwidth, dpnew, set1, set1, why,
runlength, DRC_REVERSE | DRC_MAXWIDTH |
DRC_TRIGGER | DRC_BENDS, plane2, plane);
}
else
{
drcAssign(dpnew, distance, dp->drcc_next, &tmp1, &tmp2,
why, distance, DRC_FORWARD, plane2, plane);
dptrig = (DRCCookie *) mallocMagic((unsigned)
(sizeof (DRCCookie)));
drcAssign(dptrig, wwidth, dpnew, set1, set1, why,
distance, DRC_REVERSE | DRC_MAXWIDTH |
DRC_TRIGGER | DRC_BENDS, plane2, plane);
}

dp->drcc_next = dptrig;
}
Expand Down Expand Up @@ -2189,14 +2203,28 @@ drcMaskSpacing(set1, set2, pmask1, pmask2, wwidth, distance, adjacency,

/* Assign two coupled rules (see above) */

drcAssign(dpnew, distance, dp->drcc_next, &tmp1,
&tmp2, why, distance,
if (runlength > 0)
{
drcAssign(dpnew, distance, dp->drcc_next, &tmp1,
&tmp2, why, runlength, DRC_RUNLENGTH |
DRC_REVERSE | DRC_BOTHCORNERS, plane2, plane);
dptrig = (DRCCookie *) mallocMagic((unsigned)
dptrig = (DRCCookie *) mallocMagic((unsigned)
(sizeof (DRCCookie)));
drcAssign(dptrig, wwidth, dpnew, set1, set1, why,
drcAssign(dptrig, wwidth, dpnew, set1, set1, why,
runlength, DRC_FORWARD | DRC_MAXWIDTH |
DRC_TRIGGER | DRC_BENDS, plane2, plane);
}
else
{
drcAssign(dpnew, distance, dp->drcc_next, &tmp1,
&tmp2, why, distance,
DRC_REVERSE | DRC_BOTHCORNERS, plane2, plane);
dptrig = (DRCCookie *) mallocMagic((unsigned)
(sizeof (DRCCookie)));
drcAssign(dptrig, wwidth, dpnew, set1, set1, why,
distance, DRC_FORWARD | DRC_MAXWIDTH |
DRC_TRIGGER | DRC_BENDS, plane2, plane);
}
dp->drcc_next = dptrig;
}
else if (needtrigger)
Expand Down Expand Up @@ -2474,7 +2502,7 @@ drcSpacing(argc, argv)
{
layers2 = argv[3];
distance = atoi(argv[4]);
runlength = distance;
runlength = -1;
adjacency = argv[5];
why = drcWhyCreate(argv[6]);
}
Expand All @@ -2488,7 +2516,7 @@ drcSpacing(argc, argv)
adjacency = argv[4];
wwidth = distance;
why = drcWhyCreate(argv[5]);
runlength = distance;
runlength = -1;
if (argc >= 7)
{
TechError("Unknown argument in spacing line.\n");
Expand Down
4 changes: 3 additions & 1 deletion drc/drc.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ typedef struct drccookie
* DRC_BOTHCORNERS: Must make corner extensions in both directions.
* DRC_OUTSIDE: Rule applies only to the outside edge of the rule area.
* DRC_TRIGGER: Violation of rule triggers a secondary rule.
* DRC_RUNLENGTH: "cdist" encodes runlength distance, not corner distance.
*
* All other flags denote special DRC rules that do not use the standard 4-way
* edge processing.
Expand All @@ -78,11 +79,12 @@ typedef struct drccookie
#define DRC_ANGLES_45 0x0400
#define DRC_ANGLES_90 0x0800
#define DRC_SPLITTILE 0x1000
#define DRC_RUNLENGTH 0x2000
#define DRC_NONSTANDARD (DRC_AREA|DRC_MAXWIDTH|DRC_RECTSIZE\
|DRC_ANGLES_90|DRC_OFFGRID)

/* More flags for indicating what the rule type represents */
#define DRC_CIFRULE 0x2000
#define DRC_CIFRULE 0x4000

#define DRC_PENDING 0
#define DRC_UNPROCESSED CLIENTDEFAULT
Expand Down

0 comments on commit 5ebbed4

Please sign in to comment.