Jspice3
captemp.c
Go to the documentation of this file.
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
18 CAPtemp(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 
struct sCAPinstance * CAPnextInstance
Definition: capdefs.h:21
double CAPcjsw
Definition: capdefs.h:61
double CAPcj
Definition: capdefs.h:60
CAPinstance * CAPinstances
Definition: capdefs.h:57
#define OK
Definition: iferrmsg.h:17
double CAPwidth
Definition: capdefs.h:31
double CAPnarrow
Definition: capdefs.h:63
#define NULL
Definition: spdefs.h:121
double CAPlength
Definition: capdefs.h:32
double CAPdefWidth
Definition: capdefs.h:62
static char model[32]
Definition: subckt.c:76
unsigned CAPcapGiven
Definition: capdefs.h:44
unsigned CAPwidthGiven
Definition: capdefs.h:46
int CAPtemp(GENmodel *inModel, CKTcircuit *ckt)
Definition: captemp.c:18
double CAPcapac
Definition: capdefs.h:27
struct sCAPmodel * CAPnextModel
Definition: capdefs.h:55