Skip to content

Commit

Permalink
Corrected an issue with the implementation of nondefault rules
Browse files Browse the repository at this point in the history
in DEF read and write.  The NONDEFAULT LAYER WIREEXT was assumed
to refer to the default wire extension at segments, when instead
it refers to the wire extension only at vias.  The wire
extension at segments is presumably defined by the nondefault
segment (and wire extension at vias remains unimplemented, which
is probably not a big issue because everyone puts the wire
extensions into the via definitions anyway).
  • Loading branch information
RTimothyEdwards committed Sep 27, 2023
1 parent b244d45 commit 7aa8464
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 16 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
8.3.433
8.3.434
9 changes: 6 additions & 3 deletions lef/defRead.c
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ DefAddRoutes(rootDef, f, oscale, special, netname, ruleset, defLayerMap, annotat
paintWidth = (rule) ? rule->width :
(lefl) ? lefl->info.route.width :
DEFAULT_WIDTH * DBLambda[1] / DBLambda[0];
paintExtend = (rule) ? rule->extend : paintWidth;
paintExtend = (rule) ? rule->width : paintWidth;
}
}
else if ((*token == '+') && (special == TRUE))
Expand Down Expand Up @@ -377,7 +377,7 @@ DefAddRoutes(rootDef, f, oscale, special, netname, ruleset, defLayerMap, annotat
if (rule)
{
paintWidth = rule->width;
paintExtend = rule->extend;
paintExtend = rule->width;
}
}
else if (!strcmp(token, "DEFAULT"))
Expand Down Expand Up @@ -874,7 +874,7 @@ DefReadNonDefaultRules(f, rootDef, sname, oscale, total)
rule->lefInfo = lefl;
rule->width = 0;
rule->spacing = 0;
rule->extend = 0;
rule->extend = 0; /* unused */
rule->next = ruleset->rule;
ruleset->rule = rule;
}
Expand Down Expand Up @@ -924,7 +924,10 @@ DefReadNonDefaultRules(f, rootDef, sname, oscale, total)
else if (lefl == NULL)
LefError(DEF_INFO, "No layer for non-default extension.\n");
else
{
LefError(DEF_WARNING, "Non-default extension at via not implemented.\n");
rule->extend = (int)roundf((2 * fvalue) / oscale);
}
break;
case DEF_NONDEFLAYER_DIAG:
if (!inlayer)
Expand Down
42 changes: 30 additions & 12 deletions lef/defWrite.c
Original file line number Diff line number Diff line change
Expand Up @@ -1188,7 +1188,7 @@ defNetGeometryFunc(tile, plane, defdata)
ruleset->rule = (lefRule *)mallocMagic(sizeof(lefRule));
ruleset->rule->lefInfo = lefType;
ruleset->rule->width = ndv;
/* Policy is never to use a wire extension on non-default rules. */
/* Non-default rules wire extension-at-via is not used. */
ruleset->rule->extend = 0;
/* Spacing is not needed, but set it to the layer default */
ruleset->rule->spacing = DRCGetDefaultLayerSpacing(ttype, ttype);
Expand Down Expand Up @@ -1226,11 +1226,21 @@ defNetGeometryFunc(tile, plane, defdata)
if (routeWidth == 0) routeWidth = h;

extlen = 0;
/* NOTE: non-default tapers are not using wire extensions */
if ((defdata->specialmode == DO_REGULAR) && (defdata->ruleset == NULL))
/* NOTE: non-default tapers are not using wire */
/* extension-at-via (need to implement) */

if (defdata->specialmode == DO_REGULAR)
{
x1 = x1 + (routeWidth / 2 * oscale);
x2 = x2 - (routeWidth / 2 * oscale);
if (defdata->ruleset != NULL)
{
x1 = x1 + (defdata->ruleset->rule->width / 2 * oscale);
x2 = x2 - (defdata->ruleset->rule->width / 2 * oscale);
}
else
{
x1 = x1 + (routeWidth / 2 * oscale);
x2 = x2 - (routeWidth / 2 * oscale);
}
}
}
else /* vertical orientation */
Expand All @@ -1243,11 +1253,20 @@ defNetGeometryFunc(tile, plane, defdata)
if (routeWidth == 0) routeWidth = w;

extlen = 0;
/* NOTE: non-default tapers are not using wire extensions */
if ((defdata->specialmode == DO_REGULAR) && (defdata->ruleset == NULL))
/* NOTE: non-default tapers are not using wire */
/* extension-at-via (need to implement) */
if (defdata->specialmode == DO_REGULAR)
{
y1 = y1 + (routeWidth / 2 * oscale);
y2 = y2 - (routeWidth / 2 * oscale);
if (defdata->ruleset != NULL)
{
y1 = y1 + (defdata->ruleset->rule->width / 2 * oscale);
y2 = y2 - (defdata->ruleset->rule->width / 2 * oscale);
}
else
{
y1 = y1 + (routeWidth / 2 * oscale);
y2 = y2 - (routeWidth / 2 * oscale);
}
}
}
}
Expand Down Expand Up @@ -3082,10 +3101,9 @@ DefWriteCell(def, outName, allSpecial, units, analRetentive)
if (lefl2->type == rule->lefInfo->type)
break;
if (rule != NULL) continue;
fprintf(f, "\n + LAYER %s WIDTH %.10g WIREEXT %.10g",
fprintf(f, "\n + LAYER %s WIDTH %.10g",
lefl2->canonName,
(float)(lefl2->info.route.width) * scale,
(float)(lefl2->info.route.width) * scale / 2.0);
(float)(lefl2->info.route.width) * scale);
}
}

Expand Down

0 comments on commit 7aa8464

Please sign in to comment.