From 233f9daba4f0ac540744eece20445ce0a3674d9a Mon Sep 17 00:00:00 2001 From: Holger Vogt Date: Sun, 1 Oct 2023 10:51:31 +0200 Subject: [PATCH 1/4] Remove unused instance parameter ic (initial condition of controlling source). --- src/spicelib/devices/vccs/vccs.c | 1 - src/spicelib/devices/vccs/vccsdefs.h | 1 - src/spicelib/devices/vcvs/vcvs.c | 1 - src/spicelib/devices/vcvs/vcvsask.c | 3 --- src/spicelib/devices/vcvs/vcvsdefs.h | 1 - 5 files changed, 7 deletions(-) diff --git a/src/spicelib/devices/vccs/vccs.c b/src/spicelib/devices/vccs/vccs.c index 087f3cc28..ca3a0b9b6 100644 --- a/src/spicelib/devices/vccs/vccs.c +++ b/src/spicelib/devices/vccs/vccs.c @@ -20,7 +20,6 @@ IFparm VCCSpTable[] = { /* parameters */ "Positive node of contr. source"), OPU("cont_n_node",VCCS_CONT_N_NODE,IF_INTEGER, "Negative node of contr. source"), - IP("ic", VCCS_IC, IF_REAL, "Initial condition of controlling source"), OP("i", VCCS_CURRENT,IF_REAL, "Output current"), OP("v", VCCS_VOLTS,IF_REAL, "Voltage across output"), OP("p", VCCS_POWER, IF_REAL, "Power"), diff --git a/src/spicelib/devices/vccs/vccsdefs.h b/src/spicelib/devices/vccs/vccsdefs.h index 37f193eca..d5a981fb1 100644 --- a/src/spicelib/devices/vccs/vccsdefs.h +++ b/src/spicelib/devices/vccs/vccsdefs.h @@ -31,7 +31,6 @@ typedef struct sVCCSinstance { const int VCCScontPosNode; /* number of positive node of controlling source */ const int VCCScontNegNode; /* number of negative node of controlling source */ - double VCCSinitCond; /* initial condition (of controlling source) */ double VCCScoeff; /* coefficient */ double VCCSmValue; /* Parallel multiplier */ diff --git a/src/spicelib/devices/vcvs/vcvs.c b/src/spicelib/devices/vcvs/vcvs.c index 90854d3b8..1e35772c3 100644 --- a/src/spicelib/devices/vcvs/vcvs.c +++ b/src/spicelib/devices/vcvs/vcvs.c @@ -18,7 +18,6 @@ IFparm VCVSpTable[] = { /* parameters */ "Positive node of contr. source"), OPU("cont_n_node",VCVS_CONT_N_NODE,IF_INTEGER, "Negative node of contr. source"), - IP("ic", VCVS_IC, IF_REAL, "Initial condition of controlling source"), OP("i", VCVS_CURRENT, IF_REAL, "Output current"), OP("v", VCVS_VOLTS, IF_REAL, "Output voltage"), OP("p", VCVS_POWER, IF_REAL, "Power"), diff --git a/src/spicelib/devices/vcvs/vcvsask.c b/src/spicelib/devices/vcvs/vcvsask.c index f0c9f1737..d3c9da814 100644 --- a/src/spicelib/devices/vcvs/vcvsask.c +++ b/src/spicelib/devices/vcvs/vcvsask.c @@ -40,9 +40,6 @@ VCVSask(CKTcircuit *ckt, GENinstance *inst, int which, IFvalue *value, IFvalue * case VCVS_CONT_N_NODE: value->iValue = here->VCVScontNegNode; return (OK); - case VCVS_IC: - value->rValue = here->VCVSinitCond; - return (OK); case VCVS_GAIN: value->rValue = here->VCVScoeff; return (OK); diff --git a/src/spicelib/devices/vcvs/vcvsdefs.h b/src/spicelib/devices/vcvs/vcvsdefs.h index fe9ab77a0..941e2c958 100644 --- a/src/spicelib/devices/vcvs/vcvsdefs.h +++ b/src/spicelib/devices/vcvs/vcvsdefs.h @@ -33,7 +33,6 @@ typedef struct sVCVSinstance { const int VCVScontNegNode; /* number of negative node of controlling source */ int VCVSbranch; /* equation number of branch equation added for v source */ - double VCVSinitCond; /* initial condition (of controlling source) */ double VCVScoeff; /* coefficient */ double *VCVSposIbrPtr; /* pointer to sparse matrix element at From 4f79105b061aa62add4d514fb9acff5f569a18a3 Mon Sep 17 00:00:00 2001 From: Holger Vogt Date: Mon, 2 Oct 2023 10:07:52 +0200 Subject: [PATCH 2/4] Add comment --- src/spicelib/devices/cktfinddev.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/spicelib/devices/cktfinddev.c b/src/spicelib/devices/cktfinddev.c index b5115b283..5e0f682c5 100644 --- a/src/spicelib/devices/cktfinddev.c +++ b/src/spicelib/devices/cktfinddev.c @@ -9,7 +9,8 @@ Author: 1985 Thomas L. Quarles #include "ngspice/sperror.h" #include "string.h" - +/* Key is the pointer to the device name, not the name itself. + The pointer to the instance is returned. */ GENinstance * CKTfndDev(CKTcircuit *ckt, IFuid name) { From 53315ed764f99d85e53d3657b15f6560a876712d Mon Sep 17 00:00:00 2001 From: Holger Vogt Date: Thu, 5 Oct 2023 00:19:51 +0200 Subject: [PATCH 3/4] Prevent crash when no input file given. --- src/frontend/inpcom.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/frontend/inpcom.c b/src/frontend/inpcom.c index 97c822937..f3ede2101 100644 --- a/src/frontend/inpcom.c +++ b/src/frontend/inpcom.c @@ -1010,7 +1010,7 @@ struct card *inp_readall(FILE *fp, const char *dir_name, cc = rv.cc; /* skip all pre-processing for expanded input files created by 'listing r' */ - if (ciprefix("* expanded deck of", cc->line)) + if (cc && ciprefix("* expanded deck of", cc->line)) return cc; /* files starting with *ng_script are user supplied command files */ From 7ab929e945ee33bffc0e4d05bc998149638088de Mon Sep 17 00:00:00 2001 From: h_vogt Date: Thu, 5 Oct 2023 00:26:02 +0200 Subject: [PATCH 4/4] klu and osdi are becoming standard now. --- compile_macos_gcc.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compile_macos_gcc.sh b/compile_macos_gcc.sh index 48e4035d4..f2272dab3 100755 --- a/compile_macos_gcc.sh +++ b/compile_macos_gcc.sh @@ -52,14 +52,14 @@ if test "$1" = "d"; then # You may add --enable-adms to the following command for adding adms generated devices # Builtin readline is not compatible (Big Sur), readline via Homebrew required (in /usr/local/opt) # Use gcc-11 from Homebrew to support OpenMP - ../configure --with-x --enable-xspice --enable-cider --with-readline=/usr/local/opt/readline CC="gcc-11" CXX="g++-11" CFLAGS="-m64 -O0 -g -Wall -I/opt/X11/include/freetype2 -I/usr/local/opt/readline/include" LDFLAGS="-m64 -g -L/usr/local/opt/readline/lib -L/opt/X11/lib" + ../configure --with-x --enable-xspice --enable-cider --enable-osdi --with-readline=/usr/local/opt/readline --enable-klu CC="gcc-11" CXX="g++-11" CFLAGS="-m64 -O0 -g -Wall -I/opt/X11/include/freetype2 -I/usr/local/opt/readline/include" LDFLAGS="-m64 -g -L/usr/local/opt/readline/lib -L/opt/X11/lib" else cd release if [ $? -ne 0 ]; then echo "cd release failed"; exit 1 ; fi echo "configuring for 64 bit release" echo # You may add --enable-adms to the following command for adding adms generated devices - ../configure --with-x --enable-xspice --enable-cider --with-readline=/usr/local/opt/readline --disable-debug --enable-openmp CC="gcc-11" CXX="g++-11" CFLAGS="-m64 -O2 -I/opt/X11/include/freetype2 -I/usr/local/opt/readline/include -I/usr/local/opt/ncurses/include -I/usr/local/include" LDFLAGS="-m64 -L/usr/local/opt/readline/lib -L/usr/local/opt/ncurses/lib -L/opt/X11/lib -L/usr/local/lib" + ../configure --with-x --enable-xspice --enable-cider --enable-osdi --with-readline=/usr/local/opt/readline --disable-debug --enable-openmp --enable-klu CC="gcc-11" CXX="g++-11" CFLAGS="-m64 -O2 -I/opt/X11/include/freetype2 -I/usr/local/opt/readline/include -I/usr/local/opt/ncurses/include -I/usr/local/include" LDFLAGS="-m64 -L/usr/local/opt/readline/lib -L/usr/local/opt/ncurses/lib -L/opt/X11/lib -L/usr/local/lib" fi if [ $? -ne 0 ]; then echo "../configure failed"; exit 1 ; fi