devices/isrc: EXTERNAL option for independent current source ISRC

This commit is contained in:
h_vogt 2013-08-10 15:09:07 +02:00 committed by rlar
parent 6a3da0105b
commit 2c97c31658
5 changed files with 36 additions and 1 deletions

View File

@ -24,7 +24,9 @@ IFparm ISRCpTable[] = { /* parameters */
IOP ("am", ISRC_AM, IF_REALVEC,"Amplitude modulation description"),
IOP ("trnoise", ISRC_TRNOISE, IF_REALVEC,"Transient noise description"),
IOP ("trrandom", ISRC_TRRANDOM, IF_REALVEC,"random source description"),
#ifdef SHARED_MODULE
IOP ("external", ISRC_EXTERNAL, IF_REALVEC,"external source description"),
#endif
OPU ("pos_node",ISRC_POS_NODE, IF_INTEGER,"Positive node of source"),
OPU ("neg_node",ISRC_NEG_NODE, IF_INTEGER,"Negative node of source"),
OPU ("function",ISRC_FCN_TYPE, IF_INTEGER,"Function of the source"),

View File

@ -290,6 +290,13 @@ ISRCaccept(CKTcircuit *ckt, GENmodel *inModel)
}
break;
#ifdef SHARED_MODULE
case EXTERNAL: {
/* no breakpoints (yet) */
}
break;
#endif
} // switch
} // if ... else
bkptset: ;

View File

@ -92,6 +92,7 @@ typedef struct sISRCmodel {
#define AM 6
#define TRNOISE 7
#define TRRANDOM 8
#define EXTERNAL 9
#endif /*PULSE*/
/* device parameters */
@ -126,6 +127,7 @@ typedef struct sISRCmodel {
/* gtri - end - add define for current source value */
#define ISRC_TRNOISE 25
#define ISRC_TRRANDOM 26
#define ISRC_EXTERNAL 27
/* model parameters */

View File

@ -18,6 +18,10 @@ Modified: 2000 Alansfixes
/* gtri - end - wbk - modify for supply ramping option */
#endif
#ifdef SHARED_MODULE
extern double getisrcval(double, char*);
#endif
int
ISRCload(GENmodel *inModel, CKTcircuit *ckt)
/* actually load the current value into the
@ -369,6 +373,15 @@ INoi1 1 0 DC 0 TRNOISE(0n 0.5n 1 10n) : generate 1/f noise
}
break;
#ifdef SHARED_MODULE
case EXTERNAL: {
value = getisrcval(time, here->ISRCname);
if(here -> ISRCdcGiven)
value += here->ISRCdcValue;
}
break;
#endif
} // switch
} // else (line 48)
loadDone:

View File

@ -238,6 +238,17 @@ ISRCparam(int param, IFvalue *value, GENinstance *inst, IFvalue *select)
}
break;
#ifdef SHARED_MODULE
case ISRC_EXTERNAL: {
here->ISRCfunctionType = EXTERNAL;
here->ISRCfuncTGiven = TRUE;
/* no coefficients
copy_coeffs(here, value);
*/
}
break;
#endif
default:
return(E_BADPARM);
}