diff --git a/src/spicelib/devices/vccs/vccs.c b/src/spicelib/devices/vccs/vccs.c index 313f730b5..087f3cc28 100644 --- a/src/spicelib/devices/vccs/vccs.c +++ b/src/spicelib/devices/vccs/vccs.c @@ -11,6 +11,7 @@ Author: 1987 Thomas L. Quarles IFparm VCCSpTable[] = { /* parameters */ IOPU("gain", VCCS_TRANS, IF_REAL, "Transconductance of source (gain)"), + IOP ( "m", VCCS_M, IF_REAL , "Parallel multiplier"), IP("sens_trans", VCCS_TRANS_SENS,IF_FLAG, "flag to request sensitivity WRT transconductance"), OPU("pos_node", VCCS_POS_NODE, IF_INTEGER, "Positive node of source"), diff --git a/src/spicelib/devices/vccs/vccsask.c b/src/spicelib/devices/vccs/vccsask.c index 2a5b369a4..64eef29af 100644 --- a/src/spicelib/devices/vccs/vccsask.c +++ b/src/spicelib/devices/vccs/vccsask.c @@ -31,6 +31,9 @@ VCCSask(CKTcircuit *ckt, GENinstance *inst, int which, IFvalue *value, IFvalue * case VCCS_TRANS: value->rValue = here->VCCScoeff; return (OK); + case VCCS_M: + value->rValue = here->VCCSmValue; + return (OK); case VCCS_POS_NODE: value->iValue = here->VCCSposNode; return (OK); diff --git a/src/spicelib/devices/vccs/vccsdefs.h b/src/spicelib/devices/vccs/vccsdefs.h index 238c2e545..8874fcd3b 100644 --- a/src/spicelib/devices/vccs/vccsdefs.h +++ b/src/spicelib/devices/vccs/vccsdefs.h @@ -31,6 +31,7 @@ typedef struct sVCCSinstance { double VCCSinitCond; /* initial condition (of controlling source) */ double VCCScoeff; /* coefficient */ + double VCCSmValue; /* Parallel multiplier */ double *VCCSposContPosptr; /* pointer to sparse matrix element at * (positive node, control positive node) */ @@ -41,6 +42,7 @@ typedef struct sVCCSinstance { double *VCCSnegContNegptr; /* pointer to sparse matrix element at * (negative node, control negative node) */ unsigned VCCScoeffGiven :1 ;/* flag to indicate function coeffs given */ + unsigned VCCSmGiven :1 ;/* flag to indicate multiplier given */ int VCCSsenParmNo; /* parameter # for sensitivity use; set equal to 0 if not a design parameter*/ @@ -73,6 +75,7 @@ typedef struct sVCCSmodel { /* model structure for a source */ #define VCCS_CURRENT 9 #define VCCS_POWER 10 #define VCCS_VOLTS 11 +#define VCCS_M 12 /* model parameters */ diff --git a/src/spicelib/devices/vccs/vccspar.c b/src/spicelib/devices/vccs/vccspar.c index 7f7b51a76..98c88279a 100644 --- a/src/spicelib/devices/vccs/vccspar.c +++ b/src/spicelib/devices/vccs/vccspar.c @@ -24,6 +24,12 @@ VCCSparam(int param, IFvalue *value, GENinstance *inst, IFvalue *select) case VCCS_TRANS: here->VCCScoeff = value->rValue; here->VCCScoeffGiven = TRUE; + if (here->VCCSmGiven) + here->VCCScoeff *= here->VCCSmValue; + break; + case VCCS_M: + here->VCCSmValue = value->rValue; + here->VCCSmGiven = TRUE; break; case VCCS_TRANS_SENS: here->VCCSsenParmNo = value->iValue;