Merge branch 'master' into magic-8.2

This commit is contained in:
Tim Edwards 2019-07-26 03:00:04 -04:00
commit 8a01ea8a58
4 changed files with 75 additions and 30 deletions

View File

@ -752,7 +752,7 @@ cifMakeBoundaryFunc(tile, clientdata)
CIFReadError("Warning: Cell %s boundary was redefined.\n", CIFReadError("Warning: Cell %s boundary was redefined.\n",
cifReadCellDef->cd_name); cifReadCellDef->cd_name);
else else
CalmaError("Warning: Cell %s boundary was redefined.\n", CalmaReadError("Warning: Cell %s boundary was redefined.\n",
cifReadCellDef->cd_name); cifReadCellDef->cd_name);
} }
} }

View File

@ -1572,14 +1572,29 @@ esMakePorts(hc, cdata)
while (tptr != NULL) while (tptr != NULL)
{ {
int idum[6];
bool is_array;
/* Ignore array information for the purpose of tracing */ /* Ignore array information for the purpose of tracing */
/* the cell definition hierarchy. */ /* the cell definition hierarchy. Complementary to the */
/* method used in EFbuild.c, only consider uses of */
/* brackets that conform to the [ax:bx:cx][ay:by:cy] */
/* notation. */
aptr = strchr(portname, '['); aptr = strchr(portname, '[');
if ((aptr == NULL) || (aptr > tptr)) if (aptr && (aptr < tptr) &&
*tptr = '\0'; (sscanf(aptr, "[%d:%d:%d][%d:%d:%d]",
else &idum[0], &idum[1], &idum[2],
&idum[3], &idum[4], &idum[5]) == 6))
{
is_array = TRUE;
*aptr = '\0'; *aptr = '\0';
}
else
{
is_array = FALSE;
*tptr = '\0';
}
// Find the cell for the instance // Find the cell for the instance
portdef = NULL; portdef = NULL;
@ -1589,10 +1604,10 @@ esMakePorts(hc, cdata)
use = (Use *)HashGetValue(he); use = (Use *)HashGetValue(he);
portdef = use->use_def; portdef = use->use_def;
} }
if ((aptr == NULL) || (aptr > tptr)) if (is_array)
*tptr = '/';
else
*aptr = '['; *aptr = '[';
else
*tptr = '/';
portname = tptr + 1; portname = tptr + 1;
// Find the net of portname in the subcell and // Find the net of portname in the subcell and
@ -1651,14 +1666,26 @@ esMakePorts(hc, cdata)
while (tptr != NULL) while (tptr != NULL)
{ {
int idum[6];
bool is_array;
/* Ignore array information for the purpose of tracing */ /* Ignore array information for the purpose of tracing */
/* the cell definition hierarchy. */ /* the cell definition hierarchy. */
aptr = strchr(portname, '['); aptr = strchr(portname, '[');
if ((aptr == NULL) || (aptr > tptr)) if (aptr && (aptr < tptr) &&
*tptr = '\0'; (sscanf(aptr, "[%d:%d:%d][%d:%d:%d]",
else &idum[0], &idum[1], &idum[2],
&idum[3], &idum[4], &idum[5]) == 6))
{
*aptr = '\0'; *aptr = '\0';
is_array = TRUE;
}
else
{
*tptr = '\0';
is_array = FALSE;
}
// Find the cell for the instance // Find the cell for the instance
portdef = NULL; portdef = NULL;
@ -1668,10 +1695,10 @@ esMakePorts(hc, cdata)
use = (Use *)HashGetValue(he); use = (Use *)HashGetValue(he);
portdef = use->use_def; portdef = use->use_def;
} }
if ((aptr == NULL) || (aptr > tptr)) if (is_array)
*tptr = '/';
else
*aptr = '['; *aptr = '[';
else
*tptr = '/';
portname = tptr + 1; portname = tptr + 1;
// Find the net of portname in the subcell and // Find the net of portname in the subcell and

View File

@ -1123,12 +1123,26 @@ efBuildUse(def, subDefName, subUseId, ta, tb, tc, td, te, tf)
} }
else else
{ {
*cp = '\0'; /* Note: Preserve any use of brackets as-is other than the */
newuse->use_id = StrDup((char **) NULL, subUseId); /* standard magic array notation below. This allows, for */
*cp = '['; /* example, verilog instance arrays read from DEF files to */
(void) sscanf(cp, "[%d:%d:%d][%d:%d:%d]", /* be passed through correctly. */
if ((sscanf(cp, "[%d:%d:%d][%d:%d:%d]",
&newuse->use_xlo, &newuse->use_xhi, &newuse->use_xsep, &newuse->use_xlo, &newuse->use_xhi, &newuse->use_xsep,
&newuse->use_ylo, &newuse->use_yhi, &newuse->use_ysep); &newuse->use_ylo, &newuse->use_yhi, &newuse->use_ysep)) == 6)
{
*cp = '\0';
newuse->use_id = StrDup((char **) NULL, subUseId);
*cp = '[';
}
else
{
newuse->use_id = StrDup((char **) NULL, subUseId);
newuse->use_xlo = newuse->use_xhi = 0;
newuse->use_ylo = newuse->use_yhi = 0;
newuse->use_xsep = newuse->use_ysep = 0;
}
} }
he = HashFind(&def->def_uses, newuse->use_id); he = HashFind(&def->def_uses, newuse->use_id);

View File

@ -1450,18 +1450,22 @@ DefReadComponents(f, rootDef, sname, oscale, total)
/* Does use name contain brackets? If so, this can */ /* Does use name contain brackets? If so, this can */
/* interfere with magic's use of arrays. */ /* interfere with magic's use of arrays. */
/* NOTE: This has been commented out. I think */
/* the only confusion is in ext2spice and can be */
/* avoided by allowing any bracket notation in an */
/* instance name other than that used by the .ext */
/* file for dealing with arrays, which uses the */
/* specific syntax [xlo:xsep:xhi][ylo:ysep:yhi] and */
/* is easy enough to distinguish. */
/* NOTE: It is not clear that this needs to be */ /*
/* done during DEF read. The only confusion comes */ dptr = strchr(usename, '[');
/* from the arrays being parsed by ExtFlat when */ if (dptr != NULL) {
/* doing ext2spice. */ *dptr = '_';
dptr = strchr(dptr + 1, ']');
dptr = strchr(usename, '['); if (dptr != NULL) *dptr = '_';
if (dptr != NULL) { }
*dptr = '_'; */
dptr = strchr(dptr + 1, ']');
if (dptr != NULL) *dptr = '_';
}
token = LefNextToken(f, TRUE); token = LefNextToken(f, TRUE);