diff --git a/bsimcmg_benchmark_test/gummel_n.sp b/bsimcmg_benchmark_test/gummel_n.sp index 2a3c30e85..cb1d501b5 100644 --- a/bsimcmg_benchmark_test/gummel_n.sp +++ b/bsimcmg_benchmark_test/gummel_n.sp @@ -26,8 +26,11 @@ m1 drain gate source bulk 0 nmos1 TFIN=15n L=30n NFIN=10 NRS=1 NRD=1 .print dc par'ids' par'gx' par'gx2' par'gx3' par 'gx4' .control +save @m1[VDSSAT] run +show all plot -i(vdrain) +plot @m1[VDSSAT] .endc .end diff --git a/src/spicelib/devices/adms/admst/ngspiceMODULE.c.xml b/src/spicelib/devices/adms/admst/ngspiceMODULE.c.xml index dc887ee58..6ea922da0 100644 --- a/src/spicelib/devices/adms/admst/ngspiceMODULE.c.xml +++ b/src/spicelib/devices/adms/admst/ngspiceMODULE.c.xml @@ -33,27 +33,37 @@ #include "$(module)defs.h" #include "ngspice/suffix.h" - - +IFparm $(module)pTable[] = { + - - - - + IOP("%(lower-case(name))",$(module)_instance_%(name),IF_REAL,"%(name)"), - - - - + IOP("%(lower-case(name))",$(module)_instance_%(name),IF_INTEGER,"%(name)"), - - + + + + + + + + OP("%(lower-case(name))",$(module)_ask_%(name),IF_REAL,"%(attribute[name='desc']/value)"), + + + + + + + + +}; + diff --git a/src/spicelib/devices/adms/admst/ngspiceMODULE.hxx.xml b/src/spicelib/devices/adms/admst/ngspiceMODULE.hxx.xml index 41b936538..09acb35b6 100644 --- a/src/spicelib/devices/adms/admst/ngspiceMODULE.hxx.xml +++ b/src/spicelib/devices/adms/admst/ngspiceMODULE.hxx.xml @@ -1147,6 +1147,9 @@ inline double _d1_pow(double x,double y) { return (x==0.0)?0.0:((log(x)/exp(0. + + + @@ -2363,7 +2366,14 @@ inline double _d1_pow(double x,double y) { return (x==0.0)?0.0:((log(x)/exp(0. - + + + + + + + + @@ -2718,7 +2728,13 @@ inline double _d1_pow(double x,double y) { return (x==0.0)?0.0:((log(x)/exp(0. - + + + + + + + diff --git a/src/spicelib/devices/adms/admst/ngspiceMODULEask.c.xml b/src/spicelib/devices/adms/admst/ngspiceMODULEask.c.xml index 2ebcdef42..d9bf9fb13 100644 --- a/src/spicelib/devices/adms/admst/ngspiceMODULEask.c.xml +++ b/src/spicelib/devices/adms/admst/ngspiceMODULEask.c.xml @@ -62,6 +62,23 @@ int $(module)ask(CKTcircuit *ckt, GENinstance *inst, int which, IFvalue *value, + + + + + + case $(module)_ask_%(name) : + value->rValue = ckt->CKTstate0[inst->GENstate + %(name)]; + return OK; + + + + + + + + + default: return(-1); } diff --git a/src/spicelib/devices/adms/admst/ngspiceMODULEdefs.h.xml b/src/spicelib/devices/adms/admst/ngspiceMODULEdefs.h.xml index 28e8ced0b..9d85fbc8c 100644 --- a/src/spicelib/devices/adms/admst/ngspiceMODULEdefs.h.xml +++ b/src/spicelib/devices/adms/admst/ngspiceMODULEdefs.h.xml @@ -253,10 +253,18 @@ typedef struct s$(module)instance { -#define $(module)numStates 0 - } $(module)instance ; +enum { + + + + %(name), + + + + $(module)numStates +}; /* per model data */ @@ -307,6 +315,13 @@ typedef struct s$(module)model { /* model structure */ + + + + $(module)_ask_%(name), + + + diff --git a/src/spicelib/devices/adms/admst/ngspiceMODULEsetup.c.xml b/src/spicelib/devices/adms/admst/ngspiceMODULEsetup.c.xml index fe1d3511d..abba89c4f 100644 --- a/src/spicelib/devices/adms/admst/ngspiceMODULEsetup.c.xml +++ b/src/spicelib/devices/adms/admst/ngspiceMODULEsetup.c.xml @@ -113,6 +113,8 @@ int $(module)setup (SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int * } + ((GENinstance*)here)->GENstate = *states; + *states += $(module)numStates; /* set states */