Changed the automatic search for tech files from the "tech" line in

a .mag file to include the original system path.  This restores the
ability to find the tech file for any cell created using the old
SCMOS technologies.  This method is as problematic as is the way
all SCMOS tech files used the same name "scmos".  But at least it
preserves backwards-compatible behavior (behavior prior to 8.3.471).
This commit corrects github issue #306.
This commit is contained in:
Tim Edwards
2024-05-03 21:43:27 -04:00
parent fe9ca3a4ce
commit 3dc5018af4
2 changed files with 36 additions and 19 deletions
+1 -1
View File
@@ -1 +1 @@
8.3.476 8.3.477
+35 -18
View File
@@ -497,6 +497,7 @@ dbCellReadDef(f, cellDef, ignoreTech, dereference)
int n = 1, d = 1; int n = 1, d = 1;
HashTable dbUseTable; HashTable dbUseTable;
bool needcleanup = FALSE; bool needcleanup = FALSE;
bool hasrcfile = FALSE;
/* /*
* It's very important to disable interrupts during the body of * It's very important to disable interrupts during the body of
@@ -556,7 +557,7 @@ dbCellReadDef(f, cellDef, ignoreTech, dereference)
* magic/ and look for a compatible techfile there. * magic/ and look for a compatible techfile there.
*/ */
char *found = NULL; char *found = NULL;
char *string, *techfullname; char *sptr, *string, *techfullname;
techfullname = mallocMagic(strlen(tech) + 6); techfullname = mallocMagic(strlen(tech) + 6);
sprintf(techfullname, "%s.tech", tech); sprintf(techfullname, "%s.tech", tech);
@@ -621,45 +622,61 @@ dbCellReadDef(f, cellDef, ignoreTech, dereference)
found = DBSearchForTech(techfullname, tech, string, 0); found = DBSearchForTech(techfullname, tech, string, 0);
} }
/* Experimental---check for a ".magicrc" file in */ /* Check for a ".magicrc" file in the same directory */
/* the same directory as ".tech" and source it */ /* as ".tech" and source it first. */
/* first. */
if (found) if (found)
{ {
char *rcpath; char *rcpath;
FILE *tmpf;
rcpath = (char *)mallocMagic(strlen(found) + strlen(tech) rcpath = (char *)mallocMagic(strlen(found) + strlen(tech)
+ 10); + 10);
sprintf(rcpath, "%s/%s.magicrc", found, tech); sprintf(rcpath, "%s/%s.magicrc", found, tech);
Tcl_EvalFile(magicinterp, rcpath); if ((tmpf = fopen(rcpath, "r")) != NULL)
{
fclose(tmpf);
Tcl_EvalFile(magicinterp, rcpath);
hasrcfile = TRUE;
}
freeMagic(rcpath); freeMagic(rcpath);
} }
#endif #endif
freeMagic(techfullname); freeMagic(techfullname);
if (found) if (found)
{
char *sptr;
PaAppend(&SysLibPath, found); PaAppend(&SysLibPath, found);
TxError("Loading technology %s\n", tech); TxError("Loading technology %s\n", tech);
if (!TechLoad(tech, 0)) result = TechLoad(tech, 0);
TxError("Error in loading technology file\n"); if (!result)
else if ((sptr = strstr(found, "libs.tech")) != NULL) TxError("Error in loading technology file\n");
else if (found)
{
if ((sptr = strstr(found, "libs.tech")) != NULL)
{ {
int paths = 0; int paths = 0;
/* Additional automatic handling of open_pdks- */
/* style PDKs. Append the libs.ref libraries */
/* to the cell search path. */
strcpy(sptr + 5, "ref"); if (hasrcfile == FALSE)
paths = DBAddStandardCellPaths(found, 0); {
if (paths > 0) /* Additional automatic handling of open_pdks- */
TxPrintf("Cell path is now \"%s\"\n", CellLibPath); /* style PDKs. Append the libs.ref libraries */
/* to the cell search path. Do this only if a */
/* magicrc file was not associated with the PDK */
/* as the magicrc file is expected to set the */
/* search path. */
strcpy(sptr + 5, "ref");
paths = DBAddStandardCellPaths(found, 0);
if (paths > 0)
TxPrintf("Cell path is now \"%s\"\n", CellLibPath);
}
} }
freeMagic(found); freeMagic(found);
}
#ifdef MAGIC_WRAPPER #ifdef MAGIC_WRAPPER
if (result)
{
/* Apply tag callbacks for "tech load" command */ /* Apply tag callbacks for "tech load" command */
{ {
char *argv[2]; char *argv[2];