Browse Source

devices/isrc: EXTERNAL option for independent current source ISRC

pre-master-46
h_vogt 13 years ago
committed by rlar
parent
commit
2c97c31658
  1. 4
      src/spicelib/devices/isrc/isrc.c
  2. 7
      src/spicelib/devices/isrc/isrcacct.c
  3. 2
      src/spicelib/devices/isrc/isrcdefs.h
  4. 13
      src/spicelib/devices/isrc/isrcload.c
  5. 11
      src/spicelib/devices/isrc/isrcpar.c

4
src/spicelib/devices/isrc/isrc.c

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

7
src/spicelib/devices/isrc/isrcacct.c

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

2
src/spicelib/devices/isrc/isrcdefs.h

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

13
src/spicelib/devices/isrc/isrcload.c

@ -18,6 +18,10 @@ Modified: 2000 Alansfixes
/* gtri - end - wbk - modify for supply ramping option */ /* gtri - end - wbk - modify for supply ramping option */
#endif #endif
#ifdef SHARED_MODULE
extern double getisrcval(double, char*);
#endif
int int
ISRCload(GENmodel *inModel, CKTcircuit *ckt) ISRCload(GENmodel *inModel, CKTcircuit *ckt)
/* actually load the current value into the /* 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; break;
#ifdef SHARED_MODULE
case EXTERNAL: {
value = getisrcval(time, here->ISRCname);
if(here -> ISRCdcGiven)
value += here->ISRCdcValue;
}
break;
#endif
} // switch } // switch
} // else (line 48) } // else (line 48)
loadDone: loadDone:

11
src/spicelib/devices/isrc/isrcpar.c

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

Loading…
Cancel
Save