Decided that a different approach needed to be taken for having

timestamps that are fixed, since the timestamp update routine is
called from too many places, too many times.  Instead created a
new cell definition flag indicating a fixed timestamp, which can
be set by "cellname timestamp" for an individual cell, or with
"gds datestamp" for cells read from a GDS file.
This commit is contained in:
Tim Edwards 2022-01-22 11:18:32 -05:00
parent 3065d4cc4b
commit e1aedc6f41
6 changed files with 96 additions and 32 deletions

View File

@ -1 +1 @@
8.3.260 8.3.261

View File

@ -400,7 +400,11 @@ calmaParseStructure(filename)
if (CalmaDateStamp == NULL) if (CalmaDateStamp == NULL)
cifReadCellDef->cd_timestamp = timestampval; cifReadCellDef->cd_timestamp = timestampval;
else else
{
cifReadCellDef->cd_timestamp = *CalmaDateStamp; cifReadCellDef->cd_timestamp = *CalmaDateStamp;
if (*CalmaDateStamp != (time_t)0)
cifReadCellDef->cd_flags |= CDFIXEDSTAMP;
}
/* For read-only cells, set flag in def */ /* For read-only cells, set flag in def */
if (CalmaReadOnly) if (CalmaReadOnly)

View File

@ -1378,11 +1378,20 @@ CmdCellname(w, cmd)
} }
else if (locargc == 4 || (locargc == 3 && cellname == NULL)) else if (locargc == 4 || (locargc == 3 && cellname == NULL))
{ {
int timestamp = atoi(cmd->tx_argv[2 + ((cellname == NULL) ? 0 : 1)]); int timestamp;
if (timestamp != cellDef->cd_timestamp) if (StrIsInt(cmd->tx_argv[2 + ((cellname == NULL) ? 0 : 1)]))
{ {
cellDef->cd_timestamp = timestamp; timestamp = atoi(cmd->tx_argv[2 + ((cellname == NULL) ? 0 : 1)]);
cellDef->cd_flags &= ~CDGETNEWSTAMP; if (timestamp != cellDef->cd_timestamp)
{
cellDef->cd_timestamp = timestamp;
cellDef->cd_flags &= ~CDGETNEWSTAMP | CDFIXEDSTAMP;
}
}
else
{
TxError("Invalid timestamp \"%s\".\n",
cmd->tx_argv[2 + ((cellname == NULL) ? 0 : 1)]);
} }
} }
break; break;
@ -1398,12 +1407,46 @@ CmdCellname(w, cmd)
break; break;
} }
#ifdef MAGIC_WRAPPER #ifdef MAGIC_WRAPPER
/* All of the flags are included for completeness. A number
* of these flags are set in self-contained routines and will
* never appear as the result of the "cellname flags" command.
* Mainly for diagnostics (in case a routine is not cleaning
* up its own flag settings, for example).
*/
if (cellDef->cd_flags & CDAVAILABLE) if (cellDef->cd_flags & CDAVAILABLE)
Tcl_AppendElement(magicinterp, "available"); Tcl_AppendElement(magicinterp, "available");
if (cellDef->cd_flags & CDMODIFIED) if (cellDef->cd_flags & CDMODIFIED)
Tcl_AppendElement(magicinterp, "modified"); Tcl_AppendElement(magicinterp, "modified");
if (cellDef->cd_flags & CDNOEDIT) if (cellDef->cd_flags & CDNOEDIT)
Tcl_AppendElement(magicinterp, "readonly"); Tcl_AppendElement(magicinterp, "readonly");
if (cellDef->cd_flags & CDINTERNAL)
Tcl_AppendElement(magicinterp, "internal");
if (cellDef->cd_flags & CDFIXEDSTAMP)
Tcl_AppendElement(magicinterp, "fixed-timestamp");
if (cellDef->cd_flags & CDGETNEWSTAMP)
Tcl_AppendElement(magicinterp, "timestamp-pending");
if (cellDef->cd_flags & CDSTAMPSCHANGED)
Tcl_AppendElement(magicinterp, "child-timestamp-changed");
if (cellDef->cd_flags & CDFIXEDBBOX)
Tcl_AppendElement(magicinterp, "fixed-bbox");
if (cellDef->cd_flags & CDBOXESCHANGED)
Tcl_AppendElement(magicinterp, "bbox-changed");
if (cellDef->cd_flags & CDPROCESSED)
Tcl_AppendElement(magicinterp, "bbox-processed");
if (cellDef->cd_flags & CDFLATGDS)
Tcl_AppendElement(magicinterp, "flat-gds");
if (cellDef->cd_flags & CDFLATTENED)
Tcl_AppendElement(magicinterp, "flattened-gds");
if (cellDef->cd_flags & CDPROCESSEDGDS)
Tcl_AppendElement(magicinterp, "processed-gds");
if (cellDef->cd_flags & CDVENDORGDS)
Tcl_AppendElement(magicinterp, "vendor-gds");
if (cellDef->cd_flags & CDVISITED)
Tcl_AppendElement(magicinterp, "visited");
if (cellDef->cd_flags & CDDEREFERENCE)
Tcl_AppendElement(magicinterp, "dereference");
if (cellDef->cd_flags & CDNOTFOUND)
Tcl_AppendElement(magicinterp, "not-found");
#else #else
TxPrintf("Flag settings for cell %s:\n", cellname); TxPrintf("Flag settings for cell %s:\n", cellname);
TxPrintf("in database: %s\n", (cellDef->cd_flags & CDAVAILABLE) ? TxPrintf("in database: %s\n", (cellDef->cd_flags & CDAVAILABLE) ?
@ -1412,6 +1455,12 @@ CmdCellname(w, cmd)
"true" : "false"); "true" : "false");
TxPrintf("readonly: %s\n", (cellDef->cd_flags & CDNOEDIT) ? TxPrintf("readonly: %s\n", (cellDef->cd_flags & CDNOEDIT) ?
"true" : "false"); "true" : "false");
TxPrintf("vendor: %s\n", (cellDef->cd_flags & CDVENDORGDS) ?
"true" : "false");
TxPrintf("fixed-bbox: %s\n", (cellDef->cd_flags & CDFIXEDBBOX) ?
"true" : "false");
TxPrintf("fixed-timestamp: %s\n", (cellDef->cd_flags & CDFIXEDSTAMP) ?
"true" : "false");
#endif #endif
break; break;
case IDX_RENAME: case IDX_RENAME:

View File

@ -1809,7 +1809,6 @@ CmdWire(w, cmd)
#define OPT_WRITEALL_FORCE 0 #define OPT_WRITEALL_FORCE 0
#define OPT_WRITEALL_MODIFIED 1 #define OPT_WRITEALL_MODIFIED 1
#define OPT_WRITEALL_NOUPDATE 2
void void
CmdWriteall(w, cmd) CmdWriteall(w, cmd)
@ -1818,7 +1817,7 @@ CmdWriteall(w, cmd)
{ {
int cmdWriteallFunc(); int cmdWriteallFunc();
int option = -1; int option = -1;
static char *writeallOpts[] = { "force", "modified", "noupdate", 0 }; static char *writeallOpts[] = { "force", "modified", 0 };
int argc; int argc;
int flags = CDMODIFIED | CDBOXESCHANGED | CDSTAMPSCHANGED; int flags = CDMODIFIED | CDBOXESCHANGED | CDSTAMPSCHANGED;
@ -1848,15 +1847,13 @@ CmdWriteall(w, cmd)
TxError("No such cell \"%s\".\n", cmd->tx_argv[i]); TxError("No such cell \"%s\".\n", cmd->tx_argv[i]);
notfound++; notfound++;
} }
else if (option != OPT_WRITEALL_NOUPDATE) DBUpdateStamps(def);
DBUpdateStamps(def);
} }
if (notfound == cmd->tx_argc - 2) return; if (notfound == cmd->tx_argc - 2) return;
} }
} }
if (option != OPT_WRITEALL_NOUPDATE) if (cmd->tx_argc <= 2)
if (cmd->tx_argc <= 2) DBUpdateStamps(NULL);
DBUpdateStamps(NULL);
argc = cmd->tx_argc; argc = cmd->tx_argc;
(void) DBCellSrDefs(flags, cmdWriteallFunc, (ClientData)cmd); (void) DBCellSrDefs(flags, cmdWriteallFunc, (ClientData)cmd);

View File

@ -214,11 +214,18 @@ DBUpdateStamps(def)
extern time_t time(); extern time_t time();
DBFixMismatch(); DBFixMismatch();
timestamp = time((time_t *) 0); timestamp = time((time_t *) 0);
if (def == NULL) if (def == NULL)
(void) DBCellSrDefs(CDGETNEWSTAMP, dbStampFunc, (ClientData) NULL); (void) DBCellSrDefs(CDGETNEWSTAMP, dbStampFunc, (ClientData) NULL);
else if (def->cd_flags & CDGETNEWSTAMP) else if (def->cd_flags & CDGETNEWSTAMP)
dbStampFunc(def); {
if (def->cd_flags & CDFIXEDSTAMP)
def->cd_flags &= ~CDGETNEWSTAMP;
else
dbStampFunc(def);
}
} }
int int
@ -234,11 +241,12 @@ dbStampFunc(cellDef)
if (cellDef->cd_timestamp == timestamp) return 0; if (cellDef->cd_timestamp == timestamp) return 0;
cellDef->cd_timestamp = timestamp; if (!(cellDef->cd_flags & CDFIXEDSTAMP))
cellDef->cd_timestamp = timestamp;
cellDef->cd_flags &= ~CDGETNEWSTAMP; cellDef->cd_flags &= ~CDGETNEWSTAMP;
/* printf("Writing new timestamp %d for %s.\n", // printf("Writing new timestamp %d for %s.\n", timestamp, cellDef->cd_name);
timestamp, cellDef->cd_name); */
/* If a child's stamp has changed, then the stamps must change /* If a child's stamp has changed, then the stamps must change
* in all its parents too. When the hierarchical DRC becomes * in all its parents too. When the hierarchical DRC becomes

View File

@ -411,24 +411,30 @@ typedef struct celldef
* CDDEREFERENCE is a flag indicating that when loading or expanding * CDDEREFERENCE is a flag indicating that when loading or expanding
* children of a cell, the path should be ignored and the cell * children of a cell, the path should be ignored and the cell
* path should be searched for the location. * path should be searched for the location.
* CDFIXEDSTAMP is a flag indicating that the cell has a fixed
* timestamp that should not be modified. This should be used
* with caution as it messes with the usual timestamp tracking,
* but is useful for preparing libraries all cells of which have
* the same timestamp value.
*/ */
#define CDAVAILABLE 0x0001 #define CDAVAILABLE 0x00001
#define CDMODIFIED 0x0002 #define CDMODIFIED 0x00002
#define CDNOTFOUND 0x0004 #define CDNOTFOUND 0x00004
#define CDINTERNAL 0x0008 #define CDINTERNAL 0x00008
#define CDGETNEWSTAMP 0x0010 #define CDGETNEWSTAMP 0x00010
#define CDSTAMPSCHANGED 0x0020 #define CDSTAMPSCHANGED 0x00020
#define CDBOXESCHANGED 0x0040 #define CDBOXESCHANGED 0x00040
#define CDFIXEDBBOX 0x0080 #define CDFIXEDBBOX 0x00080
#define CDNOEDIT 0x0100 #define CDNOEDIT 0x00100
#define CDPROCESSED 0x0200 #define CDPROCESSED 0x00200
#define CDFLATGDS 0x0400 #define CDFLATGDS 0x00400
#define CDFLATTENED 0x0800 #define CDFLATTENED 0x00800
#define CDPROCESSEDGDS 0x1000 #define CDPROCESSEDGDS 0x01000
#define CDVENDORGDS 0x2000 #define CDVENDORGDS 0x02000
#define CDVISITED 0x4000 #define CDVISITED 0x04000
#define CDDEREFERENCE 0x8000 #define CDDEREFERENCE 0x08000
#define CDFIXEDSTAMP 0x10000
/* /*
* Description of an array. * Description of an array.