Modified the generation of "equiv" statements in "extract" some more,

to eliminate all redundant names resulting from redundant labels.
Changed the behavior of "goto" so that it will find local names with
slashes, which are the result of using "flatten".  A hierarchical
search is done first, as before, but on failure to find a subcell
component, the local cell is searched for the verbatim name.
This commit is contained in:
Tim Edwards 2021-10-08 10:58:10 -04:00
parent 083ef458a8
commit 537b1f057d
4 changed files with 39 additions and 13 deletions

View File

@ -1 +1 @@
8.3.216
8.3.217

View File

@ -925,6 +925,7 @@ CmdExtract(w, cmd)
"local put all generated files in the current directory",
"resistance estimate resistance",
"labelcheck check for connections through sticky labels",
"aliases output all net name aliases",
NULL
};
static char *cmdExtLength[] =

View File

@ -1586,7 +1586,7 @@ CmdFindNetProc(nodename, use, rect, warn_not_found)
Rect localrect;
int pnum, xpos, ypos;
char *xstr, *ystr;
bool locvalid;
bool locvalid = FALSE, usefound = TRUE;
TileType ttype;
scx.scx_use = use;
@ -1600,9 +1600,11 @@ CmdFindNetProc(nodename, use, rect, warn_not_found)
use = scx2.scx_use;
if (use == NULL)
{
if (warn_not_found)
TxError("Couldn't find use %s\n", s);
return TT_SPACE;
/* Assume slash is part of the name and try to find locally */
*s2 = '/';
s = nodename;
usefound = FALSE;
goto checklocal;
}
GeoTransTrans(DBGetArrayTransform(use, scx2.scx_x, scx2.scx_y),
&use->cu_transform, &tmp);
@ -1621,7 +1623,6 @@ CmdFindNetProc(nodename, use, rect, warn_not_found)
/* see extract/extBasic.c for the format of the node, found */
/* in extMakeNodeNumPrint(). */
locvalid = FALSE;
if ((xstr = strchr(s, '_')) != NULL)
{
bool isNeg = FALSE;
@ -1674,10 +1675,10 @@ CmdFindNetProc(nodename, use, rect, warn_not_found)
/* coordinates that is no longer generated by magic. It is kept */
/* here for backward compatibility. */
if ((locvalid == FALSE) && (sscanf(s,"%d_%d_%d",&pnum,&xpos,&ypos) == 3))
if ((locvalid == FALSE) && (sscanf(s, "%d_%d_%d", &pnum, &xpos, &ypos) == 3))
{
xpos = ((xpos & 0x1)?-1:1)*xpos/2;
ypos = ((ypos & 0x1)?-1:1)*ypos/2;
xpos = ((xpos & 0x1) ? -1 : 1) * xpos / 2;
ypos = ((ypos & 0x1) ? -1 : 1) * ypos / 2;
localrect.r_xbot = xpos;
localrect.r_ybot = ypos;
localrect.r_xtop = xpos + 1;
@ -1685,6 +1686,8 @@ CmdFindNetProc(nodename, use, rect, warn_not_found)
locvalid = TRUE;
}
checklocal:
if (locvalid == TRUE)
{
int findTile();
@ -1714,7 +1717,11 @@ CmdFindNetProc(nodename, use, rect, warn_not_found)
else
{
if (warn_not_found)
{
TxError("Couldn't find label %s\n", s);
if (!usefound)
TxError("Couldn't find use referenced in hierarchical name\n");
}
return TT_SPACE;
}
}

View File

@ -729,7 +729,11 @@ extOutputNodes(nodeList, outFile)
/* Output the alternate names for the node. Avoid generating */
/* unnecessary "equiv A A" entries for labels on disconnected */
/* nets. */
/* nets. Also avoid multiple "equiv" statements with the same */
/* nets (happens when ports with the same name have different */
/* port numbers, which should probably just be prohibited), and */
/* raise an error if two ports with different names are being */
/* marked as equivalent. */
for (ll = reg->nreg_labels; ll; ll = ll->ll_next)
{
@ -740,7 +744,11 @@ extOutputNodes(nodeList, outFile)
if (ll->ll_label->lab_text == text)
{
char *portname = NULL;
char *lastname = NULL;
isPort = (ll->ll_attr == LL_PORTATTR) ? TRUE : FALSE;
if (isPort) portname = text;
for (ll = ll->ll_next; ll; ll = ll->ll_next)
if (extLabType(ll->ll_label->lab_text, LABTYPE_NAME))
@ -749,12 +757,22 @@ extOutputNodes(nodeList, outFile)
if ((ll->ll_attr == LL_PORTATTR) ||
(ExtOptions & EXT_DOALIASES))
{
fprintf(outFile, "equiv \"%s\" \"%s\"\n",
text, ll->ll_label->lab_text);
if (isPort && (ll->ll_attr == LL_PORTATTR))
if ((portname == NULL) ||
(strcmp(ll->ll_label->lab_text, portname)))
{
if ((lastname == NULL) ||
(strcmp(ll->ll_label->lab_text, lastname)))
fprintf(outFile, "equiv \"%s\" \"%s\"\n",
text, ll->ll_label->lab_text);
lastname = ll->ll_label->lab_text;
}
if ((portname != NULL) &&
(strcmp(ll->ll_label->lab_text, portname)))
TxError("Warning: Ports \"%s\" and \"%s\" are"
" electrically shorted.\n",
text, ll->ll_label->lab_text);
if (!isPort && (ll->ll_attr == LL_PORTATTR))
portname = ll->ll_label->lab_text;
}
}
break;