From b82ef13db704b15b596fa9f271b42814b9cf5ae6 Mon Sep 17 00:00:00 2001 From: h_vogt Date: Sun, 1 Aug 2010 10:28:18 +0000 Subject: [PATCH] update for adms --- ChangeLog | 3 +++ autogen.sh | 50 +++++++++++++++++++++++++------------ src/spicelib/parser/inp2q.c | 16 +++++++----- 3 files changed, 47 insertions(+), 22 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5cbf7f35b..051bc54fc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +2010-08-01 Holger Vogt + * autogen.sh, spicelib/parser/inp2q.c: update for adms + 2010-07-31 Robert Larice * src/frontend/parse.c : work around a segmentation fault, when plotting diff --git a/autogen.sh b/autogen.sh index bf67c687a..18ee89a11 100755 --- a/autogen.sh +++ b/autogen.sh @@ -114,16 +114,27 @@ test $TEST_TYPE $FILE || { } -cp -p configure.in configure.temp + if test "$ADMS" -eq 1; then +cp -p configure.in configure.temp + # automake needs these entries in configure.in for adms enabled - sed 's/${VLAMKF}/src\/spicelib\/devices\/adms\/ekv\/Makefile\ - src\/spicelib\/devices\/adms\/hicum0\/Makefile\ - src\/spicelib\/devices\/adms\/hicum2\/Makefile\ - src\/spicelib\/devices\/adms\/mextram\/Makefile\ - src\/spicelib\/devices\/adms\/psp102\/Makefile/g' configure.temp >configure.in +# sed 's/${VLAMKF}/src\/spicelib\/devices\/adms\/ekv\/Makefile\ +# src\/spicelib\/devices\/adms\/hicum0\/Makefile\ +# src\/spicelib\/devices\/adms\/hicum2\/Makefile\ +# src\/spicelib\/devices\/adms\/mextram\/Makefile\ +# src\/spicelib\/devices\/adms\/psp102\/Makefile/g' configure.temp >configure.test + + sed 's/tests\/vbic\/Makefile/tests\/vbic\/Makefile\ + src\/spicelib\/devices\/adms\/ekv\/Makefile\ + src\/spicelib\/devices\/adms\/hicum0\/Makefile\ + src\/spicelib\/devices\/adms\/hicum2\/Makefile\ + src\/spicelib\/devices\/adms\/mextram\/Makefile\ + src\/spicelib\/devices\/adms\/psp102\/Makefile/g' configure.temp >configure.in + +# cp -p configure.in configure.test currentdir=`pwd` @@ -155,36 +166,43 @@ if test "$ADMS" -eq 1; then fi done -else - - sed '/${VLAMKF}/d' configure.temp >configure.in - fi echo "Running libtoolize" libtoolize --copy --force -if [ $? -ne 0 ];then echo "libtoolize failed"; exit 1 ; fi +if [ $? -ne 0 ];then echo "libtoolize failed"; goto errorhandler ; fi echo "Running aclocal $ACLOCAL_FLAGS" aclocal $ACLOCAL_FLAGS -if [ $? -ne 0 ]; then echo "aclocal failed"; exit 1 ; fi +if [ $? -ne 0 ]; then echo "aclocal failed"; goto errorhandler ; fi # optional feature: autoheader (autoheader --version) < /dev/null > /dev/null 2>&1 if [ $? -eq 0 ]; then echo "Running autoheader" autoheader - if [ $? -ne 0 ]; then echo "autoheader failed"; exit 1 ; fi + if [ $? -ne 0 ]; then echo "autoheader failed"; goto errorhandler ; fi fi echo "Running automake -Wall --copy --add-missing" automake -Wall --copy --add-missing $am_opt -if [ $? -ne 0 ]; then echo "automake failed"; exit 1 ; fi +if [ $? -ne 0 ]; then echo "automake failed"; goto errorhandler ; fi echo "Running autoconf" autoconf -if [ $? -ne 0 ]; then echo "autoconf failed"; exit 1 ; fi +if [ $? -ne 0 ]; then echo "autoconf failed"; goto errorhandler ; fi -mv configure.temp configure.in +if test "$ADMS" -eq 1; then + mv configure.temp configure.in +fi echo "Success." + +exit 0 + +errorhandler: +if test "$ADMS" -eq 1; then + mv configure.temp configure.in +fi + +exit 1 \ No newline at end of file diff --git a/src/spicelib/parser/inp2q.c b/src/spicelib/parser/inp2q.c index 6fb94592b..76d6e7be3 100644 --- a/src/spicelib/parser/inp2q.c +++ b/src/spicelib/parser/inp2q.c @@ -84,12 +84,16 @@ void INP2Q(CKTcircuit *ckt, INPtables * tab, card * current, void *gnode) INPinsert(&model, tab); current->error = INPgetMod(ckt, model, &thismodel, tab); #ifdef ADMS - if ((thismodel->INPmodType == INPtypelook("hicum0")) + if (thismodel == NULL) { + fprintf(stderr, "%s\nPlease check model, level or number of terminals!\n", current->error); + controlled_exit(EXIT_BAD); + } + else if ((thismodel->INPmodType == INPtypelook("hicum0")) || (thismodel->INPmodType == INPtypelook("hicum2")) || (thismodel->INPmodType == INPtypelook("mextram"))) { node5 = gnode; /* 4-terminal adms device - thermal node to ground */ - nname5 = "0"; + nname5 = copy("0"); INPtermInsert(ckt, &nname5, tab, &node5); nodeflag = 1; /* now specify a 5 node device */ } @@ -139,9 +143,9 @@ void INP2Q(CKTcircuit *ckt, INPtables * tab, card * current, void *gnode) } #endif type = (thismodel->INPmodType); - mdfast = (thismodel->INPmodfast); + mdfast = (thismodel->INPmodfast); } else { - /* no model found */ + /* no model found */ type = INPtypelook("BJT"); if (type < 0) { LITERR("Device type BJT not supported by this binary\n"); @@ -159,7 +163,7 @@ void INP2Q(CKTcircuit *ckt, INPtables * tab, card * current, void *gnode) } mdfast = tab->defQmod; } - + #ifdef TRACE printf("INP2Q: Type: %d nodeflag: %d instancename: %s\n", type, nodeflag, name); #endif @@ -187,5 +191,5 @@ void INP2Q(CKTcircuit *ckt, INPtables * tab, card * current, void *gnode) } #ifdef CIDER } -#endif +#endif }