diff --git a/compile_cyg_make_short_check_64.sh b/compile_cyg_make_short_check_64.sh index 1f77f265a..54d0868d2 100644 --- a/compile_cyg_make_short_check_64.sh +++ b/compile_cyg_make_short_check_64.sh @@ -38,7 +38,7 @@ cd release64_cyg if [ $? -ne 0 ]; then echo "cd release64_cyg failed"; exit 1 ; fi echo # You may add --enable-adms to the following command for adding adms generated devices -../configure --with-x=yes --with-readline=yes --disable-debug --enable-cider --enable-openmp --enable-xspice --enable-osdi --enable-shortcheck CFLAGS="-O2 -m64" LDFLAGS="-s -m64" +../configure --with-x=yes --with-readline=yes --disable-debug --enable-cider --enable-openmp --enable-xspice --enable-osdi --enable-predictor --enable-shortcheck CFLAGS="-O2 -m64" LDFLAGS="-s -m64" #../configure --with-x=no --with-readline=yes --disable-debug --enable-xspice --enable-cider --enable-openmp if [ $? -ne 0 ]; then echo "../configure failed"; exit 1 ; fi diff --git a/examples/numparam/example.cir b/examples/numparam/param-example.cir similarity index 100% rename from examples/numparam/example.cir rename to examples/numparam/param-example.cir diff --git a/examples/numparam/strings.cir b/examples/numparam/strings.cir new file mode 100644 index 000000000..8495080fa --- /dev/null +++ b/examples/numparam/strings.cir @@ -0,0 +1,42 @@ +Example of string-valued parameters for XSPICE LUT + +.param and="0001" or="0111" + +* Simple AND gate via parameter. + +.model l_and d_lut table_values=and +aand [ d1 d2 ] o_and l_and + +* More usefully, strings may be passed as sub-circuit parameters + +xor d1 d2 o_or pgate table=or + +.subckt pgate 1 2 out table="0000" +.model poly d_lut table_values=table +ap [ 1 2 ] out poly +.ends + +* Strings can be concatenated by .param, but not in .subckt lines or instances. + +.param both=or{and} +xboth d1 d2 d3 o_both pgate3 table=both + +.subckt pgate3 1 2 3 out table="00000000" +.model poly3 d_lut table_values=table +ap3 [ 1 2 3 ] out poly3 +.ends + +* Verify the above with a simple transient simulation. + +v1 a1 0 pulse 1 0 0 1n 1n 0.5u 1u +v2 a2 0 pulse 1 0 0 1n 1n 1u 2u +v3 a3 0 pulse 1 0 0 1n 1n 2u 4u +aadc [ a1 a2 a3 ] [ d1 d2 d3 ] adc +.model adc adc_bridge in_low=0.5 in_high=0.5 + +.control +tran 0.1u 4.1u +plot d1 d2 d3 o_and o_or o_both digitop +.endc +.end + diff --git a/examples/optran/.spiceinit b/examples/optran/.spiceinit new file mode 100644 index 000000000..aeee13ea7 --- /dev/null +++ b/examples/optran/.spiceinit @@ -0,0 +1 @@ +set ngbehavior=ltpsa diff --git a/src/Makefile.am b/src/Makefile.am index c25b7b3db..3988837e3 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -167,7 +167,7 @@ ngspice_LDADD += \ xspice/ipc/libipcxsp.la \ xspice/idn/libidnxsp.la endif -ngspice_LDADD += @XSPICEDLLIBS@ +ngspice_LDADD += $(XSPICEDLLIBS) ngspice_LDADD += \ frontend/parser/libparser.la \ @@ -453,7 +453,7 @@ libspice_la_LIBADD += \ xspice/ipc/libipcxsp.la \ xspice/idn/libidnxsp.la endif -libspice_la_LIBADD += @XSPICEDLLIBS@ +libspice_la_LIBADD += $(XSPICEDLLIBS) libspice_la_LIBADD += \ frontend/parser/libparser.la \ @@ -577,7 +577,7 @@ libngspice_la_LIBADD += \ xspice/ipc/libipcxsp.la \ xspice/idn/libidnxsp.la endif -libngspice_la_LIBADD += @XSPICEDLLIBS@ +libngspice_la_LIBADD += $(XSPICEDLLIBS) libngspice_la_LIBADD += \ frontend/parser/libparser.la \ diff --git a/src/frontend/inpc_probe.c b/src/frontend/inpc_probe.c index e43bd2256..f18c60510 100644 --- a/src/frontend/inpc_probe.c +++ b/src/frontend/inpc_probe.c @@ -238,6 +238,17 @@ void inp_probe(struct card* deck) if (strchr("ehvk", *instname)) continue; + /* exclude a devices (code models may have special characters in their instance line. + digital nodes should not get V sources in series anyway.) */ + if ('a' == *instname) + continue; + + /* exclude x devices (Subcircuits may contain digital a devices, + and digital nodes should not get V sources in series anyway.), + when probe_alli_nox is set in .spiceinit. */ + if ('x' == *instname && cp_getvar("probe_alli_nox", CP_BOOL, NULL, 0)) + continue; + /* special treatment for controlled current sources and switches: We have three or four tokens until model name, but only the first 2 are relevant nodes. */ if (strchr("fgsw", *instname)) diff --git a/src/frontend/inpcom.c b/src/frontend/inpcom.c index 413cccff5..b22900a99 100644 --- a/src/frontend/inpcom.c +++ b/src/frontend/inpcom.c @@ -4672,10 +4672,10 @@ int get_number_terminals(char *c) while ((i < 12) && (*cc != '\0')) { char* comma; name[i] = gettok_instance(&cc); - if (strstr(name[i], "off") || strchr(name[i], '=')) + if (search_plain_identifier(name[i], "off") || strchr(name[i], '=')) j++; #ifdef CIDER - if (strstr(name[i], "save") || strstr(name[i], "print")) + if (search_plain_identifier(name[i], "save") || search_plain_identifier(name[i], "print")) j++; #endif /* If we have IC=VBE, VCE instead of IC=VBE,VCE we need to inc @@ -7006,9 +7006,12 @@ static void inp_poly_err(struct card *card) void tprint(struct card *t) { struct card *tmp; - + static int npr; + char outfile[100]; + sprintf(outfile, "tprint-out%d.txt", npr); + npr++; /*debug: print into file*/ - FILE *fd = fopen("tprint-out.txt", "w"); + FILE *fd = fopen(outfile, "w"); for (tmp = t; tmp; tmp = tmp->nextcard) if (*(tmp->line) != '*') fprintf(fd, "%6d %6d %s\n", tmp->linenum_orig, tmp->linenum, diff --git a/src/osdi/Makefile.am b/src/osdi/Makefile.am index f23a7b8eb..9cdd27fed 100644 --- a/src/osdi/Makefile.am +++ b/src/osdi/Makefile.am @@ -18,7 +18,7 @@ libosdi_la_SOURCES = \ osdicallbacks.c - +libosdi_la_LIBADD = $(XSPICEDLLIBS) AM_CPPFLAGS = @AM_CPPFLAGS@ -I$(top_srcdir)/src/include AM_CFLAGS = $(STATIC) diff --git a/src/osdi/osdi.h b/src/osdi/osdi.h index 6f633b037..d58676215 100644 --- a/src/osdi/osdi.h +++ b/src/osdi/osdi.h @@ -189,7 +189,7 @@ typedef struct OsdiDescriptor { double temperature, uint32_t num_terminals, OsdiSimParas *sim_params, OsdiInitInfo *res); - uint32_t (*eval)(void *handle, void *inst, void *model, const OsdiSimInfo *info); + uint32_t (*eval)(void *handle, void *inst, const void *model, const OsdiSimInfo *info); void (*load_noise)(void *inst, void *model, double freq, double *noise_dens, double *ln_noise_dens); void (*load_residual_resist)(void *inst, void* model, double *dst); diff --git a/src/osdi/osdiload.c b/src/osdi/osdiload.c index e00c40efb..6612323d4 100644 --- a/src/osdi/osdiload.c +++ b/src/osdi/osdiload.c @@ -60,6 +60,9 @@ static void eval(const OsdiDescriptor *descr, const GENinstance *gen_inst, static void load(CKTcircuit *ckt, const GENinstance *gen_inst, void *model, void *inst, OsdiExtraInstData *extra_inst_data, bool is_tran, bool is_init_tran, const OsdiDescriptor *descr) { + + NG_IGNORE(extra_inst_data); + double dump; if (is_tran) { /* load dc matrix and capacitances (charge derivative multiplied with @@ -113,10 +116,8 @@ static void load(CKTcircuit *ckt, const GENinstance *gen_inst, void *model, } extern int OSDIload(GENmodel *inModel, CKTcircuit *ckt) { - OsdiNgspiceHandle handle; GENmodel *gen_model; GENinstance *gen_inst; - double dump; bool is_init_smsig = ckt->CKTmode & MODEINITSMSIG; bool is_sweep = ckt->CKTmode & MODEDCTRANCURVE; diff --git a/src/spicelib/devices/cktaccept.c b/src/spicelib/devices/cktaccept.c index 817f939ca..9f9227b47 100644 --- a/src/spicelib/devices/cktaccept.c +++ b/src/spicelib/devices/cktaccept.c @@ -8,6 +8,8 @@ Author: 1985 Thomas L. Quarles * this is a driver program to iterate through all the various accept * functions provided for the circuit elements in the given circuit */ +#include + #include "ngspice/config.h" #include "ngspice/devdefs.h" #include "ngspice/sperror.h"