shared ngspice: external voltage source
This commit is contained in:
parent
96e1d7eec6
commit
8147b03465
|
|
@ -23,7 +23,7 @@ IFparm VSRCpTable[] = { /* parameters */
|
|||
IOP ("am", VSRC_AM, IF_REALVEC,"Amplitude modulation description"),
|
||||
IOP ("trnoise", VSRC_TRNOISE, IF_REALVEC,"Transient noise description"),
|
||||
IOP ("trrandom", VSRC_TRRANDOM, IF_REALVEC,"random source description"),
|
||||
|
||||
IOP ("external", VSRC_EXTERNAL, IF_REALVEC,"external source description"),
|
||||
OPU ("pos_node",VSRC_POS_NODE, IF_INTEGER,"Positive node of source"),
|
||||
OPU ("neg_node",VSRC_NEG_NODE, IF_INTEGER,"Negative node of source"),
|
||||
OPU ("function",VSRC_FCN_TYPE, IF_INTEGER,"Function of the source"),
|
||||
|
|
|
|||
|
|
@ -291,6 +291,13 @@ VSRCaccept(CKTcircuit *ckt, GENmodel *inModel)
|
|||
}
|
||||
break;
|
||||
|
||||
#ifdef SHARED_MODULE
|
||||
case EXTERNAL: {
|
||||
/* no breakpoints (yet) */
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
|
||||
} // switch
|
||||
} // if ... else
|
||||
bkptset: ;
|
||||
|
|
|
|||
|
|
@ -99,6 +99,7 @@ typedef struct sVSRCmodel {
|
|||
#define AM 6
|
||||
#define TRNOISE 7
|
||||
#define TRRANDOM 8
|
||||
#define EXTERNAL 9
|
||||
#endif /*PULSE*/
|
||||
|
||||
/* device parameters */
|
||||
|
|
@ -129,6 +130,7 @@ typedef struct sVSRCmodel {
|
|||
#define VSRC_TD 24
|
||||
#define VSRC_TRNOISE 25
|
||||
#define VSRC_TRRANDOM 26
|
||||
#define VSRC_EXTERNAL 27
|
||||
|
||||
/* model parameters */
|
||||
|
||||
|
|
|
|||
|
|
@ -18,6 +18,10 @@ Modified: 2000 AlansFixes
|
|||
/* gtri - end - wbk - modify for supply ramping option */
|
||||
#endif
|
||||
|
||||
#ifdef SHARED_MODULE
|
||||
extern double getvsrcval(double, char*);
|
||||
#endif
|
||||
|
||||
int
|
||||
VSRCload(GENmodel *inModel, CKTcircuit *ckt)
|
||||
/* actually load the current value into the
|
||||
|
|
@ -385,6 +389,15 @@ VNoi3 3 0 DC 0 TRNOISE(0 0 0 0 15m 22u 50u) : generate RTS noise
|
|||
}
|
||||
break;
|
||||
|
||||
#ifdef SHARED_MODULE
|
||||
case EXTERNAL: {
|
||||
value = getvsrcval(time, here->VSRCname);
|
||||
if(here -> VSRCdcGiven)
|
||||
value += here->VSRCdcValue;
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
|
||||
} // switch
|
||||
} // else (line 48)
|
||||
loadDone:
|
||||
|
|
|
|||
|
|
@ -261,6 +261,17 @@ VSRCparam(int param, IFvalue *value, GENinstance *inst, IFvalue *select)
|
|||
}
|
||||
break;
|
||||
|
||||
#ifdef SHARED_MODULE
|
||||
case VSRC_EXTERNAL: {
|
||||
here->VSRCfunctionType = EXTERNAL;
|
||||
here->VSRCfuncTGiven = TRUE;
|
||||
/* no coefficients
|
||||
copy_coeffs(here, value);
|
||||
*/
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
|
||||
default:
|
||||
return(E_BADPARM);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue