Cleaned up isrc and vsrc code and updated their status into DEVICE file.

This commit is contained in:
pnenzi 2004-01-26 19:51:11 +00:00
parent 7bfe6db9bf
commit 01bbb31d2e
28 changed files with 61 additions and 138 deletions

View File

@ -1,5 +1,10 @@
2004-01-26 Paolo Nenzi <p.nenzi@ieee.org>
* DEVICES: updated isrc an vsrc status
* src/spicelib/devices{isrc,vsrc}: Cleaned up code
* tests/cider: Added example files for cider simulator.
2004-01-25 Paolo Nenzi <p.nenzi@ieee.org>

35
DEVICES
View File

@ -168,6 +168,17 @@ CCVS - Current Controlled Voltage Source
Original spice model.
ISRC - Independent Current Source
Initial Release.
Ver: N/A
Class: I
Level: 1 (and only)
Status:
This is the original spice device improved by Alan Gillespie
with the following features:
- Source ramping
- Check for non-monotonic series in PWL
VCCS - Voltage Controlled Current Source
@ -189,7 +200,17 @@ VCVS - Voltage Controlled Voltage Source
Original spice model.
VSRC - Independent Voltage Source
Initial Release
Initial Release.
Ver: N/A
Class: V
Level: 1 (and only)
Status:
This is the original spice device improved by Alan Gillespie
with the following features:
- Source ramping
- Check for non-monotonic series in PWL
***************************************************************************
@ -271,6 +292,18 @@ BJT2 - Bipolar Junction Transistor
- Temperature difference from circuit temperature
- Different area parameters for collector, base and emitter
VBIC - Bipolar Junction Transistor
Initial Release.
Ver: N/A
Class: Q
Level: 4
Status:
This is the VBIC model. Colin mcAndrews ert al.
Spice 3 porting Dietmar Warning
only 3 terminals
no xcess pahse
no other
***************************************************************************
***************************** FET Devices ***************************

View File

@ -4,7 +4,6 @@ Author: 1987 Thomas L. Quarles
**********/
#include "ngspice.h"
#include <stdio.h>
#include "ifsim.h"
#include "devdefs.h"
#include "isrcdefs.h"

View File

@ -4,7 +4,6 @@ Author: 1985 Thomas L. Quarles
**********/
#include "ngspice.h"
#include <stdio.h>
#include "cktdefs.h"
#include "isrcdefs.h"
#include "trandefs.h"
@ -12,9 +11,7 @@ Author: 1985 Thomas L. Quarles
#include "suffix.h"
int
ISRCaccept(ckt,inModel)
CKTcircuit *ckt;
GENmodel *inModel;
ISRCaccept(CKTcircuit *ckt, GENmodel *inModel)
/* set up the breakpoint table. */
{
ISRCmodel *model = (ISRCmodel*)inModel;

View File

@ -4,16 +4,13 @@ Author: 1985 Thomas L. Quarles
**********/
#include "ngspice.h"
#include <stdio.h>
#include "cktdefs.h"
#include "isrcdefs.h"
#include "sperror.h"
#include "suffix.h"
int
ISRCacLoad(inModel,ckt)
GENmodel *inModel;
CKTcircuit *ckt;
ISRCacLoad(GENmodel *inModel, CKTcircuit *ckt)
{
ISRCmodel *model = (ISRCmodel*)inModel;
ISRCinstance *here;

View File

@ -11,7 +11,6 @@ Author: 1988 Thomas L. Quarles
*/
#include "ngspice.h"
#include <stdio.h>
#include "cktdefs.h"
#include "devdefs.h"
#include "ifsim.h"
@ -22,12 +21,7 @@ Author: 1988 Thomas L. Quarles
/* ARGSUSED */
int
ISRCask(ckt,inst,which,value,select)
CKTcircuit *ckt;
GENinstance *inst;
int which;
IFvalue *value;
IFvalue *select;
ISRCask(CKTcircuit *ckt, GENinstance *inst, int which, IFvalue *value, IFvalue *select)
{
ISRCinstance *here = (ISRCinstance*)inst;
static char *msg = "Current and power not available in ac analysis";

View File

@ -6,17 +6,13 @@ Author: 1985 Thomas L. Quarles
*/
#include "ngspice.h"
#include <stdio.h>
#include "isrcdefs.h"
#include "sperror.h"
#include "suffix.h"
int
ISRCdelete(inModel,name,inst)
GENmodel *inModel;
IFuid name;
GENinstance **inst;
ISRCdelete(GENmodel *inModel, IFuid name, GENinstance **inst)
{
ISRCmodel *model = (ISRCmodel*)inModel;
ISRCinstance **fast = (ISRCinstance**)inst;

View File

@ -6,14 +6,12 @@ Author: 1985 Thomas L. Quarles
*/
#include "ngspice.h"
#include <stdio.h>
#include "isrcdefs.h"
#include "suffix.h"
void
ISRCdestroy(inModel)
GENmodel **inModel;
ISRCdestroy(GENmodel **inModel)
{
ISRCmodel **model = (ISRCmodel**)inModel;
ISRCinstance *here;

View File

@ -3,7 +3,6 @@ Copyright 1990 Regents of the University of California. All rights reserved.
Author: 1985 Thomas L. Quarles
**********/
#ifdef __STDC__
extern int ISRCaccept(CKTcircuit*,GENmodel*);
extern int ISRCacLoad(GENmodel*,CKTcircuit*);
extern int ISRCask(CKTcircuit*,GENinstance*,int,IFvalue*,IFvalue*);
@ -14,15 +13,3 @@ extern int ISRCmDelete(GENmodel**,IFuid,GENmodel*);
extern int ISRCparam(int,IFvalue*,GENinstance*,IFvalue*);
extern int ISRCpzLoad(GENmodel*,CKTcircuit*,SPcomplex*);
extern int ISRCtemp(GENmodel*,CKTcircuit*);
#else /* stdc */
extern int ISRCaccept();
extern int ISRCacLoad();
extern int ISRCask();
extern int ISRCdelete();
extern void ISRCdestroy();
extern int ISRCload();
extern int ISRCmDelete();
extern int ISRCparam();
extern int ISRCpzLoad();
extern int ISRCtemp();
#endif /* stdc */

View File

@ -5,7 +5,6 @@ Modified: 2000 Alansfixes
**********/
#include "ngspice.h"
#include <stdio.h>
#include "cktdefs.h"
#include "isrcdefs.h"
#include "trandefs.h"
@ -13,9 +12,7 @@ Modified: 2000 Alansfixes
#include "suffix.h"
int
ISRCload(inModel,ckt)
GENmodel *inModel;
CKTcircuit *ckt;
ISRCload(GENmodel *inModel, CKTcircuit *ckt)
/* actually load the current current value into the
* sparse matrix previously provided
*/

View File

@ -6,17 +6,13 @@ Author: 1985 Thomas L. Quarles
*/
#include "ngspice.h"
#include <stdio.h>
#include "isrcdefs.h"
#include "sperror.h"
#include "suffix.h"
int
ISRCmDelete(inModel,modname,kill)
GENmodel **inModel;
IFuid modname;
GENmodel *kill;
ISRCmDelete(GENmodel **inModel, IFuid modname, GENmodel *kill)
{
ISRCmodel **model = (ISRCmodel**)inModel;
ISRCmodel *modfast = (ISRCmodel*)kill;

View File

@ -7,7 +7,6 @@ Modified: 2000 AlansFixes
*/
#include "ngspice.h"
#include <stdio.h>
#include "ifsim.h"
#include "isrcdefs.h"
#include "sperror.h"
@ -16,11 +15,7 @@ Modified: 2000 AlansFixes
/* ARGSUSED */
int
ISRCparam(param,value,inst,select)
int param;
IFvalue *value;
GENinstance *inst;
IFvalue *select;
ISRCparam(int param, IFvalue *value, GENinstance *inst, IFvalue *select)
{
int i;

View File

@ -4,7 +4,6 @@ Author: 1985 Thomas L. Quarles
**********/
#include "ngspice.h"
#include <stdio.h>
#include "smpdefs.h"
#include "cktdefs.h"
#include "isrcdefs.h"
@ -13,9 +12,7 @@ Author: 1985 Thomas L. Quarles
/*ARGSUSED*/
int
ISRCtemp(inModel,ckt)
GENmodel *inModel;
CKTcircuit *ckt;
ISRCtemp(GENmodel *inModel, CKTcircuit *ckt)
{
ISRCmodel *model = (ISRCmodel*)inModel;
ISRCinstance *here;

View File

@ -4,7 +4,6 @@ Author: 1987 Thomas L. Quarles
**********/
#include "ngspice.h"
#include <stdio.h>
#include "devdefs.h"
#include "ifsim.h"
#include "vsrcdefs.h"

View File

@ -4,7 +4,6 @@ Author: 1985 Thomas L. Quarles
**********/
#include "ngspice.h"
#include <stdio.h>
#include "cktdefs.h"
#include "vsrcdefs.h"
#include "trandefs.h"
@ -12,9 +11,7 @@ Author: 1985 Thomas L. Quarles
#include "suffix.h"
int
VSRCaccept(ckt,inModel)
CKTcircuit *ckt;
GENmodel *inModel;
VSRCaccept(CKTcircuit *ckt, GENmodel *inModel)
/* set up the breakpoint table.
*/
{

View File

@ -6,7 +6,6 @@ Author: 1985 Thomas L. Quarles
*/
#include "ngspice.h"
#include <stdio.h>
#include "cktdefs.h"
#include "vsrcdefs.h"
#include "sperror.h"
@ -14,9 +13,7 @@ Author: 1985 Thomas L. Quarles
int
VSRCacLoad(inModel,ckt)
GENmodel *inModel;
CKTcircuit *ckt;
VSRCacLoad(GENmodel *inModel, CKTcircuit *ckt)
{
VSRCmodel *model = (VSRCmodel *)inModel;
VSRCinstance *here;

View File

@ -11,7 +11,6 @@ Author: 1987 Thomas L. Quarles
*/
#include "ngspice.h"
#include <stdio.h>
#include "cktdefs.h"
#include "devdefs.h"
#include "ifsim.h"
@ -22,12 +21,7 @@ Author: 1987 Thomas L. Quarles
/* ARGSUSED */
int
VSRCask(ckt,inst,which,value,select)
CKTcircuit *ckt;
GENinstance *inst;
int which;
IFvalue *value;
IFvalue *select;
VSRCask(CKTcircuit *ckt, GENinstance *inst, int which, IFvalue *value, IFvalue *select)
{
VSRCinstance *here = (VSRCinstance*)inst;
int temp;

View File

@ -6,17 +6,13 @@ Author: 1985 Thomas L. Quarles
*/
#include "ngspice.h"
#include <stdio.h>
#include "vsrcdefs.h"
#include "sperror.h"
#include "suffix.h"
int
VSRCdelete(inModel,name,inst)
GENmodel *inModel;
IFuid name;
GENinstance **inst;
VSRCdelete(GENmodel *inModel, IFuid name, GENinstance **inst)
{
VSRCmodel *model = (VSRCmodel *)inModel;
VSRCinstance **fast = (VSRCinstance**)inst;

View File

@ -6,14 +6,12 @@ Author: 1985 Thomas L. Quarles
*/
#include "ngspice.h"
#include <stdio.h>
#include "vsrcdefs.h"
#include "suffix.h"
void
VSRCdestroy(inModel)
GENmodel **inModel;
VSRCdestroy(GENmodel **inModel)
{
VSRCmodel **model = (VSRCmodel**)inModel;
VSRCinstance *here;

View File

@ -3,7 +3,6 @@ Copyright 1990 Regents of the University of California. All rights reserved.
Author: 1985 Thomas L. Quarles
**********/
#ifdef __STDC__
extern int VSRCacLoad(GENmodel*,CKTcircuit*);
extern int VSRCaccept(CKTcircuit*,GENmodel *);
extern int VSRCask(CKTcircuit*,GENinstance*,int,IFvalue*,IFvalue*);
@ -19,20 +18,3 @@ extern int VSRCsetup(SMPmatrix*,GENmodel*,CKTcircuit*,int*);
extern int VSRCunsetup(GENmodel*,CKTcircuit*);
extern int VSRCpzSetup(SMPmatrix*,GENmodel*,CKTcircuit*,int*);
extern int VSRCtemp(GENmodel*,CKTcircuit*);
#else /* stdc */
extern int VSRCacLoad();
extern int VSRCaccept();
extern int VSRCask();
extern int VSRCdelete();
extern void VSRCdestroy();
extern int VSRCfindBr();
extern int VSRCload();
extern int VSRCmAsk();
extern int VSRCmDelete();
extern int VSRCparam();
extern int VSRCpzLoad();
extern int VSRCsetup();
extern int VSRCunsetup();
extern int VSRCpzSetup();
extern int VSRCtemp();
#endif /* stdc */

View File

@ -6,7 +6,6 @@ Author: 1985 Thomas L. Quarles
*/
#include "ngspice.h"
#include <stdio.h>
#include "cktdefs.h"
#include "vsrcdefs.h"
#include "sperror.h"
@ -14,10 +13,7 @@ Author: 1985 Thomas L. Quarles
int
VSRCfindBr(ckt,inModel,name)
CKTcircuit *ckt;
GENmodel *inModel;
IFuid name;
VSRCfindBr(CKTcircuit *ckt, GENmodel *inModel, IFuid name)
{
VSRCmodel *model = (VSRCmodel *)inModel;
VSRCinstance *here;

View File

@ -5,7 +5,6 @@ Modified: 2000 AlansFixes
**********/
#include "ngspice.h"
#include <stdio.h>
#include "cktdefs.h"
#include "vsrcdefs.h"
#include "trandefs.h"
@ -13,9 +12,7 @@ Modified: 2000 AlansFixes
#include "suffix.h"
int
VSRCload(inModel,ckt)
GENmodel *inModel;
CKTcircuit *ckt;
VSRCload(GENmodel *inModel, CKTcircuit *ckt)
/* actually load the current voltage value into the
* sparse matrix previously provided
*/

View File

@ -6,17 +6,13 @@ Author: 1985 Thomas L. Quarles
*/
#include "ngspice.h"
#include <stdio.h>
#include "vsrcdefs.h"
#include "sperror.h"
#include "suffix.h"
int
VSRCmDelete(inModel,modname,fast)
GENmodel **inModel;
IFuid modname;
GENmodel *fast;
VSRCmDelete(GENmodel **inModel, IFuid modname, GENmodel *fast)
{
VSRCmodel **model = (VSRCmodel **)inModel;
VSRCmodel *modfast = (VSRCmodel *)fast;

View File

@ -7,7 +7,6 @@ Modified: 2000 AlansFixes
*/
#include "ngspice.h"
#include <stdio.h>
#include "vsrcdefs.h"
#include "ifsim.h"
#include "sperror.h"
@ -16,11 +15,7 @@ Modified: 2000 AlansFixes
/* ARGSUSED */
int
VSRCparam(param,value,inst,select)
int param;
IFvalue *value;
GENinstance *inst;
IFvalue *select;
VSRCparam(int param, IFvalue *value, GENinstance *inst, IFvalue *select)
{
int i;
VSRCinstance *here = (VSRCinstance *)inst;

View File

@ -4,7 +4,6 @@ Author: 1985 Thomas L. Quarles
**********/
#include "ngspice.h"
#include <stdio.h>
#include "cktdefs.h"
#include "complex.h"
#include "sperror.h"
@ -13,10 +12,7 @@ Author: 1985 Thomas L. Quarles
/* ARGSUSED */
int
VSRCpzLoad(inModel,ckt,s)
GENmodel *inModel;
CKTcircuit *ckt;
SPcomplex *s;
VSRCpzLoad(GENmodel *inModel, CKTcircuit *ckt, SPcomplex *s)
{
VSRCmodel *model = (VSRCmodel *)inModel;
VSRCinstance *here;

View File

@ -4,7 +4,6 @@ Author: 1985 Thomas L. Quarles
**********/
#include "ngspice.h"
#include <stdio.h>
#include "smpdefs.h"
#include "cktdefs.h"
#include "vsrcdefs.h"

View File

@ -4,7 +4,6 @@ Author: 1985 Thomas L. Quarles
**********/
#include "ngspice.h"
#include <stdio.h>
#include "smpdefs.h"
#include "cktdefs.h"
#include "vsrcdefs.h"
@ -13,11 +12,7 @@ Author: 1985 Thomas L. Quarles
/* ARGSUSED */
int
VSRCsetup(matrix,inModel,ckt,state)
SMPmatrix *matrix;
GENmodel *inModel;
CKTcircuit *ckt;
int *state;
VSRCsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *state)
/* load the voltage source structure with those pointers needed later
* for fast matrix loading
*/
@ -56,9 +51,7 @@ if((here->ptr = SMPmakeElt(matrix,here->first,here->second))==(double *)NULL){\
}
int
VSRCunsetup(inModel,ckt)
GENmodel *inModel;
CKTcircuit *ckt;
VSRCunsetup(GENmodel *inModel, CKTcircuit *ckt)
{
VSRCmodel *model;
VSRCinstance *here;

View File

@ -4,7 +4,6 @@ Author: 1985 Thomas L. Quarles
**********/
#include "ngspice.h"
#include <stdio.h>
#include "smpdefs.h"
#include "cktdefs.h"
#include "vsrcdefs.h"
@ -13,9 +12,7 @@ Author: 1985 Thomas L. Quarles
/* ARGSUSED */
int
VSRCtemp(inModel,ckt)
GENmodel *inModel;
CKTcircuit *ckt;
VSRCtemp(GENmodel *inModel, CKTcircuit *ckt)
/* Pre-process voltage source parameters
*/
{