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: 1988 Hong June Park 5 1993 Stephen R. Whiteley 6 ****************************************************************************/ 7 8 #include "spice.h" 9 #include <stdio.h> 10 #include "bsim2def.h" 11 #include "sperror.h" 12 13 14 /*ARGSUSED*/ 15 int B2mAsk(ckt,inst,which,value)16B2mAsk(ckt,inst,which,value) 17 CKTcircuit *ckt; 18 GENmodel *inst; 19 int which; 20 IFvalue *value; 21 { 22 B2model *model = (B2model *)inst; 23 switch(which) { 24 case BSIM2_MOD_VFB0: 25 value->rValue = model->B2vfb0; 26 break; 27 case BSIM2_MOD_VFBL : 28 value->rValue = model->B2vfbL; 29 break; 30 case BSIM2_MOD_VFBW : 31 value->rValue = model->B2vfbW; 32 break; 33 case BSIM2_MOD_PHI0 : 34 value->rValue = model->B2phi0; 35 break; 36 case BSIM2_MOD_PHIL : 37 value->rValue = model->B2phiL; 38 break; 39 case BSIM2_MOD_PHIW : 40 value->rValue = model->B2phiW; 41 break; 42 case BSIM2_MOD_K10 : 43 value->rValue = model->B2k10; 44 break; 45 case BSIM2_MOD_K1L : 46 value->rValue = model->B2k1L; 47 break; 48 case BSIM2_MOD_K1W : 49 value->rValue = model->B2k1W; 50 break; 51 case BSIM2_MOD_K20 : 52 value->rValue = model->B2k20; 53 break; 54 case BSIM2_MOD_K2L : 55 value->rValue = model->B2k2L; 56 break; 57 case BSIM2_MOD_K2W : 58 value->rValue = model->B2k2W; 59 break; 60 case BSIM2_MOD_ETA00 : 61 value->rValue = model->B2eta00; 62 break; 63 case BSIM2_MOD_ETA0L : 64 value->rValue = model->B2eta0L; 65 break; 66 case BSIM2_MOD_ETA0W : 67 value->rValue = model->B2eta0W; 68 break; 69 case BSIM2_MOD_ETAB0 : 70 value->rValue = model->B2etaB0; 71 break; 72 case BSIM2_MOD_ETABL : 73 value->rValue = model->B2etaBL; 74 break; 75 case BSIM2_MOD_ETABW : 76 value->rValue = model->B2etaBW; 77 break; 78 case BSIM2_MOD_DELTAL : 79 value->rValue = model->B2deltaL = value->rValue; 80 break; 81 case BSIM2_MOD_DELTAW : 82 value->rValue = model->B2deltaW = value->rValue; 83 break; 84 case BSIM2_MOD_MOB00 : 85 value->rValue = model->B2mob00; 86 break; 87 case BSIM2_MOD_MOB0B0 : 88 value->rValue = model->B2mob0B0; 89 break; 90 case BSIM2_MOD_MOB0BL : 91 value->rValue = model->B2mob0BL; 92 break; 93 case BSIM2_MOD_MOB0BW : 94 value->rValue = model->B2mob0BW; 95 break; 96 case BSIM2_MOD_MOBS00 : 97 value->rValue = model->B2mobs00; 98 break; 99 case BSIM2_MOD_MOBS0L : 100 value->rValue = model->B2mobs0L; 101 break; 102 case BSIM2_MOD_MOBS0W : 103 value->rValue = model->B2mobs0W; 104 break; 105 case BSIM2_MOD_MOBSB0 : 106 value->rValue = model->B2mobsB0; 107 break; 108 case BSIM2_MOD_MOBSBL : 109 value->rValue = model->B2mobsBL; 110 break; 111 case BSIM2_MOD_MOBSBW : 112 value->rValue = model->B2mobsBW; 113 break; 114 case BSIM2_MOD_MOB200 : 115 value->rValue = model->B2mob200; 116 break; 117 case BSIM2_MOD_MOB20L : 118 value->rValue = model->B2mob20L; 119 break; 120 case BSIM2_MOD_MOB20W : 121 value->rValue = model->B2mob20W; 122 break; 123 case BSIM2_MOD_MOB2B0 : 124 value->rValue = model->B2mob2B0; 125 break; 126 case BSIM2_MOD_MOB2BL : 127 value->rValue = model->B2mob2BL; 128 break; 129 case BSIM2_MOD_MOB2BW : 130 value->rValue = model->B2mob2BW; 131 break; 132 case BSIM2_MOD_MOB2G0 : 133 value->rValue = model->B2mob2G0; 134 break; 135 case BSIM2_MOD_MOB2GL : 136 value->rValue = model->B2mob2GL; 137 break; 138 case BSIM2_MOD_MOB2GW : 139 value->rValue = model->B2mob2GW; 140 break; 141 case BSIM2_MOD_MOB300 : 142 value->rValue = model->B2mob300; 143 break; 144 case BSIM2_MOD_MOB30L : 145 value->rValue = model->B2mob30L; 146 break; 147 case BSIM2_MOD_MOB30W : 148 value->rValue = model->B2mob30W; 149 break; 150 case BSIM2_MOD_MOB3B0 : 151 value->rValue = model->B2mob3B0; 152 break; 153 case BSIM2_MOD_MOB3BL : 154 value->rValue = model->B2mob3BL; 155 break; 156 case BSIM2_MOD_MOB3BW : 157 value->rValue = model->B2mob3BW; 158 break; 159 case BSIM2_MOD_MOB3G0 : 160 value->rValue = model->B2mob3G0; 161 break; 162 case BSIM2_MOD_MOB3GL : 163 value->rValue = model->B2mob3GL; 164 break; 165 case BSIM2_MOD_MOB3GW : 166 value->rValue = model->B2mob3GW; 167 break; 168 case BSIM2_MOD_MOB400 : 169 value->rValue = model->B2mob400; 170 break; 171 case BSIM2_MOD_MOB40L : 172 value->rValue = model->B2mob40L; 173 break; 174 case BSIM2_MOD_MOB40W : 175 value->rValue = model->B2mob40W; 176 break; 177 case BSIM2_MOD_MOB4B0 : 178 value->rValue = model->B2mob4B0; 179 break; 180 case BSIM2_MOD_MOB4BL : 181 value->rValue = model->B2mob4BL; 182 break; 183 case BSIM2_MOD_MOB4BW : 184 value->rValue = model->B2mob4BW; 185 break; 186 case BSIM2_MOD_MOB4G0 : 187 value->rValue = model->B2mob4G0; 188 break; 189 case BSIM2_MOD_MOB4GL : 190 value->rValue = model->B2mob4GL; 191 break; 192 case BSIM2_MOD_MOB4GW : 193 value->rValue = model->B2mob4GW; 194 break; 195 case BSIM2_MOD_UA00 : 196 value->rValue = model->B2ua00; 197 break; 198 case BSIM2_MOD_UA0L : 199 value->rValue = model->B2ua0L; 200 break; 201 case BSIM2_MOD_UA0W : 202 value->rValue = model->B2ua0W; 203 break; 204 case BSIM2_MOD_UAB0 : 205 value->rValue = model->B2uaB0; 206 break; 207 case BSIM2_MOD_UABL : 208 value->rValue = model->B2uaBL; 209 break; 210 case BSIM2_MOD_UABW : 211 value->rValue = model->B2uaBW; 212 break; 213 case BSIM2_MOD_UB00 : 214 value->rValue = model->B2ub00; 215 break; 216 case BSIM2_MOD_UB0L : 217 value->rValue = model->B2ub0L; 218 break; 219 case BSIM2_MOD_UB0W : 220 value->rValue = model->B2ub0W; 221 break; 222 case BSIM2_MOD_UBB0 : 223 value->rValue = model->B2ubB0; 224 break; 225 case BSIM2_MOD_UBBL : 226 value->rValue = model->B2ubBL; 227 break; 228 case BSIM2_MOD_UBBW : 229 value->rValue = model->B2ubBW; 230 break; 231 case BSIM2_MOD_U100 : 232 value->rValue = model->B2u100; 233 break; 234 case BSIM2_MOD_U10L : 235 value->rValue = model->B2u10L; 236 break; 237 case BSIM2_MOD_U10W : 238 value->rValue = model->B2u10W; 239 break; 240 case BSIM2_MOD_U1B0 : 241 value->rValue = model->B2u1B0; 242 break; 243 case BSIM2_MOD_U1BL : 244 value->rValue = model->B2u1BL; 245 break; 246 case BSIM2_MOD_U1BW : 247 value->rValue = model->B2u1BW; 248 break; 249 case BSIM2_MOD_U1D0 : 250 value->rValue = model->B2u1D0; 251 break; 252 case BSIM2_MOD_U1DL : 253 value->rValue = model->B2u1DL; 254 break; 255 case BSIM2_MOD_U1DW : 256 value->rValue = model->B2u1DW; 257 break; 258 case BSIM2_MOD_N00 : 259 value->rValue = model->B2n00; 260 break; 261 case BSIM2_MOD_N0L : 262 value->rValue = model->B2n0L; 263 break; 264 case BSIM2_MOD_N0W : 265 value->rValue = model->B2n0W; 266 break; 267 case BSIM2_MOD_NB0 : 268 value->rValue = model->B2nB0; 269 break; 270 case BSIM2_MOD_NBL : 271 value->rValue = model->B2nBL; 272 break; 273 case BSIM2_MOD_NBW : 274 value->rValue = model->B2nBW; 275 break; 276 case BSIM2_MOD_ND0 : 277 value->rValue = model->B2nD0; 278 break; 279 case BSIM2_MOD_NDL : 280 value->rValue = model->B2nDL; 281 break; 282 case BSIM2_MOD_NDW : 283 value->rValue = model->B2nDW; 284 break; 285 case BSIM2_MOD_VOF00 : 286 value->rValue = model->B2vof00; 287 break; 288 case BSIM2_MOD_VOF0L : 289 value->rValue = model->B2vof0L; 290 break; 291 case BSIM2_MOD_VOF0W : 292 value->rValue = model->B2vof0W; 293 break; 294 case BSIM2_MOD_VOFB0 : 295 value->rValue = model->B2vofB0; 296 break; 297 case BSIM2_MOD_VOFBL : 298 value->rValue = model->B2vofBL; 299 break; 300 case BSIM2_MOD_VOFBW : 301 value->rValue = model->B2vofBW; 302 break; 303 case BSIM2_MOD_VOFD0 : 304 value->rValue = model->B2vofD0; 305 break; 306 case BSIM2_MOD_VOFDL : 307 value->rValue = model->B2vofDL; 308 break; 309 case BSIM2_MOD_VOFDW : 310 value->rValue = model->B2vofDW; 311 break; 312 case BSIM2_MOD_AI00 : 313 value->rValue = model->B2ai00; 314 break; 315 case BSIM2_MOD_AI0L : 316 value->rValue = model->B2ai0L; 317 break; 318 case BSIM2_MOD_AI0W : 319 value->rValue = model->B2ai0W; 320 break; 321 case BSIM2_MOD_AIB0 : 322 value->rValue = model->B2aiB0; 323 break; 324 case BSIM2_MOD_AIBL : 325 value->rValue = model->B2aiBL; 326 break; 327 case BSIM2_MOD_AIBW : 328 value->rValue = model->B2aiBW; 329 break; 330 case BSIM2_MOD_BI00 : 331 value->rValue = model->B2bi00; 332 break; 333 case BSIM2_MOD_BI0L : 334 value->rValue = model->B2bi0L; 335 break; 336 case BSIM2_MOD_BI0W : 337 value->rValue = model->B2bi0W; 338 break; 339 case BSIM2_MOD_BIB0 : 340 value->rValue = model->B2biB0; 341 break; 342 case BSIM2_MOD_BIBL : 343 value->rValue = model->B2biBL; 344 break; 345 case BSIM2_MOD_BIBW : 346 value->rValue = model->B2biBW; 347 break; 348 case BSIM2_MOD_VGHIGH0 : 349 value->rValue = model->B2vghigh0; 350 break; 351 case BSIM2_MOD_VGHIGHL : 352 value->rValue = model->B2vghighL; 353 break; 354 case BSIM2_MOD_VGHIGHW : 355 value->rValue = model->B2vghighW; 356 break; 357 case BSIM2_MOD_VGLOW0 : 358 value->rValue = model->B2vglow0; 359 break; 360 case BSIM2_MOD_VGLOWL : 361 value->rValue = model->B2vglowL; 362 break; 363 case BSIM2_MOD_VGLOWW : 364 value->rValue = model->B2vglowW; 365 break; 366 case BSIM2_MOD_TOX : 367 value->rValue = model->B2tox; 368 break; 369 case BSIM2_MOD_TEMP : 370 value->rValue = model->B2temp; 371 break; 372 case BSIM2_MOD_VDD : 373 value->rValue = model->B2vdd; 374 break; 375 case BSIM2_MOD_VGG : 376 value->rValue = model->B2vgg; 377 break; 378 case BSIM2_MOD_VBB : 379 value->rValue = model->B2vbb; 380 break; 381 case BSIM2_MOD_CGSO: 382 value->rValue = model->B2gateSourceOverlapCap; 383 break; 384 case BSIM2_MOD_CGDO: 385 value->rValue = model->B2gateDrainOverlapCap; 386 break; 387 case BSIM2_MOD_CGBO: 388 value->rValue = model->B2gateBulkOverlapCap; 389 break; 390 case BSIM2_MOD_XPART: 391 value->iValue = model->B2channelChargePartitionFlag; 392 break; 393 case BSIM2_MOD_RSH: 394 value->rValue = model->B2sheetResistance; 395 break; 396 case BSIM2_MOD_JS: 397 value->rValue = model->B2jctSatCurDensity; 398 break; 399 case BSIM2_MOD_PB: 400 value->rValue = model->B2bulkJctPotential; 401 break; 402 case BSIM2_MOD_MJ: 403 value->rValue = model->B2bulkJctBotGradingCoeff; 404 break; 405 case BSIM2_MOD_PBSW: 406 value->rValue = model->B2sidewallJctPotential; 407 break; 408 case BSIM2_MOD_MJSW: 409 value->rValue = model->B2bulkJctSideGradingCoeff; 410 break; 411 case BSIM2_MOD_CJ: 412 value->rValue = model->B2unitAreaJctCap; 413 break; 414 case BSIM2_MOD_CJSW: 415 value->rValue = model->B2unitLengthSidewallJctCap; 416 break; 417 case BSIM2_MOD_DEFWIDTH: 418 value->rValue = model->B2defaultWidth; 419 break; 420 case BSIM2_MOD_DELLENGTH: 421 value->rValue = model->B2deltaLength; 422 break; 423 default: 424 return (E_BADPARM); 425 } 426 return (OK); 427 } 428 429 430