1 /*************************************************************************** 2 JSPICE3 adaptation of Spice3f2 - Copyright (c) Stephen R. Whiteley 1992 3 Copyright 1990 Regents of the University of California. All rights reserved. 4 Authors: 1985 Thomas L. Quarles 5 1992 Stephen R. Whiteley 6 ****************************************************************************/ 7 8 9 #include "spice.h" 10 #include <stdio.h> 11 #include "capdefs.h" 12 #include "sperror.h" 13 #include "util.h" 14 15 16 /*ARGSUSED*/ 17 int CAPtemp(inModel,ckt)18CAPtemp(inModel,ckt) 19 20 GENmodel *inModel; 21 CKTcircuit *ckt; 22 { 23 CAPmodel *model = (CAPmodel*)inModel; 24 CAPinstance *here; 25 26 /* loop through all the capacitor models */ 27 for ( ; model != NULL; model = model->CAPnextModel) { 28 29 /* loop through all the instances of the model */ 30 for (here = model->CAPinstances; here != NULL; 31 here = here->CAPnextInstance) { 32 33 /* Default Value Processing for Capacitor Instance */ 34 if (!here->CAPwidthGiven) { 35 here->CAPwidth = model->CAPdefWidth; 36 } 37 if (!here->CAPcapGiven) { 38 here->CAPcapac = 39 model->CAPcj * 40 (here->CAPwidth - model->CAPnarrow) * 41 (here->CAPlength - model->CAPnarrow) + 42 model->CAPcjsw * 2 * ( 43 (here->CAPlength - model->CAPnarrow) + 44 (here->CAPwidth - model->CAPnarrow) ); 45 } 46 } 47 } 48 return (OK); 49 } 50 51