From 3d557b762bc18212237913dcfa17fef07eec931e Mon Sep 17 00:00:00 2001 From: pnenzi Date: Sun, 13 May 2001 13:24:12 +0000 Subject: [PATCH] First commit for EKV model support (as a not source model). --- acconfig.h | 6 ++++++ configure.in | 32 ++++++++++++++++++++++---------- src/Makefile.am | 1 + src/spicelib/devices/Makefile.am | 1 + src/spicelib/devices/dev.c | 17 ++++++++++++++++- 5 files changed, 46 insertions(+), 11 deletions(-) diff --git a/acconfig.h b/acconfig.h index 8e1673cd9..2f60a074f 100644 --- a/acconfig.h +++ b/acconfig.h @@ -28,3 +28,9 @@ /* Define if we want noise integration code */ #undef INT_NOISE + +/* Undefine HAVE_EKV since it is not included in the standard distribution */ +#undef HAVE_EKV + +/* Undefine HAVE_GNUREADLINE */ +#undef HAVE_GNUREADLINE diff --git a/configure.in b/configure.in index 587f49b6f..b1b023d4e 100644 --- a/configure.in +++ b/configure.in @@ -44,10 +44,9 @@ dnl --enable-experimental : define EXPERIMENTAL_CODE for the code AC_ARG_ENABLE(experimental, [ --enable-experimental Enables some experimental code]) - -dnl --have-ekv: define HAVE_EKV in the code. This is for EKV model support +dnl --enable-ekv: define HAVE_EKV in the code. This is for EKV model support AC_ARG_ENABLE(ekv, - [ --enable-ekv Enable ekv model *not in standard distribution*]) + [ --enable-ekv Enables ekv model *not in standard distribution*]) dnl Enable maintainer commands only if requested AM_MAINTAINER_MODE @@ -182,10 +181,6 @@ dnl Check for getopt function and if not found uses a local copy: AC_CHECK_FUNC(getopt, GETOPTSRC="", GETOPTSRC= "getopt.h getopt.c getopt1.c") AC_SUBST(GETOPTSRC) -AC_MSG_RESULT(Checking for readline library:) -dnl Check for the readline library -AC_CHECK_LIB(readline, AC_DEFINE(HAVE_GNUREADLINE) LIBS="$LIBS -lreadline") - # Expand the prefix variable (this is really annoying!) if eval "test x$prefix = xNONE"; then dprefix=$ac_default_prefix @@ -220,11 +215,28 @@ if test "$enable_experimental" = "yes"; then AC_DEFINE(EXPERIMENTAL_CODE) AC_MSG_RESULT(EXPERIMENTAL_CODE enabled) fi + + if test "$enable_ekv" = "yes"; then - AC_DEFINE(HAVE_EKV) AC_MSG_RESULT(Model EKV included) - EKVDIR=ekv + AC_DEFINE(HAVE_EKV) + EKVDIR="ekv" + EKVLIB="spicelib/devices/ekv/libekv.la" +else + EKVDIR="" + EKVLIB="" fi +AC_SUBST(EKVDIR) +AC_SUBST(EKVLIB) + + +dnl --with-readline : the user wants to use readline library +AC_ARG_WITH(readline, + [ --with-readline Use the readline package: SEE README], + AC_MSG_RESULT(Checking for readline library:) +dnl Check for the readline library: + AC_CHECK_LIB(readline,readline, AC_DEFINE(HAVE_GNUREADLINE) LIBS="$LIBS -lreadline") +) AC_OUTPUT( \ @@ -253,7 +265,7 @@ src/spicelib/devices/cccs/Makefile \ src/spicelib/devices/ccvs/Makefile \ src/spicelib/devices/csw/Makefile \ src/spicelib/devices/dio/Makefile \ -src/spicelib/devices/dio/Makefile \ +src/spicelib/devices/ekv/Makefile \ src/spicelib/devices/ind/Makefile \ src/spicelib/devices/isrc/Makefile \ src/spicelib/devices/hfet1/Makefile \ diff --git a/src/Makefile.am b/src/Makefile.am index 30e9864c8..49ceea3cb 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -34,6 +34,7 @@ DYNAMIC_DEVICELIBS = \ spicelib/devices/ccvs/libccvs.la \ spicelib/devices/csw/libcsw.la \ spicelib/devices/dio/libdio.la \ + @EKVLIB@ \ spicelib/devices/ind/libind.la \ spicelib/devices/isrc/libisrc.la \ spicelib/devices/hfet1/libhfet.la \ diff --git a/src/spicelib/devices/Makefile.am b/src/spicelib/devices/Makefile.am index ca5e1f7c1..f43a805c4 100644 --- a/src/spicelib/devices/Makefile.am +++ b/src/spicelib/devices/Makefile.am @@ -18,6 +18,7 @@ SUBDIRS = \ ccvs \ csw \ dio \ + @EKVDIR@ \ ind \ isrc \ hfet1 \ diff --git a/src/spicelib/devices/dev.c b/src/spicelib/devices/dev.c index 6e8e3420c..50e9ad40a 100644 --- a/src/spicelib/devices/dev.c +++ b/src/spicelib/devices/dev.c @@ -35,7 +35,10 @@ #include "dev.h" -#define DEVICES_USED "asrc bjt bjt2 bsim1 bsim2 bsim3 bsim3v2 bsim3v1 bsim4 bsim3soipd bsim3soifd bsim3soidd cap cccs ccvs csw dio hfet hfet2 ind isrc jfet ltra mes mesa mos1 mos2 mos3 mos6 mos9 res soi3 sw tra urc vccs vcvs vsrc" +#define DEVICES_USED "asrc bjt bjt2 bsim1 bsim2 bsim3 bsim3v2 bsim3v1 bsim4 bsim3soipd bsim3soifd \ + bsim3soidd cap cccs ccvs csw dio hfet hfet2 ind isrc jfet ltra mes mesa mos1 \ + mos2 mos3 mos6 mos9 res soi3 sw tra urc vccs vcvs vsrc (ekv)" + /* * Analyses @@ -93,8 +96,15 @@ #include "vcvs/vcvsitf.h" #include "vsrc/vsrcitf.h" +#ifdef HAVE_EKV +#include "ekv/ekvitf.h" +#define DEVNUM 41 + +#else #define DEVNUM 40 +#endif + SPICEdev *DEVices[DEVNUM]; @@ -144,7 +154,12 @@ spice_init_devices(void) DEVices[37] = get_vccs_info(); DEVices[38] = get_vcvs_info(); DEVices[39] = get_vsrc_info(); +#ifdef HAVE_EKV + DEVices[40] = get_ekv_info(); + assert(41 == DEVNUM); +#else assert(40 == DEVNUM); +#endif }