After much pain and suffering, finally tracked down all the places that

the timestamp is updated after reading in CIF or GDS, and managed to
get the timestamp dirty flag to remain clear after reading when
"gds datestamp" is used.  This includes a modification of the timestamp
update routine that only updates timestamps on a single file if only a
single file is being written.
This commit is contained in:
Tim Edwards 2022-01-21 22:17:54 -05:00
parent 5dd0c97dce
commit 3065d4cc4b
8 changed files with 25 additions and 14 deletions

View File

@ -550,11 +550,11 @@ calmaParseStructure(filename)
DBWAreaChanged(cifReadCellDef, &cifReadCellDef->cd_bbox,
DBW_ALLWINDOWS, &DBAllButSpaceBits);
DBCellSetModified(cifReadCellDef, TRUE);
/* Only mark cell as needing a timestamp update if the timestamp is zero */
if (cifReadCellDef->cd_timestamp != 0)
cifReadCellDef->cd_flags &= ~CDGETNEWSTAMP;
/* Note: This sets the CDGETNEWSTAMP flag, but if the timestamp is
* not zero, then it gets cleared in CIFReadCellCleanup().
*/
DBCellSetModified(cifReadCellDef, TRUE);
/*
* Assign use-identifiers to all the cell uses.

View File

@ -1660,6 +1660,10 @@ CIFReadCellCleanup(filetype)
DRCCheckThis(def, TT_CHECKPAINT, &def->cd_bbox);
DBWAreaChanged(def, &def->cd_bbox, DBW_ALLWINDOWS, &DBAllButSpaceBits);
DBCellSetModified(def, TRUE);
/* Only mark cell as needing a timestamp update if the timestamp is zero */
if (def->cd_timestamp != 0)
def->cd_flags &= ~CDGETNEWSTAMP;
}
/* Do geometrical processing on the top-level cell. */

View File

@ -209,7 +209,7 @@ CmdSave(w, cmd)
else
locDef = EditCellUse->cu_def;
DBUpdateStamps();
DBUpdateStamps(locDef);
if (cmd->tx_argc == 2)
{
char *fileName;
@ -1151,7 +1151,7 @@ CmdSelect(w, cmd)
DBStdPaintTbl(TT_CHECKPAINT, PL_DRC_CHECK),
(PaintUndoInfo *) NULL);
DBUpdateStamps();
DBUpdateStamps(SelectDef);
cmdSaveCell(SelectDef, cmd->tx_argv[2], FALSE, FALSE);
return;

View File

@ -637,7 +637,7 @@ cmdSaveCell(cellDef, newName, noninteractive, tryRename)
}
}
DBUpdateStamps();
DBUpdateStamps(cellDef);
if (!DBCellWrite(cellDef, fileName))
{
TxError("Could not write file. Cell not written.\n");

View File

@ -1837,21 +1837,26 @@ CmdWriteall(w, cmd)
/* Check if all cells exist */
if (cmd->tx_argc > 2)
{
CellDef *def;
int i;
int notfound = 0;
for (i = 2; i < cmd->tx_argc; i++)
{
if (DBCellLookDef(cmd->tx_argv[i]) == NULL)
def = DBCellLookDef(cmd->tx_argv[i]);
if (def == NULL)
{
TxError("No such cell \"%s\".\n", cmd->tx_argv[i]);
notfound++;
}
else if (option != OPT_WRITEALL_NOUPDATE)
DBUpdateStamps(def);
}
if (notfound == cmd->tx_argc - 2) return;
}
}
if (option != OPT_WRITEALL_NOUPDATE)
DBUpdateStamps();
if (cmd->tx_argc <= 2)
DBUpdateStamps(NULL);
argc = cmd->tx_argc;
(void) DBCellSrDefs(flags, cmdWriteallFunc, (ClientData)cmd);

View File

@ -1511,8 +1511,6 @@ DBScaleEverything(scalen, scaled)
int dbCellDefEnumFunc();
LinkedCellDef *lhead, *lcd;
// DBUpdateStamps();
SigDisableInterrupts();
lhead = NULL;

View File

@ -207,14 +207,18 @@ DBFixMismatch()
*/
void
DBUpdateStamps()
DBUpdateStamps(def)
CellDef *def;
{
extern int dbStampFunc();
extern time_t time();
DBFixMismatch();
timestamp = time((time_t *) 0);
(void) DBCellSrDefs(CDGETNEWSTAMP, dbStampFunc, (ClientData) NULL);
if (def == NULL)
(void) DBCellSrDefs(CDGETNEWSTAMP, dbStampFunc, (ClientData) NULL);
else if (def->cd_flags & CDGETNEWSTAMP)
dbStampFunc(def);
}
int

View File

@ -553,7 +553,7 @@ ExtIncremental(rootUse)
DBFixMismatch();
/* Update all timestamps */
DBUpdateStamps();
DBUpdateStamps(NULL);
/* Mark all defs as being unvisited */
(void) DBCellSrDefs(0, extDefInitFunc, (ClientData) 0);