vsrc, isrc, parameter descriptors, synchronize to each other

This commit is contained in:
rlar 2011-02-27 20:32:36 +00:00
parent 454ade725f
commit 0916de085c
3 changed files with 59 additions and 54 deletions

View File

@ -1,3 +1,8 @@
2011-02-27 Robert Larice
* src/spicelib/devices/isrc/isrc.c ,
* src/spicelib/devices/vsrc/vsrc.c :
vsrc, isrc, parameter descriptors, synchronize to each other
2011-02-27 Robert Larice
* src/spicelib/devices/isrc/isrcpar.c ,
* src/spicelib/devices/vsrc/vsrcpar.c :

View File

@ -4,42 +4,42 @@ Author: 1987 Thomas L. Quarles
**********/
#include "ngspice.h"
#include "ifsim.h"
#include "devdefs.h"
#include "ifsim.h"
#include "isrcdefs.h"
#include "suffix.h"
IFparm ISRCpTable[] = { /* parameters */
IOPP( "dc", ISRC_DC, IF_REAL ,"DC value of source"),
IOPPA( "acmag", ISRC_AC_MAG, IF_REAL ,"AC magnitude"),
IOPAAU( "acphase", ISRC_AC_PHASE, IF_REAL ,"AC phase"),
/* Modified to allow print @Iin[sin] A.Roldan */
IOP ( "pulse", ISRC_PULSE, IF_REALVEC,"Pulse description"),
IOP ( "sine", ISRC_SINE, IF_REALVEC,"Sinusoidal source description"),
IOP ( "sin", ISRC_SINE, IF_REALVEC,"Sinusoidal source description"),
IOP ( "exp", ISRC_EXP, IF_REALVEC,"Exponential source description"),
IOP ( "pwl", ISRC_PWL, IF_REALVEC,"Piecewise linear description"),
IOP ( "sffm", ISRC_SFFM, IF_REALVEC,"Single freq. FM description"),
IOP ( "am", ISRC_AM, IF_REALVEC,"Amplitude modulation description"),
IOP ( "trnoise", ISRC_TRNOISE, IF_REALVEC,"Transient noise descripton"),
OPU ( "neg_node",ISRC_NEG_NODE, IF_INTEGER,"Negative node of source"),
OPU ( "pos_node",ISRC_POS_NODE, IF_INTEGER,"Positive node of source"),
OPU ( "acreal", ISRC_AC_REAL, IF_REAL ,"AC real part"),
OPU ( "acimag", ISRC_AC_IMAG, IF_REAL ,"AC imaginary part"),
OPU ( "function",ISRC_FCN_TYPE, IF_INTEGER,"Function of the source"),
OPU ( "order", ISRC_FCN_ORDER, IF_INTEGER,"Order of the source function"),
OPU ( "coeffs", ISRC_FCN_COEFFS,IF_REALVEC,"Coefficients of the source"),
OP ( "v", ISRC_VOLTS, IF_REAL, "Voltage across the supply"),
OP ( "p", ISRC_POWER, IF_REAL, "Power supplied by the source"),
IP ( "ac", ISRC_AC, IF_REALVEC,"AC magnitude,phase vector"),
IP ( "c", ISRC_DC, IF_REAL, "Current through current source"),
IFparm ISRCpTable[] = { /* parameters */
IOPP("dc", ISRC_DC, IF_REAL ,"DC value of source"),
IOPPA("acmag", ISRC_AC_MAG, IF_REAL ,"AC Magnitude"),
IOPAAU("acphase", ISRC_AC_PHASE, IF_REAL ,"AC Phase"),
/* Modified to allow print @Iin[sin] A.Roldan */
IOP ("pulse", ISRC_PULSE, IF_REALVEC,"Pulse description"),
IOP ("sine", ISRC_SINE, IF_REALVEC,"Sinusoidal source description"),
IOP ("sin", ISRC_SINE, IF_REALVEC,"Sinusoidal source description"),
IOP ("exp", ISRC_EXP, IF_REALVEC,"Exponential source description"),
IOP ("pwl", ISRC_PWL, IF_REALVEC,"Piecewise linear description"),
IOP ("sffm", ISRC_SFFM, IF_REALVEC,"Single freq. FM description"),
IOP ("am", ISRC_AM, IF_REALVEC,"Amplitude modulation description"),
IOP ("trnoise", ISRC_TRNOISE, IF_REALVEC,"Transient noise description"),
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"),
OPU ("order", ISRC_FCN_ORDER, IF_INTEGER,"Order of the source function"),
OPU ("coeffs", ISRC_FCN_COEFFS,IF_REALVEC,"Coefficients for the function"),
OPU ("acreal", ISRC_AC_REAL, IF_REAL, "AC real part"),
OPU ("acimag", ISRC_AC_IMAG, IF_REAL, "AC imaginary part"),
IP ("ac", ISRC_AC, IF_REALVEC,"AC magnitude, phase vector"),
OP ("v", ISRC_VOLTS, IF_REAL, "Voltage across the supply"),
OP ("p", ISRC_POWER, IF_REAL, "Power supplied by the source"),
IP ("c", ISRC_DC, IF_REAL, "Current through current source"),
/* gtri - begin - add parameter for current source value */
#ifdef XSPICE
OP ( "current", ISRC_CURRENT, IF_REAL, "Current in DC or Transient mode"),
OP ("current", ISRC_CURRENT, IF_REAL, "Current in DC or Transient mode"),
#endif
/* gtri - end - add parameter for current source value */
IP ( "distof1", ISRC_D_F1, IF_REALVEC,"f1 input for distortion"),
IP ( "distof2", ISRC_D_F2, IF_REALVEC,"f2 input for distortion")
IP ("distof1", ISRC_D_F1, IF_REALVEC,"f1 input for distortion"),
IP ("distof2", ISRC_D_F2, IF_REALVEC,"f2 input for distortion")
};
char *ISRCnames[] = {
@ -47,8 +47,8 @@ char *ISRCnames[] = {
"I-"
};
int ISRCnSize = NUMELEMS(ISRCnames);
int ISRCpTSize = NUMELEMS(ISRCpTable);
int ISRCmPTSize = 0;
int ISRCiSize = sizeof(ISRCinstance);
int ISRCmSize = sizeof(ISRCmodel);
int ISRCnSize = NUMELEMS(ISRCnames);
int ISRCpTSize = NUMELEMS(ISRCpTable);
int ISRCmPTSize = 0;
int ISRCiSize = sizeof(ISRCinstance);
int ISRCmSize = sizeof(ISRCmodel);

View File

@ -9,20 +9,20 @@ Author: 1987 Thomas L. Quarles
#include "vsrcdefs.h"
#include "suffix.h"
IFparm VSRCpTable[] = { /* parameters */
IOPP("dc", VSRC_DC, IF_REAL ,"D.C. source value"),
IOPPA("acmag", VSRC_AC_MAG, IF_REAL ,"A.C. Magnitude"),
IOPAAU("acphase", VSRC_AC_PHASE, IF_REAL ,"A.C. Phase"),
/* Modified to allow print @vin[sin] A.Roldan */
IFparm VSRCpTable[] = { /* parameters */
IOPP("dc", VSRC_DC, IF_REAL ,"DC value of source"),
IOPPA("acmag", VSRC_AC_MAG, IF_REAL ,"AC Magnitude"),
IOPAAU("acphase", VSRC_AC_PHASE, IF_REAL ,"AC Phase"),
/* Modified to allow print @vin[sin] A.Roldan */
IOP ("pulse", VSRC_PULSE, IF_REALVEC,"Pulse description"),
IOP ("sine", VSRC_SINE, IF_REALVEC,"Sinusoidal source description"),
IOP ("sin", VSRC_SINE, IF_REALVEC,"Sinusoidal source description"),
IOP ("exp", VSRC_EXP, IF_REALVEC,"Exponential source description"),
IOP ("pwl", VSRC_PWL, IF_REALVEC,"Piecewise linear description"),
IOP ("sffm", VSRC_SFFM, IF_REALVEC,"Single freq. FM descripton"),
IOP ("am", VSRC_AM, IF_REALVEC,"Amplitude modulation descripton"),
IOP ("trnoise", VSRC_TRNOISE, IF_REALVEC,"Transient noise descripton"),
IOP ("trrandom", VSRC_TRRANDOM, IF_REALVEC,"random voltage descripton"),
IOP ("sffm", VSRC_SFFM, IF_REALVEC,"Single freq. FM description"),
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 voltage 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"),
@ -31,13 +31,13 @@ IFparm VSRCpTable[] = { /* parameters */
OPU ("coeffs", VSRC_FCN_COEFFS,IF_REALVEC,"Coefficients for the function"),
OPU ("acreal", VSRC_AC_REAL, IF_REAL, "AC real part"),
OPU ("acimag", VSRC_AC_IMAG, IF_REAL, "AC imaginary part"),
IP ("ac", VSRC_AC, IF_REALVEC,"AC magnitude, phase vector"),
OP ("i", VSRC_CURRENT, IF_REAL, "Voltage source current"),
OP ("p", VSRC_POWER, IF_REAL, "Instantaneous power"),
IP ("distof1", VSRC_D_F1, IF_REALVEC,"f1 input for distortion"),
IP ("distof2", VSRC_D_F2, IF_REALVEC,"f2 input for distortion"),
IP ("r", VSRC_R, IF_REAL, "pwl repeat value"),
IP ("td", VSRC_TD, IF_REAL, "pwl delay value")
IP ("ac", VSRC_AC, IF_REALVEC,"AC magnitude, phase vector"),
OP ("i", VSRC_CURRENT, IF_REAL, "Voltage source current"),
OP ("p", VSRC_POWER, IF_REAL, "Instantaneous power"),
IP ("r", VSRC_R, IF_REAL, "pwl repeat value"),
IP ("td", VSRC_TD, IF_REAL, "pwl delay value"),
IP ("distof1", VSRC_D_F1, IF_REALVEC,"f1 input for distortion"),
IP ("distof2", VSRC_D_F2, IF_REALVEC,"f2 input for distortion")
};
char *VSRCnames[] = {
@ -45,8 +45,8 @@ char *VSRCnames[] = {
"V-"
};
int VSRCnSize = NUMELEMS(VSRCnames);
int VSRCpTSize = NUMELEMS(VSRCpTable);
int VSRCmPTSize = 0;
int VSRCiSize = sizeof(VSRCinstance);
int VSRCmSize = sizeof(VSRCmodel);
int VSRCnSize = NUMELEMS(VSRCnames);
int VSRCpTSize = NUMELEMS(VSRCpTable);
int VSRCmPTSize = 0;
int VSRCiSize = sizeof(VSRCinstance);
int VSRCmSize = sizeof(VSRCmodel);