Jspice3
b1.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 Hong J. Park, Thomas L. Quarles
5  1993 Stephen R. Whiteley
6 ****************************************************************************/
7 
8 #include "spice.h"
9 #include <stdio.h>
10 #include "bsim1def.h"
11 #include "uflags.h"
12 
13 static IFparm B1pTable[] = { /* parameters */
14  IOP( "l", BSIM1_L, IF_REAL, "Length"),
15  IOP( "w", BSIM1_W, IF_REAL, "Width"),
16  IOP( "ad", BSIM1_AD, IF_REAL, "Drain area"),
17  IOP( "as", BSIM1_AS, IF_REAL, "Source area"),
18  IOP( "pd", BSIM1_PD, IF_REAL, "Drain perimeter"),
19  IOP( "ps", BSIM1_PS, IF_REAL, "Source perimeter"),
20  IOP( "nrd", BSIM1_NRD, IF_REAL, "Number of squares in drain"),
21  IOP( "nrs", BSIM1_NRS, IF_REAL, "Number of squares in source"),
22  IOP( "off", BSIM1_OFF, IF_FLAG, "Device is initially off"),
23  IOP( "vds", BSIM1_IC_VDS, IF_REAL, "Initial D-S voltage"),
24  IOP( "vgs", BSIM1_IC_VGS, IF_REAL, "Initial G-S voltage"),
25  IOP( "vbs", BSIM1_IC_VBS, IF_REAL, "Initial B-S voltage"),
26  IP( "ic", BSIM1_IC, IF_VECTOR , "Vector of DS,GS,BS initial voltages")
27 };
28 
29 static IFparm B1mPTable[] = { /* model parameters */
30  IOP( "vfb", BSIM1_MOD_VFB0, IF_REAL,"Flat band voltage"),
31  IOP( "lvfb", BSIM1_MOD_VFBL, IF_REAL,
32  "Length dependence of vfb"),
33  IOP( "wvfb", BSIM1_MOD_VFBW, IF_REAL,
34  "Width dependence of vfb"),
35  IOP( "phi", BSIM1_MOD_PHI0, IF_REAL,
36  "Strong inversion surface potential "),
37  IOP( "lphi", BSIM1_MOD_PHIL, IF_REAL,
38  "Length dependence of phi"),
39  IOP( "wphi", BSIM1_MOD_PHIW, IF_REAL,
40  "Width dependence of phi"),
41  IOP( "k1", BSIM1_MOD_K10, IF_REAL,
42  "Bulk effect coefficient 1"),
43  IOP( "lk1", BSIM1_MOD_K1L, IF_REAL,
44  "Length dependence of k1"),
45  IOP( "wk1", BSIM1_MOD_K1W, IF_REAL,
46  "Width dependence of k1"),
47  IOP( "k2", BSIM1_MOD_K20, IF_REAL,
48  "Bulk effect coefficient 2"),
49  IOP( "lk2", BSIM1_MOD_K2L, IF_REAL,
50  "Length dependence of k2"),
51  IOP( "wk2", BSIM1_MOD_K2W, IF_REAL,
52  "Width dependence of k2"),
53  IOP( "eta", BSIM1_MOD_ETA0, IF_REAL,
54  "VDS dependence of threshold voltage"),
55  IOP( "leta", BSIM1_MOD_ETAL, IF_REAL,
56  "Length dependence of eta"),
57  IOP( "weta", BSIM1_MOD_ETAW, IF_REAL,
58  "Width dependence of eta"),
59  IOP( "x2e", BSIM1_MOD_ETAB0, IF_REAL,
60  "VBS dependence of eta"),
61  IOP( "lx2e", BSIM1_MOD_ETABL, IF_REAL,
62  "Length dependence of x2e"),
63  IOP( "wx2e", BSIM1_MOD_ETABW, IF_REAL,
64  "Width dependence of x2e"),
65  IOP( "x3e", BSIM1_MOD_ETAD0, IF_REAL,
66  "VDS dependence of eta"),
67  IOP( "lx3e", BSIM1_MOD_ETADL, IF_REAL,
68  "Length dependence of x3e"),
69  IOP( "wx3e", BSIM1_MOD_ETADW, IF_REAL,
70  "Width dependence of x3e"),
72  "Channel length reduction in um"),
74  "Channel width reduction in um"),
75  IOP( "muz", BSIM1_MOD_MOBZERO, IF_REAL,
76  "Zero field mobility at VDS=0 VGS=VTH"),
78  "VBS dependence of muz"),
79  IOP( "lx2mz", BSIM1_MOD_MOBZEROBL, IF_REAL,
80  "Length dependence of x2mz"),
81  IOP( "wx2mz", BSIM1_MOD_MOBZEROBW, IF_REAL,
82  "Width dependence of x2mz"),
83  IOP( "mus", BSIM1_MOD_MOBVDD0, IF_REAL,
84  "Mobility at VDS=VDD VGS=VTH, channel length modulation"),
85  IOP( "lmus", BSIM1_MOD_MOBVDDL, IF_REAL,
86  "Length dependence of mus"),
87  IOP( "wmus", BSIM1_MOD_MOBVDDW, IF_REAL,
88  "Width dependence of mus"),
89  IOP( "x2ms", BSIM1_MOD_MOBVDDB0, IF_REAL,
90  "VBS dependence of mus"),
91  IOP( "lx2ms", BSIM1_MOD_MOBVDDBL, IF_REAL,
92  "Length dependence of x2ms"),
93  IOP( "wx2ms", BSIM1_MOD_MOBVDDBW, IF_REAL,
94  "Width dependence of x2ms"),
95  IOP( "x3ms", BSIM1_MOD_MOBVDDD0, IF_REAL,
96  "VDS dependence of mus"),
97  IOP( "lx3ms", BSIM1_MOD_MOBVDDDL, IF_REAL,
98  "Length dependence of x3ms"),
99  IOP( "wx3ms", BSIM1_MOD_MOBVDDDW, IF_REAL,
100  "Width dependence of x3ms"),
101  IOP( "u0", BSIM1_MOD_UGS0, IF_REAL,
102  "VGS dependence of mobility"),
103  IOP( "lu0", BSIM1_MOD_UGSL, IF_REAL,
104  "Length dependence of u0"),
105  IOP( "wu0", BSIM1_MOD_UGSW, IF_REAL,
106  "Width dependence of u0"),
107  IOP( "x2u0", BSIM1_MOD_UGSB0, IF_REAL,
108  "VBS dependence of u0"),
109  IOP( "lx2u0", BSIM1_MOD_UGSBL, IF_REAL,
110  "Length dependence of x2u0"),
111  IOP( "wx2u0", BSIM1_MOD_UGSBW, IF_REAL,
112  "Width dependence of x2u0"),
113  IOP( "u1", BSIM1_MOD_UDS0, IF_REAL,
114  "VDS depence of mobility, velocity saturation"),
115  IOP( "lu1", BSIM1_MOD_UDSL, IF_REAL,
116  "Length dependence of u1"),
117  IOP( "wu1", BSIM1_MOD_UDSW, IF_REAL,
118  "Width dependence of u1"),
119  IOP( "x2u1", BSIM1_MOD_UDSB0, IF_REAL,
120  "VBS depence of u1"),
121  IOP( "lx2u1", BSIM1_MOD_UDSBL, IF_REAL,
122  "Length depence of x2u1"),
123  IOP( "wx2u1", BSIM1_MOD_UDSBW, IF_REAL,
124  "Width depence of x2u1"),
125  IOP( "x3u1", BSIM1_MOD_UDSD0, IF_REAL,
126  "VDS depence of u1"),
127  IOP( "lx3u1", BSIM1_MOD_UDSDL, IF_REAL,
128  "Length dependence of x3u1"),
129  IOP( "wx3u1", BSIM1_MOD_UDSDW, IF_REAL,
130  "Width depence of x3u1"),
131  IOP( "n0", BSIM1_MOD_N00, IF_REAL,
132  "Subthreshold slope"),
133  IOP( "ln0", BSIM1_MOD_N0L, IF_REAL,
134  "Length dependence of n0"),
135  IOP( "wn0", BSIM1_MOD_N0W, IF_REAL,
136  "Width dependence of n0"),
137  IOP( "nb", BSIM1_MOD_NB0, IF_REAL,
138  "VBS dependence of subthreshold slope"),
139  IOP( "lnb", BSIM1_MOD_NBL, IF_REAL,
140  "Length dependence of nb"),
141  IOP( "wnb", BSIM1_MOD_NBW, IF_REAL,
142  "Width dependence of nb"),
143  IOP( "nd", BSIM1_MOD_ND0, IF_REAL,
144  "VDS dependence of subthreshold slope"),
145  IOP( "lnd", BSIM1_MOD_NDL, IF_REAL,
146  "Length dependence of nd"),
147  IOP( "wnd", BSIM1_MOD_NDW, IF_REAL,
148  "Width dependence of nd"),
149  IOP( "tox", BSIM1_MOD_TOX, IF_REAL,
150  "Gate oxide thickness in um"),
151  IOP( "temp", BSIM1_MOD_TEMP, IF_REAL,
152  "Temperature in degree Celcius"),
153  IOP( "vdd", BSIM1_MOD_VDD, IF_REAL,
154  "Supply voltage to specify mus"),
155  IOPA("cgso", BSIM1_MOD_CGSO, IF_REAL,
156  "Gate source overlap capacitance per unit channel width(m)"),
157  IOPA("cgdo", BSIM1_MOD_CGDO, IF_REAL,
158  "Gate drain overlap capacitance per unit channel width(m)"),
159  IOPA("cgbo", BSIM1_MOD_CGBO, IF_REAL,
160  "Gate bulk overlap capacitance per unit channel length(m)"),
161  IOP( "xpart", BSIM1_MOD_XPART, IF_REAL,
162  "Flag for channel charge partitioning"),
163  IOP( "rsh", BSIM1_MOD_RSH, IF_REAL,
164  "Source drain diffusion sheet resistance in ohm per square"),
165  IOP( "js", BSIM1_MOD_JS, IF_REAL,
166  "Source drain junction saturation current per unit area"),
167  IOP( "pb", BSIM1_MOD_PB, IF_REAL,
168  "Source drain junction built in potential"),
169  IOPA("mj", BSIM1_MOD_MJ, IF_REAL,
170  "Source drain bottom junction capacitance grading coefficient"),
171  IOPA("pbsw", BSIM1_MOD_PBSW, IF_REAL,
172  "Source drain side junction capacitance built in potential"),
173  IOPA("mjsw", BSIM1_MOD_MJSW, IF_REAL,
174  "Source drain side junction capacitance grading coefficient"),
175  IOPA("cj", BSIM1_MOD_CJ, IF_REAL,
176  "Source drain bottom junction capacitance per unit area"),
177  IOPA("cjsw", BSIM1_MOD_CJSW, IF_REAL,
178  "Source drain side junction capacitance per unit area"),
179  IOP( "wdf", BSIM1_MOD_DEFWIDTH, IF_REAL,
180  "Default width of source drain diffusion in um"),
181  IOP( "dell", BSIM1_MOD_DELLENGTH, IF_REAL,
182  "Length reduction of source drain diffusion"),
183  IP( "nmos", BSIM1_MOD_NMOS, IF_FLAG,
184  "Flag to indicate NMOS"),
185  IP( "pmos", BSIM1_MOD_PMOS, IF_FLAG,
186  "Flag to indicate PMOS"),
187 };
188 
189 static char *B1names[] = {
190  "Drain",
191  "Gate",
192  "Source",
193  "Bulk"
194 };
195 
196 static char *B1modNames[] = {
197  "nmos",
198  "pmos",
199  NULL
200 };
201 
202 static IFkeys B1keys[] = {
203  { 'm', NUMELEMS(B1names), B1names, 0, 0 },
204 };
205 
206 
207 static int B1kSize = NUMELEMS(B1keys);
208 static int B1pTSize = NUMELEMS(B1pTable);
209 static int B1mPTSize = NUMELEMS(B1mPTable);
210 static int B1iSize = sizeof(B1instance);
211 static int B1mSize = sizeof(B1model);
212 
213 
215  { "B1",
216  "Berkeley Short Channel IGFET Model",
217 
218  &B1kSize,
219  B1keys,
220  8, /* level 4 */
221  B1modNames,
222  GENmosParse,
223 
224  &B1pTSize,
225  B1pTable,
226 
227  &B1mPTSize,
228  B1mPTable,
229  },
230 
231  B1param,
232  B1mParam,
233  B1load,
234  B1setup,
235  B1setup,
236  B1temp,
237  B1trunc,
238  NULL,
239  B1acLoad,
240  NULL,
241  GENdestroy,
242  GENmDelete,
243  GENdelete,
244  B1getic,
245  B1ask,
246  B1mAsk,
247  B1pzLoad,
248  B1convTest,
249  B1disto,
250  NULL, /* NOISE */
251 
252  &B1iSize,
253  &B1mSize
254 };
#define BSIM1_MOD_UDSBL
Definition: bsim1def.h:539
#define BSIM1_MOD_UGSL
Definition: bsim1def.h:530
#define BSIM1_MOD_ETAB0
Definition: bsim1def.h:508
#define BSIM1_AS
Definition: bsim1def.h:480
#define BSIM1_MOD_MOBZEROBW
Definition: bsim1def.h:519
#define BSIM1_MOD_UDSL
Definition: bsim1def.h:536
#define BSIM1_W
Definition: bsim1def.h:478
#define BSIM1_MOD_K1L
Definition: bsim1def.h:500
int B1trunc()
#define BSIM1_MOD_CJSW
Definition: bsim1def.h:567
static int B1mSize
Definition: b1.c:211
#define BSIM1_MOD_MOBVDDB0
Definition: bsim1def.h:523
#define IOP(a, b, c, d)
Definition: devdefs.h:120
#define BSIM1_MOD_MOBVDDW
Definition: bsim1def.h:522
int B1setup()
#define BSIM1_IC
Definition: bsim1def.h:490
#define BSIM1_MOD_UDSD0
Definition: bsim1def.h:541
#define BSIM1_MOD_CGBO
Definition: bsim1def.h:558
#define BSIM1_MOD_TEMP
Definition: bsim1def.h:554
#define BSIM1_MOD_DEFWIDTH
Definition: bsim1def.h:568
#define BSIM1_MOD_MOBVDDDW
Definition: bsim1def.h:528
#define BSIM1_MOD_DELTAW
Definition: bsim1def.h:515
#define BSIM1_MOD_UGSB0
Definition: bsim1def.h:532
#define NUMELEMS(ARRAY)
Definition: spice.h:157
#define BSIM1_MOD_UGS0
Definition: bsim1def.h:529
#define BSIM1_MOD_ETABL
Definition: bsim1def.h:509
#define BSIM1_MOD_UDS0
Definition: bsim1def.h:535
#define BSIM1_MOD_XPART
Definition: bsim1def.h:559
#define BSIM1_MOD_K20
Definition: bsim1def.h:502
#define BSIM1_MOD_DELTAL
Definition: bsim1def.h:514
#define BSIM1_MOD_RSH
Definition: bsim1def.h:560
#define BSIM1_AD
Definition: bsim1def.h:481
#define BSIM1_MOD_NDL
Definition: bsim1def.h:551
#define BSIM1_MOD_MJSW
Definition: bsim1def.h:565
#define BSIM1_MOD_PHIW
Definition: bsim1def.h:498
void GENmosParse()
static IFparm B1pTable[]
Definition: b1.c:13
static int B1pTSize
Definition: b1.c:208
#define BSIM1_MOD_MOBVDDD0
Definition: bsim1def.h:526
void GENdestroy()
#define BSIM1_MOD_NBL
Definition: bsim1def.h:548
#define BSIM1_MOD_MOBZERO
Definition: bsim1def.h:516
#define BSIM1_MOD_ETAL
Definition: bsim1def.h:506
#define BSIM1_MOD_NBW
Definition: bsim1def.h:549
static char * B1names[]
Definition: b1.c:189
#define BSIM1_MOD_ETABW
Definition: bsim1def.h:510
#define BSIM1_NRD
Definition: bsim1def.h:485
static IFkeys B1keys[]
Definition: b1.c:202
#define BSIM1_MOD_UGSBL
Definition: bsim1def.h:533
SPICEdev B1info
Definition: b1.c:214
#define BSIM1_MOD_VFB0
Definition: bsim1def.h:493
#define BSIM1_MOD_K2W
Definition: bsim1def.h:504
#define BSIM1_OFF
Definition: bsim1def.h:486
#define BSIM1_MOD_MOBZEROBL
Definition: bsim1def.h:518
#define IF_VECTOR
Definition: ifsim.h:121
static int B1mPTSize
Definition: b1.c:209
#define BSIM1_MOD_TOX
Definition: bsim1def.h:553
#define BSIM1_MOD_VDD
Definition: bsim1def.h:555
#define BSIM1_MOD_UDSDW
Definition: bsim1def.h:543
#define NULL
Definition: spdefs.h:121
#define BSIM1_MOD_MOBVDDDL
Definition: bsim1def.h:527
static IFparm B1mPTable[]
Definition: b1.c:29
#define BSIM1_MOD_MJ
Definition: bsim1def.h:563
#define BSIM1_MOD_UGSBW
Definition: bsim1def.h:534
int B1pzLoad()
#define BSIM1_IC_VGS
Definition: bsim1def.h:489
#define BSIM1_MOD_NB0
Definition: bsim1def.h:547
int B1ask()
#define BSIM1_MOD_UDSBW
Definition: bsim1def.h:540
#define BSIM1_IC_VBS
Definition: bsim1def.h:487
#define BSIM1_MOD_UGSW
Definition: bsim1def.h:531
int B1mAsk()
#define BSIM1_L
Definition: bsim1def.h:479
#define BSIM1_MOD_MOBVDDBW
Definition: bsim1def.h:525
#define BSIM1_MOD_NDW
Definition: bsim1def.h:552
#define IOPA(a, b, c, d)
Definition: uflags.h:50
#define BSIM1_MOD_VFBW
Definition: bsim1def.h:495
#define BSIM1_MOD_UDSB0
Definition: bsim1def.h:538
#define BSIM1_PD
Definition: bsim1def.h:483
#define BSIM1_MOD_ETAD0
Definition: bsim1def.h:511
Definition: ifsim.h:54
Definition: ifsim.h:267
#define BSIM1_MOD_PBSW
Definition: bsim1def.h:564
#define BSIM1_MOD_PMOS
Definition: bsim1def.h:571
#define BSIM1_MOD_VFBL
Definition: bsim1def.h:494
#define BSIM1_MOD_JS
Definition: bsim1def.h:561
#define IF_REAL
Definition: ifsim.h:108
#define IP(a, b, c, d)
Definition: devdefs.h:118
#define BSIM1_MOD_CGDO
Definition: bsim1def.h:557
static int B1iSize
Definition: b1.c:210
#define BSIM1_MOD_PHIL
Definition: bsim1def.h:497
#define BSIM1_MOD_MOBVDD0
Definition: bsim1def.h:520
struct sBSIM1model B1model
#define BSIM1_MOD_NMOS
Definition: bsim1def.h:570
#define BSIM1_MOD_CJ
Definition: bsim1def.h:566
#define IF_FLAG
Definition: ifsim.h:106
int B1param()
int B1disto()
#define BSIM1_MOD_N0W
Definition: bsim1def.h:546
int GENmDelete()
#define BSIM1_MOD_UDSDL
Definition: bsim1def.h:542
static char * B1modNames[]
Definition: b1.c:196
int B1mParam()
int GENdelete()
static int B1kSize
Definition: b1.c:207
#define BSIM1_MOD_ETADL
Definition: bsim1def.h:512
#define BSIM1_MOD_N0L
Definition: bsim1def.h:545
#define BSIM1_MOD_PB
Definition: bsim1def.h:562
#define BSIM1_MOD_DELLENGTH
Definition: bsim1def.h:569
#define BSIM1_MOD_CGSO
Definition: bsim1def.h:556
#define BSIM1_MOD_K10
Definition: bsim1def.h:499
struct sBSIM1instance B1instance
#define BSIM1_MOD_K1W
Definition: bsim1def.h:501
#define BSIM1_MOD_K2L
Definition: bsim1def.h:503
#define BSIM1_MOD_MOBVDDL
Definition: bsim1def.h:521
#define BSIM1_MOD_PHI0
Definition: bsim1def.h:496
int B1temp()
#define BSIM1_MOD_ETADW
Definition: bsim1def.h:513
#define BSIM1_MOD_ETAW
Definition: bsim1def.h:507
#define BSIM1_NRS
Definition: bsim1def.h:484
#define BSIM1_IC_VDS
Definition: bsim1def.h:488
#define BSIM1_PS
Definition: bsim1def.h:482
#define BSIM1_MOD_ETA0
Definition: bsim1def.h:505
int B1load()
#define BSIM1_MOD_MOBVDDBL
Definition: bsim1def.h:524
#define BSIM1_MOD_N00
Definition: bsim1def.h:544
#define BSIM1_MOD_ND0
Definition: bsim1def.h:550
#define BSIM1_MOD_MOBZEROB0
Definition: bsim1def.h:517
int B1convTest()
#define BSIM1_MOD_UDSW
Definition: bsim1def.h:537
int B1getic()
int B1acLoad()