From 89f1c4ee67ceb834ceeba352192d8f9aa51fbd93 Mon Sep 17 00:00:00 2001 From: Tim Edwards Date: Fri, 28 Jul 2023 09:40:41 -0400 Subject: [PATCH] Corrected a previous implementation that was supposed to not print warning messages about ports being electrically connected when those ports have names that match under rules of case-insensitivity, and the .ext file is being read for the purpose of generating a SPICE netlist, which is case-insensitive. Also: Corrected a crash condition when using "extract path " when directory does not exist. --- VERSION | 2 +- ext2sim/ext2sim.c | 4 ++-- ext2spice/ext2spice.c | 4 ++-- extcheck/extcheck.c | 2 +- extflat/EFantenna.c | 2 +- extflat/EFbuild.c | 6 +++--- extflat/EFread.c | 20 ++++++++++++-------- extflat/extflat.h | 21 --------------------- extract/ExtCell.c | 6 ++++++ lef/defWrite.c | 2 +- 10 files changed, 29 insertions(+), 40 deletions(-) diff --git a/VERSION b/VERSION index cf39b3db..9107f86f 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -8.3.417 +8.3.418 diff --git a/ext2sim/ext2sim.c b/ext2sim/ext2sim.c index 17277a91..a4e87cbd 100644 --- a/ext2sim/ext2sim.c +++ b/ext2sim/ext2sim.c @@ -615,7 +615,7 @@ runexttosim: } /* Read the hierarchical description of the input circuit */ - if (EFReadFile(inName, FALSE, esDoSimExtResis, FALSE) == FALSE) + if (EFReadFile(inName, FALSE, esDoSimExtResis, FALSE, FALSE) == FALSE) { EFDone(); return /* TCL_ERROR */; @@ -791,7 +791,7 @@ main(argc, argv) } /* Read the hierarchical description of the input circuit */ - if (EFReadFile(inName, FALSE, esDoSimExtResis, FALSE) == FALSE) + if (EFReadFile(inName, FALSE, esDoSimExtResis, FALSE, FALSE) == FALSE) { exit(1); } diff --git a/ext2spice/ext2spice.c b/ext2spice/ext2spice.c index 1a9635fa..7fd9681d 100644 --- a/ext2spice/ext2spice.c +++ b/ext2spice/ext2spice.c @@ -875,7 +875,7 @@ runexttospice: sprintf(spcesDefaultOut, "%s.spice", inName); /* Read the hierarchical description of the input circuit */ - if (EFReadFile(inName, TRUE, esDoExtResis, FALSE) == FALSE) + if (EFReadFile(inName, TRUE, esDoExtResis, FALSE, TRUE) == FALSE) { EFDone(); return; @@ -1230,7 +1230,7 @@ main(argc, argv) } /* Read the hierarchical description of the input circuit */ - if (EFReadFile(inName, TRUE, esDoExtResis, FALSE) == FALSE) + if (EFReadFile(inName, TRUE, esDoExtResis, FALSE, TRUE) == FALSE) { exit (1); } diff --git a/extcheck/extcheck.c b/extcheck/extcheck.c index ed0f66ee..5a71cf5b 100644 --- a/extcheck/extcheck.c +++ b/extcheck/extcheck.c @@ -74,7 +74,7 @@ main(argc, argv) exit (1); /* Read the hierarchical description of the input circuit */ - EFReadFile(inName, FALSE, FALSE, FALSE); + EFReadFile(inName, FALSE, FALSE, FALSE, FALSE); if (EFArgTech) EFTech = StrDup((char **) NULL, EFArgTech); if (EFScale == 0.0) EFScale = 1.0; diff --git a/extflat/EFantenna.c b/extflat/EFantenna.c index 02529cb2..c0a9725e 100644 --- a/extflat/EFantenna.c +++ b/extflat/EFantenna.c @@ -224,7 +224,7 @@ runantennacheck: /* Read the hierarchical description of the input circuit */ TxPrintf("Reading extract file.\n"); - if (EFReadFile(inName, FALSE, FALSE, FALSE) == FALSE) + if (EFReadFile(inName, FALSE, FALSE, FALSE, FALSE) == FALSE) { EFDone(); return /* TCL_ERROR */; diff --git a/extflat/EFbuild.c b/extflat/EFbuild.c index 0f4c4fab..4ef61dbd 100644 --- a/extflat/EFbuild.c +++ b/extflat/EFbuild.c @@ -498,9 +498,9 @@ efBuildEquiv(def, nodeName1, nodeName2, resist, isspice) * or nodeName2 must already be known. */ bool resist; /* True if "extresist on" option was selected */ - bool isspice; /* Passed from "dosubckt" in EFReadFile(), is only - * TRUE when running ext2spice. Indicates that nodes - * are case-insensitive. + bool isspice; /* Passed from EFReadFile(), is only TRUE when + * running ext2spice. Indicates that nodes are + * case-insensitive. */ { EFNodeName *nn1, *nn2; diff --git a/extflat/EFread.c b/extflat/EFread.c index 2201bf32..9ea115ba 100644 --- a/extflat/EFread.c +++ b/extflat/EFread.c @@ -121,7 +121,10 @@ static bool efReadDef(); * name of 'name', allocates a new one. Calls efReadDef to do the * work of reading the def itself. If 'dosubckt' is true, then port * mappings are kept. If 'resist' is true, read in the .res.ext file - * (from extresist) if it exists, after reading the .ext file. + * (from extresist) if it exists, after reading the .ext file. If + * "isspice" is true, then the .ext file is being read for SPICE + * netlist generation, and node names should be treated as case- + * insensitive. * * Results: * Passes on the return value of efReadDef (see below) @@ -136,9 +139,9 @@ static bool efReadDef(); */ bool -EFReadFile(name, dosubckt, resist, noscale) +EFReadFile(name, dosubckt, resist, noscale, isspice) char *name; /* Name of def to be read in */ - bool dosubckt, resist, noscale; + bool dosubckt, resist, noscale, isspice; { Def *def; bool rc; @@ -148,7 +151,7 @@ EFReadFile(name, dosubckt, resist, noscale) def = efDefNew(name); locScale = 1.0; - rc = efReadDef(def, dosubckt, resist, noscale, TRUE); + rc = efReadDef(def, dosubckt, resist, noscale, TRUE, isspice); if (EFArgTech) EFTech = StrDup((char **) NULL, EFArgTech); if (EFScale == 0.0) EFScale = 1.0; @@ -176,9 +179,9 @@ EFReadFile(name, dosubckt, resist, noscale) */ bool -efReadDef(def, dosubckt, resist, noscale, toplevel) +efReadDef(def, dosubckt, resist, noscale, toplevel, isspice) Def *def; - bool dosubckt, resist, noscale, toplevel; + bool dosubckt, resist, noscale, toplevel, isspice; { int argc, ac, n; CellDef *dbdef; @@ -325,7 +328,7 @@ readfile: /* equiv node1 node2 */ case EQUIV: - efBuildEquiv(def, argv[1], argv[2], resist, dosubckt); + efBuildEquiv(def, argv[1], argv[2], resist, isspice); break; /* replaces "fet" (below) */ @@ -645,7 +648,8 @@ resistChanged: { use = (Use *)HashGetValue(he); if ((use->use_def->def_flags & DEF_AVAILABLE) == 0) - if (efReadDef(use->use_def, DoSubCircuit, resist, noscale, FALSE) != TRUE) + if (efReadDef(use->use_def, DoSubCircuit, resist, noscale, FALSE, + isspice) != TRUE) rc = FALSE; } diff --git a/extflat/extflat.h b/extflat/extflat.h index befd871c..f61d1930 100644 --- a/extflat/extflat.h +++ b/extflat/extflat.h @@ -418,25 +418,4 @@ extern int EFHierVisitResists(); extern int EFHierVisitCaps(); extern int EFHierVisitNodes(); - -/* ------------------------- constants used by clients -------------- */ - -/* - * ANSI C definitions of arguments to EFvisit procedures - */ - -/* - left for documentation purposes - -typedef int (*capproc)(HierName *, HierName *, double, ClientData ); - -extern int EFVisitCaps(capproc, ClientData ); - -typedef int (*nodeproc)(EFNode *, int , double, ClientData ); - -extern int EFVisitNodes(nodeproc , ClientData ); - -extern int EFReadFile(char *); - -*/ - #endif /* _EXTFLAT_H */ diff --git a/extract/ExtCell.c b/extract/ExtCell.c index 997eca19..48d33751 100644 --- a/extract/ExtCell.c +++ b/extract/ExtCell.c @@ -195,6 +195,12 @@ extFileOpen(def, file, mode, prealfile) ExtLocalPath); name = def->cd_name; /* Save locally */ } + else + { + /* Save locally in specified path, which was just created */ + name = namebuf; + sprintf(namebuf, "%s/%s", ExtLocalPath, def->cd_name); + } } else { diff --git a/lef/defWrite.c b/lef/defWrite.c index 088ade10..44ace580 100644 --- a/lef/defWrite.c +++ b/lef/defWrite.c @@ -265,7 +265,7 @@ defCountNets(rootDef, allSpecial) EFScale = 0.0; /* Allows EFScale to be set to the scale value */ - if (EFReadFile(rootDef->cd_name, TRUE, FALSE, TRUE)) + if (EFReadFile(rootDef->cd_name, TRUE, FALSE, TRUE, FALSE)) { EFFlatBuild(rootDef->cd_name, EF_FLATNODES | EF_NOFLATSUBCKT); EFVisitNodes(defnodeCount, (ClientData)&total);