Browse Source

new: configure --enable-adms3

rlar 14 years ago
parent
commit
f7ea50c287
  1. 36
      ChangeLog
  2. 12
      configure.ac
  3. 2
      src/frontend/inpcom.c
  4. 6
      src/frontend/subckt.c
  5. 2
      src/include/ngspice/devdefs.h
  6. 2
      src/include/ngspice/ngspice.h
  7. 4
      src/spicelib/devices/dev.c
  8. 4
      src/spicelib/parser/inp2u.c
  9. 4
      src/spicelib/parser/inpdomod.c

36
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 2011-12-13 Robert Larice
* **/* : * **/* :
remove CVS `Id',`log' etc. keyword incantations remove CVS `Id',`log' etc. keyword incantations

12
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, AC_ARG_ENABLE(adms,
AS_HELP_STRING([--enable-adms],[Enable ADMS code models, (experimental) ])) 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 dnl --enable-ndev: define NDEV in the code. An interface for external device i.e. numerical device
AC_ARG_ENABLE(ndev, AC_ARG_ENABLE(ndev,
AS_HELP_STRING([--enable-ndev],[Enable NDEV interface, (experimental) ])) AS_HELP_STRING([--enable-ndev],[Enable NDEV interface, (experimental) ]))
@ -867,7 +871,7 @@ AM_CONDITIONAL([NUMDEV_WANTED], [test "$enable_cider" = "yes"])
dnl adms option dnl adms option
if test "$enable_adms" = "yes"; then
if test "$enable_adms" = "yes" -o "$enable_adms3" = "yes" ; then
AC_MSG_RESULT(********************************** AC_MSG_RESULT(**********************************
* ADMS support is experimental * * ADMS support is experimental *
**********************************) **********************************)
@ -876,7 +880,11 @@ if test "$enable_adms" = "yes"; then
if test "$ADMSXML" = "no"; then if test "$ADMSXML" = "no"; then
AC_MSG_ERROR(If you want Verilog-A models you should install admsXml) AC_MSG_ERROR(If you want Verilog-A models you should install admsXml)
fi 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 \ VLADEVDIR=" adms/ekv \
adms/hicum0 \ adms/hicum0 \

2
src/frontend/inpcom.c

@ -1540,7 +1540,7 @@ comment_out_unused_subckt_models( struct line *start_card , int no_of_lines)
found_model = FALSE; found_model = FALSE;
for ( i = 0; i < num_used_model_names; i++ ) 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; 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 */ /* ngspice strategy to detect unused models fails with dynamic models - reason: # of terms unknown during parsing */
#else #else
if ( !found_model ) *line = '*'; if ( !found_model ) *line = '*';

6
src/frontend/subckt.c

@ -1881,8 +1881,8 @@ devmodtranslate(struct line *deck, char *subname)
tfree(s->li_line); tfree(s->li_line);
s->li_line = buffer; s->li_line = buffer;
break; 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. */ name = gettok_node(&t); /* this can be either a model name or a node name. */
for (wlsub = submod; wlsub; wlsub = wlsub->wl_next) { for (wlsub = submod; wlsub; wlsub = wlsub->wl_next) {
if (eq(name, wlsub->wl_word)) { /* a three terminal bjt */ if (eq(name, wlsub->wl_word)) { /* a three terminal bjt */
@ -1911,6 +1911,8 @@ devmodtranslate(struct line *deck, char *subname)
tfree(s->li_line); tfree(s->li_line);
s->li_line = buffer; s->li_line = buffer;
break; break;
#else
case 'u': /* urc transmissionline */
#endif #endif
/* 3 terminal devices */ /* 3 terminal devices */
case 'w': /* current controlled switch */ case 'w': /* current controlled switch */

2
src/include/ngspice/devdefs.h

@ -103,7 +103,7 @@ typedef struct SPICEdev {
} SPICEdev; /* instance of structure for each possible type of device */ } SPICEdev; /* instance of structure for each possible type of device */
#ifdef ADMS
#if ADMS >= 3
typedef struct SPICEadmsdev { typedef struct SPICEadmsdev {
SPICEdev spicedev; SPICEdev spicedev;
int (*DEVunsetup)(GENmodel*,CKTcircuit*); int (*DEVunsetup)(GENmodel*,CKTcircuit*);

2
src/include/ngspice/ngspice.h

@ -234,7 +234,7 @@ extern char *Inp_Path;
extern int ARCHme; /* My logical process number */ extern int ARCHme; /* My logical process number */
extern int ARCHsize; /* Total number of processes */ extern int ARCHsize; /* Total number of processes */
#ifdef ADMS
#if ADMS >= 3
int load_vadev(CKTcircuit *ckt, char *name); int load_vadev(CKTcircuit *ckt, char *name);
#endif #endif

4
src/spicelib/devices/dev.c

@ -142,7 +142,7 @@ int add_udn(int,Evt_Udn_Info_t **);
#endif #endif
/*saj in xspice the DEVices size can be varied so DEVNUM is an int*/ /*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; static int DEVNUM = 63;
#else #else
#define DEVNUM 63 #define DEVNUM 63
@ -165,7 +165,7 @@ int DEVflag(int type){
} }
#endif #endif
#ifdef ADMS
#if ADMS >= 3
#include "ngspice/fteext.h" /* for ft_sim */ #include "ngspice/fteext.h" /* for ft_sim */
#include "ngspice/cktdefs.h" /* for DEVmaxnum */ #include "ngspice/cktdefs.h" /* for DEVmaxnum */
#include <ltdl.h> #include <ltdl.h>

4
src/spicelib/parser/inp2u.c

@ -10,13 +10,13 @@ Author: 1988 Thomas L. Quarles
#include "ngspice/inpmacs.h" #include "ngspice/inpmacs.h"
#include "ngspice/fteext.h" #include "ngspice/fteext.h"
#include "inp.h" #include "inp.h"
#ifdef ADMS
#if ADMS >= 3
#include "error.h" /* controlled_exit() */ #include "error.h" /* controlled_exit() */
#endif #endif
void INP2U(CKTcircuit *ckt, INPtables * tab, card * current) void INP2U(CKTcircuit *ckt, INPtables * tab, card * current)
{ {
#ifdef ADMS
#if ADMS >= 3
/* Uname <node> <node> ... <model> [param1=<val1>] [param1=<val2>] ... */ /* Uname <node> <node> ... <model> [param1=<val1>] [param1=<val2>] ... */

4
src/spicelib/parser/inpdomod.c

@ -7,7 +7,7 @@ Author: 1985 Thomas L. Quarles
#include "ngspice/iferrmsg.h" #include "ngspice/iferrmsg.h"
#include "ngspice/inpdefs.h" #include "ngspice/inpdefs.h"
#include "inp.h" #include "inp.h"
#ifdef ADMS
#if ADMS >= 3
#include "error.h" /* controlled_exit() */ #include "error.h" /* controlled_exit() */
#endif #endif
@ -45,7 +45,7 @@ char *INPdomodel(CKTcircuit *ckt, card * image, INPtables * tab)
INPinsert(&modname, tab); /* stick model name into table */ INPinsert(&modname, tab); /* stick model name into table */
INPgetTok(&line, &type_name, 1); /* get model type */ INPgetTok(&line, &type_name, 1); /* get model type */
#ifdef ADMS
#if ADMS >= 3
if ((type=load_vadev(ckt,type_name)) && type>=0) { if ((type=load_vadev(ckt,type_name)) && type>=0) {
INPmodel *thismodel; INPmodel *thismodel;
char *error; char *error;

Loading…
Cancel
Save