K&R->ANSI patches by R. Larice
This commit is contained in:
parent
07f90563dc
commit
71c371485c
|
|
@ -1,7 +1,8 @@
|
|||
2010-02-13 Holger Vogt
|
||||
* icm/dllmain.c, evtload.c, ngspice.h, terminal.c, evaluate.c, twomesh.c,
|
||||
tclspice.c, conf.h, conf.c: patches by R. Larice 100213
|
||||
|
||||
* K&R -> ANSI patches by R. Larice 100103
|
||||
|
||||
2010-02-11 Holger Vogt
|
||||
* terminal.h, cpextern.h: use format (__printf__, 1, 2)
|
||||
* pzan.c, nipzmeth.c, cktpzstr.c, macros.h: remove conflicting macro definition
|
||||
|
|
|
|||
|
|
@ -14,9 +14,7 @@ Copyright 1990 Regents of the University of California. All rights reserved.
|
|||
#define BSIZE_SP 512
|
||||
|
||||
int
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
|
||||
FILE *fp;
|
||||
|
|
|
|||
|
|
@ -29,9 +29,7 @@
|
|||
|
||||
|
||||
void
|
||||
spConstMult(matrix, constant)
|
||||
MatrixPtr matrix;
|
||||
double constant;
|
||||
spConstMult(MatrixPtr matrix, double constant)
|
||||
{
|
||||
ElementPtr e;
|
||||
int i;
|
||||
|
|
|
|||
|
|
@ -453,9 +453,7 @@ spFactor(void *eMatrix)
|
|||
*/
|
||||
|
||||
static int
|
||||
FactorComplexMatrix( Matrix )
|
||||
|
||||
MatrixPtr Matrix;
|
||||
FactorComplexMatrix( MatrixPtr Matrix )
|
||||
{
|
||||
ElementPtr pElement;
|
||||
ElementPtr pColumn;
|
||||
|
|
@ -737,9 +735,7 @@ spPartition(void *eMatrix, int Mode)
|
|||
*/
|
||||
|
||||
void
|
||||
spcCreateInternalVectors( Matrix )
|
||||
|
||||
MatrixPtr Matrix;
|
||||
spcCreateInternalVectors( MatrixPtr Matrix )
|
||||
{
|
||||
int Size;
|
||||
|
||||
|
|
@ -923,7 +919,7 @@ MarkowitzProducts(MatrixPtr Matrix, int Step)
|
|||
if (fProduct >= LARGEST_LONG_INTEGER)
|
||||
*pMarkowitzProduct++ = LARGEST_LONG_INTEGER;
|
||||
else
|
||||
*pMarkowitzProduct++ = fProduct;
|
||||
*pMarkowitzProduct++ = (long)fProduct;
|
||||
} else {
|
||||
Product = *pMarkowitzRow++ * *pMarkowitzCol++;
|
||||
if ((*pMarkowitzProduct++ = Product) == 0)
|
||||
|
|
@ -983,10 +979,7 @@ MarkowitzProducts(MatrixPtr Matrix, int Step)
|
|||
*/
|
||||
|
||||
static ElementPtr
|
||||
SearchForPivot( Matrix, Step, DiagPivoting )
|
||||
|
||||
MatrixPtr Matrix;
|
||||
int Step, DiagPivoting;
|
||||
SearchForPivot( MatrixPtr Matrix, int Step, int DiagPivoting )
|
||||
{
|
||||
ElementPtr ChosenPivot;
|
||||
ElementPtr SearchForSingleton();
|
||||
|
|
@ -1088,10 +1081,7 @@ ElementPtr SearchEntireMatrix();
|
|||
*/
|
||||
|
||||
static ElementPtr
|
||||
SearchForSingleton( Matrix, Step )
|
||||
|
||||
MatrixPtr Matrix;
|
||||
int Step;
|
||||
SearchForSingleton( MatrixPtr Matrix, int Step )
|
||||
{
|
||||
ElementPtr ChosenPivot;
|
||||
int I;
|
||||
|
|
@ -1318,10 +1308,7 @@ RealNumber PivotMag, FindBiggestInColExclude();
|
|||
*/
|
||||
|
||||
static ElementPtr
|
||||
QuicklySearchDiagonal( Matrix, Step )
|
||||
|
||||
MatrixPtr Matrix;
|
||||
int Step;
|
||||
QuicklySearchDiagonal( MatrixPtr Matrix, int Step )
|
||||
{
|
||||
long MinMarkowitzProduct, *pMarkowitzProduct;
|
||||
ElementPtr pDiag, pOtherInRow, pOtherInCol;
|
||||
|
|
@ -1527,10 +1514,7 @@ RealNumber FindBiggestInColExclude();
|
|||
*/
|
||||
|
||||
static ElementPtr
|
||||
QuicklySearchDiagonal( Matrix, Step )
|
||||
|
||||
MatrixPtr Matrix;
|
||||
int Step;
|
||||
QuicklySearchDiagonal( MatrixPtr Matrix, int Step )
|
||||
{
|
||||
long MinMarkowitzProduct, *pMarkowitzProduct;
|
||||
ElementPtr pDiag;
|
||||
|
|
@ -1700,10 +1684,7 @@ RealNumber FindBiggestInColExclude();
|
|||
*/
|
||||
|
||||
static ElementPtr
|
||||
SearchDiagonal( Matrix, Step )
|
||||
|
||||
MatrixPtr Matrix;
|
||||
int Step;
|
||||
SearchDiagonal( MatrixPtr Matrix, int Step )
|
||||
{
|
||||
int J;
|
||||
long MinMarkowitzProduct, *pMarkowitzProduct;
|
||||
|
|
@ -1835,10 +1816,7 @@ int Step;
|
|||
*/
|
||||
|
||||
static ElementPtr
|
||||
SearchEntireMatrix( Matrix, Step )
|
||||
|
||||
MatrixPtr Matrix;
|
||||
int Step;
|
||||
SearchEntireMatrix( MatrixPtr Matrix, int Step )
|
||||
{
|
||||
int I, Size = Matrix->Size;
|
||||
ElementPtr pElement;
|
||||
|
|
@ -1967,9 +1945,7 @@ int Step;
|
|||
* The magnitude of the currently active element. */
|
||||
|
||||
static RealNumber
|
||||
FindLargestInCol( pElement )
|
||||
|
||||
ElementPtr pElement;
|
||||
FindLargestInCol( ElementPtr pElement )
|
||||
{
|
||||
RealNumber Magnitude, Largest = 0.0;
|
||||
|
||||
|
|
@ -2034,11 +2010,7 @@ FindLargestInCol( pElement )
|
|||
*/
|
||||
|
||||
static RealNumber
|
||||
FindBiggestInColExclude( Matrix, pElement, Step )
|
||||
|
||||
MatrixPtr Matrix;
|
||||
ElementPtr pElement;
|
||||
int Step;
|
||||
FindBiggestInColExclude( MatrixPtr Matrix, ElementPtr pElement, int Step )
|
||||
{
|
||||
int Row;
|
||||
int Col;
|
||||
|
|
@ -2113,11 +2085,7 @@ RealNumber Largest, Magnitude;
|
|||
*/
|
||||
|
||||
static void
|
||||
ExchangeRowsAndCols( Matrix, pPivot, Step )
|
||||
|
||||
MatrixPtr Matrix;
|
||||
ElementPtr pPivot;
|
||||
int Step;
|
||||
ExchangeRowsAndCols( MatrixPtr Matrix, ElementPtr pPivot, int Step )
|
||||
{
|
||||
int Row, Col;
|
||||
long OldMarkowitzProd_Step, OldMarkowitzProd_Row, OldMarkowitzProd_Col;
|
||||
|
|
@ -2250,10 +2218,7 @@ ElementPtr spcFindElementInCol();
|
|||
*/
|
||||
|
||||
void
|
||||
spcRowExchange( Matrix, Row1, Row2 )
|
||||
|
||||
MatrixPtr Matrix;
|
||||
int Row1, Row2;
|
||||
spcRowExchange( MatrixPtr Matrix, int Row1, int Row2 )
|
||||
{
|
||||
ElementPtr Row1Ptr, Row2Ptr;
|
||||
int Column;
|
||||
|
|
@ -2357,10 +2322,7 @@ ElementPtr Element1, Element2;
|
|||
*/
|
||||
|
||||
void
|
||||
spcColExchange( Matrix, Col1, Col2 )
|
||||
|
||||
MatrixPtr Matrix;
|
||||
int Col1, Col2;
|
||||
spcColExchange( MatrixPtr Matrix, int Col1, int Col2 )
|
||||
{
|
||||
ElementPtr Col1Ptr, Col2Ptr;
|
||||
int Row;
|
||||
|
|
@ -2469,11 +2431,7 @@ ElementPtr Element1, Element2;
|
|||
*/
|
||||
|
||||
static void
|
||||
ExchangeColElements( Matrix, Row1, Element1, Row2, Element2, Column )
|
||||
|
||||
MatrixPtr Matrix;
|
||||
ElementPtr Element1, Element2;
|
||||
int Row1, Row2, Column;
|
||||
ExchangeColElements( MatrixPtr Matrix, int Row1, ElementPtr Element1, int Row2, ElementPtr Element2, int Column )
|
||||
{
|
||||
ElementPtr *ElementAboveRow1, *ElementAboveRow2;
|
||||
ElementPtr ElementBelowRow1, ElementBelowRow2;
|
||||
|
|
@ -2617,11 +2575,7 @@ ElementPtr ElementBelowRow1, ElementBelowRow2;
|
|||
*/
|
||||
|
||||
static void
|
||||
ExchangeRowElements( Matrix, Col1, Element1, Col2, Element2, Row )
|
||||
|
||||
MatrixPtr Matrix;
|
||||
int Col1, Col2, Row;
|
||||
ElementPtr Element1, Element2;
|
||||
ExchangeRowElements( MatrixPtr Matrix, int Col1, ElementPtr Element1, int Col2, ElementPtr Element2, int Row )
|
||||
{
|
||||
ElementPtr *ElementLeftOfCol1, *ElementLeftOfCol2;
|
||||
ElementPtr ElementRightOfCol1, ElementRightOfCol2;
|
||||
|
|
@ -2758,10 +2712,7 @@ ElementPtr ElementRightOfCol1, ElementRightOfCol2;
|
|||
*/
|
||||
|
||||
static void
|
||||
RealRowColElimination( Matrix, pPivot )
|
||||
|
||||
MatrixPtr Matrix;
|
||||
ElementPtr pPivot;
|
||||
RealRowColElimination( MatrixPtr Matrix, ElementPtr pPivot )
|
||||
{
|
||||
ElementPtr pSub;
|
||||
int Row;
|
||||
|
|
@ -2849,10 +2800,7 @@ MatrixPtr Matrix;
|
|||
*/
|
||||
|
||||
static void
|
||||
ComplexRowColElimination( Matrix, pPivot )
|
||||
|
||||
MatrixPtr Matrix;
|
||||
ElementPtr pPivot;
|
||||
ComplexRowColElimination( MatrixPtr Matrix, ElementPtr pPivot )
|
||||
{
|
||||
ElementPtr pSub;
|
||||
int Row;
|
||||
|
|
@ -2935,10 +2883,7 @@ MatrixPtr Matrix;
|
|||
*/
|
||||
|
||||
static void
|
||||
UpdateMarkowitzNumbers( Matrix, pPivot )
|
||||
|
||||
MatrixPtr Matrix;
|
||||
ElementPtr pPivot;
|
||||
UpdateMarkowitzNumbers( MatrixPtr Matrix, ElementPtr pPivot )
|
||||
{
|
||||
int Row, Col;
|
||||
ElementPtr ColPtr, RowPtr;
|
||||
|
|
@ -2962,7 +2907,7 @@ ElementPtr pPivot;
|
|||
if (Product >= LARGEST_LONG_INTEGER)
|
||||
Matrix->MarkowitzProd[Row] = LARGEST_LONG_INTEGER;
|
||||
else
|
||||
Matrix->MarkowitzProd[Row] = Product;
|
||||
Matrix->MarkowitzProd[Row] = (long)Product;
|
||||
}
|
||||
else Matrix->MarkowitzProd[Row] = MarkoRow[Row] * MarkoCol[Row];
|
||||
if (MarkoRow[Row] == 0)
|
||||
|
|
@ -2982,7 +2927,7 @@ ElementPtr pPivot;
|
|||
if (Product >= LARGEST_LONG_INTEGER)
|
||||
Matrix->MarkowitzProd[Col] = LARGEST_LONG_INTEGER;
|
||||
else
|
||||
Matrix->MarkowitzProd[Col] = Product;
|
||||
Matrix->MarkowitzProd[Col] = (long)Product;
|
||||
}
|
||||
else Matrix->MarkowitzProd[Col] = MarkoRow[Col] * MarkoCol[Col];
|
||||
if ((MarkoCol[Col] == 0) && (MarkoRow[Col] != 0))
|
||||
|
|
@ -3028,11 +2973,7 @@ ElementPtr pPivot;
|
|||
*/
|
||||
|
||||
static ElementPtr
|
||||
CreateFillin( Matrix, Row, Col )
|
||||
|
||||
MatrixPtr Matrix;
|
||||
int Row;
|
||||
int Col;
|
||||
CreateFillin( MatrixPtr Matrix, int Row, int Col )
|
||||
{
|
||||
ElementPtr pElement, *ppElementAbove;
|
||||
ElementPtr spcCreateElement();
|
||||
|
|
@ -3092,10 +3033,7 @@ ElementPtr spcCreateElement();
|
|||
*/
|
||||
|
||||
static int
|
||||
MatrixIsSingular( Matrix, Step )
|
||||
|
||||
MatrixPtr Matrix;
|
||||
int Step;
|
||||
MatrixIsSingular( MatrixPtr Matrix, int Step )
|
||||
{
|
||||
/* Begin `MatrixIsSingular'. */
|
||||
|
||||
|
|
@ -3106,10 +3044,7 @@ int Step;
|
|||
|
||||
|
||||
static int
|
||||
ZeroPivot( Matrix, Step )
|
||||
|
||||
MatrixPtr Matrix;
|
||||
int Step;
|
||||
ZeroPivot( MatrixPtr Matrix, int Step )
|
||||
{
|
||||
/* Begin `ZeroPivot'. */
|
||||
|
||||
|
|
@ -3133,10 +3068,7 @@ int Step;
|
|||
*/
|
||||
|
||||
static void
|
||||
WriteStatus( Matrix, Step )
|
||||
|
||||
MatrixPtr Matrix;
|
||||
int Step;
|
||||
WriteStatus( MatrixPtr Matrix, int Step )
|
||||
{
|
||||
int I;
|
||||
|
||||
|
|
|
|||
|
|
@ -258,10 +258,7 @@ spSolve(void *eMatrix, RealVector RHS, RealVector Solution,
|
|||
*/
|
||||
|
||||
static void
|
||||
SolveComplexMatrix( Matrix, RHS, Solution , iRHS, iSolution )
|
||||
|
||||
MatrixPtr Matrix;
|
||||
RealVector RHS, Solution , iRHS, iSolution;
|
||||
SolveComplexMatrix( MatrixPtr Matrix, RealVector RHS, RealVector Solution , RealVector iRHS, RealVector iSolution )
|
||||
{
|
||||
ElementPtr pElement;
|
||||
ComplexVector Intermediate;
|
||||
|
|
@ -537,10 +534,7 @@ spSolveTransposed(void *eMatrix, RealVector RHS, RealVector Solution,
|
|||
*/
|
||||
|
||||
static void
|
||||
SolveComplexTransposedMatrix(Matrix, RHS, Solution , iRHS, iSolution )
|
||||
|
||||
MatrixPtr Matrix;
|
||||
RealVector RHS, Solution , iRHS, iSolution;
|
||||
SolveComplexTransposedMatrix(MatrixPtr Matrix, RealVector RHS, RealVector Solution , RealVector iRHS, RealVector iSolution )
|
||||
{
|
||||
ElementPtr pElement;
|
||||
ComplexVector Intermediate;
|
||||
|
|
|
|||
|
|
@ -242,11 +242,7 @@ spMNA_Preorder(void *eMatrix)
|
|||
*/
|
||||
|
||||
static int
|
||||
CountTwins( Matrix, Col, ppTwin1, ppTwin2 )
|
||||
|
||||
MatrixPtr Matrix;
|
||||
int Col;
|
||||
ElementPtr *ppTwin1, *ppTwin2;
|
||||
CountTwins( MatrixPtr Matrix, int Col, ElementPtr *ppTwin1, ElementPtr *ppTwin2 )
|
||||
{
|
||||
int Row, Twins = 0;
|
||||
ElementPtr pTwin1, pTwin2;
|
||||
|
|
@ -286,10 +282,7 @@ ElementPtr *ppTwin1, *ppTwin2;
|
|||
*/
|
||||
|
||||
static void
|
||||
SwapCols( Matrix, pTwin1, pTwin2 )
|
||||
|
||||
MatrixPtr Matrix;
|
||||
ElementPtr pTwin1, pTwin2;
|
||||
SwapCols( MatrixPtr Matrix, ElementPtr pTwin1, ElementPtr pTwin2 )
|
||||
{
|
||||
int Col1 = pTwin1->Col, Col2 = pTwin2->Col;
|
||||
|
||||
|
|
@ -657,10 +650,7 @@ spMultiply(void *eMatrix, RealVector RHS, RealVector Solution,
|
|||
*/
|
||||
|
||||
static void
|
||||
ComplexMatrixMultiply( Matrix, RHS, Solution , iRHS, iSolution )
|
||||
|
||||
MatrixPtr Matrix;
|
||||
RealVector RHS, Solution , iRHS, iSolution;
|
||||
ComplexMatrixMultiply( MatrixPtr Matrix, RealVector RHS, RealVector Solution , RealVector iRHS, RealVector iSolution )
|
||||
{
|
||||
ElementPtr pElement;
|
||||
ComplexVector Vector;
|
||||
|
|
@ -805,10 +795,7 @@ spMultTransposed(void *eMatrix, RealVector RHS, RealVector Solution,
|
|||
*/
|
||||
|
||||
static void
|
||||
ComplexTransposedMatrixMultiply( Matrix, RHS, Solution , iRHS, iSolution )
|
||||
|
||||
MatrixPtr Matrix;
|
||||
RealVector RHS, Solution , iRHS, iSolution;
|
||||
ComplexTransposedMatrixMultiply( MatrixPtr Matrix, RealVector RHS, RealVector Solution , RealVector iRHS, RealVector iSolution )
|
||||
{
|
||||
ElementPtr pElement;
|
||||
ComplexVector Vector;
|
||||
|
|
@ -2176,10 +2163,7 @@ RealNumber Rho;
|
|||
*/
|
||||
|
||||
void
|
||||
spErrorMessage( eMatrix, Stream, Originator )
|
||||
|
||||
char *eMatrix, *Originator;
|
||||
FILE *Stream;
|
||||
spErrorMessage( char *eMatrix, FILE *Stream, char *Originator )
|
||||
{
|
||||
int Row, Col, Error;
|
||||
|
||||
|
|
|
|||
|
|
@ -22,9 +22,7 @@ extern double phi();
|
|||
extern void spErrorMessage(char*, FILE*, char*);
|
||||
|
||||
int
|
||||
main (argc, argv)
|
||||
int argc;
|
||||
char **argv;
|
||||
main (int argc, char **argv)
|
||||
{
|
||||
int ch;
|
||||
int errflg=0,i,j;
|
||||
|
|
@ -343,8 +341,7 @@ int
|
|||
}
|
||||
|
||||
void
|
||||
usage(argv)
|
||||
char **argv;
|
||||
usage(char **argv)
|
||||
{
|
||||
|
||||
fprintf(stderr,"Purpose: make subckt. for coupled lines using uncoupled simple lossy lines\n");
|
||||
|
|
@ -362,10 +359,7 @@ fflush(stderr);
|
|||
}
|
||||
|
||||
void
|
||||
comments(r,l,g,c,ctot,cm,lm,k,name,num,len)
|
||||
double r,l,g,c,ctot,cm,lm,k,len;
|
||||
char *name;
|
||||
int num;
|
||||
comments(double r,double l,double g,double c,double ctot,double cm,double lm,double k,char *name,int num, double len)
|
||||
{
|
||||
|
||||
fprintf(stdout,"* Subcircuit %s\n",name);
|
||||
|
|
@ -401,9 +395,7 @@ fflush(stdout);
|
|||
}
|
||||
|
||||
double
|
||||
phi(i,arg)
|
||||
int i;
|
||||
double arg;
|
||||
phi(int i, double arg)
|
||||
{
|
||||
double rval;
|
||||
|
||||
|
|
|
|||
|
|
@ -302,10 +302,8 @@ main(void) {
|
|||
}
|
||||
|
||||
void
|
||||
getdata(vals,count,width)
|
||||
double vals[];
|
||||
int count;
|
||||
int width; /* maximum number of values to accept per line */
|
||||
getdata(double *vals, int count, int width)
|
||||
/* width: maximum number of values to accept per line */
|
||||
{
|
||||
int i;
|
||||
int error;
|
||||
|
|
|
|||
|
|
@ -13,56 +13,44 @@ Author: 1985 Hong J. Park, Thomas L. Quarles
|
|||
*/
|
||||
|
||||
void
|
||||
B1mosCap(ckt,vgd,vgs,vgb,
|
||||
args,
|
||||
/*
|
||||
GateDrainOverlapCap,GateSourceOverlapCap, GateBulkOverlapCap,
|
||||
capbd,capbs,
|
||||
cggb,cgdb,cgsb,
|
||||
*/
|
||||
cbgb,cbdb,cbsb,cdgb,cddb,cdsb,
|
||||
gcggbPointer,gcgdbPointer,gcgsbPointer,gcbgbPointer,gcbdbPointer,
|
||||
gcbsbPointer,gcdgbPointer,gcddbPointer,gcdsbPointer,
|
||||
gcsgbPointer,gcsdbPointer,gcssbPointer,qGatePointer,qBulkPointer,
|
||||
qDrainPointer,qSourcePointer)
|
||||
CKTcircuit *ckt;
|
||||
double vgd;
|
||||
double vgs;
|
||||
double vgb;
|
||||
double args[8];
|
||||
/*
|
||||
double GateDrainOverlapCap;
|
||||
double GateSourceOverlapCap;
|
||||
double GateBulkOverlapCap;
|
||||
double capbd;
|
||||
double capbs;
|
||||
double cggb;
|
||||
double cgdb;
|
||||
double cgsb;
|
||||
*/
|
||||
double cbgb;
|
||||
double cbdb;
|
||||
double cbsb;
|
||||
double cdgb;
|
||||
double cddb;
|
||||
double cdsb;
|
||||
double *gcggbPointer;
|
||||
double *gcgdbPointer;
|
||||
double *gcgsbPointer;
|
||||
double *gcbgbPointer;
|
||||
double *gcbdbPointer;
|
||||
double *gcbsbPointer;
|
||||
double *gcdgbPointer;
|
||||
double *gcddbPointer;
|
||||
double *gcdsbPointer;
|
||||
double *gcsgbPointer;
|
||||
double *gcsdbPointer;
|
||||
double *gcssbPointer;
|
||||
double *qGatePointer;
|
||||
double *qBulkPointer;
|
||||
double *qDrainPointer;
|
||||
double *qSourcePointer;
|
||||
|
||||
B1mosCap(
|
||||
CKTcircuit *ckt,
|
||||
double vgd,
|
||||
double vgs,
|
||||
double vgb,
|
||||
double args[8],
|
||||
/*
|
||||
double GateDrainOverlapCap,
|
||||
double GateSourceOverlapCap,
|
||||
double GateBulkOverlapCap,
|
||||
double capbd,
|
||||
double capbs,
|
||||
double cggb,
|
||||
double cgdb,
|
||||
double cgsb,
|
||||
*/
|
||||
double cbgb,
|
||||
double cbdb,
|
||||
double cbsb,
|
||||
double cdgb,
|
||||
double cddb,
|
||||
double cdsb,
|
||||
double *gcggbPointer,
|
||||
double *gcgdbPointer,
|
||||
double *gcgsbPointer,
|
||||
double *gcbgbPointer,
|
||||
double *gcbdbPointer,
|
||||
double *gcbsbPointer,
|
||||
double *gcdgbPointer,
|
||||
double *gcddbPointer,
|
||||
double *gcdsbPointer,
|
||||
double *gcsgbPointer,
|
||||
double *gcsdbPointer,
|
||||
double *gcssbPointer,
|
||||
double *qGatePointer,
|
||||
double *qBulkPointer,
|
||||
double *qDrainPointer,
|
||||
double *qSourcePointer)
|
||||
{
|
||||
double qgd;
|
||||
double qgs;
|
||||
|
|
|
|||
|
|
@ -13,56 +13,44 @@ Author: 1985 Hong J. Park, Thomas L. Quarles
|
|||
*/
|
||||
|
||||
void
|
||||
B2mosCap(ckt,vgd,vgs,vgb,
|
||||
args,
|
||||
/*
|
||||
GateDrainOverlapCap,GateSourceOverlapCap, GateBulkOverlapCap,
|
||||
capbd,capbs,
|
||||
cggb,cgdb,cgsb,
|
||||
*/
|
||||
cbgb,cbdb,cbsb,cdgb,cddb,cdsb,
|
||||
gcggbPointer,gcgdbPointer,gcgsbPointer,gcbgbPointer,gcbdbPointer,
|
||||
gcbsbPointer,gcdgbPointer,gcddbPointer,gcdsbPointer,
|
||||
gcsgbPointer,gcsdbPointer,gcssbPointer,qGatePointer,qBulkPointer,
|
||||
qDrainPointer,qSourcePointer)
|
||||
CKTcircuit *ckt;
|
||||
double vgd;
|
||||
double vgs;
|
||||
double vgb;
|
||||
double args[8];
|
||||
/*
|
||||
double GateDrainOverlapCap;
|
||||
double GateSourceOverlapCap;
|
||||
double GateBulkOverlapCap;
|
||||
double capbd;
|
||||
double capbs;
|
||||
double cggb;
|
||||
double cgdb;
|
||||
double cgsb;
|
||||
*/
|
||||
double cbgb;
|
||||
double cbdb;
|
||||
double cbsb;
|
||||
double cdgb;
|
||||
double cddb;
|
||||
double cdsb;
|
||||
double *gcggbPointer;
|
||||
double *gcgdbPointer;
|
||||
double *gcgsbPointer;
|
||||
double *gcbgbPointer;
|
||||
double *gcbdbPointer;
|
||||
double *gcbsbPointer;
|
||||
double *gcdgbPointer;
|
||||
double *gcddbPointer;
|
||||
double *gcdsbPointer;
|
||||
double *gcsgbPointer;
|
||||
double *gcsdbPointer;
|
||||
double *gcssbPointer;
|
||||
double *qGatePointer;
|
||||
double *qBulkPointer;
|
||||
double *qDrainPointer;
|
||||
double *qSourcePointer;
|
||||
|
||||
B2mosCap(
|
||||
CKTcircuit *ckt,
|
||||
double vgd,
|
||||
double vgs,
|
||||
double vgb,
|
||||
double args[8],
|
||||
/*
|
||||
double GateDrainOverlapCap,
|
||||
double GateSourceOverlapCap,
|
||||
double GateBulkOverlapCap,
|
||||
double capbd,
|
||||
double capbs,
|
||||
double cggb,
|
||||
double cgdb,
|
||||
double cgsb,
|
||||
*/
|
||||
double cbgb,
|
||||
double cbdb,
|
||||
double cbsb,
|
||||
double cdgb,
|
||||
double cddb,
|
||||
double cdsb,
|
||||
double *gcggbPointer,
|
||||
double *gcgdbPointer,
|
||||
double *gcgsbPointer,
|
||||
double *gcbgbPointer,
|
||||
double *gcbdbPointer,
|
||||
double *gcbsbPointer,
|
||||
double *gcdgbPointer,
|
||||
double *gcddbPointer,
|
||||
double *gcdsbPointer,
|
||||
double *gcsgbPointer,
|
||||
double *gcsdbPointer,
|
||||
double *gcssbPointer,
|
||||
double *qGatePointer,
|
||||
double *qBulkPointer,
|
||||
double *qDrainPointer,
|
||||
double *qSourcePointer)
|
||||
{
|
||||
double qgd;
|
||||
double qgs;
|
||||
|
|
|
|||
|
|
@ -658,17 +658,16 @@ add_new_vi(CPLinstance *here, CKTcircuit *ckt, int time)
|
|||
|
||||
|
||||
static int
|
||||
get_pvs_vi(t1, t2, cp, v1_i, v2_i, i1_i, i2_i, v1_o, v2_o, i1_o, i2_o)
|
||||
CPLine *cp;
|
||||
int t1, t2;
|
||||
double v1_i[MAX_CP_TX_LINES][MAX_CP_TX_LINES];
|
||||
double v2_i[MAX_CP_TX_LINES][MAX_CP_TX_LINES];
|
||||
double i1_i[MAX_CP_TX_LINES][MAX_CP_TX_LINES];
|
||||
double i2_i[MAX_CP_TX_LINES][MAX_CP_TX_LINES];
|
||||
double v1_o[MAX_CP_TX_LINES][MAX_CP_TX_LINES];
|
||||
double v2_o[MAX_CP_TX_LINES][MAX_CP_TX_LINES];
|
||||
double i1_o[MAX_CP_TX_LINES][MAX_CP_TX_LINES];
|
||||
double i2_o[MAX_CP_TX_LINES][MAX_CP_TX_LINES];
|
||||
get_pvs_vi(int t1, int t2,
|
||||
CPLine *cp,
|
||||
double v1_i[MAX_CP_TX_LINES][MAX_CP_TX_LINES],
|
||||
double v2_i[MAX_CP_TX_LINES][MAX_CP_TX_LINES],
|
||||
double i1_i[MAX_CP_TX_LINES][MAX_CP_TX_LINES],
|
||||
double i2_i[MAX_CP_TX_LINES][MAX_CP_TX_LINES],
|
||||
double v1_o[MAX_CP_TX_LINES][MAX_CP_TX_LINES],
|
||||
double v2_o[MAX_CP_TX_LINES][MAX_CP_TX_LINES],
|
||||
double i1_o[MAX_CP_TX_LINES][MAX_CP_TX_LINES],
|
||||
double i2_o[MAX_CP_TX_LINES][MAX_CP_TX_LINES])
|
||||
{
|
||||
double ta[MAX_CP_TX_LINES], tb[MAX_CP_TX_LINES];
|
||||
VI_list *vi, *vi1;
|
||||
|
|
|
|||
|
|
@ -21,9 +21,7 @@ Author: 1990 Jaijeet S. Roychowdhury
|
|||
|
||||
|
||||
int
|
||||
LTRAquadInterp(t, t1, t2, t3, c1, c2, c3)
|
||||
double t, t1, t2, t3;
|
||||
double *c1, *c2, *c3;
|
||||
LTRAquadInterp(double t, double t1, double t2, double t3, double *c1, double *c2, double *c3)
|
||||
{
|
||||
double f1, f2, f3;
|
||||
|
||||
|
|
@ -84,10 +82,7 @@ LTRAquadInterp(t, t1, t2, t3, c1, c2, c3)
|
|||
/* linear interpolation */
|
||||
|
||||
int
|
||||
LTRAlinInterp(t, t1, t2, c1, c2)
|
||||
double t, t1, t2;
|
||||
double *c1, *c2;
|
||||
|
||||
LTRAlinInterp(double t, double t1, double t2, double *c1, double *c2)
|
||||
{
|
||||
double temp;
|
||||
|
||||
|
|
@ -117,8 +112,7 @@ LTRAlinInterp(t, t1, t2, c1, c2)
|
|||
*/
|
||||
|
||||
double
|
||||
intlinfunc(lolimit, hilimit, lovalue, hivalue, t1, t2)
|
||||
double lolimit, hilimit, lovalue, hivalue, t1, t2;
|
||||
intlinfunc(double lolimit, double hilimit, double lovalue, double hivalue, double t1, double t2)
|
||||
{
|
||||
double width, m;
|
||||
|
||||
|
|
@ -141,8 +135,7 @@ intlinfunc(lolimit, hilimit, lovalue, hivalue, t1, t2)
|
|||
*/
|
||||
|
||||
double
|
||||
twiceintlinfunc(lolimit, hilimit, otherlolimit, lovalue, hivalue, t1, t2)
|
||||
double lolimit, hilimit, lovalue, hivalue, t1, t2, otherlolimit;
|
||||
twiceintlinfunc(double lolimit, double hilimit, double otherlolimit, double lovalue, double hivalue, double t1, double t2)
|
||||
{
|
||||
double width, m, dummy;
|
||||
double temp1, temp2, temp3;
|
||||
|
|
@ -171,9 +164,7 @@ twiceintlinfunc(lolimit, hilimit, otherlolimit, lovalue, hivalue, t1, t2)
|
|||
*/
|
||||
|
||||
double
|
||||
thriceintlinfunc(lolimit, hilimit, secondlolimit, thirdlolimit, lovalue,
|
||||
hivalue, t1, t2)
|
||||
double lolimit, hilimit, lovalue, hivalue, t1, t2, secondlolimit, thirdlolimit;
|
||||
thriceintlinfunc(double lolimit, double hilimit, double secondlolimit, double thirdlolimit, double lovalue, double hivalue, double t1, double t2)
|
||||
{
|
||||
double width, m, dummy;
|
||||
double temp1, temp2, temp3, temp4;
|
||||
|
|
@ -210,8 +201,7 @@ thriceintlinfunc(lolimit, hilimit, secondlolimit, thirdlolimit, lovalue,
|
|||
*/
|
||||
|
||||
double
|
||||
bessI0(x)
|
||||
double x;
|
||||
bessI0(double x)
|
||||
{
|
||||
double ax, ans;
|
||||
double y;
|
||||
|
|
@ -232,8 +222,7 @@ bessI0(x)
|
|||
}
|
||||
|
||||
double
|
||||
bessI1(x)
|
||||
double x;
|
||||
bessI1(double x)
|
||||
{
|
||||
double ax, ans;
|
||||
double y;
|
||||
|
|
@ -255,8 +244,7 @@ bessI1(x)
|
|||
}
|
||||
|
||||
double
|
||||
bessI1xOverX(x)
|
||||
double x;
|
||||
bessI1xOverX(double x)
|
||||
{
|
||||
double ax, ans;
|
||||
double y;
|
||||
|
|
@ -280,9 +268,7 @@ bessI1xOverX(x)
|
|||
/* LTRArlcH1dashFunc - the first impulse response function */
|
||||
|
||||
double
|
||||
LTRArlcH1dashFunc(time, T, alpha, beta)
|
||||
double time, T, alpha, beta;
|
||||
|
||||
LTRArlcH1dashFunc(double time, double T, double alpha, double beta)
|
||||
{
|
||||
double besselarg, exparg, returnval;
|
||||
/* T is not used in this function */
|
||||
|
|
@ -302,9 +288,7 @@ LTRArlcH1dashFunc(time, T, alpha, beta)
|
|||
}
|
||||
|
||||
double
|
||||
LTRArlcH2Func(time, T, alpha, beta)
|
||||
double time, T, alpha, beta;
|
||||
|
||||
LTRArlcH2Func(double time, double T, double alpha, double beta)
|
||||
{
|
||||
double besselarg, exparg, returnval;
|
||||
|
||||
|
|
@ -330,9 +314,7 @@ LTRArlcH2Func(time, T, alpha, beta)
|
|||
}
|
||||
|
||||
double
|
||||
LTRArlcH3dashFunc(time, T, alpha, beta)
|
||||
double time, T, alpha, beta;
|
||||
|
||||
LTRArlcH3dashFunc(double time, double T, double alpha, double beta)
|
||||
{
|
||||
double exparg, besselarg, returnval;
|
||||
|
||||
|
|
@ -364,8 +346,7 @@ LTRArlcH3dashFunc(time, T, alpha, beta)
|
|||
*/
|
||||
|
||||
double
|
||||
LTRArlcH1dashTwiceIntFunc(time, beta)
|
||||
double time, beta;
|
||||
LTRArlcH1dashTwiceIntFunc(double time, double beta)
|
||||
{
|
||||
double arg, returnval;
|
||||
|
||||
|
|
@ -390,9 +371,7 @@ LTRArlcH1dashTwiceIntFunc(time, beta)
|
|||
*/
|
||||
|
||||
double
|
||||
LTRArlcH3dashIntFunc(time, T, beta)
|
||||
double time, T, beta;
|
||||
|
||||
LTRArlcH3dashIntFunc(double time, double T, double beta)
|
||||
{
|
||||
double exparg, besselarg;
|
||||
double returnval;
|
||||
|
|
@ -409,8 +388,7 @@ LTRArlcH3dashIntFunc(time, T, beta)
|
|||
|
||||
|
||||
double
|
||||
LTRArcH1dashTwiceIntFunc(time, cbyr)
|
||||
double time, cbyr;
|
||||
LTRArcH1dashTwiceIntFunc(double time, double cbyr)
|
||||
{
|
||||
|
||||
return (sqrt(4 * cbyr * time / M_PI));
|
||||
|
|
@ -420,8 +398,7 @@ LTRArcH1dashTwiceIntFunc(time, cbyr)
|
|||
|
||||
|
||||
double
|
||||
LTRArcH2TwiceIntFunc(time, rclsqr)
|
||||
double time, rclsqr;
|
||||
LTRArcH2TwiceIntFunc(double time, double rclsqr)
|
||||
{
|
||||
double temp;
|
||||
|
||||
|
|
@ -436,8 +413,7 @@ LTRArcH2TwiceIntFunc(time, rclsqr)
|
|||
|
||||
|
||||
double
|
||||
LTRArcH3dashTwiceIntFunc(time, cbyr, rclsqr)
|
||||
double time, cbyr, rclsqr;
|
||||
LTRArcH3dashTwiceIntFunc(double time, double cbyr, double rclsqr)
|
||||
{
|
||||
double temp;
|
||||
|
||||
|
|
@ -457,12 +433,9 @@ LTRArcH3dashTwiceIntFunc(time, cbyr, rclsqr)
|
|||
*/
|
||||
|
||||
void
|
||||
LTRArcCoeffsSetup(h1dashfirstcoeff, h2firstcoeff, h3dashfirstcoeff, h1dashcoeffs, h2coeffs, h3dashcoeffs, listsize, cbyr, rclsqr, curtime, timelist, timeindex, reltol)
|
||||
double *h1dashcoeffs, *h2coeffs, *h3dashcoeffs, *timelist;
|
||||
int listsize, timeindex;
|
||||
double cbyr, rclsqr, curtime, *h1dashfirstcoeff, *h2firstcoeff, *h3dashfirstcoeff;
|
||||
double reltol;
|
||||
|
||||
LTRArcCoeffsSetup(double *h1dashfirstcoeff, double *h2firstcoeff, double *h3dashfirstcoeff, double *h1dashcoeffs,
|
||||
double *h2coeffs, double *h3dashcoeffs, int listsize, double cbyr,
|
||||
double rclsqr, double curtime, double *timelist, int timeindex, double reltol)
|
||||
{
|
||||
double delta1, delta2;
|
||||
double h1dummy1, h1dummy2;
|
||||
|
|
@ -593,11 +566,9 @@ LTRArcCoeffsSetup(h1dashfirstcoeff, h2firstcoeff, h3dashfirstcoeff, h1dashcoeffs
|
|||
}
|
||||
|
||||
void
|
||||
LTRArlcCoeffsSetup(h1dashfirstcoeff, h2firstcoeff, h3dashfirstcoeff, h1dashcoeffs, h2coeffs, h3dashcoeffs, listsize, T, alpha, beta, curtime, timelist, timeindex, reltol, auxindexptr)
|
||||
double *h1dashfirstcoeff, *h2firstcoeff, *h3dashfirstcoeff;
|
||||
double *h1dashcoeffs, *h2coeffs, *h3dashcoeffs, *timelist;
|
||||
double T, alpha, beta, curtime, reltol;
|
||||
int listsize, timeindex, *auxindexptr;
|
||||
LTRArlcCoeffsSetup(double *h1dashfirstcoeff, double *h2firstcoeff, double *h3dashfirstcoeff, double *h1dashcoeffs, double *h2coeffs,
|
||||
double *h3dashcoeffs, int listsize, double T, double alpha, double beta, double curtime, double *timelist, int timeindex, double reltol, int *auxindexptr)
|
||||
|
||||
{
|
||||
unsigned exact;
|
||||
double lolimit1, lolimit2 = 0.0, hilimit1, hilimit2 = 0.0;
|
||||
|
|
@ -803,9 +774,7 @@ LTRArlcCoeffsSetup(h1dashfirstcoeff, h2firstcoeff, h3dashfirstcoeff, h1dashcoeff
|
|||
*/
|
||||
|
||||
int
|
||||
LTRAstraightLineCheck(x1, y1, x2, y2, x3, y3, reltol, abstol)
|
||||
double x1, y1, x2, y2, x3, y3, reltol, abstol;
|
||||
|
||||
LTRAstraightLineCheck(double x1, double y1, double x2, double y2, double x3, double y3, double reltol, double abstol)
|
||||
{
|
||||
/*
|
||||
* double asqr, bsqr, csqr, c, c1sqr; double htsqr;
|
||||
|
|
@ -854,11 +823,7 @@ LTRAstraightLineCheck(x1, y1, x2, y2, x3, y3, reltol, abstol)
|
|||
|
||||
|
||||
double
|
||||
LTRAlteCalculate(ckt, genmodel, geninstance, curtime)
|
||||
CKTcircuit *ckt;
|
||||
GENmodel *genmodel;
|
||||
GENinstance *geninstance;
|
||||
double curtime;
|
||||
LTRAlteCalculate(CKTcircuit *ckt, GENmodel *genmodel, GENinstance *geninstance, double curtime)
|
||||
{
|
||||
LTRAmodel *model = (LTRAmodel *) genmodel;
|
||||
LTRAinstance *instance = (LTRAinstance *) geninstance;
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ VBICload(GENmodel *inModel, CKTcircuit *ckt)
|
|||
double ibcphat;
|
||||
double iccphat;
|
||||
double ceq, geq, rhs_current;
|
||||
int icheck;
|
||||
int icheck = 0;
|
||||
int ichk1, ichk2, ichk3, ichk4, ichk5;
|
||||
int error;
|
||||
int SenCond=0;
|
||||
|
|
@ -1260,30 +1260,19 @@ c Stamp element: Rs
|
|||
return(OK);
|
||||
}
|
||||
|
||||
int vbic_4T_it_cf_fj(p
|
||||
,Vbei,Vbex,Vbci,Vbep,Vbcp,Vrcx
|
||||
,Vbcx,Vrci,Vrbx,Vrbi,Vre,Vrbp,Vrs
|
||||
,Vbe,Vbc,Ibe,Ibe_Vbei,Ibex,Ibex_Vbex,Itzf
|
||||
,Itzf_Vbei,Itzf_Vbci,Itzr,Itzr_Vbci,Itzr_Vbei,Ibc,Ibc_Vbci
|
||||
,Ibc_Vbei,Ibep,Ibep_Vbep,Ircx,Ircx_Vrcx,Irci,Irci_Vrci
|
||||
,Irci_Vbci,Irci_Vbcx,Irbx,Irbx_Vrbx,Irbi,Irbi_Vrbi,Irbi_Vbei
|
||||
,Irbi_Vbci,Ire,Ire_Vre,Irbp,Irbp_Vrbp,Irbp_Vbep,Irbp_Vbci
|
||||
,Qbe,Qbe_Vbei,Qbe_Vbci,Qbex,Qbex_Vbex,Qbc,Qbc_Vbci
|
||||
,Qbcx,Qbcx_Vbcx,Qbep,Qbep_Vbep,Qbep_Vbci,Qbeo,Qbeo_Vbe
|
||||
,Qbco,Qbco_Vbc,Ibcp,Ibcp_Vbcp,Iccp,Iccp_Vbep,Iccp_Vbci
|
||||
,Iccp_Vbcp,Irs,Irs_Vrs,Qbcp,Qbcp_Vbcp,SCALE)
|
||||
double *p
|
||||
,*Vbei,*Vbex,*Vbci,*Vbep,*Vbcp,*Vrcx
|
||||
,*Vbcx,*Vrci,*Vrbx,*Vrbi,*Vre,*Vrbp,*Vrs
|
||||
,*Vbe,*Vbc,*Ibe,*Ibe_Vbei,*Ibex,*Ibex_Vbex,*Itzf
|
||||
,*Itzf_Vbei,*Itzf_Vbci,*Itzr,*Itzr_Vbci,*Itzr_Vbei,*Ibc,*Ibc_Vbci
|
||||
,*Ibc_Vbei,*Ibep,*Ibep_Vbep,*Ircx,*Ircx_Vrcx,*Irci,*Irci_Vrci
|
||||
,*Irci_Vbci,*Irci_Vbcx,*Irbx,*Irbx_Vrbx,*Irbi,*Irbi_Vrbi,*Irbi_Vbei
|
||||
,*Irbi_Vbci,*Ire,*Ire_Vre,*Irbp,*Irbp_Vrbp,*Irbp_Vbep,*Irbp_Vbci
|
||||
,*Qbe,*Qbe_Vbei,*Qbe_Vbci,*Qbex,*Qbex_Vbex,*Qbc,*Qbc_Vbci
|
||||
,*Qbcx,*Qbcx_Vbcx,*Qbep,*Qbep_Vbep,*Qbep_Vbci,*Qbeo,*Qbeo_Vbe
|
||||
,*Qbco,*Qbco_Vbc,*Ibcp,*Ibcp_Vbcp,*Iccp,*Iccp_Vbep,*Iccp_Vbci
|
||||
,*Iccp_Vbcp,*Irs,*Irs_Vrs,*Qbcp,*Qbcp_Vbcp,*SCALE;
|
||||
int vbic_4T_it_cf_fj(
|
||||
double *p
|
||||
, double *Vbei, double *Vbex, double *Vbci, double *Vbep, double *Vbcp, double *Vrcx
|
||||
, double *Vbcx, double *Vrci, double *Vrbx, double *Vrbi, double *Vre, double *Vrbp, double *Vrs
|
||||
, double *Vbe, double *Vbc, double *Ibe, double *Ibe_Vbei, double *Ibex, double *Ibex_Vbex, double *Itzf
|
||||
, double *Itzf_Vbei, double *Itzf_Vbci, double *Itzr, double *Itzr_Vbci, double *Itzr_Vbei, double *Ibc, double *Ibc_Vbci
|
||||
, double *Ibc_Vbei, double *Ibep, double *Ibep_Vbep, double *Ircx, double *Ircx_Vrcx, double *Irci, double *Irci_Vrci
|
||||
, double *Irci_Vbci, double *Irci_Vbcx, double *Irbx, double *Irbx_Vrbx, double *Irbi, double *Irbi_Vrbi, double *Irbi_Vbei
|
||||
, double *Irbi_Vbci, double *Ire, double *Ire_Vre, double *Irbp, double *Irbp_Vrbp, double *Irbp_Vbep, double *Irbp_Vbci
|
||||
, double *Qbe, double *Qbe_Vbei, double *Qbe_Vbci, double *Qbex, double *Qbex_Vbex, double *Qbc, double *Qbc_Vbci
|
||||
, double *Qbcx, double *Qbcx_Vbcx, double *Qbep, double *Qbep_Vbep, double *Qbep_Vbci, double *Qbeo, double *Qbeo_Vbe
|
||||
, double *Qbco, double *Qbco_Vbc, double *Ibcp, double *Ibcp_Vbcp, double *Iccp, double *Iccp_Vbep, double *Iccp_Vbci
|
||||
, double *Iccp_Vbcp, double *Irs, double *Irs_Vrs, double *Qbcp, double *Qbcp_Vbcp, double *SCALE)
|
||||
{
|
||||
double Vtv,IVEF,IVER,IIKF,IIKR,IIKP,IVO;
|
||||
double IHRCF,IVTF,IITF,slTF,dv0,dvh,dvh_Vbei;
|
||||
|
|
|
|||
Loading…
Reference in New Issue