From ba131a507772da08f125906d39a31b5c0ec26d46 Mon Sep 17 00:00:00 2001 From: rlar Date: Thu, 25 Oct 2012 18:53:18 +0200 Subject: [PATCH] remove adms3 #1/2, code due to license issues, and with the aim to approach the next ngspice release 25 we have to move this over to a development branch --- autogen.sh | 20 ++------- configure.ac | 12 +----- src/frontend/inpcom.c | 4 -- src/frontend/subckt.c | 21 ---------- src/include/ngspice/devdefs.h | 9 ---- src/include/ngspice/ngspice.h | 4 -- src/spicelib/devices/dev.c | 69 +----------------------------- src/spicelib/parser/inp.h | 3 -- src/spicelib/parser/inp2u.c | 76 ---------------------------------- src/spicelib/parser/inpdomod.c | 21 ---------- src/spicelib/parser/inppas2.c | 4 -- 11 files changed, 6 insertions(+), 237 deletions(-) diff --git a/autogen.sh b/autogen.sh index f7d5b6a4e..241930791 100755 --- a/autogen.sh +++ b/autogen.sh @@ -28,7 +28,6 @@ help() echo "$PROJECT autogen.sh help" echo echo "--adms -a: enables adms feature" - echo "--adms3 : enables adms3 feature" echo "--help -h: print this file" echo "--version -v: print version" echo @@ -104,11 +103,6 @@ case "$1" in ADMS=1 ;; - "--adms3" ) - check_adms - ADMS=3 - ;; - "--help" | "-h") help exit 0 @@ -176,17 +170,9 @@ $znew echo "-->"$ADMSDIR/$adms_dir ( cd $ADMSDIR/$adms_dir - if [ "$ADMS" -eq 3 ]; then - $ADMSXML \ - -I adms3va \ - --create_makefile_am \ - -e ../admst/ngspice.xml \ - `ls adms3va/*.va` - else - $ADMSXML `ls admsva/*.va` -Iadmsva -xv \ - -e ../admst/ngspiceVersion.xml \ - -e ../admst/ngspiceMakefile.am.xml - fi + $ADMSXML `ls admsva/*.va` -Iadmsva -xv \ + -e ../admst/ngspiceVersion.xml \ + -e ../admst/ngspiceMakefile.am.xml ) ;; esac diff --git a/configure.ac b/configure.ac index e95fa9b58..1adec3c69 100644 --- a/configure.ac +++ b/configure.ac @@ -145,10 +145,6 @@ AC_ARG_ENABLE([cider], AC_ARG_ENABLE([adms], [AS_HELP_STRING([--enable-adms], [Enable ADMS code models, (experimental)])]) -# --enable-adms3: define ADMS in the code. This is for the adms Verilog-A compiler support -AC_ARG_ENABLE([adms3], - [AS_HELP_STRING([--enable-adms3], [Enable ADMS code models, (experimental) (adms3)])]) - # --enable-xspice: define XSPICE in the code. This is for xspice support AC_ARG_ENABLE([pss], [AS_HELP_STRING([--enable-pss], [Enable PSS analysis, (very experimental)])]) @@ -881,7 +877,7 @@ AM_CONDITIONAL([NUMDEV_WANTED], [test "x$enable_cider" = xyes]) AM_CONDITIONAL([PSS_WANTED], [test "x$enable_pss" = xyes]) # adms option -if test "x$enable_adms" = xyes || test "x$enable_adms3" = xyes ; then +if test "x$enable_adms" = xyes ; then AC_MSG_RESULT([********************************** * ADMS support is experimental * **********************************]) @@ -890,11 +886,7 @@ if test "x$enable_adms" = xyes || test "x$enable_adms3" = xyes ; then if test "x$ADMSXML" = xno; then AC_MSG_ERROR([If you want Verilog-A models you should install admsXml]) fi - if test "x$enable_adms3" = xyes ; then - AC_DEFINE([ADMS], [3], [Support for Verilog-A models (adms3)]) - else - AC_DEFINE([ADMS], [1], [Support for Verilog-A models]) - fi + AC_DEFINE([ADMS], [1], [Support for Verilog-A models]) VLADEVDIR=" adms/ekv \ adms/hicum0 \ diff --git a/src/frontend/inpcom.c b/src/frontend/inpcom.c index 6618cdcde..16f728b9e 100644 --- a/src/frontend/inpcom.c +++ b/src/frontend/inpcom.c @@ -1611,12 +1611,8 @@ comment_out_unused_subckt_models(struct line *start_card, int no_of_lines) } if (model_type) tfree(model_type); -#if ADMS >= 3 - /* ngspice strategy to detect unused models fails with dynamic models - reason: # of terms unknown during parsing */ -#else if (!found_model) *line = '*'; -#endif tfree(model_name); } } diff --git a/src/frontend/subckt.c b/src/frontend/subckt.c index 63d7390c8..693464219 100644 --- a/src/frontend/subckt.c +++ b/src/frontend/subckt.c @@ -1873,28 +1873,7 @@ devmodtranslate(struct line *deck, char *subname, wordlist * const submod) tfree(s->li_line); s->li_line = buffer; break; -#if ADMS >= 3 - case 'u': /* urc transmissionline */ /* hijacked for adms */ - name = gettok_node(&t); /* this can be either a model name or a node name. */ - wlsub = wl_find(name, submod); - - while (!wlsub) { - (void) sprintf(buffer + strlen(buffer), "%s ", name); - tfree(name); - name = gettok_node(&t); /* this can be either a model name or a node name. */ - wlsub = wl_find(name, submod); - } - - if (wlsub) - (void) sprintf(buffer + strlen(buffer), "%s:%s ", subname, name); - - (void) strcat(buffer, t); - tfree(s->li_line); - s->li_line = buffer; - break; -#else case 'u': /* urc transmissionline */ -#endif /* 3 terminal devices */ case 'w': /* current controlled switch */ case 'j': /* jfet */ diff --git a/src/include/ngspice/devdefs.h b/src/include/ngspice/devdefs.h index 94f7da335..fb5ba6771 100644 --- a/src/include/ngspice/devdefs.h +++ b/src/include/ngspice/devdefs.h @@ -103,15 +103,6 @@ typedef struct SPICEdev { } SPICEdev; /* instance of structure for each possible type of device */ -#if ADMS >= 3 -typedef struct SPICEadmsdev { - SPICEdev spicedev; - int (*DEVunsetup)(GENmodel*,CKTcircuit*); - int (*mkn)(CKTcircuit *, CKTnode **, IFuid, char *); - double *(*mkj)(SMPmatrix *, int, int); -} SPICEadmsdev; -#endif - extern SPICEdev **DEVices; extern int DEVmaxnum; /* size of DEVices array */ diff --git a/src/include/ngspice/ngspice.h b/src/include/ngspice/ngspice.h index b5c7f7738..39f304a2a 100644 --- a/src/include/ngspice/ngspice.h +++ b/src/include/ngspice/ngspice.h @@ -232,10 +232,6 @@ extern char *Help_Path; extern char *Lib_Path; extern char *Inp_Path; -#if ADMS >= 3 -int load_vadev(CKTcircuit *ckt, char *name); -#endif - #ifdef TCL_MODULE #include diff --git a/src/spicelib/devices/dev.c b/src/spicelib/devices/dev.c index eb50dce90..8037c6fef 100644 --- a/src/spicelib/devices/dev.c +++ b/src/spicelib/devices/dev.c @@ -141,7 +141,7 @@ int add_udn(int,Evt_Udn_Info_t **); #endif /*saj in xspice the DEVices size can be varied so DEVNUM is an int*/ -#if defined XSPICE || ADMS >= 3 +#if defined XSPICE static int DEVNUM = 63; #else #define DEVNUM 63 @@ -164,73 +164,6 @@ int DEVflag(int type){ } #endif -#if ADMS >= 3 -#include "ngspice/fteext.h" /* for ft_sim */ -#include "ngspice/cktdefs.h" /* for DEVmaxnum */ -#include -static void varelink(CKTcircuit *ckt) { - -/* - * This replacement done by SDB on 6.11.2003 - * - * ft_sim->numDevices = num_devices(); - * DEVmaxnum = num_devices(); - */ - ft_sim->numDevices = DEVNUM; - DEVmaxnum = DEVNUM; - - ckt->CKThead = TREALLOC(GENmodel *, ckt->CKThead, DEVmaxnum); - ckt->CKThead[DEVmaxnum-1] = NULL; - - - ft_sim->devices = devices_ptr(); - return; -} -int load_vadev(CKTcircuit *ckt, char *name) -{ - char *msg, libname[50]; - void *lib; - SPICEadmsdev *device; - void* fetch; /* fixme funptr_t */ - - strcpy(libname, "lib"); - strcat(libname,name); - strcat(libname,".so"); - - lib = dlopen(libname, RTLD_NOW); - - if(!lib){ - msg = dlerror(); - printf("%s\n", msg); - return -1; - } - - strcpy(libname, "get_"); - strcat(libname,name); - strcat(libname,"_info"); - fetch = dlsym(lib,libname); - - if(fetch) - device = ((SPICEadmsdev * (*)(void)) fetch) (); - else - device = NULL; - - if(!device) { - msg = dlerror(); - printf("%s\n", msg); - return -1; - } - - device->mkn = CKTmkVolt; - device->mkj = SMPmakeElt; - - DEVices = TREALLOC(SPICEdev *, DEVices, DEVNUM + 1); - printf("Added device: %s from dynamic library %s\n", device->spicedev.DEVpublic.name, libname); - DEVices[DEVNUM++] = & (device->spicedev); - varelink(ckt); - return DEVNUM-1; -} -#endif void diff --git a/src/spicelib/parser/inp.h b/src/spicelib/parser/inp.h index d41b84b94..9c679d9a7 100644 --- a/src/spicelib/parser/inp.h +++ b/src/spicelib/parser/inp.h @@ -33,9 +33,6 @@ void INP2W(CKTcircuit *ckt, INPtables *tab, card *current); void INP2Y(CKTcircuit *ckt, INPtables *tab, card *current); void INP2Z(CKTcircuit *ckt, INPtables *tab, card *current); -#if ADMS >= 3 -void INP2adms(CKTcircuit *ckt, INPtables *tab, card *current); -#endif /* ptfuncs.c */ diff --git a/src/spicelib/parser/inp2u.c b/src/spicelib/parser/inp2u.c index ae489801b..df7a7de28 100644 --- a/src/spicelib/parser/inp2u.c +++ b/src/spicelib/parser/inp2u.c @@ -11,80 +11,6 @@ Author: 1988 Thomas L. Quarles #include "ngspice/fteext.h" #include "inp.h" -#if ADMS >= 3 - -void INP2adms(CKTcircuit *ckt, INPtables * tab, card * current) -{ - /* Uname ... [param1=] [param1=] ... */ - - char *line; /* the part of the current line left to parse */ - char *iname; /* the instance's name */ - char *name; /* the resistor's name */ - int nsize; /* number of nodes */ - int i; - CKTnode **node; /* the first node's node pointer */ - int error; /* error code temporary */ - GENinstance *fast; /* pointer to the actual instance */ - int waslead; /* flag to indicate that funny unlabeled number was found */ - double leadval; /* actual value of unlabeled number */ - -#ifdef TRACE - printf("INP2adms: Parsing '%s'\n", current->line); -#endif - - nsize = 0; - node=NULL; - line = current->line; - - INPgetTok(&line, &iname, 1); - INPinsert(&iname, tab); - - INPgetNetTok(&line, &name, 1); - while(!INPlookMod(name) && (*line != '\0')) - { -#ifdef TRACE - printf("INP2adms: found node %s\n",name); -#endif - nsize++; - node=TREALLOC(CKTnode*,node,nsize); - INPtermInsert(ckt, &name, tab, &node[nsize-1]); - INPgetNetTok(&line, &name, 1); - } - - if (INPlookMod(name)) { - INPmodel *thismodel; /* pointer to model description for user's model */ - thismodel = NULL; - INPinsert(&name, tab); -#ifdef TRACE - printf("INP2adms: found dynamic model %s\n",name); -#endif - current->error = INPgetMod(ckt, name, &thismodel, tab); - if (thismodel == NULL) { - fprintf(stderr, "%s\nPlease check model, level or number of terminals!\n", current->error); - controlled_exit(EXIT_BAD); - } - else - { - IFC(newInstance, (ckt, thismodel->INPmodfast, &fast, iname)); - for(i=0;iINPmodType, fast, &leadval, &waslead, tab)); -#ifdef TRACE - printf("INP2adms: Looking up model done\n"); -#endif - } - } else { - fprintf(stderr, "Unable to find definition of model %s\n", name); - controlled_exit(EXIT_BAD); - } -} - - -#else - - void INP2U(CKTcircuit *ckt, INPtables * tab, card * current) { /* Uname [l=] [n=] */ @@ -148,5 +74,3 @@ void INP2U(CKTcircuit *ckt, INPtables * tab, card * current) IFC(bindNode, (ckt, fast, 3, node3)); PARSECALL((&line, ckt, type, fast, &leadval, &waslead, tab)); } - -#endif /* ADMS */ diff --git a/src/spicelib/parser/inpdomod.c b/src/spicelib/parser/inpdomod.c index bee2cdca9..4a55bb6c3 100644 --- a/src/spicelib/parser/inpdomod.c +++ b/src/spicelib/parser/inpdomod.c @@ -7,9 +7,6 @@ Author: 1985 Thomas L. Quarles #include "ngspice/iferrmsg.h" #include "ngspice/inpdefs.h" #include "inp.h" -#if ADMS >= 3 -#include "ngspice/fteext.h" /* controlled_exit() */ -#endif /*-------------------------------------------------------------- * This fcn takes the model card & examines it. Depending upon @@ -45,24 +42,6 @@ char *INPdomodel(CKTcircuit *ckt, card * image, INPtables * tab) INPinsert(&modname, tab); /* stick model name into table */ INPgetTok(&line, &type_name, 1); /* get model type */ -#if ADMS >= 3 - if ((type=load_vadev(ckt,type_name)) && type>=0) { - INPmodel *thismodel; - char *error; -#ifdef TRACE - printf("inpdomod.c: got model %s from dynamic library - create device # %i\n",type_name,type); -#endif - INPmakeMod(modname, type, image); - thismodel=NULL; - error=INPgetMod(ckt, modname, &thismodel, tab); - if (thismodel == NULL) - { - fprintf(stderr, "%s\nPlease check model, level or number of terminals!\n", error); - controlled_exit(EXIT_BAD); - } - } - else -#endif /* ----- Check if model is a BJT --------- */ if (strcmp(type_name, "npn") == 0 || strcmp(type_name, "pnp") == 0) { err = INPfindLev(line,&lev); diff --git a/src/spicelib/parser/inppas2.c b/src/spicelib/parser/inppas2.c index 0718a6247..c16b879fa 100644 --- a/src/spicelib/parser/inppas2.c +++ b/src/spicelib/parser/inppas2.c @@ -221,11 +221,7 @@ void INPpas2(CKTcircuit *ckt, card * data, INPtables * tab, TSKtask *task) case 'U': /* Uname [l=] [n=] */ -#if ADMS >= 3 - INP2adms(ckt, tab, current); -#else INP2U(ckt, tab, current); -#endif break; /* Kspice addition - saj */