diff --git a/INSTALL b/INSTALL index 84551b35b..ea2bdb479 100644 --- a/INSTALL +++ b/INSTALL @@ -198,12 +198,11 @@ This file describes the procedures to install ngspice from sources. 1.5.1 Most useful options: - --enable-adms - ADMS is an experimental model compiler that translates - Verilog-A compact models into C code that can be compiled into - ngspice. This is (as of ngspice-27) still experimental, some - features (e.g. noise) are missing. If you want to use it, please - refer to the ADMS section on ngspice web site. + --enable-osdi + Add the OSDI interface to ngspice. This interface allow to dynamically + load compiled Veriloag-A compact models. Compiling is done with + OpenVAF. Thus for the first time ngspice has access to modern + device models like BSOMBULK or BSIM_CMG. --enable-cider Cider is a mixed-level simulator that couples Spice3 and DSIM @@ -246,6 +245,7 @@ This file describes the procedures to install ngspice from sources. Enables a 'make check' with strongly reduced runtime. Besides some regression tests only BSIM3 and BSM4 devices are checked. + 1.5.2 Options Specific to Enable Ngspice as a shared library --with-ngshared diff --git a/configure.ac b/configure.ac index 5492f6bf0..55da0c74c 100644 --- a/configure.ac +++ b/configure.ac @@ -16,7 +16,7 @@ # problem to the user. AC_PREREQ([2.59]) -m4_define([ngspice_major_version], [39]) +m4_define([ngspice_major_version], [39+]) m4_define([ngspice_minor_version], [0]) m4_define([ngspice_version], [ngspice_major_version]) @@ -31,7 +31,7 @@ AC_REVISION([$Revision: ngspice_version$]) AC_CONFIG_SRCDIR([src/ngspice.c]) # Create a configuration header -AC_CONFIG_HEADER([src/include/ngspice/config.h]) +AC_CONFIG_HEADERS([src/include/ngspice/config.h]) # Initialize automake stuff AM_INIT_AUTOMAKE([-Wall -Werror nostdinc serial-tests]) @@ -360,19 +360,11 @@ if test "x$enable_gprof" = xyes; then fi # Checks for ANSI-C header files. -AC_HEADER_STDC + AC_CHECK_HEADERS([strings.h]) if test "x$enable_ansi" = xyes; then - AC_PROG_CC() - AC_DIAGNOSE([obsolete], [AM_PROG_CC_STDC: - your code should no longer depend upon `am_cv_prog_cc_stdc', but upon - `ac_cv_prog_cc_stdc'. Remove this warning and the assignment when - you adjust the code. You can also remove the above call to - AC_PROG_CC if you already called it elsewhere.]) - am_cv_prog_cc_stdc=$ac_cv_prog_cc_stdc - - if test "x$am_cv_prog_cc_stdc" != xyes ; then + if test "x$ac_cv_prog_cc_stdc" != xyes ; then AC_MSG_WARN([Failed to find Ansi flag!]) fi fi @@ -652,15 +644,8 @@ AC_SUBST([TCL_LIB_SPEC]) # ################################################################# - - # Checks for programs -AC_LIBTOOL_WIN32_DLL -AC_LIBTOOL_DLOPEN AM_PROG_CC_C_O -## AM_PROG_LIBTOOL -AC_PROG_LIBTOOL - # --with-windows : the user wants to use generate the MS WINDOWS GUI executable # old command version, deprecated, use --with-wingui @@ -759,7 +744,6 @@ AC_TYPE_SIZE_T # Checks for library functions. AC_FUNC_CLOSEDIR_VOID AC_FUNC_SELECT_ARGTYPES -AC_FUNC_SETVBUF_REVERSED AC_FUNC_VPRINTF # Check if the user wants to use the appropriate rpath commands to compile in @@ -888,7 +872,6 @@ AM_CONDITIONAL([OLDAPPS], [test "x$enable_oldapps" = xyes]) # Check for a few typdefs: AC_TYPE_PID_T -AC_TYPE_SIGNAL # sighandler_t is the type of the signal handler on GNU variants, # sig_t is the type of a signal handler on 4.4BSD's, @@ -907,7 +890,6 @@ AC_CHECK_HEADERS([arpa/inet.h netdb.h netinet/in.h stddef.h sys/file.h sys/param # Check time and resources headers and functions: -AC_HEADER_TIME AC_STRUCT_TM AC_STRUCT_TIMEZONE AC_CHECK_FUNCS([localtime]) diff --git a/examples/osdi/bsimcmg/simple_inverter_dc.sp b/examples/osdi/bsimcmg/simple_inverter_dc.sp index 13b164094..71ad6aa53 100644 --- a/examples/osdi/bsimcmg/simple_inverter_dc.sp +++ b/examples/osdi/bsimcmg/simple_inverter_dc.sp @@ -12,10 +12,10 @@ NP1 vout vin supply supply BSIMCMG_osdi_P NN1 vout vin 0 0 BSIMCMG_osdi_N * --- DC Analysis --- -*.dc vsig 0 1 0.01 +.dc vsig 0 1 0.01 * --- Transient Analysis --- -.tran 10n 2u +*.tran 10n 2u .control * pre_osdi ../osdi_libs/bsimcmg.osdi diff --git a/src/frontend/aspice.c b/src/frontend/aspice.c index 671708b38..7125d64ea 100644 --- a/src/frontend/aspice.c +++ b/src/frontend/aspice.c @@ -52,7 +52,7 @@ Author: 1985 Wayne A. Christopher, U. C. Berkeley CAD Group # define SEEK_SET 0 #endif -static RETSIGTYPE sigchild(void); +static void sigchild(void); struct proc { int pr_pid; /* The pid of the spice job. */ @@ -163,7 +163,7 @@ com_jobs(wordlist *wl) } -static RETSIGTYPE +static void sigchild(void) { numchanged++; diff --git a/src/frontend/com_fft.c b/src/frontend/com_fft.c index 0dc42ddc6..2d592525b 100644 --- a/src/frontend/com_fft.c +++ b/src/frontend/com_fft.c @@ -179,7 +179,9 @@ com_fft(wordlist *wl) fftw_execute(plan_forward); scale = (double) fpts - 1.0; - for (j = 0; j < fpts; j++) { + fdvec[i][0].cx_real = out[0][0]/scale/2.0; + fdvec[i][0].cx_imag = 0.0; + for (j = 1; j < fpts; j++) { fdvec[i][j].cx_real = out[j][0]/scale; fdvec[i][j].cx_imag = out[j][1]/scale; } @@ -212,7 +214,7 @@ com_fft(wordlist *wl) scale = (double) fpts - 1.0; /* Re(x[0]), Re(x[N/2]), Re(x[1]), Im(x[1]), Re(x[2]), Im(x[2]), ... Re(x[N/2-1]), Im(x[N/2-1]). */ - fdvec[i][0].cx_real = in[0]/scale; + fdvec[i][0].cx_real = in[0]/scale/2.0; fdvec[i][0].cx_imag = 0.0; for (j = 1; j < fpts-1; j++) { fdvec[i][j].cx_real = in[2*j]/scale; diff --git a/src/frontend/com_measure2.c b/src/frontend/com_measure2.c index 91dbffa7b..5b947eacf 100644 --- a/src/frontend/com_measure2.c +++ b/src/frontend/com_measure2.c @@ -491,14 +491,13 @@ com_measure_when( crossCnt = 0; if (value < value2) { section = S_BELOW_VAL; - if ((prevValue <= value2) && (value >= value2)) { + if (prevValue >= prevValue2) { fallCnt = 1; crossCnt = 1; } - } else { section = S_ABOVE_VAL; - if ((prevValue <= value2) && (value >= value2)) { + if (prevValue < prevValue2) { riseCnt = 1; crossCnt = 1; } @@ -509,14 +508,13 @@ com_measure_when( crossCnt = 0; if (value < meas->m_val) { section = S_BELOW_VAL; - if ((prevValue <= meas->m_val) && (value >= meas->m_val)) { + if (prevValue >= meas->m_val) { fallCnt = 1; crossCnt = 1; } - } else { section = S_ABOVE_VAL; - if ((prevValue <= meas->m_val) && (value >= meas->m_val)) { + if (prevValue < meas->m_val) { riseCnt = 1; crossCnt = 1; } @@ -1699,7 +1697,10 @@ get_measure2( goto err_ret1; } // measure targ - com_measure_when(measTarg); + if (measTarg->m_at == 1e99) + com_measure_when(measTarg); + else + measTarg->m_measured = measTarg->m_at; if (isnan(measTarg->m_measured)) { sprintf(errbuf, "out of interval\n"); diff --git a/src/frontend/evaluate.c b/src/frontend/evaluate.c index 044f85d51..f38aff246 100644 --- a/src/frontend/evaluate.c +++ b/src/frontend/evaluate.c @@ -20,7 +20,7 @@ Author: 1985 Wayne A. Christopher, U. C. Berkeley CAD Group #include "ngspice/sim.h" /* To get SV_VOLTAGE definition */ -static RETSIGTYPE sig_matherr(void); +static void sig_matherr(void); static struct dvec *apply_func(struct func *func, struct pnode *arg); static struct dvec *ft_ternary(struct pnode *node); static char *mkcname(char what, char *v1, char *v2); @@ -33,7 +33,7 @@ static char *mkcname(char what, char *v1, char *v2); static JMP_BUF matherrbuf; -static RETSIGTYPE +static void sig_matherr(void) { fprintf(cp_err, "Error: argument out of range for math function\n"); diff --git a/src/frontend/inp.c b/src/frontend/inp.c index 86652c08e..bf6d954d5 100644 --- a/src/frontend/inp.c +++ b/src/frontend/inp.c @@ -60,6 +60,7 @@ static char *upper(register char *string); static void rem_unused_mos_models(struct card* deck); extern void com_optran(wordlist * wl); +extern void tprint(struct card *deck); //void inp_source_recent(void); diff --git a/src/frontend/inpc_probe.c b/src/frontend/inpc_probe.c index 112b1208d..8a7a79f47 100644 --- a/src/frontend/inpc_probe.c +++ b/src/frontend/inpc_probe.c @@ -874,6 +874,12 @@ void inp_probe(struct card* deck) else numnodes = get_number_terminals(thisline); + if (numnodes < 2) { + fprintf(stderr, "Warning: Power mesasurement not available,\n .probe %s will be ignored\n", wltmp->wl_word); + tfree(instname); + continue; + } + int err = 0; /* call fcn with power requested */ err = setallvsources(tmpcard, instances, instname, numnodes, haveall, TRUE); @@ -1266,7 +1272,7 @@ void modprobenames(INPtables* tab) { If .probe p(Q1) is found, flag power is true, then do additional power calculations: Define a reference voltage of an n-terminal device as Vref = (V(1) + V(2) +...+ V(n)) / n with terminal (node) voltages V(n). Calculate power PQ1 = (v(1) - Vref) * i1 + (V(2) - Vref) * i2 + ... + (V(n) - Vref) * in) with terminal currents in. - See "Quantities of a Multiterminal Circuit Determined on the Basis of Kirchhoff’s Laws", M. Depenbrock, + See "Quantities of a Multiterminal Circuit Determined on the Basis of Kirchhoff�s Laws", M. Depenbrock, ETEP Vol. 8, No. 4, July/August 1998. probe_int_ is used to trigger supressing the vectors when saving the results. Internal vectors thus are not saved. */ diff --git a/src/frontend/parser/unixcom.c b/src/frontend/parser/unixcom.c index 6186acae2..6cbc46da7 100644 --- a/src/frontend/parser/unixcom.c +++ b/src/frontend/parser/unixcom.c @@ -187,7 +187,7 @@ tryexec(char *name, char *argv[]) # endif int pid, j; - RETSIGTYPE (*svint)(), (*svquit)(), (*svtstp)(); + void (*svint)(), (*svquit)(), (*svtstp)(); pid = vfork(); if (pid == 0) { diff --git a/src/frontend/plotting/graf.c b/src/frontend/plotting/graf.c index 2e9a70797..929a6e5fb 100644 --- a/src/frontend/plotting/graf.c +++ b/src/frontend/plotting/graf.c @@ -485,12 +485,15 @@ void gr_point(struct dvec *dv, case PLOT_RETLIN: /* If it's a linear plot, ignore first point since we don't want to connect with oldx and oldy. */ - if (np) + if (np) { #ifdef LINE_COMPRESSION_CHECKS drawLine(fromx, fromy, tox, toy, dv); #else drawLine(fromx, fromy, tox, toy); #endif + } else { + LC_flush(); // May be retrace with non-monotonic x-axis + } if ((tics = currentgraph->ticdata) != NULL) { for (; *tics < HUGE; tics++) diff --git a/src/frontend/plotting/x11.c b/src/frontend/plotting/x11.c index 0b5d5f5eb..8879328ac 100644 --- a/src/frontend/plotting/x11.c +++ b/src/frontend/plotting/x11.c @@ -1189,6 +1189,9 @@ void RemoveWindow(GRAPH *graph) DEVDEP(graph).isopen = 0; /* MW. Not sure but DestroyGraph might free() too much - try Xt...() first */ XtUnmapWidget(DEVDEP(graph).shell); +#ifdef HAVE_LIBXFT + XftDrawDestroy(DEVDEP(graph).draw); +#endif XtDestroyWidget(DEVDEP(graph).shell); #ifndef HAVE_LIBXFT XFreeFont(display, DEVDEP(graph).font); @@ -1198,7 +1201,6 @@ void RemoveWindow(GRAPH *graph) #ifdef HAVE_LIBXFT XftFontClose( display, DEVDEP(graph).font0); XftFontClose( display, DEVDEP(graph).font90); - XftDrawDestroy(DEVDEP(graph).draw); XftColorFree(display, DefaultVisual(display, 0), DEVDEP(graph).cmap, &DEVDEP(graph).color); #endif } diff --git a/src/frontend/resource.c b/src/frontend/resource.c index b8013eec9..09b40863b 100644 --- a/src/frontend/resource.c +++ b/src/frontend/resource.c @@ -570,7 +570,7 @@ static int get_sysmem(struct sys_mem *memall) static JMP_BUF env; -static RETSIGTYPE +static void fault(void) { signal(SIGSEGV, (SIGNAL_FUNCTION) fault); /* SysV style */ @@ -586,7 +586,7 @@ baseaddr(void) #else char *low, *high, *at; long x; - RETSIGTYPE (*orig_signal)(); + void (*orig_signal)(); if (getenv("SPICE_NO_DATASEG_CHECK")) return 0; diff --git a/src/frontend/signal_handler.c b/src/frontend/signal_handler.c index 5b414e8d0..058c3c352 100644 --- a/src/frontend/signal_handler.c +++ b/src/frontend/signal_handler.c @@ -70,7 +70,7 @@ ft_sigintr_cleanup(void) /* invoke this function upon keyboard interrupt */ -RETSIGTYPE +void ft_sigintr(void) { static int interrupt_counter = 0; @@ -103,7 +103,7 @@ ft_sigintr(void) } -RETSIGTYPE +void sigfloat(int code) { fperror("Error", code); @@ -117,7 +117,7 @@ sigfloat(int code) #ifdef SIGTSTP -RETSIGTYPE +void sigstop(void) { gr_clean(); @@ -127,7 +127,7 @@ sigstop(void) } -RETSIGTYPE +void sigcont(void) { (void) signal(SIGTSTP, (SIGNAL_FUNCTION) sigstop); @@ -141,7 +141,7 @@ sigcont(void) /* Special (void) signal handlers. */ -RETSIGTYPE +void sigill(void) { fprintf(cp_err, "\ninternal error -- illegal instruction\n"); @@ -149,7 +149,7 @@ sigill(void) } -RETSIGTYPE +void sigbus(void) { fprintf(cp_err, "\ninternal error -- bus error\n"); @@ -157,7 +157,7 @@ sigbus(void) } -RETSIGTYPE +void sigsegv(void) { fprintf(cp_err, "\ninternal error -- segmentation violation\n"); @@ -167,7 +167,7 @@ sigsegv(void) fatal(); } -RETSIGTYPE +void sigsegvsh(void) { fprintf(cp_err, "\ninternal error -- segmentation violation\n"); @@ -175,7 +175,7 @@ sigsegvsh(void) } -RETSIGTYPE +void sig_sys(void) { fprintf(cp_err, "\ninternal error -- bad argument to system call\n"); diff --git a/src/frontend/signal_handler.h b/src/frontend/signal_handler.h index cfe1eca46..7ef02c6da 100644 --- a/src/frontend/signal_handler.h +++ b/src/frontend/signal_handler.h @@ -6,15 +6,15 @@ #ifndef ngspice_SIGNAL_HANDLER_H #define ngspice_SIGNAL_HANDLER_H -RETSIGTYPE ft_sigintr(void); -RETSIGTYPE sigfloat(int code); -RETSIGTYPE sigstop(void); -RETSIGTYPE sigcont(void); -RETSIGTYPE sigill(void); -RETSIGTYPE sigbus(void); -RETSIGTYPE sigsegv(void); -RETSIGTYPE sigsegvsh(void); -RETSIGTYPE sig_sys(void); +void ft_sigintr(void); +void sigfloat(int code); +void sigstop(void); +void sigcont(void); +void sigill(void); +void sigbus(void); +void sigsegv(void); +void sigsegvsh(void); +void sig_sys(void); extern JMP_BUF jbuf; diff --git a/src/frontend/subckt.c b/src/frontend/subckt.c index 3d5b7b337..9579784a7 100644 --- a/src/frontend/subckt.c +++ b/src/frontend/subckt.c @@ -77,6 +77,7 @@ Modified: 2000 AlansFixes extern void line_free_x(struct card *deck, bool recurse); extern int get_number_terminals(char* c); +extern void tprint(struct card* deck); #define line_free(line, flag) \ do { \ diff --git a/src/frontend/wdisp/windisp.c b/src/frontend/wdisp/windisp.c index 93716f3e9..33a238fcd 100644 --- a/src/frontend/wdisp/windisp.c +++ b/src/frontend/wdisp/windisp.c @@ -645,14 +645,7 @@ LRESULT CALLBACK PlotWindowProc(HWND hwnd, UINT uMsg, case WM_CLOSE: /* close window */ { - GRAPH *g = pGraph(hwnd); - if (g) { - /* if g equals currentgraph, reset currentgraph. */ - if (g == currentgraph) - currentgraph = NULL; - DestroyGraph(g->graphid); - } } goto WIN_DEFAULT; @@ -1233,6 +1226,13 @@ void RemoveWindow(GRAPH *dgraph) wd = pWindowData(dgraph); if (wd) SendMessage(wd->wnd, WM_CLOSE, (WPARAM) wd->hDC, 0); + + if (dgraph) { + /* if g equals currentgraph, reset currentgraph. */ + if (dgraph == currentgraph) + currentgraph = NULL; + DestroyGraph(dgraph->graphid); + } } diff --git a/src/include/ngspice/defines.h b/src/include/ngspice/defines.h index d5dadd650..62e2737bd 100644 --- a/src/include/ngspice/defines.h +++ b/src/include/ngspice/defines.h @@ -101,7 +101,7 @@ #define HAS_TIME_H #define HAS_RLIMIT_ - +#define void void #ifndef SIGNAL_FUNCTION # ifdef HAVE_SIGHANDLER_T @@ -111,7 +111,7 @@ # elif HAVE___SIGHANDLER_T # define SIGNAL_FUNCTION __sighandler_t # else -# define SIGNAL_FUNCTION RETSIGTYPE (*)(int) +# define SIGNAL_FUNCTION void (*)(int) # endif #endif diff --git a/src/include/ngspice/sharedspice.h b/src/include/ngspice/sharedspice.h index 8c3b3084f..a3b4ffed9 100644 --- a/src/include/ngspice/sharedspice.h +++ b/src/include/ngspice/sharedspice.h @@ -97,7 +97,7 @@ are of type bool if sharedspice.h is used externally. */ #ifndef NGSPICE_PACKAGE_VERSION -#define NGSPICE_PACKAGE_VERSION "39" +#define NGSPICE_PACKAGE_VERSION "39+" #endif /* we have NG_BOOL instead of BOOL */ #ifndef HAS_NG_BOOL diff --git a/src/maths/cmaths/cmath4.c b/src/maths/cmaths/cmath4.c index b3dd42f9a..fa2b7cb6f 100644 --- a/src/maths/cmaths/cmath4.c +++ b/src/maths/cmaths/cmath4.c @@ -773,7 +773,9 @@ cx_fft(void *data, short int type, int length, int *newlength, short int *newtyp fftw_execute(plan_forward); scale = (double) fpts - 1.0; - for (i = 0; i < fpts; i++) { + outdata[0].cx_real = out[0][0]/scale/2.0; + outdata[0].cx_imag = 0.0; + for (i = 1; i < fpts; i++) { outdata[i].cx_real = out[i][0]/scale; outdata[i].cx_imag = out[i][1]/scale; } @@ -798,7 +800,7 @@ cx_fft(void *data, short int type, int length, int *newlength, short int *newtyp scale = (double) fpts - 1.0; /* Re(x[0]), Re(x[N/2]), Re(x[1]), Im(x[1]), Re(x[2]), Im(x[2]), ... Re(x[N/2-1]), Im(x[N/2-1]). */ - outdata[0].cx_real = datax[0]/scale; + outdata[0].cx_real = datax[0]/scale/2.0; outdata[0].cx_imag = 0.0; for (i = 1; i < fpts-1; i++) { outdata[i].cx_real = datax[2*i]/scale; diff --git a/src/maths/sparse/spfactor.c b/src/maths/sparse/spfactor.c index 337ad2ace..de5de6177 100644 --- a/src/maths/sparse/spfactor.c +++ b/src/maths/sparse/spfactor.c @@ -228,6 +228,11 @@ spOrderAndFactor(MatrixPtr Matrix, RealNumber RHS[], RealNumber RelThreshold, INCRESP; #endif pPivot = Matrix->Diag[Step]; + if (!pPivot) { + fprintf(stderr, "Warning: spfactor.c, 230, Pivot for step = %d not found\n", Step); + ReorderingRequired = YES; + break; /* for loop */ + } LargestInCol = FindLargestInCol(pPivot->NextInCol); if ((LargestInCol * RelThreshold < ELEMENT_MAG(pPivot))) { if (Matrix->Complex) diff --git a/src/misc/string.c b/src/misc/string.c index 147fe3648..1374607da 100644 --- a/src/misc/string.c +++ b/src/misc/string.c @@ -88,7 +88,7 @@ char *dup_string(const char *str, size_t n_char) char *tvprintf(const char *fmt, va_list args) { - char buf[1024]; + static char buf[1024]; char *p = buf; int size = sizeof(buf); int nchars; diff --git a/src/osdi/osdicallbacks.c b/src/osdi/osdicallbacks.c index 1efecf212..de7b1dc97 100644 --- a/src/osdi/osdicallbacks.c +++ b/src/osdi/osdicallbacks.c @@ -50,18 +50,6 @@ double osdi_pnjlim(bool init, bool *check, double vnew, double vold, double vt, return res; } -double osdi_typedpnjlim(bool init, bool *check, double vnew, double vold, double vt, - double vcrit, double type) { - if (init) { - *check = true; - return vcrit; - } - int icheck = 0; - double res = DEVpnjlim(type*vnew, vold, vt, vcrit, &icheck); - *check = icheck != 0; - return res; -} - double osdi_limvds(bool init, bool *check, double vnew, double vold) { if (init) { *check = true; diff --git a/src/osdi/osdidefs.h b/src/osdi/osdidefs.h index d1108b666..6130482ad 100644 --- a/src/osdi/osdidefs.h +++ b/src/osdi/osdidefs.h @@ -96,8 +96,7 @@ typedef void (*osdi_log_ptr)(void *handle, char *msg, uint32_t lvl); double osdi_pnjlim(bool init, bool *icheck, double vnew, double vold, double vt, double vcrit); -double osdi_typedpnjlim(bool init, bool *icheck, double vnew, double vold, double vt, - double vcrit, double type); + double osdi_limvds(bool init, bool *icheck, double vnew, double vold); double osdi_limitlog(bool init, bool *icheck, double vnew, double vold, double LIM_TOL); diff --git a/src/osdi/osdiload.c b/src/osdi/osdiload.c index 6612323d4..6fe4b4f40 100644 --- a/src/osdi/osdiload.c +++ b/src/osdi/osdiload.c @@ -137,9 +137,7 @@ extern int OSDIload(GENmodel *inModel, CKTcircuit *ckt) { .flags = CALC_RESIST_JACOBIAN, }; - if (is_init_smsig || is_sweep) { - sim_info.flags |= CALC_OP; - } + sim_info.flags |= CALC_OP; if (is_dc) { sim_info.flags |= ANALYSIS_DC | ANALYSIS_STATIC; @@ -174,13 +172,13 @@ extern int OSDIload(GENmodel *inModel, CKTcircuit *ckt) { sim_info.flags |= CALC_NOISE | ANALYSIS_NOISE; } - int ret = OK; - OsdiRegistryEntry *entry = osdi_reg_entry_model(inModel); const OsdiDescriptor *descr = entry->descriptor; uint32_t eval_flags = 0; #ifdef USE_OMP + int ret = OK; + /* use openmp 3.0 tasks to parallelize linked list transveral */ #pragma omp parallel #pragma omp single diff --git a/src/osdi/osdiregistry.c b/src/osdi/osdiregistry.c index 66d14704b..e3362fa38 100644 --- a/src/osdi/osdiregistry.c +++ b/src/osdi/osdiregistry.c @@ -302,6 +302,7 @@ extern OsdiObjectFile load_object_file(const char *input) { * nghash_insert returns NULL if the key (handle) was not already in the table * and the data (DUMMYDATA) that was previously insered (!= NULL) otherwise*/ if (nghash_insert(known_object_files, handle, DUMMYDATA)) { + txfree(path); return EMPTY_OBJECT; } @@ -313,6 +314,7 @@ extern OsdiObjectFile load_object_file(const char *input) { printf("NGSPICE only supports OSDI v%d.%d but \"%s\" targets v%d.%d!", OSDI_VERSION_MAJOR_CURR, OSDI_VERSION_MINOR_CURR, path, OSDI_VERSION_MAJOR, OSDI_VERSION_MINOR); + txfree(path); return INVALID_OBJECT; } @@ -338,7 +340,6 @@ extern OsdiObjectFile load_object_file(const char *input) { for (uint32_t i = 0; i < lim_table_len; i++) { int expected_args = -1; IS_LIM_FUN("pnjlim", 2, osdi_pnjlim) - IS_LIM_FUN("typedpnjlim", 3, osdi_typedpnjlim) IS_LIM_FUN("limvds", 0, osdi_limvds) IS_LIM_FUN("fetlim", 1, osdi_fetlim) IS_LIM_FUN("limitlog", 1, osdi_limitlog) @@ -384,6 +385,7 @@ extern OsdiObjectFile load_object_file(const char *input) { }; } + txfree(path); return (OsdiObjectFile){ .entrys = dst, .num_entries = (int)OSDI_NUM_DESCRIPTORS, diff --git a/src/spicelib/devices/dio/diosetup.c b/src/spicelib/devices/dio/diosetup.c index ef0695669..2cae77ca0 100644 --- a/src/spicelib/devices/dio/diosetup.c +++ b/src/spicelib/devices/dio/diosetup.c @@ -180,7 +180,7 @@ DIOsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states) model->DIOte_max = 1e99; } if(!model->DIOrecEmissionCoeffGiven) { - model->DIOrecEmissionCoeff = 1; + model->DIOrecEmissionCoeff = 2; } if(!model->DIOrecSatCurGiven) { model->DIOrecSatCur = 1e-14; diff --git a/src/xspice/evt/evtbackup.c b/src/xspice/evt/evtbackup.c index 1055deced..fe1e02784 100644 --- a/src/xspice/evt/evtbackup.c +++ b/src/xspice/evt/evtbackup.c @@ -577,7 +577,7 @@ static void EVTbackup_output_queue( output = *output_ptr; while(output) { - if (output->posted_time < new_time) + if(output->event_time > new_time) break; output_ptr = &((*output_ptr)->next); output = *output_ptr; @@ -618,17 +618,26 @@ static void EVTbackup_output_queue( } output_queue->next_time = next_time; - /* Update the modified list by looking for any queued events */ - /* with posted time > last_time */ + /* Update the modified list by looking for events that were processed + * or queued in the current timestep. + */ + for(i = 0, j = 0; i < num_modified; i++) { output_index = output_queue->modified_index[i]; output = *(output_queue->last_step[output_index]); - while(output) { - if(output->posted_time > output_queue->last_time) - break; - output = output->next; + if (output_queue->current[output_index] == + output_queue->last_step[output_index]) { + /* Nothing now removed from the queue, + * but it may have been modified by an addition. + */ + + while(output) { + if(output->posted_time > output_queue->last_time) + break; + output = output->next; + } } if(! output) { diff --git a/src/xspice/icm/digital/d_osc/cfunc.mod b/src/xspice/icm/digital/d_osc/cfunc.mod index b76386132..6f16a93e4 100644 --- a/src/xspice/icm/digital/d_osc/cfunc.mod +++ b/src/xspice/icm/digital/d_osc/cfunc.mod @@ -20,6 +20,7 @@ MODIFICATIONS 23 Aug 1991 Jeffrey P. Murray 30 Sep 1991 Jeffrey P. Murray 09 Nov 2022 Holger Vogt + 05 Jan 2023 Robert Turnbull SUMMARY @@ -54,7 +55,7 @@ NON-STANDARD FEATURES #include "d_osc.h" /* ...contains macros & type defns. for this model. 7/24/91 - JPM */ - +#include /*=== CONSTANTS ========================*/ @@ -180,7 +181,6 @@ static void cm_d_osc_callback(ARGS, * * *************************************************************/ -#include void cm_d_osc(ARGS) { diff --git a/src/xspice/icm/digital/d_pwm/cfunc.mod b/src/xspice/icm/digital/d_pwm/cfunc.mod index e64d6efcd..4aa5ec6be 100644 --- a/src/xspice/icm/digital/d_pwm/cfunc.mod +++ b/src/xspice/icm/digital/d_pwm/cfunc.mod @@ -20,6 +20,7 @@ MODIFICATIONS 23 Aug 1991 Jeffrey P. Murray 30 Sep 1991 Jeffrey P. Murray 06 Oct 2022 Holger Vogt + 05 Jan 2023 Robert Turnbull SUMMARY @@ -54,6 +55,7 @@ NON-STANDARD FEATURES #include "d_pwm.h" /* ...contains macros & type defns. for this model. 7/24/91 - JPM */ +#include @@ -182,7 +184,6 @@ static void cm_d_pwm_callback(ARGS, * * *************************************************************/ -#include void cm_d_pwm(ARGS) { diff --git a/visualc/src/include/ngspice/config.h b/visualc/src/include/ngspice/config.h index 47a327dcc..91125700e 100644 --- a/visualc/src/include/ngspice/config.h +++ b/visualc/src/include/ngspice/config.h @@ -15,7 +15,7 @@ #define PACKAGE "ngspice" /* Version number of package */ -#define VERSION "39" +#define VERSION "39+" /* Define the directory for executables */ #define NGSPICEBINDIR "../bin" @@ -499,9 +499,6 @@ /* Define if you want to debug pole-zero analysis */ /* #undef PZDEBUG */ -/* Define as the return type of signal handlers (`int' or `void'). */ -#define RETSIGTYPE void - /* Define to the type of arg 1 for `select'. */ /* #undef SELECT_TYPE_ARG1 */