Skip to content

Commit

Permalink
Corrected one major error which will cause magic to fail to find the
Browse files Browse the repository at this point in the history
".res.ext" file from "extresist" after using "extract do local" (and
probably with "extract path" as well).  Fixed this, and also made
sure that "extresist" writes the ".res.ext" file to the same location
as ".ext" always, so that handling is consistent throughout the
full R-C extraction process, across the use of "extract", "ext2sim",
"extresist", and "ext2spice".
  • Loading branch information
RTimothyEdwards committed Aug 6, 2023
1 parent 952b20d commit 22fbb28
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 4 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
8.3.421
8.3.422
30 changes: 28 additions & 2 deletions extflat/EFread.c
Original file line number Diff line number Diff line change
Expand Up @@ -623,13 +623,39 @@ efReadDef(def, dosubckt, resist, noscale, toplevel, isspice)
break;
}
}
(void) fclose(inf);
fclose(inf);
inf = (FILE *)NULL;

/* Is there an "extresist" extract file? */
if (DoResist)
{
DoResist = FALSE; /* do this only once */
inf = PaOpen(name, "r", ".res.ext", EFSearchPath, EFLibPath, &efReadFileName);
if (EFSearchPath != NULL)
inf = PaOpen(name, "r", ".res.ext", EFSearchPath,
EFLibPath, &efReadFileName);

if ((inf == NULL) && (dbdef = DBCellLookDef(name)) != NULL)
{
/* If cell is in main database, check if there is a file path set. */
if (dbdef->cd_file != NULL)
{
char *filepath, *sptr;

filepath = StrDup((char **)NULL, dbdef->cd_file);
sptr = strrchr(filepath, '/');
if (sptr) {
*sptr = '\0';
inf = PaOpen(name, "r", ".res.ext", filepath,
EFLibPath, &efReadFileName);
}
freeMagic(filepath);
}
}

/* Try with the standard search path */
if ((inf == NULL) && (EFSearchPath == NULL))
inf = PaOpen(name, "r", ".res.ext", Path, EFLibPath, &efReadFileName);

if (inf != NULL)
goto readfile;
}
Expand Down
12 changes: 11 additions & 1 deletion resis/ResRex.c
Original file line number Diff line number Diff line change
Expand Up @@ -975,7 +975,17 @@ ResCheckSimNodes(celldef, resisdata)

if (ResOptionsFlags & ResOpt_DoExtFile)
{
ResExtFile = PaOpen(outfile,"w",".res.ext",".",(char *) NULL, (char **) NULL);
if (ExtLocalPath != NULL)
if (strcmp(ExtLocalPath, "."))
{
char *namebuf;
namebuf = mallocMagic(strlen(ExtLocalPath) + strlen(celldef->cd_name)
+ 2);
sprintf(namebuf, "%s/%s", ExtLocalPath, celldef->cd_name);
outfile = namebuf;
}
ResExtFile = PaOpen(outfile, "w", ".res.ext", ".", (char *)NULL, (char **)NULL);
if (outfile != celldef->cd_name) freeMagic(outfile);
}
else
{
Expand Down

0 comments on commit 22fbb28

Please sign in to comment.