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
This commit is contained in:
parent
07bb5f8e2f
commit
ba131a5077
20
autogen.sh
20
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
|
||||
|
|
|
|||
12
configure.ac
12
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 \
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 */
|
||||
|
|
|
|||
|
|
@ -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 */
|
||||
|
|
|
|||
|
|
@ -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 <errno.h>
|
||||
|
|
|
|||
|
|
@ -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 <dlfcn.h>
|
||||
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
|
||||
|
|
|
|||
|
|
@ -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 */
|
||||
|
||||
|
|
|
|||
|
|
@ -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 <node> <node> ... <model> [param1=<val1>] [param1=<val2>] ... */
|
||||
|
||||
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;i<nsize;i++)
|
||||
{
|
||||
IFC(bindNode, (ckt, fast, i+1, node[i]));
|
||||
}
|
||||
PARSECALL((&line, ckt, thismodel->INPmodType, 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 <node> <node> <model> [l=<val>] [n=<val>] */
|
||||
|
|
@ -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 */
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -221,11 +221,7 @@ void INPpas2(CKTcircuit *ckt, card * data, INPtables * tab, TSKtask *task)
|
|||
|
||||
case 'U':
|
||||
/* Uname <node> <node> <model> [l=<val>] [n=<val>] */
|
||||
#if ADMS >= 3
|
||||
INP2adms(ckt, tab, current);
|
||||
#else
|
||||
INP2U(ckt, tab, current);
|
||||
#endif
|
||||
break;
|
||||
|
||||
/* Kspice addition - saj */
|
||||
|
|
|
|||
Loading…
Reference in New Issue