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 June Park, Thomas L. Quarles 5 1993 Stephen R. Whiteley 6 ****************************************************************************/ 7 8 #include "spice.h" 9 #include <stdio.h> 10 #include "bsim2def.h" 11 #include "sperror.h" 12 #include "util.h" 13 14 15 /* ARGSUSED */ 16 int B2param(ckt,param,value,inst,select)17B2param(ckt,param,value,inst,select) 18 19 CKTcircuit *ckt; 20 int param; 21 IFvalue *value; 22 GENinstance *inst; 23 IFvalue *select; 24 { 25 B2instance *here = (B2instance*)inst; 26 switch(param) { 27 case BSIM2_W: 28 here->B2w = value->rValue; 29 here->B2wGiven = TRUE; 30 break; 31 case BSIM2_L: 32 here->B2l = value->rValue; 33 here->B2lGiven = TRUE; 34 break; 35 case BSIM2_AS: 36 here->B2sourceArea = value->rValue; 37 here->B2sourceAreaGiven = TRUE; 38 break; 39 case BSIM2_AD: 40 here->B2drainArea = value->rValue; 41 here->B2drainAreaGiven = TRUE; 42 break; 43 case BSIM2_PS: 44 here->B2sourcePerimeter = value->rValue; 45 here->B2sourcePerimeterGiven = TRUE; 46 break; 47 case BSIM2_PD: 48 here->B2drainPerimeter = value->rValue; 49 here->B2drainPerimeterGiven = TRUE; 50 break; 51 case BSIM2_NRS: 52 here->B2sourceSquares = value->rValue; 53 here->B2sourceSquaresGiven = TRUE; 54 break; 55 case BSIM2_NRD: 56 here->B2drainSquares = value->rValue; 57 here->B2drainSquaresGiven = TRUE; 58 break; 59 case BSIM2_OFF: 60 here->B2off = value->iValue; 61 break; 62 case BSIM2_IC_VBS: 63 here->B2icVBS = value->rValue; 64 here->B2icVBSGiven = TRUE; 65 break; 66 case BSIM2_IC_VDS: 67 here->B2icVDS = value->rValue; 68 here->B2icVDSGiven = TRUE; 69 break; 70 case BSIM2_IC_VGS: 71 here->B2icVGS = value->rValue; 72 here->B2icVGSGiven = TRUE; 73 break; 74 case BSIM2_IC: 75 switch(value->v.numValue){ 76 case 3: 77 here->B2icVBS = *(value->v.vec.rVec+2); 78 here->B2icVBSGiven = TRUE; 79 case 2: 80 here->B2icVGS = *(value->v.vec.rVec+1); 81 here->B2icVGSGiven = TRUE; 82 case 1: 83 here->B2icVDS = *(value->v.vec.rVec); 84 here->B2icVDSGiven = TRUE; 85 break; 86 default: 87 return(E_BADPARM); 88 } 89 break; 90 default: 91 return(E_BADPARM); 92 } 93 return(OK); 94 } 95 96 97 98