diff --git a/ChangeLog b/ChangeLog index 89036ff06..6b5cba419 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,39 @@ +2011-12-15 Robert Larice + * configure.ac , + * src/frontend/inpcom.c , + * src/frontend/subckt.c , + * src/include/ngspice/devdefs.h , + * src/include/ngspice/ngspice.h , + * src/spicelib/devices/dev.c , + * src/spicelib/parser/inp2u.c , + * src/spicelib/parser/inpdomod.c : + new: configure --enable-adms3 + + make Laurents changes truely --adms3 specific + trying to preserve --adms + +2011-12-15 Laurent Lemaitre + * src/frontend/inpcom.c , + * src/frontend/subckt.c , + * src/include/ngspice/devdefs.h , + * src/spicelib/devices/adms/admst/ngspice.xml , + * src/spicelib/devices/dev.c : + added SPICEadmsdev - a super structure of SPICEdev used to build dynamic device libraries + +2011-12-14 Laurent Lemaitre + * src/spicelib/parser/inp2u.c , + * src/spicelib/parser/inpdomod.c , + * src/spicelib/devices/dev.c , + * src/include/ngspice/ngspice.h , + * src/spicelib/devices/adms/admst/prengspice.xml , + * src/spicelib/devices/adms/admst/ngspice.xml : + renamed premint.xml to prengspice.xml. + xml file that does preformating of verilog files. + add routine load_vadev to public definitions. + add routine load_vadev for dynamic loading of modules. + add dynamic loading of models. shared libs should be libNAME.so. + use u instance as dynamically defined models in --adms mode + 2011-12-13 Robert Larice * **/* : remove CVS `Id',`log' etc. keyword incantations diff --git a/configure.ac b/configure.ac index 8a0d81cd5..98b18e27d 100644 --- a/configure.ac +++ b/configure.ac @@ -140,6 +140,10 @@ dnl --enable-adms: define ADMS in the code. This is for the adms Verilog-A compi AC_ARG_ENABLE(adms, AS_HELP_STRING([--enable-adms],[Enable ADMS code models, (experimental) ])) +dnl --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) ])) + dnl --enable-ndev: define NDEV in the code. An interface for external device i.e. numerical device AC_ARG_ENABLE(ndev, AS_HELP_STRING([--enable-ndev],[Enable NDEV interface, (experimental) ])) @@ -867,7 +871,7 @@ AM_CONDITIONAL([NUMDEV_WANTED], [test "$enable_cider" = "yes"]) dnl adms option -if test "$enable_adms" = "yes"; then +if test "$enable_adms" = "yes" -o "$enable_adms3" = "yes" ; then AC_MSG_RESULT(********************************** * ADMS support is experimental * **********************************) @@ -876,7 +880,11 @@ if test "$enable_adms" = "yes"; then if test "$ADMSXML" = "no"; then AC_MSG_ERROR(If you want Verilog-A models you should install admsXml) fi - AC_DEFINE(ADMS,[1],[Support for Verilog-A models]) + if test "$enable_adms3" = "yes" ; then + AC_DEFINE(ADMS,[3],[Support for Verilog-A models (adms3)]) + else + AC_DEFINE(ADMS,[1],[Support for Verilog-A models]) + fi VLADEVDIR=" adms/ekv \ adms/hicum0 \ diff --git a/src/frontend/inpcom.c b/src/frontend/inpcom.c index 98af26a3e..e9eda3f17 100644 --- a/src/frontend/inpcom.c +++ b/src/frontend/inpcom.c @@ -1540,7 +1540,7 @@ comment_out_unused_subckt_models( struct line *start_card , int no_of_lines) found_model = FALSE; for ( i = 0; i < num_used_model_names; i++ ) if ( strcmp( used_model_names[i], model_name ) == 0 || model_bin_match( used_model_names[i], model_name ) ) found_model = TRUE; -#ifdef ADMS +#if ADMS >= 3 /* ngspice strategy to detect unused models fails with dynamic models - reason: # of terms unknown during parsing */ #else if ( !found_model ) *line = '*'; diff --git a/src/frontend/subckt.c b/src/frontend/subckt.c index 3cd6041f4..24fe511d5 100644 --- a/src/frontend/subckt.c +++ b/src/frontend/subckt.c @@ -1881,8 +1881,8 @@ devmodtranslate(struct line *deck, char *subname) tfree(s->li_line); s->li_line = buffer; break; - case 'u': /* urc transmissionline */ -#ifdef ADMS +#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. */ for (wlsub = submod; wlsub; wlsub = wlsub->wl_next) { if (eq(name, wlsub->wl_word)) { /* a three terminal bjt */ @@ -1911,6 +1911,8 @@ devmodtranslate(struct line *deck, char *subname) tfree(s->li_line); s->li_line = buffer; break; +#else + case 'u': /* urc transmissionline */ #endif /* 3 terminal devices */ case 'w': /* current controlled switch */ diff --git a/src/include/ngspice/devdefs.h b/src/include/ngspice/devdefs.h index ccd6f47ad..98f6666dd 100644 --- a/src/include/ngspice/devdefs.h +++ b/src/include/ngspice/devdefs.h @@ -103,7 +103,7 @@ typedef struct SPICEdev { } SPICEdev; /* instance of structure for each possible type of device */ -#ifdef ADMS +#if ADMS >= 3 typedef struct SPICEadmsdev { SPICEdev spicedev; int (*DEVunsetup)(GENmodel*,CKTcircuit*); diff --git a/src/include/ngspice/ngspice.h b/src/include/ngspice/ngspice.h index 5478ac3cf..1255e6132 100644 --- a/src/include/ngspice/ngspice.h +++ b/src/include/ngspice/ngspice.h @@ -234,7 +234,7 @@ extern char *Inp_Path; extern int ARCHme; /* My logical process number */ extern int ARCHsize; /* Total number of processes */ -#ifdef ADMS +#if ADMS >= 3 int load_vadev(CKTcircuit *ckt, char *name); #endif diff --git a/src/spicelib/devices/dev.c b/src/spicelib/devices/dev.c index af1015b5d..5f4e4601a 100644 --- a/src/spicelib/devices/dev.c +++ b/src/spicelib/devices/dev.c @@ -142,7 +142,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 || defined ADMS +#if defined XSPICE || ADMS >= 3 static int DEVNUM = 63; #else #define DEVNUM 63 @@ -165,7 +165,7 @@ int DEVflag(int type){ } #endif -#ifdef ADMS +#if ADMS >= 3 #include "ngspice/fteext.h" /* for ft_sim */ #include "ngspice/cktdefs.h" /* for DEVmaxnum */ #include diff --git a/src/spicelib/parser/inp2u.c b/src/spicelib/parser/inp2u.c index e87e4a482..700623c24 100644 --- a/src/spicelib/parser/inp2u.c +++ b/src/spicelib/parser/inp2u.c @@ -10,13 +10,13 @@ Author: 1988 Thomas L. Quarles #include "ngspice/inpmacs.h" #include "ngspice/fteext.h" #include "inp.h" -#ifdef ADMS +#if ADMS >= 3 #include "error.h" /* controlled_exit() */ #endif void INP2U(CKTcircuit *ckt, INPtables * tab, card * current) { -#ifdef ADMS +#if ADMS >= 3 /* Uname ... [param1=] [param1=] ... */ diff --git a/src/spicelib/parser/inpdomod.c b/src/spicelib/parser/inpdomod.c index 9eb12751d..b47ff2ed8 100644 --- a/src/spicelib/parser/inpdomod.c +++ b/src/spicelib/parser/inpdomod.c @@ -7,7 +7,7 @@ Author: 1985 Thomas L. Quarles #include "ngspice/iferrmsg.h" #include "ngspice/inpdefs.h" #include "inp.h" -#ifdef ADMS +#if ADMS >= 3 #include "error.h" /* controlled_exit() */ #endif @@ -45,7 +45,7 @@ char *INPdomodel(CKTcircuit *ckt, card * image, INPtables * tab) INPinsert(&modname, tab); /* stick model name into table */ INPgetTok(&line, &type_name, 1); /* get model type */ -#ifdef ADMS +#if ADMS >= 3 if ((type=load_vadev(ckt,type_name)) && type>=0) { INPmodel *thismodel; char *error;