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          1993 Stephen R. Whiteley
6 ****************************************************************************/
7 
8 #include "spice.h"
9 #include <stdio.h>
10 #include "capdefs.h"
11 #include "uflags.h"
12 
13 static IFparm CAPpTable[] = { /* parameters */
14  IOPAP("capacitance", CAP_CAP,    IF_REAL, "Device capacitance"),
15  IOPAU("ic",          CAP_IC,     IF_REAL, "Initial capacitor voltage"),
16  IOPAU("w",           CAP_WIDTH,  IF_REAL, "Device width"),
17  IOPAU("l",           CAP_LENGTH, IF_REAL, "Device length"),
18  OP(   "i",           CAP_CURRENT,IF_REAL, "Device current"),
19  OPR(  "c",           CAP_CURRENT,IF_REAL, "Device current"),
20  OP(   "p",           CAP_POWER,  IF_REAL, "Instantaneous device power")
21 };
22 
23 static IFparm CAPmPTable[] = { /* names of model parameters */
24  IOPA( "cj",     CAP_MOD_CJ,      IF_REAL, "Bottom Capacitance per area"),
25  IOPA( "cjsw",   CAP_MOD_CJSW,    IF_REAL, "Sidewall capacitance per meter"),
26  IOPX( "defw",   CAP_MOD_DEFWIDTH,IF_REAL, "Default width"),
27  IP(   "c",      CAP_MOD_C,       IF_FLAG, "Capacitor model"),
28  IOPA( "narrow", CAP_MOD_NARROW,  IF_REAL, "width correction factor")
29 };
30 
31 static char *CAPnames[] = {
32     "C+",
33     "C-"
34 };
35 
36 static char *CAPmodNames[] = {
37     "c",
38     NULL
39 };
40 
41 static IFkeys CAPkeys[] = {
42     { 'c', NUMELEMS(CAPnames), CAPnames, 0, 0 },
43 };
44 
45 
46 static int CAPkSize = NUMELEMS(CAPkeys);
47 static int CAPpTSize = NUMELEMS(CAPpTable);
48 static int CAPmPTSize = NUMELEMS(CAPmPTable);
49 static int CAPiSize = sizeof(CAPinstance);
50 static int CAPmSize = sizeof(CAPmodel);
51 
52 
53 SPICEdev CAPinfo = {
54     {   "Capacitor",
55         "Fixed capacitor",
56 
57         &CAPkSize,
58         CAPkeys,
59         1,
60         CAPmodNames,
61         CAPparse,
62 
63         &CAPpTSize,
64         CAPpTable,
65 
66         &CAPmPTSize,
67         CAPmPTable,
68     },
69     CAPparam,
70     CAPmParam,
71     CAPload,
72     CAPsetup,
73     CAPsetup,
74     CAPtemp,
75     CAPtrunc,
76     NULL,
77     CAPacLoad,
78     NULL,
79     GENdestroy,
80     GENmDelete,
81     GENdelete,
82     CAPgetic,
83     CAPask,
84     CAPmAsk,
85     CAPpzLoad,
86     NULL,
87     NULL,  /* DISTO */
88     NULL,  /* NOISE */
89 
90     &CAPiSize,
91     &CAPmSize
92 };
93