Merge branch 'master' into magic-8.2

This commit is contained in:
Tim Edwards 2020-01-03 03:00:07 -05:00
commit 2311f1aee4
18 changed files with 118 additions and 35 deletions

View File

@ -746,8 +746,11 @@ calmaProcessDef(def, outf)
/* Read the cell in if it is not already available. */
if ((def->cd_flags & CDAVAILABLE) == 0)
if (!DBCellRead(def, (char *) NULL, TRUE, FALSE, NULL))
{
bool dereference = (def->cd_flags & CDDEREFERENCE) ? TRUE : FALSE;
if (!DBCellRead(def, (char *) NULL, TRUE, dereference, NULL))
return (0);
}
/*
* Output the definitions for any of our descendants that have

View File

@ -312,7 +312,8 @@ cifOut(outf)
/* Read the cell in if it is not already available. */
if ((def->cd_flags & CDAVAILABLE) == 0)
{
if (!DBCellRead(def, (char *) NULL, TRUE, FALSE, NULL)) continue;
bool dereference = (def->cd_flags & CDDEREFERENCE) ? TRUE : FALSE;
if (!DBCellRead(def, (char *) NULL, TRUE, dereference, NULL)) continue;
}
/* Add any subcells to the stack. This must be done before

View File

@ -3650,7 +3650,7 @@ cmdDumpParseArgs(cmdName, w, cmd, dummy, scx)
{
Point childPoint, editPoint, rootPoint;
CellDef *def, *rootDef, *editDef;
bool hasChild, hasRoot, hasTrans;
bool hasChild, hasRoot, hasTrans, dereference;
Rect rootBox, bbox;
Transform *tx_cell, trans_cell;
char **av;
@ -3750,7 +3750,8 @@ cmdDumpParseArgs(cmdName, w, cmd, dummy, scx)
* looked for then no new error message will be printed.
*/
def->cd_flags &= ~CDNOTFOUND;
if (!DBCellRead(def, (char *) NULL, TRUE, FALSE, NULL))
dereference = (def->cd_flags & CDDEREFERENCE) ? TRUE : FALSE;
if (!DBCellRead(def, (char *) NULL, TRUE, dereference, NULL))
return (FALSE);
DBReComputeBbox(def);
dummy->cu_def = def;

View File

@ -130,7 +130,11 @@ CmdEdit(w, cmd)
return;
}
else if (!(EditCellUse->cu_def->cd_flags & CDAVAILABLE))
DBCellRead(EditCellUse->cu_def, (char *)NULL, TRUE, FALSE, NULL);
{
bool dereference = (EditCellUse->cu_def->cd_flags & CDDEREFERENCE) ?
TRUE : FALSE;
DBCellRead(EditCellUse->cu_def, (char *)NULL, TRUE, dereference, NULL);
}
if (EditCellUse->cu_def->cd_flags & CDNOEDIT)
{

View File

@ -288,6 +288,7 @@ cmdFlushCell(def)
CellDef *def;
{
CellUse *parentUse;
bool dereference;
/* Disallow flushing a cell that contains the edit cell as a child */
if (EditCellUse && (EditCellUse->cu_parent == def))
@ -309,7 +310,8 @@ cmdFlushCell(def)
}
DBCellClearDef(def);
DBCellClearAvail(def);
(void) DBCellRead(def, (char *) NULL, TRUE, FALSE, NULL);
dereference = (def->cd_flags & CDDEREFERENCE) ? TRUE : FALSE;
(void) DBCellRead(def, (char *) NULL, TRUE, dereference, NULL);
DBCellSetAvail(def);
DBReComputeBbox(def);
DBCellSetModified(def, FALSE);

View File

@ -188,7 +188,10 @@ dbCellTileSrFunc(scx, fp)
if (!DBDescendSubcell(scx->scx_use, fp->tf_xmask))
return 0;
if ((def->cd_flags & CDAVAILABLE) == 0)
if (!DBCellRead(def, (char *) NULL, TRUE, FALSE, NULL)) return 0;
{
bool dereference = (def->cd_flags & CDDEREFERENCE) ? TRUE : FALSE;
if (!DBCellRead(def, (char *) NULL, TRUE, dereference, NULL)) return 0;
}
context.tc_scx = scx;
context.tc_filter = fp;
@ -307,7 +310,10 @@ dbCellUniqueTileSrFunc(scx, fp)
if (!DBDescendSubcell(scx->scx_use, fp->tf_xmask))
return 0;
if ((def->cd_flags & CDAVAILABLE) == 0)
if (!DBCellRead(def, (char *) NULL, TRUE, FALSE, NULL)) return 0;
{
bool dereference = (def->cd_flags & CDDEREFERENCE) ? TRUE : FALSE;
if (!DBCellRead(def, (char *) NULL, TRUE, dereference, NULL)) return 0;
}
context.tc_scx = scx;
context.tc_filter = fp;
@ -418,7 +424,10 @@ DBNoTreeSrTiles(scx, mask, xMask, func, cdarg)
return 0;
if ((def->cd_flags & CDAVAILABLE) == 0)
if (!DBCellRead(def, (char *) NULL, TRUE, FALSE, NULL)) return 0;
{
bool dereference = (def->cd_flags & CDDEREFERENCE) ? TRUE : FALSE;
if (!DBCellRead(def, (char *) NULL, TRUE, dereference, NULL)) return 0;
}
filter.tf_func = func;
filter.tf_arg = cdarg;
@ -526,7 +535,10 @@ DBTreeSrLabels(scx, mask, xMask, tpath, flags, func, cdarg)
ASSERT(def != (CellDef *) NULL, "DBTreeSrLabels");
if (!DBDescendSubcell(cellUse, xMask)) return 0;
if ((def->cd_flags & CDAVAILABLE) == 0)
if (!DBCellRead(def, (char *) NULL, TRUE, FALSE, NULL)) return 0;
{
bool dereference = (def->cd_flags & CDDEREFERENCE) ? TRUE : FALSE;
if (!DBCellRead(def, (char *) NULL, TRUE, dereference, NULL)) return 0;
}
for (lab = def->cd_labels; lab; lab = lab->lab_next)
{
@ -627,7 +639,10 @@ dbCellLabelSrFunc(scx, fp)
ASSERT(def != (CellDef *) NULL, "dbCellLabelSrFunc");
if (!DBDescendSubcell(scx->scx_use, fp->tf_xmask)) return 0;
if ((def->cd_flags & CDAVAILABLE) == 0)
if (!DBCellRead(def, (char *) NULL, TRUE, FALSE, NULL)) return 0;
{
bool dereference = (def->cd_flags & CDDEREFERENCE) ? TRUE : FALSE;
if (!DBCellRead(def, (char *) NULL, TRUE, dereference, NULL)) return 0;
}
if (fp->tf_tpath != (TerminalPath *) NULL)
{
@ -741,8 +756,11 @@ DBTreeSrCells(scx, xMask, func, cdarg)
if (!DBDescendSubcell(cellUse, xMask))
return 0;
if ((cellUse->cu_def->cd_flags & CDAVAILABLE) == 0)
if (!DBCellRead(cellUse->cu_def, (char *) NULL, TRUE, FALSE, NULL))
{
bool dereference = (cellUse->cu_def->cd_flags & CDDEREFERENCE) ? TRUE : FALSE;
if (!DBCellRead(cellUse->cu_def, (char *) NULL, TRUE, dereference, NULL))
return 0;
}
context.tc_scx = scx;
context.tc_filter = &filter;
@ -787,8 +805,11 @@ dbTreeCellSrFunc(scx, fp)
else
{
if ((use->cu_def->cd_flags & CDAVAILABLE) == 0)
if (!DBCellRead(use->cu_def, (char *) NULL, TRUE, FALSE, NULL))
{
bool dereference = (use->cu_def->cd_flags & CDDEREFERENCE) ? TRUE : FALSE;
if (!DBCellRead(use->cu_def, (char *) NULL, TRUE, dereference, NULL))
return 0;
}
result = DBCellSrArea(scx, dbTreeCellSrFunc, (ClientData) fp);
}
return result;
@ -1039,8 +1060,12 @@ DBCellSrArea(scx, func, cdarg)
context.tc_scx = scx;
if ((scx->scx_use->cu_def->cd_flags & CDAVAILABLE) == 0)
if (!DBCellRead(scx->scx_use->cu_def, (char *) NULL, TRUE, FALSE, NULL))
{
bool dereference = (scx->scx_use->cu_def->cd_flags & CDDEREFERENCE) ?
TRUE : FALSE;
if (!DBCellRead(scx->scx_use->cu_def, (char *) NULL, TRUE, dereference, NULL))
return 0;
}
/* In order to make this work with zero-size areas, we first expand
* the area by before searching the tile plane. DbCellSrFunc will
@ -1215,7 +1240,10 @@ DBCellEnum(cellDef, func, cdarg)
filter.tf_func = func;
filter.tf_arg = cdarg;
if ((cellDef->cd_flags & CDAVAILABLE) == 0)
if (!DBCellRead(cellDef, (char *) NULL, TRUE, FALSE, NULL)) return 0;
{
bool dereference = (cellDef->cd_flags & CDDEREFERENCE) ? TRUE : FALSE;
if (!DBCellRead(cellDef, (char *) NULL, TRUE, dereference, NULL)) return 0;
}
if (TiSrArea((Tile *) NULL, cellDef->cd_planes[PL_CELL],
&TiPlaneRect, dbEnumFunc, (ClientData) &filter))
return 1;

View File

@ -73,8 +73,12 @@ DBDescendSubcell(use, xMask)
case CU_DESCEND_NO_SUBCKT:
if ((use->cu_def->cd_flags & CDAVAILABLE) == 0)
if (!DBCellRead(use->cu_def, (char *) NULL, TRUE, FALSE, NULL))
{
bool dereference = (use->cu_def->cd_flags & CDDEREFERENCE) ?
TRUE : FALSE;
if (!DBCellRead(use->cu_def, (char *) NULL, TRUE, dereference, NULL))
return FALSE;
}
return (DBIsSubcircuit(use->cu_def)) ? FALSE : TRUE;
case CU_DESCEND_NO_LOCK:

View File

@ -37,6 +37,7 @@ static char rcsid[] __attribute__ ((unused)) = "$Header: /usr/cvsroot/magic-8.0/
*/
struct expandArg
{
bool ea_deref; /* TRUE if root def dereference flag is set */
int ea_xmask; /* Expand mask. */
int (*ea_func)(); /* Function to call for each cell whose
* status is changed.
@ -81,7 +82,8 @@ DBExpand(cellUse, expandMask, expandFlag)
def = cellUse->cu_def;
if ((def->cd_flags & CDAVAILABLE) == 0)
{
if (!DBCellRead(def, (char *) NULL, TRUE, FALSE, NULL))
bool dereference = (def->cd_flags & CDDEREFERENCE) ? TRUE : FALSE;
if (!DBCellRead(def, (char *) NULL, TRUE, dereference, NULL))
return;
/* Note: we don't have to recompute the bbox here, because
* if it changed, then a timestamp violation must have occurred
@ -142,9 +144,13 @@ DBExpandAll(rootUse, rootRect, expandMask, expandFlag, func, cdarg)
int dbExpandFunc(), dbUnexpandFunc();
SearchContext scontext;
struct expandArg arg;
bool dereference = (rootUse->cu_def->cd_flags & CDDEREFERENCE) ?
TRUE : FALSE;
if ((rootUse->cu_def->cd_flags & CDAVAILABLE) == 0)
(void) DBCellRead(rootUse->cu_def, (char *) NULL, TRUE, FALSE, NULL);
{
(void) DBCellRead(rootUse->cu_def, (char *) NULL, TRUE, dereference, NULL);
}
/*
* Walk through the area and set the expansion state
@ -154,6 +160,7 @@ DBExpandAll(rootUse, rootRect, expandMask, expandFlag, func, cdarg)
arg.ea_xmask = expandMask;
arg.ea_func = func;
arg.ea_arg = cdarg;
arg.ea_deref = dereference;
scontext.scx_use = rootUse;
scontext.scx_trans = GeoIdentityTransform;
@ -193,7 +200,7 @@ dbExpandFunc(scx, arg)
/* If the cell is unavailable, then don't expand it.
*/
if ((childUse->cu_def->cd_flags & CDAVAILABLE) == 0)
if(!DBCellRead(childUse->cu_def, (char *) NULL, TRUE, FALSE, NULL))
if(!DBCellRead(childUse->cu_def, (char *) NULL, TRUE, arg->ea_deref, NULL))
{
TxError("Cell %s is unavailable. It could not be expanded.\n",
childUse->cu_def->cd_name);
@ -303,7 +310,8 @@ dbReadAreaFunc(scx)
if ((def->cd_flags & CDAVAILABLE) == 0)
{
(void) DBCellRead(def, (char *) NULL, TRUE, FALSE, NULL);
bool dereference = (def->cd_flags & CDDEREFERENCE) ? TRUE : FALSE;
(void) DBCellRead(def, (char *) NULL, TRUE, dereference, NULL);
/* Note: we don't have to invoke DBReComputeBbox here because
* if the bbox changed then there was a timestamp mismatch and
* the timestamp code will take care of the bounding box later.

View File

@ -934,7 +934,7 @@ DBCellRead(cellDef, name, ignoreTech, dereference, errptr)
* names do not match, but an attempt will be
* made to read the file anyway.
*/
bool dereference; /* If TRUE, ignore path references in the input */
bool dereference; /* If TRUE then ignore path argument to uses */
int *errptr; /* Copy of errno set by file reading routine
* is placed here, unless NULL.
*/
@ -2855,8 +2855,11 @@ DBCellWrite(cellDef, fileName)
#ifdef FILE_LOCKS
else
{
bool dereference = (cellDef->cd_flags & CDDEREFERENCE) ? TRUE : FALSE;
/* Re-aquire the lock on the new file by opening it. */
DBCellRead(cellDef, NULL, TRUE, FALSE, NULL);
DBCellRead(cellDef, NULL, TRUE, dereference, NULL);
}
#endif
}

View File

@ -294,7 +294,10 @@ DBTreeFindUse(name, use, scx)
* is read in from disk.
*/
if ((def->cd_flags & CDAVAILABLE) == 0)
(void) DBCellRead(def, (char *) NULL, TRUE, FALSE, NULL);
{
bool dereference = (def->cd_flags & CDDEREFERENCE) ? TRUE : FALSE;
(void) DBCellRead(def, (char *) NULL, TRUE, dereference, NULL);
}
cp = name;
he = HashLookOnly(&def->cd_idHash, name);
@ -343,7 +346,10 @@ DBTreeFindUse(name, use, scx)
/* Ensure that the leaf cell is read in */
def = use->cu_def;
if ((def->cd_flags & CDAVAILABLE) == 0)
(void) DBCellRead(def, (char *) NULL, TRUE, FALSE, NULL);
{
bool dereference = (def->cd_flags & CDDEREFERENCE) ? TRUE : FALSE;
(void) DBCellRead(def, (char *) NULL, dereference, NULL);
}
scx->scx_use = use;
}

View File

@ -126,6 +126,8 @@ DBFixMismatch()
while (mismatch != NULL)
{
bool dereference;
/* Be careful to remove the front element from the mismatch
* list before processing it, because while processing it we
* may add new elements to the list.
@ -137,7 +139,8 @@ DBFixMismatch()
mismatch = mismatch->mm_next;
if (cellDef->cd_flags & CDPROCESSED) continue;
(void) DBCellRead(cellDef, (char *) NULL, TRUE, FALSE, NULL);
dereference = (cellDef->cd_flags & CDDEREFERENCE) ? TRUE : FALSE;
(void) DBCellRead(cellDef, (char *) NULL, TRUE, dereference, NULL);
/* Jimmy up the cell's current bounding box, so the following
* procedure call will absolutely and positively know that

View File

@ -385,6 +385,8 @@ DBWloadWindow(window, name, ignoreTech, expand, dereference)
if (newEditDef == (CellDef *) NULL)
newEditDef = DBCellNewDef(rootname, (char *) NULL);
if (dereference) newEditDef->cd_flags |= CDDEREFERENCE;
if (!DBCellRead(newEditDef, name, ignoreTech, dereference, &error_val))
{
if (error_val == ENOENT)

View File

@ -894,13 +894,15 @@ drcFindFunc(scx, finddata)
CellDef *def;
HashEntry *h;
int drcFindFunc2();
bool dereference;
def = scx->scx_use->cu_def;
h = HashFind(finddata->deft, (char *)def);
if (HashGetValue(h) != 0) return 0;
HashSetValue(h, 1);
(void) DBCellRead(def, (char *) NULL, TRUE, FALSE, NULL);
dereference = (def->cd_flags & CDDEREFERENCE) ? TRUE : FALSE;
(void) DBCellRead(def, (char *) NULL, TRUE, dereference, NULL);
if (DBSrPaintArea((Tile *) NULL, def->cd_planes[PL_DRC_ERROR],
&def->cd_bbox, &DBAllButSpaceBits, drcFindFunc2,

View File

@ -424,7 +424,10 @@ extTreeSrPaintArea(scx, func, cdarg)
int pNum;
if ((def->cd_flags & CDAVAILABLE) == 0)
if (!DBCellRead(def, (char *) NULL, TRUE, FALSE, NULL)) return 0;
{
bool dereference = (def->cd_flags & CDDEREFERENCE) ? TRUE : FALSE;
if (!DBCellRead(def, (char *) NULL, TRUE, dereference, NULL)) return 0;
}
filter.tf_func = func;
filter.tf_arg = cdarg;
@ -461,7 +464,10 @@ extTreeSrFunc(scx, fp)
int pNum;
if ((def->cd_flags & CDAVAILABLE) == 0)
if (!DBCellRead(def, (char *) NULL, TRUE, FALSE, NULL)) return (0);
{
bool dereference = (def->cd_flags & CDDEREFERENCE) ? TRUE : FALSE;
if (!DBCellRead(def, (char *) NULL, TRUE, dereference, NULL)) return (0);
}
context.tc_scx = scx;
context.tc_filter = fp;
@ -548,8 +554,12 @@ extCellSrArea(scx, func, cdarg)
filter.tf_arg = cdarg;
if ((scx->scx_use->cu_def->cd_flags & CDAVAILABLE) == 0)
if (!DBCellRead(scx->scx_use->cu_def, (char *) NULL, TRUE, FALSE, NULL))
{
bool dereference = (scx->scx_use->cu_def->cd_flags & CDDEREFERENCE) ?
TRUE : FALSE;
if (!DBCellRead(scx->scx_use->cu_def, (char *) NULL, TRUE, dereference, NULL))
return 0;
}
/*
* In order to make this work with zero-size areas, we first expand

View File

@ -1389,12 +1389,14 @@ W3DloadWindow(window, name)
CellDef *newEditDef;
CellUse *newEditUse;
Rect loadBox;
bool dereference;
newEditDef = DBCellLookDef(name);
if (newEditDef == (CellDef *)NULL)
return FALSE;
if (!DBCellRead(newEditDef, (char *)NULL, TRUE, FALSE, NULL))
dereference = (newEditDef->cd_flags & CDDEREFERENCE) ? TRUE : FALSE;
if (!DBCellRead(newEditDef, (char *)NULL, TRUE, dereference, NULL))
return FALSE;
DBReComputeBbox(newEditDef);

View File

@ -1487,11 +1487,14 @@ DefReadComponents(f, rootDef, sname, oscale, total)
if (defMacro == (CellDef *)NULL)
{
bool dereference;
/* Before giving up, assume that this cell has a */
/* magic .mag layout file. */
defMacro = DBCellNewDef(token, (char *)NULL);
defMacro->cd_flags &= ~CDNOTFOUND;
if (!DBCellRead(defMacro, (char *)NULL, TRUE, FALSE, NULL))
dereference = (defMacro->cd_flags & CDDEREFERENCE) ? TRUE : FALSE;
if (!DBCellRead(defMacro, (char *)NULL, TRUE, dereference, NULL))
{
LefError(DEF_ERROR, "Cell %s is not defined. Maybe you "
"have not read the corresponding LEF file?\n",

View File

@ -789,7 +789,10 @@ SimCellTileSrFunc(scx, fp)
if (!DBDescendSubcell(scx->scx_use, fp->tf_xmask))
return 0;
if ((def->cd_flags & CDAVAILABLE) == 0)
if (!DBCellRead(def, (char *) NULL, TRUE, FALSE, NULL)) return 0;
{
bool dereference = (def->cd_flags & CDDEREFERENCE) ? TRUE : FALSE;
if (!DBCellRead(def, (char *) NULL, TRUE, dereference, NULL)) return 0;
}
context.tc_scx = scx;
context.tc_filter = fp;

View File

@ -2,9 +2,7 @@ args.o: args.c ../utils/magic.h ../utils/utils.h
child.o: child.c ../utils/utils.h ../utils/magic.h ../utils/malloc.h
dqueue.o: dqueue.c ../utils/magic.h ../utils/dqueue.h ../utils/malloc.h
finddisp.o: finddisp.c ../utils/magic.h ../utils/utils.h
flock.o: flock.c ../utils/magic.h ../utils/hash.h ../utils/geometry.h \
../tiles/tile.h ../database/database.h ../windows/windows.h \
../utils/malloc.h
flock.o: flock.c
flsbuf.o: flsbuf.c
fraction.o: fraction.c ../utils/magic.h ../utils/geometry.h
geometry.o: geometry.c ../utils/magic.h ../utils/geometry.h \