1 /******************************************************************************/
3 /* Chaine de CAO & VLSI AVERTEC */
5 /* Fichier : mcc_mod_spice.c */
8 /* (c) copyright 2001 AVERTEC */
9 /* Tous droits reserves */
11 /* Auteur(s) : Marc KUOCH */
12 /*----------------------------------------------------------------------------*/
15 /*----------------------------------------------------------------------------*/
17 /******************************************************************************/
19 /******************************************************************************/
23 #include "mcc_mod_util.h"
24 #include "mcc_mod_bsim3v3.h"
25 #include "mcc_mod_bsim4.h"
26 #include "mcc_mod_psp.h"
27 #include "mcc_mod_ext.h"
28 #include "mcc_mod_mos2.h"
29 #include "mcc_mod_mm9.h"
30 #include "mcc_mod_spice.h"
31 #include "mcc_genspi.h"
32 #include "mcc_debug.h"
34 #include "mcc_parse_cfg.h"
36 /******************************************************************************/
38 /******************************************************************************/
40 /******************************************************************************/
41 /* extern fonctions */
42 /******************************************************************************/
44 /******************************************************************************/
46 /******************************************************************************/
48 /****************************************************************************\
49 FUNCTION : mcc_integfordw()
50 Return voltage dependant capacitance value
51 \****************************************************************************/
53 double mcc_integfordw_q( double c
, double p
, double m
, double vbd
)
56 double epsilon
= 1e-3 ;
59 if( m
< 1.0-epsilon
|| m
> 1.0+epsilon
)
60 q
= c
*p
/(m
-1.0) * ( pow( 1.0-vbd
/p
, 1.0-m
) - 1.0 );
62 q
= -c
*p
* log( 1.0-vbd
/p
);
65 q
= c
* ( vbd
+ m
/(p
+p
)*vbd
*vbd
);
70 double mcc_integfordw( double c
, double vbd0
, double vbd1
, double p
, double m
)
76 q0
= mcc_integfordw_q( c
, p
, m
, vbd0
);
77 q1
= mcc_integfordw_q( c
, p
, m
, vbd1
);
78 cx
= fabs( (q1
- q0
) / (vbd1
- vbd0
) ) ;
83 /******************************************************************************/
84 /* Obtention de fichier technologique */
85 /******************************************************************************/
86 mcc_technolist
*mcc_gettechnofile (char *technoname
)
88 mcc_technolist
*pttechnofile
;
90 if ((pttechnofile
= mcc_gettechno(technoname
)) != NULL
)
91 return ( pttechnofile
) ;
93 if ( MCC_USE_SPI_PARSER
)
94 parsespice ( technoname
);
96 mcc_parserfile (technoname
) ;
98 if ((pttechnofile
= mcc_gettechno(technoname
)) != NULL
) {
99 mcc_initallparam ( technoname
) ;
103 avt_errmsg(MCC_ERRMSG
, "012", AVT_ERROR
, technoname
);
107 /******************************************************************************/
108 /* Destruction de fichier technologique */
109 /******************************************************************************/
110 void mcc_deltechnofile(char *technoname
)
112 mcc_technolist
*pttechnofile
;
113 mcc_technolist
*pttechnofileprev
;
114 mcc_technolist
*pttechnofilenext
;
116 pttechnofile
= MCC_HEADTECHNO
;
118 if (pttechnofile
->NAME
== namealloc(technoname
))
120 pttechnofileprev
= pttechnofile
;
121 pttechnofile
= pttechnofile
->NEXT
;
122 free_all_model(pttechnofileprev
) ;
123 mbkfree(pttechnofileprev
) ;
124 MCC_HEADTECHNO
= pttechnofile
;
128 while (pttechnofile
->NEXT
!= NULL
)
130 pttechnofileprev
= pttechnofile
;
131 pttechnofile
= pttechnofile
->NEXT
;
132 pttechnofilenext
= pttechnofile
->NEXT
;
134 if (pttechnofile
->NAME
== namealloc(technoname
))
136 pttechnofileprev
->NEXT
= pttechnofilenext
;
137 free_all_model(pttechnofile
) ;
138 mbkfree(pttechnofile
) ;
143 if (pttechnofile
->NAME
== namealloc(technoname
))
145 pttechnofileprev
->NEXT
= NULL
;
146 free_all_model(pttechnofile
) ;
147 mbkfree(pttechnofile
) ;
152 avt_errmsg(MCC_ERRMSG
, "013", AVT_ERROR
, technoname
);
157 /******************************************************************************\
159 FUNCT mcc_get_modeltype
161 \******************************************************************************/
162 int mcc_get_modeltype ( mcc_modellist
*ptmodel
, char *name
)
164 int modeltype
= MCC_NOMODEL
;
170 if( ptmodel
->MODELTYPE
>=0 )
171 return ptmodel
->MODELTYPE
;
173 if( ptmodel
->TYPE
== MCC_DIODE
)
176 for( m
= mcc_getmodcfg() ; m
; m
= m
->NEXT
) {
177 if( strcasecmp(V_INT_TAB
[__SIM_TOOLMODEL
].ENUMSTR_FUNC(V_INT_TAB
[__SIM_TOOLMODEL
].VALUE
), m
->NAME
) == 0 )
185 for( md
= m
->MODLIST
; md
; md
= md
->NEXT
) {
187 if( md
->CRITERION
== MCC_CRIT_PARAM
) {
189 if( mcc_getparamtype( ptmodel
, md
->VALUE
.PARAM
.PARAM
) == MCC_SETVALUE
) {
191 value
= (int)(mcc_getparam( ptmodel
, md
->VALUE
.PARAM
.PARAM
) + 0.5 );
193 if( value
== (int)(md
->VALUE
.PARAM
.VALUE
+0.5) ) {
194 modeltype
= md
->MCCTYPE
;
200 if( md
->CRITERION
== MCC_CRIT_MODEL
&& name
) {
202 if( strcasecmp( md
->VALUE
.MODEL
, name
) == 0 ) {
203 modeltype
= md
->MCCTYPE
;
211 /* cas ou on a pas trouvé : peut etre que le simtoolmodel n'est pas
212 positionné. dans ce cas on essaye de trouver une correspondance. */
213 for( m
= mcc_getmodcfg() ; m
; m
= m
->NEXT
) {
214 for( md
= m
->MODLIST
; md
; md
= md
->NEXT
) {
215 if( md
->CRITERION
== MCC_CRIT_PARAM
) {
217 if( mcc_getparamtype( ptmodel
, md
->VALUE
.PARAM
.PARAM
) == MCC_SETVALUE
) {
219 value
= (int)(mcc_getparam( ptmodel
, md
->VALUE
.PARAM
.PARAM
) + 0.5 );
221 if( value
== (int)(md
->VALUE
.PARAM
.VALUE
+0.5) ) {
222 modeltype
= md
->MCCTYPE
;
228 if( md
->CRITERION
== MCC_CRIT_MODEL
&& name
) {
230 if( strcasecmp( md
->VALUE
.MODEL
, name
) == 0 ) {
231 modeltype
= md
->MCCTYPE
;
239 if( modeltype
!= MCC_NOMODEL
) {
240 avt_errmsg( MCC_ERRMSG
, "042", AVT_ERROR
, ptmodel
->NAME
, V_INT_TAB
[__SIM_TOOLMODEL
].ENUMSTR_FUNC(V_INT_TAB
[__SIM_TOOLMODEL
].VALUE
), MCC_MOD_NAME
[modeltype
], m
->NAME
) ;
245 if (md
->EXTNAME
) ptmodel
->USER
= addptype(ptmodel
->USER
, MCC_MODEL_EXTNAME
, md
->EXTNAME
);
246 for( d
= md
->DEFAULT
; d
; d
= d
->NEXT
) {
247 if( mcc_getparamtype( ptmodel
, d
->NAME
) != MCC_SETVALUE
)
248 mcc_addparam( ptmodel
, d
->NAME
, d
->VALUE
, MCC_SETVALUE
);
255 /******************************************************************************/
256 /* Obtention du type de modele de transistor a partir d'un technofile */
257 /* On suppose que les transistors sont tous du meme model dans le technofile */
258 /* C'est pourquoi on ne compare que le parametre LEVEL d'un seul transistor */
259 /******************************************************************************/
260 int mcc_getmodeltype(char *technoname
)
262 int modeltype
= MCC_NOMODEL
;
263 mcc_technolist
*pttechnolist
;
264 mcc_modellist
*ptmodel
;
266 if(!(pttechnolist
= mcc_gettechnofile(technoname
)))
267 return(MCC_NOMODEL
) ;
269 ptmodel
= pttechnolist
->MODEL
;
271 modeltype
= MCC_MOS2
;
274 if( ptmodel
->TYPE
!= MCC_UNKNOWN
&&
275 mcc_getparamtype_quick(ptmodel
, __MCC_QUICK_LEVEL
) == MCC_SETVALUE
)
278 ptmodel
= ptmodel
->NEXT
;
281 modeltype
= mcc_get_modeltype( ptmodel
, NULL
);
287 /******************************************************************************/
288 /* initialisation des parametres de tous les modeles d'un technofile */
289 /******************************************************************************/
290 void mcc_initallparam ( char *technoname
)
292 mcc_technolist
*pttechnolist
;
293 mcc_modellist
*ptmodel
;
295 if(!(pttechnolist
= mcc_gettechno(technoname
)))
298 for(ptmodel
= pttechnolist
->MODEL
; ptmodel
; ptmodel
= ptmodel
->NEXT
)
300 if ( ptmodel
->TYPE
== MCC_DIODE
)
301 mcc_initparam_diode(ptmodel
);
303 switch ( ptmodel
->MODELTYPE
) {
304 case MCC_BSIM3V3
: mcc_initparam_bsim3v3(ptmodel
) ;
307 mcc_initparam_bsim4 (ptmodel
) ;
309 case MCC_MM9
: mcc_initparam_mm9 (ptmodel
) ;
311 case MCC_MOS2
: mcc_initparam_mos2 (ptmodel
) ;
314 case MCC_MPSP
: mcc_initparam_psp( ptmodel
);
316 case MCC_EXTMOD
: mcc_initparam_ext(ptmodel
);
322 /******************************************************************************/
323 /* initialisation des parametres d'un modele d'un technofile */
324 /******************************************************************************/
325 void mcc_initmodel ( mcc_modellist
*ptmodel
)
327 if (ptmodel
->TYPE
== MCC_DIODE
)
328 mcc_initparam_diode (ptmodel
);
330 else if (ptmodel
->TYPE
== MCC_MODEL_RESI
)
331 mcc_initparam_resi (ptmodel
);
334 switch ( ptmodel
->MODELTYPE
) {
335 case MCC_BSIM3V3
: mcc_initparam_bsim3v3(ptmodel
) ;
338 mcc_initparam_bsim4 (ptmodel
) ;
340 case MCC_MM9
: mcc_initparam_mm9 (ptmodel
) ;
342 case MCC_MOS2
: mcc_initparam_mos2 (ptmodel
) ;
345 case MCC_MPSP
: mcc_initparam_psp( ptmodel
);
347 case MCC_EXTMOD
: mcc_initparam_ext( ptmodel
);
352 /******************************************************************************/
353 /* Obtention du parametre LMIN d'un modele */
354 /******************************************************************************/
355 double mcc_getLMIN (char *technoname
, char *transname
,
356 int transtype
, int transcase
, double L
, double W
)
358 mcc_modellist
*ptmodel
;
361 if(!(ptmodel
= mcc_getmodel(technoname
, transname
, transtype
, transcase
, L
, W
, 0)))
364 lmin
= mcc_getparam_quick(ptmodel
, __MCC_QUICK_LMIN
) ;
369 /******************************************************************************/
370 /* Obtention du parametre LMAX d'un modele */
371 /******************************************************************************/
372 double mcc_getLMAX (char *technoname
, char *transname
,
373 int transtype
, int transcase
, double L
, double W
)
375 mcc_modellist
*ptmodel
;
376 double lmax
= MCC_D_LWMAX
;
378 if(!(ptmodel
= mcc_getmodel(technoname
, transname
, transtype
, transcase
, L
, W
, 0)))
381 lmax
= mcc_getparam_quick(ptmodel
, __MCC_QUICK_LMAX
) ;
386 /******************************************************************************/
387 /* Obtention du parametre WMIN d'un modele */
388 /******************************************************************************/
389 double mcc_getWMIN (char *technoname
, char *transname
,
390 int transtype
, int transcase
, double L
, double W
)
392 mcc_modellist
*ptmodel
;
395 if(!(ptmodel
= mcc_getmodel(technoname
, transname
, transtype
, transcase
, L
, W
, 0)))
398 wmin
= mcc_getparam_quick(ptmodel
, __MCC_QUICK_WMIN
) ;
403 /******************************************************************************/
404 /* Obtention du parametre WMAX d'un modele */
405 /******************************************************************************/
406 double mcc_getWMAX (char *technoname
, char *transname
,
407 int transtype
, int transcase
, double L
, double W
)
409 mcc_modellist
*ptmodel
;
410 double wmax
= MCC_D_LWMAX
;
412 if(!(ptmodel
= mcc_getmodel(technoname
, transname
, transtype
, transcase
, L
, W
, 0)))
415 wmax
= mcc_getparam_quick(ptmodel
, __MCC_QUICK_WMAX
) ;
420 /******************************************************************************/
421 /* Calcul le parametre de shrink DL d'un modele */
422 /******************************************************************************/
423 double mcc_calcDL (char *technoname
, char *transname
,
424 int transtype
, int transcase
,
425 double L
, double W
, elp_lotrs_param
*lotrsparam
)
427 mcc_modellist
*ptmodel
;
430 if(!(ptmodel
= mcc_getmodel(technoname
, transname
, transtype
, transcase
, L
, W
, 0)))
433 switch(ptmodel
->MODELTYPE
) {
434 case MCC_BSIM4
: dl
= mcc_calcDL_bsim4 (ptmodel
, lotrsparam
, L
, W
) ;
436 case MCC_BSIM3V3
: dl
= mcc_calcDL_bsim3v3(ptmodel
, L
, W
) ;
439 case MCC_MOS2
: dl
= mcc_calcDL_com(ptmodel
) ;
442 case MCC_MPSP
: dl
= 0.0 ;
444 case MCC_EXTMOD
: dl
= 0.0 ;
451 /******************************************************************************/
452 /* Calcul le parametre de shrink DW d'un modele */
453 /******************************************************************************/
454 double mcc_calcDW (char *technoname
, char *transname
,
455 int transtype
, int transcase
,
456 double L
, double W
, elp_lotrs_param
*lotrsparam
)
458 mcc_modellist
*ptmodel
;
461 if(!(ptmodel
= mcc_getmodel(technoname
, transname
, transtype
, transcase
, L
, W
, 0)))
464 switch(ptmodel
->MODELTYPE
) {
465 case MCC_BSIM3V3
: dw
= mcc_calcDW_bsim3v3(ptmodel
, L
, W
) ;
468 dw
= mcc_calcDW_bsim4(ptmodel
, lotrsparam
, L
, W
) ;
471 case MCC_MOS2
: dw
= mcc_calcDW_com(ptmodel
) ;
474 case MCC_MPSP
: dw
= 0.0 ;
476 case MCC_EXTMOD
: dw
= 0.0 ;
483 /******************************************************************************/
484 /* Calcul le parametre de shrink active DLC d'un modele */
485 /******************************************************************************/
486 double mcc_calcDLC (char *technoname
, char *transname
,
487 int transtype
, int transcase
,
488 double L
, double W
, elp_lotrs_param
*lotrsparam
)
490 mcc_modellist
*ptmodel
;
493 if(!(ptmodel
= mcc_getmodel(technoname
, transname
, transtype
, transcase
, L
, W
, 0)))
496 switch(ptmodel
->MODELTYPE
) {
497 case MCC_BSIM4
: dlc
= mcc_calcDLC_bsim4 (ptmodel
, lotrsparam
, L
, W
) ;
499 case MCC_BSIM3V3
: dlc
= mcc_calcDLC_bsim3v3(ptmodel
, L
, W
) ;
502 case MCC_MOS2
: dlc
= mcc_calcDL_com(ptmodel
) ;
505 case MCC_MPSP
: dlc
= 0.0 ;
507 case MCC_EXTMOD
: dlc
= 0.0 ;
514 /******************************************************************************/
515 /* Calcul le parametre de shrink active DWC d'un modele */
516 /******************************************************************************/
517 double mcc_calcDWC (char *technoname
, char *transname
,
518 int transtype
, int transcase
,
519 double L
, double W
, elp_lotrs_param
*lotrsparam
)
521 mcc_modellist
*ptmodel
;
524 if(!(ptmodel
= mcc_getmodel(technoname
, transname
, transtype
, transcase
, L
, W
, 0)))
527 switch(ptmodel
->MODELTYPE
) {
528 case MCC_BSIM3V3
: dwc
= mcc_calcDWC_bsim3v3(ptmodel
, L
, W
) ;
531 dwc
= mcc_calcDWC_bsim4(ptmodel
, lotrsparam
, L
, W
) ;
534 case MCC_MOS2
: dwc
= mcc_calcDW_com(ptmodel
) ;
537 case MCC_MPSP
: dwc
= 0.0 ;
539 case MCC_EXTMOD
: dwc
= 0.0 ;
546 /******************************************************************************/
547 /* Calcul de la tension de seuil VTH d'un modele */
548 /******************************************************************************/
549 double mcc_calcVTH(char *technoname
, char *transname
,
550 int transtype
, int transcase
, double L
, double W
,
551 double temp
, double vbs
, double vds
,
552 elp_lotrs_param
*lotrsparam
, int mcclog
)
554 mcc_modellist
*ptmodel
;
557 if(!(ptmodel
= mcc_getmodel(technoname
, transname
, transtype
, transcase
, L
, W
, 0)))
560 switch(ptmodel
->MODELTYPE
) {
561 case MCC_BSIM3V3
: vth
= mcc_calcVTH_bsim3v3(ptmodel
, L
, W
, temp
,
562 vbs
, vds
,lotrsparam
,mcclog
) ;
565 vth
= mcc_calcVTH_bsim4 (ptmodel
, L
, W
, temp
,
566 vbs
, vds
,0,lotrsparam
,mcclog
) ;
568 case MCC_MM9
: vth
= mcc_calcVTH_mm9(ptmodel
, L
, W
, temp
, vbs
, vds
, 0.0) ;
570 case MCC_MOS2
: vth
= mcc_calcVTH_mos2(ptmodel
) ;
573 case MCC_MPSP
: vth
= mcc_calcVTH_psp(ptmodel
, L
, W
, temp
, vbs
, vds
,lotrsparam
);
575 case MCC_EXTMOD
: vth
= mcc_calcVTH_ext(ptmodel
, L
, W
, temp
, vbs
, vds
,lotrsparam
);
582 /******************************************************************************/
583 /* Calcul du courant IDS d'un modele */
584 /******************************************************************************/
585 double mcc_calcIDS(char *technoname
, char *transname
,
586 int transtype
, int transcase
, double vbs
, double vgs
, double vds
,
588 double temp
,elp_lotrs_param
*lotrsparam
)
590 mcc_modellist
*ptmodel
;
593 if(!(ptmodel
= mcc_getmodel(technoname
, transname
, transtype
, transcase
, L
, W
, 0)))
596 switch(ptmodel
->MODELTYPE
) {
597 case MCC_BSIM3V3
: ids
= mcc_calcIDS_bsim3v3 (ptmodel
, vbs
, vgs
,
602 ids
= mcc_calcIDS_bsim4 (ptmodel
, vbs
, vgs
,
608 ids
= mcc_calcIDS_psp (ptmodel
, vbs
, vgs
,
613 ids
= mcc_calcIDS_ext(ptmodel
, vbs
, vgs
,
622 /******************************************************************************/
623 /* Calcul de la tension degradee VDDDEG d'un modele de transistor */
624 /******************************************************************************/
625 double mcc_calcVDDDEG(char *technoname
, char *transname
,
626 int transtype
, int transcase
, double L
, double W
,
627 double vdd
, double temp
,
628 double step
, elp_lotrs_param
*lotrsparam
)
630 mcc_modellist
*ptmodel
;
633 if (!(ptmodel
= mcc_getmodel(technoname
, transname
, transtype
, transcase
, L
, W
, 0)))
636 vdeg
= mcc_calcVDDDEG_com (ptmodel
, transname
, L
, W
,
643 /******************************************************************************/
644 /* Calcul de la tension degradee VSSDEG d'un modele de transistor */
645 /******************************************************************************/
646 double mcc_calcVSSDEG(char *technoname
, char *transname
,
647 int transtype
, int transcase
, double L
, double W
,
648 double vdd
, double temp
,
649 double step
,elp_lotrs_param
*lotrsparam
)
651 mcc_modellist
*ptmodel
;
654 if(!(ptmodel
= mcc_getmodel(technoname
, transname
, transtype
, transcase
, L
, W
, 0)))
657 vdeg
= mcc_calcVSSDEG_com (ptmodel
, transname
,L
, W
,
664 /*******************************************************************************/
665 /* Calcul de capacite de grille CGD d'un transistor */
666 /* CGD represente la capacite d'oxyde par unite de surface */
668 /*******************************************************************************/
669 double mcc_calcCGD( char *technoname
,
680 elp_lotrs_param
*lotrsparam
683 mcc_modellist
*ptmodel
;
686 if(!(ptmodel
= mcc_getmodel(technoname
, transname
, transtype
, transcase
, L
, W
, 0)))
689 switch(ptmodel
->MODELTYPE
) {
690 case MCC_BSIM3V3
: cgd
= mcc_calcCGD_bsim3v3( ptmodel
, L
, W
, temp
, vgs0
, vgs1
, vbs
, vds
,lotrsparam
) ;
692 case MCC_BSIM4
: cgd
= mcc_calcCGD_bsim4( ptmodel
, L
, W
, temp
, vgs0
, vgs1
, vbs
, vds
,lotrsparam
) ;
695 case MCC_MOS2
: cgd
= 0.0 ;
698 case MCC_MPSP
: cgd
= mcc_calcCGD_psp( ptmodel
, L
, W
, temp
, vgs0
, vgs1
, vbs
, vds
,lotrsparam
) ;
700 case MCC_EXTMOD
: cgd
= mcc_calcCGD_ext( ptmodel
, L
, W
, temp
, vgs0
, vgs1
, vbs
, vds
,lotrsparam
) ;
707 /*******************************************************************************\
708 Calcul de capacite de grille CGSI d'un transistor
709 lie au charges intrinseques de la source
711 \*******************************************************************************/
712 double mcc_calcCGSI(char *technoname
, char *transname
,
713 int transtype
, int transcase
, double L
, double W
, double temp
,
714 double vgs
, double vbs
, double vds
,elp_lotrs_param
*lotrsparam
)
716 mcc_modellist
*ptmodel
;
719 if(!(ptmodel
= mcc_getmodel(technoname
, transname
, transtype
, transcase
, L
, W
, 0)))
722 switch(ptmodel
->MODELTYPE
) {
723 case MCC_BSIM3V3
: cgsi
= mcc_calcCGSI_bsim3v3 (ptmodel
, L
, W
, temp
,
724 vgs
, vbs
, vds
,lotrsparam
) ;
727 cgsi
= mcc_calcCGSI_bsim4 (ptmodel
, L
, W
, temp
,
728 vgs
, vbs
, vds
,lotrsparam
) ;
731 case MCC_MOS2
: cgsi
= 0.0 ;
734 case MCC_MPSP
: cgsi
= mcc_calcCGSI_psp( ptmodel
, L
, W
, temp
,
735 vgs
, vbs
, vds
,lotrsparam
) ;
736 case MCC_EXTMOD
: cgsi
= mcc_calcCGSI_ext( ptmodel
, L
, W
, temp
,
737 vgs
, vbs
, vds
,lotrsparam
) ;
744 /*******************************************************************************\
746 \*******************************************************************************/
747 double mcc_calcCGPU (char *technoname
, char *transname
,
748 int transtype
, int transcase
,
749 double L
, double W
, double vdd
)
751 double vg1
,vg2
,vd1
,vd2
,vs1
,vs2
;
757 if ( transtype
== MCC_NMOS
)
761 mcc_GetInputCapa ( technoname
, transname
,
762 transtype
, transcase
, L
, W
,
770 /*******************************************************************************\
772 \*******************************************************************************/
773 double mcc_calcCGPD (char *technoname
, char *transname
,
774 int transtype
, int transcase
,
775 double L
, double W
, double vdd
)
777 double vg1
,vg2
,vd1
,vd2
,vs1
,vs2
;
783 if ( transtype
== MCC_NMOS
)
787 mcc_GetInputCapa ( technoname
, transname
,
788 transtype
, transcase
, L
, W
,
796 /*******************************************************************************/
797 /* Calcul de capacite de grille CGP d'un transistor */
798 /* CGP represente la capacite de recouvrement (overlap) entre G/D ou G/S */
800 /* Methode de calcul(approximative): CGP = CGDO ou CGP = CGSO */
801 /*******************************************************************************/
802 double mcc_calcCGP(char *technoname
, char *transname
,
803 int transtype
, int transcase
,
804 double L
, double W
, double vgx
, double *ptQov
,
805 elp_lotrs_param
*lotrsparam
, double temp
)
807 mcc_modellist
*ptmodel
;
810 if(!(ptmodel
= mcc_getmodel(technoname
, transname
, transtype
, transcase
, L
, W
, 0)))
813 switch(ptmodel
->MODELTYPE
) {
814 case MCC_BSIM3V3
: cgp
= mcc_calcCGP_bsim3v3(ptmodel
, vgx
, L
, W
, ptQov
) ;
817 cgp
= mcc_calcCGP_bsim4 (ptmodel
, lotrsparam
, vgx
, L
, W
, ptQov
) ;
820 case MCC_MOS2
: cgp
= mcc_calcCGP_com(ptmodel
) ;
824 cgp
= mcc_calcCGP_psp (ptmodel
, lotrsparam
, vgx
, L
, W
, temp
, ptQov
) ;
826 cgp
= mcc_calcCGP_ext(ptmodel
, lotrsparam
, vgx
, L
, W
, temp
, ptQov
);
833 /*******************************************************************************/
834 /* Calcul de capacite de drain CDS d'un transistor */
835 /* CDS represente la capacite de jonction par unite de surface */
837 /* Methode de calcul(approximative): CDS = CJ */
838 /*******************************************************************************/
839 double mcc_calcCDS(char *technoname
, char *transname
,
840 int transtype
, int transcase
, double L
, double W
, double temp
,
841 double vbx1
, double vbx2
, elp_lotrs_param
*lotrsparam
)
843 mcc_modellist
*ptmodel
;
846 if(!(ptmodel
= mcc_getmodel(technoname
, transname
, transtype
, transcase
, L
, W
, 0)))
849 switch(ptmodel
->MODELTYPE
) {
852 case MCC_MOS2
: cds
= mcc_calcCDS_com(ptmodel
, temp
, vbx1
, vbx2
) ;
854 case MCC_BSIM4
: cds
= mcc_calcCDS_bsim4 (ptmodel
, temp
, vbx1
, vbx2
) ;
857 case MCC_MPSP
: cds
= mcc_calcCDS_psp( ptmodel
, lotrsparam
, temp
, vbx1
, vbx2
, L
, W
);
859 case MCC_EXTMOD
: cds
= mcc_calcCDS_ext( ptmodel
, lotrsparam
, temp
, vbx1
, vbx2
, L
, W
);
866 /*******************************************************************************/
867 /* Calcul de capacite de drain CDP d'un transistor */
868 /* CDP represente la capacite de jonction (sidewall junction) */
870 /* Methode de calcul(approximative): CDP = CJSW */
871 /*******************************************************************************/
872 double mcc_calcCDP(char *technoname
, char *transname
,
873 int transtype
, int transcase
, double L
, double W
,
874 double temp
, double vbx1
, double vbx2
, elp_lotrs_param
*lotrsparam
)
876 mcc_modellist
*ptmodel
;
879 if(!(ptmodel
= mcc_getmodel(technoname
, transname
, transtype
, transcase
, L
, W
, 0)))
882 switch(ptmodel
->MODELTYPE
) {
885 case MCC_MOS2
: cdp
= mcc_calcCDP_com(ptmodel
, temp
, vbx1
, vbx2
) ;
887 case MCC_BSIM4
: cdp
= mcc_calcCDP_bsim4( ptmodel
, lotrsparam
,temp
, vbx1
, vbx2
);
890 case MCC_MPSP
: cdp
= mcc_calcCDP_psp( ptmodel
, lotrsparam
,temp
, vbx1
, vbx2
, L
, W
);
892 case MCC_EXTMOD
: cdp
= mcc_calcCDP_ext( ptmodel
, lotrsparam
,temp
, vbx1
, vbx2
, L
, W
);
899 /*******************************************************************************/
900 /* Calcul de capacite de drain CDW d'un transistor */
901 /* CDW represente la capacite de jonction (sidewall junction facing gate) */
903 /* Methode de calcul(approximative): CDW = CJSWG (bsim3v3) */
904 /* Methode de calcul(approximative): CDW = CGP (mos level 2) */
905 /*******************************************************************************/
906 double mcc_calcCDW(char *technoname
, char *transname
,
907 int transtype
, int transcase
, double L
, double W
, double temp
,
908 double vbx1
, double vbx2
, double vgx
, elp_lotrs_param
*lotrsparam
)
910 mcc_modellist
*ptmodel
;
913 if(!(ptmodel
= mcc_getmodel(technoname
, transname
, transtype
, transcase
, L
, W
, 0)))
916 switch(ptmodel
->MODELTYPE
) {
919 case MCC_MOS2
: cdw
= mcc_calcCDW_com(ptmodel
, temp
, vbx1
, vbx2
, vgx
, L
, W
) ;
921 case MCC_BSIM4
: cdw
= mcc_calcCDW_bsim4 (ptmodel
, lotrsparam
,temp
, vbx1
, vbx2
, vgx
, L
, W
) ;
924 case MCC_MPSP
: cdw
= mcc_calcCDW_psp (ptmodel
, lotrsparam
,temp
, vbx1
, vbx2
, L
, W
) ;
926 case MCC_EXTMOD
: cdw
= mcc_calcCDW_ext(ptmodel
, lotrsparam
,temp
, vbx1
, vbx2
, L
, W
) ;
933 /******************************************************************************\
934 Function : mcc_calcDWCJ
935 \******************************************************************************/
936 double mcc_calcDWCJ (char *technoname
, char *transname
,
937 int transtype
, int transcase
,
939 elp_lotrs_param
*lotrsparam
, double temp
)
941 mcc_modellist
*ptmodel
;
944 if(!(ptmodel
= mcc_getmodel(technoname
, transname
, transtype
, transcase
, L
, W
, 0)))
947 switch(ptmodel
->MODELTYPE
) {
948 case MCC_BSIM3V3
: dwcj
= mcc_calcDW_bsim3v3(ptmodel
, L
, W
) ;
950 case MCC_BSIM4
: dwcj
= mcc_calcDWCJ_bsim4(ptmodel
, lotrsparam
,L
, W
) ;
953 case MCC_MOS2
: dwcj
= mcc_calcDW_com(ptmodel
) ;
956 case MCC_MPSP
: dwcj
= mcc_calcDWCJ_psp(ptmodel
, lotrsparam
, temp
, L
, W
) ;
958 case MCC_EXTMOD
: dwcj
= mcc_calcDWCJ_ext(ptmodel
, lotrsparam
, temp
, L
, W
) ;
966 /*******************************************************************************/
967 /* Les valeurs des capacites de source sont egales aux capacites de drain */
968 /*******************************************************************************/
969 /* Calcul de capacite de source CSS d'un transistor */
970 /* CSS represente la capacite de jonction par unite de surface */
972 /* Methode de calcul(approximative): CSS = CJ = CDS */
973 /*******************************************************************************/
974 double mcc_calcCSS(char *technoname
, char *transname
,
975 int transtype
, int transcase
, double L
, double W
,
976 double temp
, double vbx1
, double vbx2
, elp_lotrs_param
*lotrsparam
)
978 mcc_modellist
*ptmodel
;
981 if(!(ptmodel
= mcc_getmodel(technoname
, transname
, transtype
, transcase
, L
, W
, 0)))
984 switch(ptmodel
->MODELTYPE
) {
987 case MCC_MOS2
: css
= mcc_calcCDS_com(ptmodel
, temp
, vbx1
, vbx2
) ;
989 case MCC_BSIM4
: css
= mcc_calcCDS_bsim4 (ptmodel
, temp
, vbx1
, vbx2
) ;
992 case MCC_MPSP
: css
= mcc_calcCDS_psp( ptmodel
, lotrsparam
, temp
, vbx1
, vbx2
, L
, W
);
994 case MCC_EXTMOD
: css
= mcc_calcCDS_ext( ptmodel
, lotrsparam
, temp
, vbx1
, vbx2
, L
, W
);
1001 /*******************************************************************************/
1002 /* Calcul de capacite de source CSP d'un transistor */
1003 /* CSP represente la capacite de jonction (sidewall junction) */
1005 /* Methode de calcul(approximative): CSP = CJSW = CDP */
1006 /*******************************************************************************/
1007 double mcc_calcCSP(char *technoname
, char *transname
,
1008 int transtype
, int transcase
, double L
, double W
,
1009 double temp
, double vbx1
, double vbx2
, elp_lotrs_param
*lotrsparam
)
1011 mcc_modellist
*ptmodel
;
1014 if(!(ptmodel
= mcc_getmodel(technoname
, transname
, transtype
, transcase
, L
, W
, 0)))
1017 switch(ptmodel
->MODELTYPE
) {
1020 case MCC_MOS2
: csp
= mcc_calcCDP_com(ptmodel
, temp
, vbx1
,vbx2
) ;
1022 case MCC_BSIM4
: csp
= mcc_calcCDP_bsim4 (ptmodel
, lotrsparam
,temp
, vbx1
,vbx2
) ;
1025 case MCC_MPSP
: csp
= mcc_calcCDP_psp( ptmodel
, lotrsparam
,temp
, vbx1
, vbx2
, L
, W
) ;
1027 case MCC_EXTMOD
: csp
= mcc_calcCDP_ext( ptmodel
, lotrsparam
,temp
, vbx1
, vbx2
, L
, W
) ;
1034 /*******************************************************************************/
1035 /* Calcul de capacite de drain CSW d'un transistor */
1036 /* CSW represente la capacite de jonction (sidewall junction facing gate) */
1038 /* Methode de calcul(approximative): CSW = CJSWG (bsim3v3) = CDW */
1039 /* Methode de calcul(approximative): CSW = CGP = CDW (mos2) */
1040 /*******************************************************************************/
1041 double mcc_calcCSW(char *technoname
, char *transname
,
1042 int transtype
, int transcase
, double L
, double W
, double temp
,
1043 double vbx1
, double vbx2
, double vgx
, elp_lotrs_param
*lotrsparam
)
1045 mcc_modellist
*ptmodel
;
1048 if(!(ptmodel
= mcc_getmodel(technoname
, transname
, transtype
, transcase
, L
, W
, 0)))
1051 switch(ptmodel
->MODELTYPE
) {
1054 case MCC_MOS2
: csw
= mcc_calcCDW_com(ptmodel
, temp
, vbx1
, vbx2
, vgx
, L
, W
) ;
1056 case MCC_BSIM4
: csw
= mcc_calcCDW_bsim4 (ptmodel
, lotrsparam
, temp
, vbx1
, vbx2
, vgx
, L
, W
) ;
1059 case MCC_MPSP
: csw
= mcc_calcCDW_psp (ptmodel
, lotrsparam
, temp
, vbx1
, vbx2
, L
, W
) ;
1061 case MCC_EXTMOD
: csw
= mcc_calcCDW_ext(ptmodel
, lotrsparam
, temp
, vbx1
, vbx2
, L
, W
);
1068 /******************************************************************************/
1069 /* Obtention du level du modele */
1070 /******************************************************************************/
1071 double mcc_gettechnolevel(char *technoname
)
1073 double level
= 0.0 ;
1074 mcc_technolist
*pttechnofile
;
1075 mcc_modellist
*ptmodel
;
1078 if(!(pttechnofile
= mcc_gettechnofile(technoname
)))
1081 ptmodel
= pttechnofile
->MODEL
;
1083 if (ptmodel
->TYPE
!= MCC_UNKNOWN
)
1085 if ((mcc_getparamtype_quick(ptmodel
, __MCC_QUICK_LEVEL
) == MCC_SETVALUE
) &&
1089 ptmodel
= ptmodel
->NEXT
;
1092 level
= mcc_getparam_quick(ptmodel
, __MCC_QUICK_LEVEL
) ;
1097 /******************************************************************************/
1098 /* Obtention de l'index d'un modele */
1099 /******************************************************************************/
1100 int mcc_gettransindex(char *technoname
, char *transname
, int transtype
,
1101 int transcase
, double L
, double W
)
1103 mcc_modellist
*ptmodel
;
1106 if (( ptmodel
= mcc_getmodel(technoname
, transname
, transtype
,
1107 transcase
, L
, W
, 0) )) {
1108 name
= strchr(ptmodel
->NAME
, MCC_MOD_SEPAR
) ;
1112 return(atoi(name
+1)) ;
1114 avt_errmsg(MCC_ERRMSG
, "014", AVT_ERROR
,transname
, technoname
) ;
1118 /******************************************************************************/
1119 /* Obtention du nom complet (avec ou sans extension) d'un modele */
1120 /******************************************************************************/
1121 char *mcc_getmodelname(char *technoname
, char *transname
,
1122 int transtype
, int transcase
, double L
, double W
)
1124 mcc_modellist
*ptmodel
;
1126 if((ptmodel
= mcc_getmodel(technoname
, transname
, transtype
, transcase
, L
, W
, 0)) != NULL
)
1127 return(mbkstrdup(ptmodel
->NAME
)) ;
1129 avt_errmsg(MCC_ERRMSG
, "015", AVT_ERROR
, transname
, technoname
) ;
1133 /******************************************************************************/
1134 /* Calcul du parametre de XL <=> LMLT d'un modele */
1135 /******************************************************************************/
1136 double mcc_getXL (char *technoname
, char *transname
,
1137 int transtype
, int transcase
, double L
, double W
)
1139 mcc_modellist
*ptmodel
;
1142 if(!(ptmodel
= mcc_getmodel(technoname
, transname
, transtype
, transcase
, L
, W
, 0))) {
1143 avt_errmsg(MCC_ERRMSG
, "016", AVT_ERROR
, transname
, technoname
) ;
1147 switch(ptmodel
->MODELTYPE
) {
1152 lmlt
= mcc_getparam_quick(ptmodel
, __MCC_QUICK_LMLT
) ;
1165 /******************************************************************************/
1166 /* Calcul du parametre de XW <=> WMLT d'un modele */
1167 /******************************************************************************/
1168 double mcc_getXW (char *technoname
, char *transname
,
1169 int transtype
, int transcase
, double L
, double W
)
1171 mcc_modellist
*ptmodel
;
1174 if(!(ptmodel
= mcc_getmodel(technoname
, transname
, transtype
, transcase
, L
, W
, 0))) {
1175 avt_errmsg(MCC_ERRMSG
, "017", AVT_ERROR
, transname
, technoname
) ;
1179 switch(ptmodel
->MODELTYPE
) {
1184 wmlt
= mcc_getparam_quick(ptmodel
, __MCC_QUICK_WMLT
) ;
1197 /********************************************************************************************/
1198 /* Fonction qui calcule la capacite de grille CGS d'un transistor */
1199 /* CGS = Cox = epsox / TOX */
1200 /********************************************************************************************/
1201 double mcc_calcCGS_com(mcc_modellist
*ptmodel
)
1206 TOX
= mcc_getparam_quick(ptmodel
, __MCC_QUICK_TOX
) ;
1207 Cox
= MCC_EPSOX
/ TOX
;
1213 /********************************************************************************************/
1214 /* Fonction qui calcule la capacite de grille CGP d'un transistor */
1215 /* CGP = CGSO = CGDO */
1216 /********************************************************************************************/
1217 double mcc_calcCGP_com(mcc_modellist
*ptmodel
)
1222 //CGDO = mcc_getprm(ptmodel, "CGDO") ;
1223 CGDO
= mcc_getprm_quick(ptmodel
, __MCC_GETPRM_CGDO
) ;
1229 /******************************************************************************\
1230 Fonction qui calcule la capacite de drain CDS d'un transistor
1231 Contribution surfacique.
1234 \******************************************************************************/
1235 double mcc_calcCDS_com(mcc_modellist
*ptmodel
, double temp
, double vbx1
, double vbx2
)
1238 double T
, Tnom
, dT
, VtT
, VtTnom
;
1239 double Egeff_T
, Egeff_Tnom
;
1243 double EG
, GAP1
, GAP2
;
1245 /* param pour diolev = 9 */
1246 double VR
, VDBR
, CJBR
, TRDIO9
;
1248 double Egeff_TR
= 0.0 ;
1256 if( ptmodel
->TYPE
== MCC_TRANS_P
) {
1261 T
= temp
+ MCC_KELVIN
;
1262 Tnom
= mcc_getparam_quick(ptmodel
, __MCC_QUICK_TNOM
)+MCC_KELVIN
;
1264 VtT
= MCC_KB
*T
/MCC_Q
;
1265 VtTnom
= MCC_KB
*Tnom
/MCC_Q
;
1267 GAP1
= mcc_getparam_quick(ptmodel
, __MCC_QUICK_GAP1
) ;
1268 GAP2
= mcc_getparam_quick(ptmodel
, __MCC_QUICK_GAP2
) ;
1269 EG
= mcc_getparam_quick(ptmodel
, __MCC_QUICK_EG
) ;
1271 if((mcc_getparam_quick(ptmodel
, __MCC_QUICK_TLEV
) == 0.0) ||
1272 (mcc_getparam_quick(ptmodel
, __MCC_QUICK_TLEV
) == 1.0)) {
1273 Egeff_T
= 1.16-7.02e-4*pow(T
, 2.0)/(T
+1108.0) ;
1274 Egeff_Tnom
= 1.16-7.02e-4*pow(Tnom
, 2.0)/(Tnom
+1108.0) ;
1277 Egeff_T
= EG
- GAP1
*pow(T
, 2.0)/(T
+GAP2
) ;
1278 Egeff_Tnom
= EG
- GAP1
*pow(Tnom
, 2.0)/(Tnom
+GAP2
) ;
1282 if(mcc_getparam_quick(ptmodel
, __MCC_QUICK_DIOLEV
) != 9.0) {
1283 CJ
= mcc_getparam_quick(ptmodel
, __MCC_QUICK_CJ
) ;
1284 MJ
= mcc_getparam_quick(ptmodel
, __MCC_QUICK_MJ
) ;
1285 PB
= mcc_getparam_quick(ptmodel
, __MCC_QUICK_PB
) ;
1286 if((mcc_getparamtype_quick(ptmodel
, __MCC_QUICK_OPTACM
) == MCC_SETVALUE
) &&
1287 (mcc_getparam_quick(ptmodel
, __MCC_QUICK_ACM
) >= 10.0)){
1292 if(mcc_getparam_quick(ptmodel
, __MCC_QUICK_TLEVC
) == 0.0) {
1293 PB_T
= PB
*T
/Tnom
-VtT
*(Egeff_Tnom
/VtTnom
-Egeff_T
/VtT
+3.0*log(T
/Tnom
)) ;
1294 CJ_T
= CJ
*(1.0+MJ
*(1.0+4.0e-4*dT
-PB_T
/PB
)) ;
1296 else if(mcc_getparam_quick(ptmodel
, __MCC_QUICK_TLEVC
) == 1.0) {
1297 //PB_T = PB - mcc_getprm(ptmodel, "PTA")*dT ;
1298 //CJ_T = CJ*(1.0+mcc_getprm(ptmodel, "CTA")*dT) ;
1299 PB_T
= PB
- mcc_getprm_quick(ptmodel
, __MCC_GETPRM_PTA
)*dT
;
1300 CJ_T
= CJ
*(1.0+mcc_getprm_quick(ptmodel
, __MCC_GETPRM_CTA
)*dT
) ;
1302 else if(mcc_getparam_quick(ptmodel
, __MCC_QUICK_TLEVC
) == 2.0) {
1303 //PB_T = PB - mcc_getprm(ptmodel, "PTA")*dT ;
1304 PB_T
= PB
- mcc_getprm_quick(ptmodel
, __MCC_GETPRM_PTA
)*dT
;
1305 CJ_T
= CJ
*pow((PB
/PB_T
), MJ
) ;
1307 else if(mcc_getparam_quick(ptmodel
, __MCC_QUICK_TLEVC
) == 3.0) {
1308 Dpb
= PB
- Egeff_Tnom
-3.0*VtTnom
+(Egeff_Tnom
-EG
)*(2.0-Tnom
/(Tnom
+GAP2
)) ;
1309 PB_T
= PB
+ Dpb
* (dT
/Tnom
) ;
1310 CJ_T
= CJ
*(1.0-0.5*(Dpb
/PB
)*(dT
/Tnom
)) ;
1317 /* influence de vbx */
1318 // seulement valable pour les vbx < 0
1319 cds
= mcc_integfordw ( CJ_T
, vbx1
, vbx2
, PB_T
, MJ
);
1323 VR
= mcc_getparam_quick(ptmodel
, __MCC_QUICK_VR
) ;
1324 PB
= mcc_getparam_quick(ptmodel
, __MCC_QUICK_PB
) ;
1325 VDBR
= mcc_getparam_quick(ptmodel
, __MCC_QUICK_VDBR
) ;
1326 CJBR
= mcc_getparam_quick(ptmodel
, __MCC_QUICK_CJBR
) ;
1327 TRDIO9
= mcc_getparam_quick(ptmodel
, __MCC_QUICK_TRDIO9
)+MCC_KELVIN
;
1328 /* Temperature update */
1329 VtTR
= MCC_KB
*TRDIO9
/MCC_Q
;
1330 Egeff_T
= 1.16-7.02e-4*pow(T
, 2.0)/(T
+1108.0) ;
1331 Egeff_TR
= 1.16-7.02e-4*pow(TRDIO9
, 2.0)/(TRDIO9
+1108.0) ;
1332 Ftd
= pow((T
/TRDIO9
), 1.5)*exp((Egeff_TR
/(2.0*VtTR
))-Egeff_T
/(2.0*VtT
)) ;
1334 VdbT
= VDBR
*T
/TRDIO9
-2.0*VtT
*log(Ftd
) ;
1335 CjbT
= CJBR
*pow(((VDBR
-VR
)/VdbT
), PB
) ;
1337 Fcb
= 1.0-pow(((1.0+PB
)/3.0), (1.0/PB
)) ;
1339 Clb
= CjbT
*pow((1.0-Fcb
), -PB
) ;
1341 cds
= mcc_integfordw ( CjbT
, vbx1
, vbx2
, VdbT
, PB
);
1347 /******************************************************************************\
1348 Fonction qui calcule la capacite de drain CDP d'un transistor
1349 Contribution perimetrique.
1352 \******************************************************************************/
1353 double mcc_calcCDP_com(mcc_modellist
*ptmodel
, double temp
, double vbx1
, double vbx2
)
1360 double VtTnom
= 0.0 ;
1361 double Egeff_T
= 0.0 ;
1362 double Egeff_Tnom
= 0.0 ;
1366 double CJSW_T
= 0.0 ;
1367 double PBSW_T
= 0.0 ;
1371 double Dpbsw
= 0.0 ;
1372 /* param pour diolev = 9 */
1373 double VR
, PS
, VDSR
, CJSR
, TRDIO9
;
1375 double Egeff_TR
= 0.0 ;
1384 if( ptmodel
->TYPE
== MCC_TRANS_P
) {
1389 T
= temp
+ MCC_KELVIN
;
1390 Tnom
= mcc_getparam_quick(ptmodel
, __MCC_QUICK_TNOM
)+MCC_KELVIN
;
1392 VtT
= MCC_KB
*T
/MCC_Q
;
1393 VtTnom
= MCC_KB
*Tnom
/MCC_Q
;
1395 GAP1
= mcc_getparam_quick(ptmodel
, __MCC_QUICK_GAP1
) ;
1396 GAP2
= mcc_getparam_quick(ptmodel
, __MCC_QUICK_GAP2
) ;
1397 EG
= mcc_getparam_quick(ptmodel
, __MCC_QUICK_EG
) ;
1399 if((mcc_getparam_quick(ptmodel
, __MCC_QUICK_TLEV
) == 0.0) ||
1400 (mcc_getparam_quick(ptmodel
, __MCC_QUICK_TLEV
) == 1.0)) {
1401 Egeff_T
= 1.16-7.02e-4*pow(T
, 2.0)/(T
+1108.0) ;
1402 Egeff_Tnom
= 1.16-7.02e-4*pow(Tnom
, 2.0)/(Tnom
+1108.0) ;
1405 Egeff_T
= EG
- GAP1
*pow(T
, 2.0)/(T
+GAP2
) ;
1406 Egeff_Tnom
= EG
- GAP1
*pow(Tnom
, 2.0)/(Tnom
+GAP2
) ;
1409 if(mcc_getparam_quick(ptmodel
, __MCC_QUICK_DIOLEV
) != 9.0) {
1410 CJSW
= mcc_getparam_quick(ptmodel
, __MCC_QUICK_CJSW
) ;
1411 MJSW
= mcc_getparam_quick(ptmodel
, __MCC_QUICK_MJSW
) ;
1412 PBSW
= mcc_getparam_quick(ptmodel
, __MCC_QUICK_PBSW
) ;
1413 if(ptmodel
->MODELTYPE
== MCC_BSIM3V3
) {
1414 if ( V_INT_TAB
[__SIM_TOOLMODEL
].VALUE
== SIM_TOOLMODEL_HSPICE
) {
1415 //ACM = mcc_check_hsp_acm_bsim3v3 (ptmodel);
1416 ACM
= MCC_ROUND (mcc_getparam_quick(ptmodel
,__MCC_QUICK_ACM
));
1417 if ( ACM
>= 0 && ACM
<= 3 )
1418 PBSW
= mcc_getparam_quick(ptmodel
, __MCC_QUICK_PHP
) ;
1422 if((mcc_getparamtype_quick(ptmodel
, __MCC_QUICK_OPTACM
) == MCC_SETVALUE
) &&
1423 (mcc_getparam_quick(ptmodel
, __MCC_QUICK_ACM
) >= 10.0)){
1428 if(mcc_getparam_quick(ptmodel
, __MCC_QUICK_TLEVC
) == 0.0) {
1429 PBSW_T
= PBSW
*T
/Tnom
-VtT
*(Egeff_Tnom
/VtTnom
-Egeff_T
/VtT
+3.0*log(T
/Tnom
)) ;
1430 CJSW_T
= CJSW
*(1.0+MJSW
*(1.0+4.0e-4*dT
-PBSW_T
/PBSW
)) ;
1432 else if(mcc_getparam_quick(ptmodel
, __MCC_QUICK_TLEVC
) == 1.0) {
1433 //PBSW_T = PBSW - mcc_getprm(ptmodel, "PTP")*dT ;
1434 //CJSW_T = CJSW*(1.0+mcc_getprm(ptmodel, "CTP")*dT) ;
1435 PBSW_T
= PBSW
- mcc_getprm_quick(ptmodel
, __MCC_GETPRM_PTP
)*dT
;
1436 CJSW_T
= CJSW
*(1.0+mcc_getprm_quick(ptmodel
, __MCC_GETPRM_CTP
)*dT
) ;
1438 else if(mcc_getparam_quick(ptmodel
, __MCC_QUICK_TLEVC
) == 2.0) {
1439 //PBSW_T = PBSW-mcc_getprm(ptmodel, "PTP")*dT ;
1440 PBSW_T
= PBSW
-mcc_getprm_quick(ptmodel
, __MCC_GETPRM_PTP
)*dT
;
1441 CJSW_T
= CJSW
*pow((PBSW
/PBSW_T
), MJSW
) ;
1443 else if(mcc_getparam_quick(ptmodel
, __MCC_QUICK_TLEVC
) == 3.0) {
1444 Dpbsw
= PBSW
- Egeff_Tnom
-3.0*VtTnom
+(Egeff_Tnom
-EG
)*(2.0-Tnom
/(Tnom
+GAP2
)) ;
1445 PBSW_T
= PBSW
+ Dpbsw
*(dT
/Tnom
) ;
1446 CJSW_T
= CJSW
*(1.0-0.5*(Dpbsw
/PBSW
)*(dT
/Tnom
)) ;
1453 cdp
= mcc_integfordw ( CJSW_T
, vbx1
, vbx2
, PBSW_T
, MJSW
);
1456 VR
= mcc_getparam_quick(ptmodel
, __MCC_QUICK_VR
) ;
1457 PS
= mcc_getparam_quick(ptmodel
, __MCC_QUICK_PS
) ;
1458 VDSR
= mcc_getparam_quick(ptmodel
, __MCC_QUICK_VDSR
) ;
1459 CJSR
= mcc_getparam_quick(ptmodel
, __MCC_QUICK_CJSR
) ;
1460 TRDIO9
= mcc_getparam_quick(ptmodel
, __MCC_QUICK_TRDIO9
)+MCC_KELVIN
;
1461 /* Temperature update */
1462 VtTR
= MCC_KB
*TRDIO9
/MCC_Q
;
1463 Egeff_T
= 1.16-7.02e-4*pow(T
, 2.0)/(T
+1108.0) ;
1464 Egeff_TR
= 1.16-7.02e-4*pow(TRDIO9
, 2.0)/(TRDIO9
+1108.0) ;
1465 Ftd
= pow((T
/TRDIO9
), 1.5)*exp((Egeff_TR
/(2.0*VtTR
))-Egeff_T
/(2.0*VtT
)) ;
1467 VdsT
= VDSR
*T
/TRDIO9
-2.0*VtT
*log(Ftd
) ;
1468 CjsT
= CJSR
*pow(((VDSR
-VR
)/VdsT
), PS
) ;
1470 Fcs
= 1.0-pow(((1.0+PS
)/3.0), (1.0/PS
)) ;
1472 Cls
= CjsT
*pow((1.0-Fcs
), -PS
) ;
1474 cdp
= mcc_integfordw ( CjsT
, vbx1
, vbx2
, VdsT
, PS
);
1480 /********************************************************************************************\
1481 Fonction qui calcule la capacite de grille CDW d'un transistor
1482 CDW = CSW = CGP + Capa (contribion en largeur face a la grille)
1484 \********************************************************************************************/
1485 double mcc_calcCDW_com(mcc_modellist
*ptmodel
, double temp
, double vbx1
, double vbx2
, double vgx
, double L
, double W
)
1488 double CJSWG
, CJGR
, CJGATE
;
1490 /* param pour CJGR */
1491 double VtT
, VtTnom
, VtTR
, Egeff_T
, Egeff_TR
, Ftd
;
1495 double VR
, VDGR
, PG
;
1497 /* param pour CJSWG */
1498 double MJSWG
, PBSWG
;
1500 /* param pour CJGATE */
1501 double TLEVC
, MJSW
, dT
;
1502 double PbswT
= 0.0 ;
1504 double CjgateT
= 0.0 ;
1505 double CTP
, GAP2
, EG
, PTP
, Dpbsw
, Egeff_Tnom
;
1506 /* contribution de CGP */
1511 T
= temp
+ MCC_KELVIN
;
1512 Tnom
= mcc_getparam_quick(ptmodel
, __MCC_QUICK_TNOM
) + MCC_KELVIN
;
1514 VtT
= MCC_KB
*T
/MCC_Q
;
1515 VtTnom
= MCC_KB
*Tnom
/MCC_Q
;
1517 CJSWG
= mcc_getparam_quick(ptmodel
, __MCC_QUICK_CJSWG
) ;
1518 CJGR
= mcc_getparam_quick(ptmodel
, __MCC_QUICK_CJGR
) ;
1519 CJGATE
= mcc_getparam_quick(ptmodel
, __MCC_QUICK_CJGATE
) ;
1520 if(ptmodel
->MODELTYPE
== MCC_BSIM3V3
) {
1521 if ( V_INT_TAB
[__SIM_TOOLMODEL
].VALUE
== SIM_TOOLMODEL_HSPICE
)
1522 //ACM = mcc_check_hsp_acm_bsim3v3 (ptmodel);
1523 ACM
= MCC_ROUND (mcc_getparam_quick(ptmodel
,__MCC_QUICK_ACM
));
1526 /* Contribution de la capacite Cgp (overlap capacitance) */
1527 if( ptmodel
->MODELTYPE
== MCC_BSIM3V3
) {
1528 // Before taking CJSWG, test if it is HSPICE models and take CJGATE instead
1529 if ( V_INT_TAB
[__SIM_TOOLMODEL
].VALUE
== SIM_TOOLMODEL_HSPICE
) {
1530 if ( ACM
>= 0 && ACM
<= 3 )
1531 CJSWG
= mcc_getparam_quick(ptmodel
, __MCC_QUICK_CJGATE
) ;
1533 Cgp
= mcc_calcCGP_bsim3v3(ptmodel
, vgx
, L
, W
, NULL
) ;
1534 Cdp
= mcc_calcCDP_com(ptmodel
, temp
, vbx1
, vbx2
);
1537 Cgp
= mcc_calcCGP_com(ptmodel
) ;
1539 if( ptmodel
->TYPE
== MCC_TRANS_P
) {
1544 /* Debut du calcul de la capacite cdw en fonction de diolev */
1545 if(mcc_getparam_quick(ptmodel
, __MCC_QUICK_DIOLEV
) == 9.0) {
1547 TRDIO9
= mcc_getparam_quick(ptmodel
, __MCC_QUICK_TRDIO9
)+MCC_KELVIN
;
1548 VDGR
= mcc_getparam_quick(ptmodel
, __MCC_QUICK_VDGR
) ;
1549 PG
= mcc_getparam_quick(ptmodel
, __MCC_QUICK_PG
) ;
1550 VR
= mcc_getparam_quick(ptmodel
, __MCC_QUICK_VR
) ;
1552 VtTR
= MCC_KB
*TRDIO9
/MCC_Q
;
1553 Egeff_T
= 1.16-7.02e-4*pow(T
, 2.0)/(T
+1108.0) ;
1554 Egeff_TR
= 1.16-7.02e-4*pow(TRDIO9
, 2.0)/(TRDIO9
+1108.0) ;
1555 Ftd
= pow((T
/TRDIO9
), 1.5)*exp((Egeff_TR
/(2.0*VtTR
))-Egeff_T
/(2.0*VtT
)) ;
1557 VdgT
= VDGR
*T
/TRDIO9
-2.0*VtT
*log(Ftd
) ;
1558 CjgT
= CJGR
*pow(((VDGR
-VR
)/VdgT
), PG
) ;
1560 Cjgv
= mcc_integfordw ( CjgT
, vbx1
, vbx2
, VdgT
, PG
);
1564 else if(ptmodel
->MODELTYPE
== MCC_BSIM3V3
) {
1565 MJSWG
= mcc_getparam_quick(ptmodel
, __MCC_QUICK_MJSWG
);
1566 PBSWG
= mcc_getparam_quick(ptmodel
, __MCC_QUICK_PBSWG
);
1567 if ( V_INT_TAB
[__SIM_TOOLMODEL
].VALUE
== SIM_TOOLMODEL_HSPICE
) {
1568 if ( ACM
>= 0 && ACM
<= 3 ) {
1569 MJSWG
= mcc_getparam_quick(ptmodel
, __MCC_QUICK_MJSW
);
1570 PBSWG
= mcc_getparam_quick(ptmodel
, __MCC_QUICK_PHP
);
1573 /* no temp effect */
1576 Cbxg
= mcc_integfordw ( CJSWG
, vbx1
, vbx2
, PBSWG
, MJSWG
);
1582 TLEVC
= mcc_getparam_quick(ptmodel
, __MCC_QUICK_TLEVC
) ;
1583 PBSW
= mcc_getparam_quick(ptmodel
, __MCC_QUICK_PBSW
) ;
1584 if ( V_INT_TAB
[__SIM_TOOLMODEL
].VALUE
== SIM_TOOLMODEL_HSPICE
)
1585 if ( ACM
>= 0 && ACM
<= 3 )
1586 PBSW
= mcc_getparam_quick(ptmodel
, __MCC_QUICK_PHP
) ;
1588 MJSW
= mcc_getparam_quick(ptmodel
, __MCC_QUICK_MJSW
) ;
1591 Egeff_T
= 1.16-7.02e-4*pow(T
, 2.0)/(T
+1108.0) ;
1592 Egeff_Tnom
= 1.16-7.02e-4*pow(Tnom
, 2.0)/(Tnom
+1108.0) ;
1593 PbswT
= PBSW
*T
/Tnom
-VtT
*(Egeff_Tnom
/VtTnom
-Egeff_T
/VtT
+3.0*log(T
/Tnom
)) ;
1594 CjgateT
= CJGATE
*(1.0+MJSW
*(1.0+4.0e-4*dT
-PbswT
/PBSW
)) ;
1596 else if(TLEVC
== 1.0) {
1597 //CTP = mcc_getprm(ptmodel, "CTP") ;
1598 //PTP = mcc_getprm(ptmodel, "PTP") ;
1599 CTP
= mcc_getprm_quick(ptmodel
, __MCC_GETPRM_CTP
) ;
1600 PTP
= mcc_getprm_quick(ptmodel
, __MCC_GETPRM_PTP
) ;
1601 PbswT
= PBSW
- PTP
*dT
;
1602 CjgateT
= CJGATE
*(1.0+CTP
*dT
) ;
1604 else if(TLEVC
== 2.0) {
1605 //PTP = mcc_getprm(ptmodel, "PTP") ;
1606 PTP
= mcc_getprm_quick(ptmodel
, __MCC_GETPRM_PTP
) ;
1607 PbswT
= PBSW
- PTP
*dT
;
1608 CjgateT
= CJGATE
*pow((PBSW
/PbswT
), MJSW
) ;
1610 else if(TLEVC
== 3.0) {
1611 GAP2
= mcc_getparam_quick(ptmodel
, __MCC_QUICK_GAP2
) ;
1612 EG
= mcc_getparam_quick(ptmodel
, __MCC_QUICK_EG
) ;
1613 Egeff_Tnom
= 1.16-7.02e-4*pow(Tnom
, 2.0)/(Tnom
+1108.0) ;
1614 Dpbsw
= PBSW
- Egeff_Tnom
-3.0*VtTnom
+(Egeff_Tnom
-EG
)
1615 *(2.0-Tnom
/(Tnom
+GAP2
)) ;
1616 PbswT
= PBSW
+ Dpbsw
*(dT
/Tnom
) ;
1617 CjgateT
= CJGATE
*(1.0-0.5*(Dpbsw
/PBSW
)*(dT
/Tnom
)) ;
1621 if ( CjgateT
< 0.0 )
1624 Cbxg
= mcc_integfordw ( CjgateT
, vbx1
, vbx2
, PBSW
, MJSW
);
1633 /**************************************************************************/
1635 /**************************************************************************/
1636 double mcc_calcDL_com (mcc_modellist
*ptmodel
)
1638 double XL
, LD
, DELL
, DL
;
1640 //XL = mcc_getprm(ptmodel, "XL") ;
1641 //LD = mcc_getprm(ptmodel, "LD") ;
1642 XL
= mcc_getprm_quick(ptmodel
, __MCC_GETPRM_XL
) ;
1643 LD
= mcc_getprm_quick(ptmodel
, __MCC_GETPRM_LD
) ;
1645 DELL
= mcc_getparam_quick(ptmodel
, __MCC_QUICK_DELL
) ;
1647 DL
= XL
- 2.0*LD
+ DELL
;
1652 /**************************************************************************/
1654 /**************************************************************************/
1655 double mcc_calcDW_com (mcc_modellist
*ptmodel
)
1657 double XW
, WD
, DELW
, DW
;
1659 //XW = mcc_getprm(ptmodel, "XW") ;
1660 //WD = mcc_getprm(ptmodel, "WD") ;
1661 XW
= mcc_getprm_quick(ptmodel
, __MCC_GETPRM_XW
) ;
1662 WD
= mcc_getprm_quick(ptmodel
, __MCC_GETPRM_WD
) ;
1664 DELW
= mcc_getparam_quick(ptmodel
, __MCC_QUICK_DELW
) ;
1666 DW
= XW
- 2.0*WD
+ DELW
;
1671 /********************************************************************************************/
1672 /* Fonction commune d'initialisation des parametres en commun des differents modeles */
1673 /********************************************************************************************/
1674 void mcc_initparam_com(mcc_modellist
*ptmodel
)
1678 versiond
= (int)( 10.0 * mcc_getparam_quick( ptmodel
, __MCC_QUICK_VERSION
) + 0.5 );
1680 mcc_initparam_quick(ptmodel
, __MCC_QUICK_LMIN
, 0.0, NULL
, MCC_INITVALUE
) ;
1681 mcc_initparam_quick(ptmodel
, __MCC_QUICK_LMAX
, MCC_D_LWMAX
, NULL
, MCC_INITVALUE
) ;
1682 mcc_initparam_quick(ptmodel
, __MCC_QUICK_WMIN
, 0.0, NULL
, MCC_INITVALUE
) ;
1683 mcc_initparam_quick(ptmodel
, __MCC_QUICK_WMAX
, MCC_D_LWMAX
, NULL
, MCC_INITVALUE
) ;
1684 mcc_initparam_quick(ptmodel
, __MCC_QUICK_LMLT
, 1.0, NULL
, MCC_INITVALUE
) ;
1685 mcc_initparam_quick(ptmodel
, __MCC_QUICK_WMLT
, 1.0, NULL
, MCC_INITVALUE
) ;
1687 mcc_initparam_quick(ptmodel
, __MCC_QUICK_NJ
, 1.0, NULL
, MCC_INITVALUE
) ;
1688 mcc_initparam_quick(ptmodel
, __MCC_QUICK_JS
, 1.0e-4, NULL
, MCC_INITVALUE
) ;
1689 mcc_initparam_quick(ptmodel
, __MCC_QUICK_JSW
, 0.0, NULL
, MCC_INITVALUE
) ;
1690 mcc_initparam_quick(ptmodel
, __MCC_QUICK_XTI
, 0.0, NULL
, MCC_INITVALUE
) ;
1691 /* Initialisation des parametres relatifs a la temperature */
1692 mcc_initparam_quick(ptmodel
, __MCC_QUICK_TNOM
, V_FLOAT_TAB
[__SIM_TNOM
].VALUE
, NULL
, MCC_INITVALUE
) ;
1693 mcc_initparam_quick(ptmodel
, __MCC_QUICK_TMOD
, mcc_getparam_quick(ptmodel
, __MCC_QUICK_TNOM
), NULL
, MCC_INITVALUE
) ;
1694 mcc_initparam_quick(ptmodel
, __MCC_QUICK_TLEV
, 0.0, NULL
, MCC_INITVALUE
) ;
1695 mcc_initparam_quick(ptmodel
, __MCC_QUICK_TLEVC
, 0.0, NULL
, MCC_INITVALUE
) ;
1696 mcc_initparam_quick(ptmodel
, __MCC_QUICK_CTA
, 0.0, NULL
, MCC_INITVALUE
) ;
1697 mcc_initparam_quick(ptmodel
, __MCC_QUICK_CTP
, 0.0, NULL
, MCC_INITVALUE
) ;
1698 mcc_initparam_quick(ptmodel
, __MCC_QUICK_PTA
, 0.0, NULL
, MCC_INITVALUE
) ;
1699 mcc_initparam_quick(ptmodel
, __MCC_QUICK_PTP
, 0.0, NULL
, MCC_INITVALUE
) ;
1700 mcc_initparam_quick(ptmodel
, __MCC_QUICK_GAP1
, 7.02e-4, NULL
, MCC_INITVALUE
) ;
1701 mcc_initparam_quick(ptmodel
, __MCC_QUICK_GAP2
, 1108.0, NULL
, MCC_INITVALUE
) ;
1702 mcc_initparam_quick(ptmodel
, __MCC_QUICK_TLEVI
, 0.0, NULL
, MCC_INITVALUE
) ;
1703 mcc_initparam_quick(ptmodel
, __MCC_QUICK_ISTMP
, 10.0, NULL
, MCC_INITVALUE
) ;
1704 mcc_initparam_quick(ptmodel
, __MCC_QUICK_TLEVR
, 1.0, NULL
, MCC_INITVALUE
) ;
1705 mcc_initparam_quick(ptmodel
, __MCC_QUICK_TRD1
, 0.0, NULL
, MCC_INITVALUE
) ;
1706 mcc_initparam_quick(ptmodel
, __MCC_QUICK_TRD2
, 0.0, NULL
, MCC_INITVALUE
) ;
1707 mcc_initparam_quick(ptmodel
, __MCC_QUICK_TRS1
, 0.0, NULL
, MCC_INITVALUE
) ;
1708 mcc_initparam_quick(ptmodel
, __MCC_QUICK_TRS2
, 0.0, NULL
, MCC_INITVALUE
) ;
1709 mcc_initparam_quick(ptmodel
, __MCC_QUICK_TRSH1
, 0.0, NULL
, MCC_INITVALUE
) ;
1710 mcc_initparam_quick(ptmodel
, __MCC_QUICK_TRSH2
, 0.0, NULL
, MCC_INITVALUE
) ;
1712 /* Initialisation des parametres en fonction de ACM */
1713 if(mcc_getparamtype_quick(ptmodel
, __MCC_QUICK_OPTACM
) == MCC_SETVALUE
) {
1714 if(mcc_getparam_quick(ptmodel
, __MCC_QUICK_ACM
) == 0.0) {
1715 mcc_initparam_quick(ptmodel
, __MCC_QUICK_ALEV
, 0.0, NULL
, MCC_INITVALUE
) ;
1716 mcc_initparam_quick(ptmodel
, __MCC_QUICK_RLEV
, 0.0, NULL
, MCC_INITVALUE
) ;
1717 mcc_initparam_quick(ptmodel
, __MCC_QUICK_DIOLEV
, 2.0, NULL
, MCC_INITVALUE
) ;
1718 mcc_initparam_quick(ptmodel
, __MCC_QUICK_DCAPLEV
, 3.0, NULL
, MCC_INITVALUE
) ;
1720 else if (mcc_getparam_quick(ptmodel
, __MCC_QUICK_ACM
) == 1.0) {
1721 mcc_initparam_quick(ptmodel
, __MCC_QUICK_ALEV
, 1.0, NULL
, MCC_INITVALUE
) ;
1722 mcc_initparam_quick(ptmodel
, __MCC_QUICK_RLEV
, 1.0, NULL
, MCC_INITVALUE
) ;
1723 mcc_initparam_quick(ptmodel
, __MCC_QUICK_DIOLEV
, 2.0, NULL
, MCC_INITVALUE
) ;
1724 mcc_initparam_quick(ptmodel
, __MCC_QUICK_DCAPLEV
, 3.0, NULL
, MCC_INITVALUE
) ;
1726 else if (mcc_getparam_quick(ptmodel
, __MCC_QUICK_ACM
) == 2.0) {
1727 mcc_initparam_quick(ptmodel
, __MCC_QUICK_ALEV
, 2.0, NULL
, MCC_INITVALUE
) ;
1728 mcc_initparam_quick(ptmodel
, __MCC_QUICK_RLEV
, 2.0, NULL
, MCC_INITVALUE
) ;
1729 mcc_initparam_quick(ptmodel
, __MCC_QUICK_DIOLEV
, 2.0, NULL
, MCC_INITVALUE
) ;
1730 mcc_initparam_quick(ptmodel
, __MCC_QUICK_DCAPLEV
, 5.0, NULL
, MCC_INITVALUE
) ;
1732 else if (mcc_getparam_quick(ptmodel
, __MCC_QUICK_ACM
) == 3.0) {
1733 mcc_initparam_quick(ptmodel
, __MCC_QUICK_ALEV
, 3.0, NULL
, MCC_INITVALUE
) ;
1734 mcc_initparam_quick(ptmodel
, __MCC_QUICK_RLEV
, 3.0, NULL
, MCC_INITVALUE
) ;
1735 mcc_initparam_quick(ptmodel
, __MCC_QUICK_DIOLEV
, 2.0, NULL
, MCC_INITVALUE
) ;
1736 mcc_initparam_quick(ptmodel
, __MCC_QUICK_DCAPLEV
, 0.0, NULL
, MCC_INITVALUE
) ;
1738 else if (mcc_getparam_quick(ptmodel
, __MCC_QUICK_ACM
) == 10.0) {
1739 mcc_initparam_quick(ptmodel
, __MCC_QUICK_ALEV
, 0.0, NULL
, MCC_INITVALUE
) ;
1740 mcc_initparam_quick(ptmodel
, __MCC_QUICK_RLEV
, 0.0, NULL
, MCC_INITVALUE
) ;
1741 if( versiond
== 31 )
1742 mcc_initparam_quick(ptmodel
, __MCC_QUICK_DIOLEV
, 6.0, NULL
, MCC_INITVALUE
) ;
1743 else if( versiond
== 32 )
1744 mcc_initparam_quick(ptmodel
, __MCC_QUICK_DIOLEV
, 7.0, NULL
, MCC_INITVALUE
) ;
1745 mcc_initparam_quick(ptmodel
, __MCC_QUICK_DCAPLEV
, 4.0, NULL
, MCC_INITVALUE
) ;
1747 else if (mcc_getparam_quick(ptmodel
, __MCC_QUICK_ACM
) == 11.0) {
1748 mcc_initparam_quick(ptmodel
, __MCC_QUICK_ALEV
, 0.0, NULL
, MCC_INITVALUE
) ;
1749 mcc_initparam_quick(ptmodel
, __MCC_QUICK_RLEV
, 1.0, NULL
, MCC_INITVALUE
) ;
1750 if( versiond
== 31 )
1751 mcc_initparam_quick(ptmodel
, __MCC_QUICK_DIOLEV
, 6.0, NULL
, MCC_INITVALUE
) ;
1752 else if( versiond
== 32 )
1753 mcc_initparam_quick(ptmodel
, __MCC_QUICK_DIOLEV
, 7.0, NULL
, MCC_INITVALUE
) ;
1754 mcc_initparam_quick(ptmodel
, __MCC_QUICK_DCAPLEV
, 4.0, NULL
, MCC_INITVALUE
) ;
1756 else if (mcc_getparam_quick(ptmodel
, __MCC_QUICK_ACM
) == 12.0) {
1757 if((mcc_getparam_quick(ptmodel
, __MCC_QUICK_CALCACM
) == 0.0) ||
1758 (mcc_getparamtype_quick(ptmodel
, __MCC_QUICK_CALCACM
) == MCC_INITVALUE
))
1759 mcc_initparam_quick(ptmodel
, __MCC_QUICK_ALEV
, 0.0, NULL
, MCC_INITVALUE
) ;
1760 else if(mcc_getparam_quick(ptmodel
, __MCC_QUICK_CALCACM
) == 1.0)
1761 mcc_initparam_quick(ptmodel
, __MCC_QUICK_ALEV
, 2.0, NULL
, MCC_INITVALUE
) ;
1763 mcc_initparam_quick(ptmodel
, __MCC_QUICK_RLEV
, 2.0, NULL
, MCC_INITVALUE
) ;
1764 if( versiond
== 31 )
1765 mcc_initparam_quick(ptmodel
, __MCC_QUICK_DIOLEV
, 6.0, NULL
, MCC_INITVALUE
) ;
1766 else if( versiond
== 32 )
1767 mcc_initparam_quick(ptmodel
, __MCC_QUICK_DIOLEV
, 7.0, NULL
, MCC_INITVALUE
) ;
1768 mcc_initparam_quick(ptmodel
, __MCC_QUICK_DCAPLEV
, 4.0, NULL
, MCC_INITVALUE
) ;
1770 else if (mcc_getparam_quick(ptmodel
, __MCC_QUICK_ACM
) == 13.0) {
1771 mcc_initparam_quick(ptmodel
, __MCC_QUICK_ALEV
, 0.0, NULL
, MCC_INITVALUE
) ;
1772 mcc_initparam_quick(ptmodel
, __MCC_QUICK_RLEV
, 3.0, NULL
, MCC_INITVALUE
) ;
1773 if( versiond
== 31 )
1774 mcc_initparam_quick(ptmodel
, __MCC_QUICK_DIOLEV
, 6.0, NULL
, MCC_INITVALUE
) ;
1775 else if( versiond
== 32 )
1776 mcc_initparam_quick(ptmodel
, __MCC_QUICK_DIOLEV
, 7.0, NULL
, MCC_INITVALUE
) ;
1777 mcc_initparam_quick(ptmodel
, __MCC_QUICK_DCAPLEV
, 4.0, NULL
, MCC_INITVALUE
) ;
1781 /* Initialisation des parametres en fonction de DIOLEV */
1782 if(mcc_getparam_quick(ptmodel
, __MCC_QUICK_DIOLEV
) == 9.0) {
1783 mcc_initparam_quick(ptmodel
, __MCC_QUICK_VR
, 0.0, NULL
, MCC_INITVALUE
) ;
1784 mcc_initparam_quick(ptmodel
, __MCC_QUICK_JSGBR
, 1.0e-3, NULL
, MCC_INITVALUE
) ;
1785 mcc_initparam_quick(ptmodel
, __MCC_QUICK_JSDBR
, 1.0e-3, NULL
, MCC_INITVALUE
) ;
1786 mcc_initparam_quick(ptmodel
, __MCC_QUICK_JSGSR
, 1.0e-3, NULL
, MCC_INITVALUE
) ;
1787 mcc_initparam_quick(ptmodel
, __MCC_QUICK_JSDSR
, 1.0e-3, NULL
, MCC_INITVALUE
) ;
1788 mcc_initparam_quick(ptmodel
, __MCC_QUICK_JSGGR
, 1.0e-3, NULL
, MCC_INITVALUE
) ;
1789 mcc_initparam_quick(ptmodel
, __MCC_QUICK_JSDGR
, 1.0e-3, NULL
, MCC_INITVALUE
) ;
1790 mcc_initparam_quick(ptmodel
, __MCC_QUICK_NBJ
, 1.0, NULL
, MCC_INITVALUE
) ;
1791 mcc_initparam_quick(ptmodel
, __MCC_QUICK_NSJ
, 1.0, NULL
, MCC_INITVALUE
) ;
1792 mcc_initparam_quick(ptmodel
, __MCC_QUICK_NGJ
, 1.0, NULL
, MCC_INITVALUE
) ;
1793 mcc_initparam_quick(ptmodel
, __MCC_QUICK_CJBR
, 1.0e-12, NULL
, MCC_INITVALUE
) ;
1794 mcc_initparam_quick(ptmodel
, __MCC_QUICK_CJSR
, 1.0e-12, NULL
, MCC_INITVALUE
) ;
1795 mcc_initparam_quick(ptmodel
, __MCC_QUICK_CJGR
, 1.0e-12, NULL
, MCC_INITVALUE
) ;
1796 mcc_initparam_quick(ptmodel
, __MCC_QUICK_VDBR
, 1.0, NULL
, MCC_INITVALUE
) ;
1797 mcc_initparam_quick(ptmodel
, __MCC_QUICK_VDSR
, 1.0, NULL
, MCC_INITVALUE
) ;
1798 mcc_initparam_quick(ptmodel
, __MCC_QUICK_VDGR
, 1.0, NULL
, MCC_INITVALUE
) ;
1799 mcc_initparam_quick(ptmodel
, __MCC_QUICK_PB
, 0.4, NULL
, MCC_INITVALUE
) ;
1800 mcc_initparam_quick(ptmodel
, __MCC_QUICK_PS
, 0.4, NULL
, MCC_INITVALUE
) ;
1801 mcc_initparam_quick(ptmodel
, __MCC_QUICK_PG
, 0.4, NULL
, MCC_INITVALUE
) ;
1802 mcc_initparam_quick(ptmodel
, __MCC_QUICK_TRDIO9
, mcc_getparam_quick(ptmodel
, __MCC_QUICK_TNOM
), mcc_getparamexp_quick(ptmodel
, __MCC_QUICK_TNOM
), MCC_INITVALUE
) ;
1805 mcc_initparam_quick(ptmodel
, __MCC_QUICK_CBD
, 0.0, NULL
, MCC_INITVALUE
) ;
1806 mcc_initparam_quick(ptmodel
, __MCC_QUICK_CBS
, 0.0, NULL
, MCC_INITVALUE
) ;
1807 mcc_initparam_quick(ptmodel
, __MCC_QUICK_CJGATE
, 0.0, NULL
, MCC_INITVALUE
) ;
1808 mcc_initparam_quick(ptmodel
, __MCC_QUICK_MJ
, 0.5, NULL
, MCC_INITVALUE
) ;
1809 mcc_initparam_quick(ptmodel
, __MCC_QUICK_MJSW
, 0.33, NULL
, MCC_INITVALUE
) ;
1810 mcc_initparam_quick(ptmodel
, __MCC_QUICK_FC
, 0.5, NULL
, MCC_INITVALUE
) ;
1811 mcc_initparam_quick(ptmodel
, __MCC_QUICK_TT
, 0.0, NULL
, MCC_INITVALUE
) ;
1812 /* a verifier vrai dans eldo bsim3 */
1813 if(mcc_getparamtype_quick(ptmodel
, __MCC_QUICK_PHP
) == MCC_SETVALUE
)
1815 mcc_initparam_quick(ptmodel
, __MCC_QUICK_PBSW
, mcc_getparam_quick(ptmodel
, __MCC_QUICK_PHP
), mcc_getparamexp_quick(ptmodel
, __MCC_QUICK_PHP
), MCC_INITVALUE
) ;
1819 mcc_initparam_quick(ptmodel
, __MCC_QUICK_CJ
, 0.0, NULL
, MCC_INITVALUE
) ;
1820 mcc_initparam_quick(ptmodel
, __MCC_QUICK_CJSW
, 0.0, NULL
, MCC_INITVALUE
) ;
1821 mcc_initparam_quick(ptmodel
, __MCC_QUICK_PB
, 0.8, NULL
, MCC_INITVALUE
) ;
1822 mcc_initparam_quick(ptmodel
, __MCC_QUICK_PBSW
, mcc_getparam_quick(ptmodel
, __MCC_QUICK_PB
), mcc_getparamexp_quick(ptmodel
, __MCC_QUICK_PB
), MCC_INITVALUE
) ;
1823 mcc_initparam_quick(ptmodel
, __MCC_QUICK_PHP
, mcc_getparam_quick(ptmodel
, __MCC_QUICK_PB
), mcc_getparamexp_quick(ptmodel
, __MCC_QUICK_PB
), MCC_INITVALUE
) ;
1828 /*******************************************************************************************\
1829 FUNC : mcc_initparam_diode
1830 \*******************************************************************************************/
1831 void mcc_initparam_diode (mcc_modellist
*ptmodel
)
1835 if ( ptmodel
->TYPE
== MCC_DIODE
) {
1836 mcc_initparam_quick(ptmodel
, __MCC_QUICK_LEVEL
, 1.0, NULL
, MCC_INITVALUE
);
1837 level
= MCC_ROUND (mcc_getparam_quick(ptmodel
,__MCC_QUICK_LEVEL
));
1838 mcc_initparam_quick(ptmodel
, __MCC_QUICK_TNOM
, V_FLOAT_TAB
[__SIM_TNOM
].VALUE
, NULL
, MCC_INITVALUE
);
1839 mcc_initparam_quick(ptmodel
, __MCC_QUICK_TREF
, V_FLOAT_TAB
[__SIM_TNOM
].VALUE
, NULL
, MCC_INITVALUE
);
1840 mcc_initparam_quick(ptmodel
, __MCC_QUICK_TMOD
, mcc_getparam_quick(ptmodel
, __MCC_QUICK_TNOM
), mcc_getparamexp_quick(ptmodel
, __MCC_QUICK_TNOM
), MCC_INITVALUE
) ;
1841 mcc_initparam_quick(ptmodel
, __MCC_QUICK_TLEV
, 0.0, NULL
, MCC_INITVALUE
);
1842 mcc_initparam_quick(ptmodel
, __MCC_QUICK_TLEVC
, 0.0, NULL
, MCC_INITVALUE
);
1849 mcc_initparam_quick(ptmodel
, __MCC_QUICK_SCALEV
, 2.0, NULL
, MCC_INITVALUE
);
1850 mcc_initparam_quick(ptmodel
, __MCC_QUICK_AREA
, 1.0, NULL
, MCC_INITVALUE
);
1851 mcc_initparam_quick(ptmodel
, __MCC_QUICK_PERIM
, 0.0, NULL
, MCC_INITVALUE
);
1852 mcc_initparam_quick(ptmodel
, __MCC_QUICK_SCALM
, 1.0, NULL
, MCC_INITVALUE
);
1853 mcc_initparam_quick(ptmodel
, __MCC_QUICK_SHRINK
, 1.0, NULL
, MCC_INITVALUE
);
1854 // DC Related model param
1855 mcc_initparam_quick(ptmodel
, __MCC_QUICK_IS
, 1.0e-14, NULL
, MCC_INITVALUE
);
1856 mcc_initparam_quick(ptmodel
, __MCC_QUICK_JS
, 1.0e-14, NULL
, MCC_INITVALUE
);
1857 mcc_initparam_quick(ptmodel
, __MCC_QUICK_ISA
, 1.0e-14, NULL
, MCC_INITVALUE
);
1858 mcc_initparam_quick(ptmodel
, __MCC_QUICK_ISW
, 0.0, NULL
, MCC_INITVALUE
);
1859 mcc_initparam_quick(ptmodel
, __MCC_QUICK_JSW
, 0.0, NULL
, MCC_INITVALUE
);
1860 mcc_initparam_quick(ptmodel
, __MCC_QUICK_ISP
, 0.0, NULL
, MCC_INITVALUE
);
1861 mcc_initparam_quick(ptmodel
, __MCC_QUICK_N
, 1.0, NULL
, MCC_INITVALUE
);
1862 mcc_initparam_quick(ptmodel
, __MCC_QUICK_NF
, 1.0, NULL
, MCC_INITVALUE
);
1863 mcc_initparam_quick(ptmodel
, __MCC_QUICK_IBV
, 1.0e-3, NULL
, MCC_INITVALUE
);
1864 mcc_initparam_quick(ptmodel
, __MCC_QUICK_IK
, 0.0, NULL
, MCC_INITVALUE
);
1865 mcc_initparam_quick(ptmodel
, __MCC_QUICK_IKR
, 0.0, NULL
, MCC_INITVALUE
);
1866 // Capacitance Related Model Parameters
1867 mcc_initparam_quick(ptmodel
, __MCC_QUICK_DCAP
, 1.0, NULL
, MCC_INITVALUE
);
1868 mcc_initparam_quick(ptmodel
, __MCC_QUICK_CJO
, 0.0, NULL
, MCC_INITVALUE
);
1869 mcc_initparam_quick(ptmodel
, __MCC_QUICK_CJ0
, 0.0, NULL
, MCC_INITVALUE
);
1870 mcc_initparam_quick(ptmodel
, __MCC_QUICK_CJ
, 0.0, NULL
, MCC_INITVALUE
);
1871 mcc_initparam_quick(ptmodel
, __MCC_QUICK_CJA
, 0.0, NULL
, MCC_INITVALUE
);
1872 mcc_initparam_quick(ptmodel
, __MCC_QUICK_M
, 0.5, NULL
, MCC_INITVALUE
);
1873 mcc_initparam_quick(ptmodel
, __MCC_QUICK_MJ
, 0.5, NULL
, MCC_INITVALUE
);
1874 mcc_initparam_quick(ptmodel
, __MCC_QUICK_EXA
, 0.5, NULL
, MCC_INITVALUE
);
1875 mcc_initparam_quick(ptmodel
, __MCC_QUICK_CJSW
, 0.0, NULL
, MCC_INITVALUE
);
1876 mcc_initparam_quick(ptmodel
, __MCC_QUICK_CJP
, 0.0, NULL
, MCC_INITVALUE
);
1877 mcc_initparam_quick(ptmodel
, __MCC_QUICK_MJSW
, 0.33, NULL
, MCC_INITVALUE
);
1878 mcc_initparam_quick(ptmodel
, __MCC_QUICK_EXP
, 0.33, NULL
, MCC_INITVALUE
);
1879 mcc_initparam_quick(ptmodel
, __MCC_QUICK_FC
, 0.5, NULL
, MCC_INITVALUE
);
1880 mcc_initparam_quick(ptmodel
, __MCC_QUICK_FCS
, mcc_getparam_quick(ptmodel
, __MCC_QUICK_FC
), mcc_getparamexp_quick(ptmodel
, __MCC_QUICK_FC
), MCC_INITVALUE
) ;
1881 mcc_initparam_quick(ptmodel
, __MCC_QUICK_KMS
, 0.0, NULL
, MCC_INITVALUE
);
1882 mcc_initparam_quick(ptmodel
, __MCC_QUICK_TT
, 0.0, NULL
, MCC_INITVALUE
);
1883 mcc_initparam_quick(ptmodel
, __MCC_QUICK_VJ
, 1.0, NULL
, MCC_INITVALUE
);
1884 mcc_initparam_quick(ptmodel
, __MCC_QUICK_PB
, 1.0, NULL
, MCC_INITVALUE
);
1885 mcc_initparam_quick(ptmodel
, __MCC_QUICK_PHI
, 1.0, NULL
, MCC_INITVALUE
);
1886 mcc_initparam_quick(ptmodel
, __MCC_QUICK_PHP
, mcc_getparam_quick(ptmodel
, __MCC_QUICK_PB
), mcc_getparamexp_quick(ptmodel
, __MCC_QUICK_PB
), MCC_INITVALUE
) ;
1887 // Metal and Polisillicon Capacitor Parameter
1888 mcc_initparam_quick(ptmodel
, __MCC_QUICK_LM
, 0.0, NULL
, MCC_INITVALUE
);
1889 mcc_initparam_quick(ptmodel
, __MCC_QUICK_LP
, 0.0, NULL
, MCC_INITVALUE
);
1890 mcc_initparam_quick(ptmodel
, __MCC_QUICK_WM
, 0.0, NULL
, MCC_INITVALUE
);
1891 mcc_initparam_quick(ptmodel
, __MCC_QUICK_WP
, 0.0, NULL
, MCC_INITVALUE
);
1892 mcc_initparam_quick(ptmodel
, __MCC_QUICK_XM
, 0.0, NULL
, MCC_INITVALUE
);
1893 mcc_initparam_quick(ptmodel
, __MCC_QUICK_XOI
, 1.0e3
, NULL
, MCC_INITVALUE
);
1894 mcc_initparam_quick(ptmodel
, __MCC_QUICK_XOM
, 1.0e3
, NULL
, MCC_INITVALUE
);
1895 mcc_initparam_quick(ptmodel
, __MCC_QUICK_XP
, 0.0, NULL
, MCC_INITVALUE
);
1896 // Parasistic Resistance Related Model Parameters
1897 mcc_initparam_quick(ptmodel
, __MCC_QUICK_RS
, 0.0, NULL
, MCC_INITVALUE
);
1898 mcc_initparam_quick(ptmodel
, __MCC_QUICK_RB
, 0.0, NULL
, MCC_INITVALUE
);
1899 // Noise Related Model Parameters
1900 mcc_initparam_quick(ptmodel
, __MCC_QUICK_AF
, 1.0, NULL
, MCC_INITVALUE
);
1901 mcc_initparam_quick(ptmodel
, __MCC_QUICK_KF
, 1.0, NULL
, MCC_INITVALUE
);
1902 // Temperature Related Model Parameters
1903 mcc_initparam_quick(ptmodel
, __MCC_QUICK_EG
, 1.11, NULL
, MCC_INITVALUE
);
1904 mcc_initparam_quick(ptmodel
, __MCC_QUICK_CTA
, 0.0, NULL
, MCC_INITVALUE
);
1905 mcc_initparam_quick(ptmodel
, __MCC_QUICK_CTP
, 0.0, NULL
, MCC_INITVALUE
);
1906 mcc_initparam_quick(ptmodel
, __MCC_QUICK_GAP1
, 7.02e-4, NULL
, MCC_INITVALUE
);
1907 mcc_initparam_quick(ptmodel
, __MCC_QUICK_GAP2
, 1108.0, NULL
, MCC_INITVALUE
);
1908 mcc_initparam_quick(ptmodel
, __MCC_QUICK_TCV
, 0.0, NULL
, MCC_INITVALUE
);
1909 mcc_initparam_quick(ptmodel
, __MCC_QUICK_TM1
, 0.0, NULL
, MCC_INITVALUE
);
1910 mcc_initparam_quick(ptmodel
, __MCC_QUICK_TM2
, 0.0, NULL
, MCC_INITVALUE
);
1911 mcc_initparam_quick(ptmodel
, __MCC_QUICK_TPB
, 0.0, NULL
, MCC_INITVALUE
);
1912 mcc_initparam_quick(ptmodel
, __MCC_QUICK_TVJ
, 0.0, NULL
, MCC_INITVALUE
);
1913 mcc_initparam_quick(ptmodel
, __MCC_QUICK_TPHP
, 0.0, NULL
, MCC_INITVALUE
);
1914 mcc_initparam_quick(ptmodel
, __MCC_QUICK_TRS
, 0.0, NULL
, MCC_INITVALUE
);
1915 mcc_initparam_quick(ptmodel
, __MCC_QUICK_TTT1
, 0.0, NULL
, MCC_INITVALUE
);
1916 mcc_initparam_quick(ptmodel
, __MCC_QUICK_TTT2
, 0.0, NULL
, MCC_INITVALUE
);
1917 mcc_initparam_quick(ptmodel
, __MCC_QUICK_XTI
, 3.0, NULL
, MCC_INITVALUE
);
1918 mcc_initparam_quick(ptmodel
, __MCC_QUICK_PT
, 3.0, NULL
, MCC_INITVALUE
);
1924 // DC Related Model Parameters
1925 mcc_initparam_quick(ptmodel
, __MCC_QUICK_IS
, 1.0e-14, NULL
, MCC_INITVALUE
);
1926 mcc_initparam_quick(ptmodel
, __MCC_QUICK_ISR
, 0.0, NULL
, MCC_INITVALUE
);
1927 mcc_initparam_quick(ptmodel
, __MCC_QUICK_NR
, 2.0, NULL
, MCC_INITVALUE
);
1928 mcc_initparam_quick(ptmodel
, __MCC_QUICK_N
, 1.0, NULL
, MCC_INITVALUE
);
1929 mcc_initparam_quick(ptmodel
, __MCC_QUICK_NF
, 1.0, NULL
, MCC_INITVALUE
);
1930 mcc_initparam_quick(ptmodel
, __MCC_QUICK_IBV
, 1.0e-3, NULL
, MCC_INITVALUE
);
1931 mcc_initparam_quick(ptmodel
, __MCC_QUICK_IBVL
, 0.0, NULL
, MCC_INITVALUE
);
1932 mcc_initparam_quick(ptmodel
, __MCC_QUICK_NBV
, 1.0, NULL
, MCC_INITVALUE
);
1933 mcc_initparam_quick(ptmodel
, __MCC_QUICK_NBVL
, 1.0, NULL
, MCC_INITVALUE
);
1934 // Capacitance Related Model Parameters
1935 mcc_initparam_quick(ptmodel
, __MCC_QUICK_CJO
, 0.0, NULL
, MCC_INITVALUE
);
1936 mcc_initparam_quick(ptmodel
, __MCC_QUICK_CJ0
, 0.0, NULL
, MCC_INITVALUE
);
1937 mcc_initparam_quick(ptmodel
, __MCC_QUICK_M
, 0.5, NULL
, MCC_INITVALUE
);
1938 mcc_initparam_quick(ptmodel
, __MCC_QUICK_EG
, 1.11, NULL
, MCC_INITVALUE
);
1939 mcc_initparam_quick(ptmodel
, __MCC_QUICK_FC
, 0.5, NULL
, MCC_INITVALUE
);
1940 mcc_initparam_quick(ptmodel
, __MCC_QUICK_TT
, 0.0, NULL
, MCC_INITVALUE
);
1941 mcc_initparam_quick(ptmodel
, __MCC_QUICK_VJ
, 1.0, NULL
, MCC_INITVALUE
);
1942 mcc_initparam_quick(ptmodel
, __MCC_QUICK_RS
, 0.0, NULL
, MCC_INITVALUE
);
1943 mcc_initparam_quick(ptmodel
, __MCC_QUICK_AF
, 1.0, NULL
, MCC_INITVALUE
);
1944 mcc_initparam_quick(ptmodel
, __MCC_QUICK_KF
, 0.0, NULL
, MCC_INITVALUE
);
1945 // Temperature Related Model Parameters
1946 mcc_initparam_quick(ptmodel
, __MCC_QUICK_TRS1
, 0.0, NULL
, MCC_INITVALUE
);
1947 mcc_initparam_quick(ptmodel
, __MCC_QUICK_TRS2
, 0.0, NULL
, MCC_INITVALUE
);
1948 mcc_initparam_quick(ptmodel
, __MCC_QUICK_TBV1
, 0.0, NULL
, MCC_INITVALUE
);
1949 mcc_initparam_quick(ptmodel
, __MCC_QUICK_TBV2
, 0.0, NULL
, MCC_INITVALUE
);
1950 mcc_initparam_quick(ptmodel
, __MCC_QUICK_TIKF
, 0.0, NULL
, MCC_INITVALUE
);
1956 // DC Related Model Parameters
1957 mcc_initparam_quick(ptmodel
, __MCC_QUICK_EF
, 1.0e-8, NULL
, MCC_INITVALUE
);
1958 mcc_initparam_quick(ptmodel
, __MCC_QUICK_ER
, mcc_getparam_quick(ptmodel
, __MCC_QUICK_EF
), mcc_getparamexp_quick(ptmodel
, __MCC_QUICK_EF
), MCC_INITVALUE
) ;
1959 mcc_initparam_quick(ptmodel
, __MCC_QUICK_JF
, 1.0e-10, NULL
, MCC_INITVALUE
);
1960 mcc_initparam_quick(ptmodel
, __MCC_QUICK_JR
, mcc_getparam_quick(ptmodel
, __MCC_QUICK_JF
), mcc_getparamexp_quick(ptmodel
, __MCC_QUICK_JF
), MCC_INITVALUE
) ;
1961 mcc_initparam_quick(ptmodel
, __MCC_QUICK_TOX
, 100.0, NULL
, MCC_INITVALUE
);
1962 mcc_initparam_quick(ptmodel
, __MCC_QUICK_L
, 0.0, NULL
, MCC_INITVALUE
);
1963 mcc_initparam_quick(ptmodel
, __MCC_QUICK_W
, 0.0, NULL
, MCC_INITVALUE
);
1964 mcc_initparam_quick(ptmodel
, __MCC_QUICK_XW
, 0.0, NULL
, MCC_INITVALUE
);
1970 // DC Related Model Parameters
1971 mcc_initparam_quick(ptmodel, __MCC_QUICK_AB, 1.0e-12, NULL, MCC_INITVALUE);
1972 mcc_initparam_quick(ptmodel, __MCC_QUICK_LS, 1.0e-6, NULL, MCC_INITVALUE);
1973 mcc_initparam_quick(ptmodel, __MCC_QUICK_LG, 0.0, NULL, MCC_INITVALUE);
1974 mcc_initparam_quick(ptmodel, __MCC_QUICK_DTA, 0.0, NULL, MCC_INITVALUE);
1975 mcc_initparam_quick(ptmodel, __MCC_QUICK_TR, 25.0, NULL, MCC_INITVALUE);
1976 mcc_initparam_quick(ptmodel, __MCC_QUICK_VR, 0.0, NULL, MCC_INITVALUE);
1977 mcc_initparam_quick(ptmodel, __MCC_QUICK_JSGBR, 1.0e-3, NULL, MCC_INITVALUE);
1978 mcc_initparam_quick(ptmodel, __MCC_QUICK_JSDBR, 1.0e-3, NULL, MCC_INITVALUE);
1979 mcc_initparam_quick(ptmodel, __MCC_QUICK_JSGSR, 1.0e-3, NULL, MCC_INITVALUE);
1980 mcc_initparam_quick(ptmodel, __MCC_QUICK_JSDBR, 1.0e-3, NULL, MCC_INITVALUE);
1981 mcc_initparam_quick(ptmodel, __MCC_QUICK_JSGGR, 1.0e-3, NULL, MCC_INITVALUE);
1982 mcc_initparam_quick(ptmodel, __MCC_QUICK_JSDGR, 1.0e-3, NULL, MCC_INITVALUE);
1983 mcc_initparam_quick(ptmodel, __MCC_QUICK_NB, 1.0, NULL, MCC_INITVALUE);
1984 mcc_initparam_quick(ptmodel, __MCC_QUICK_NS, 1.0, NULL, MCC_INITVALUE);
1985 mcc_initparam_quick(ptmodel, __MCC_QUICK_NG, 1.0, NULL, MCC_INITVALUE);
1986 mcc_initparam_quick(ptmodel, __MCC_QUICK_VB, 0.9, NULL, MCC_INITVALUE);
1987 mcc_initparam_quick(ptmodel, __MCC_QUICK_CJBR, 1.0e-12, NULL, MCC_INITVALUE);
1988 mcc_initparam_quick(ptmodel, __MCC_QUICK_CJSR, 1.0e-12, NULL, MCC_INITVALUE);
1989 mcc_initparam_quick(ptmodel, __MCC_QUICK_CJGR, 1.0e-12, NULL, MCC_INITVALUE);
1990 mcc_initparam_quick(ptmodel, __MCC_QUICK_VDBR, 1.0, NULL, MCC_INITVALUE);
1991 mcc_initparam_quick(ptmodel, __MCC_QUICK_VDSR, 1.0, NULL, MCC_INITVALUE);
1992 mcc_initparam_quick(ptmodel, __MCC_QUICK_VDGR, 1.0, NULL, MCC_INITVALUE);
1993 mcc_initparam_quick(ptmodel, __MCC_QUICK_PB, 0.4, NULL, MCC_INITVALUE);
1994 mcc_initparam_quick(ptmodel, __MCC_QUICK_PS, 0.4, NULL, MCC_INITVALUE);
1995 mcc_initparam_quick(ptmodel, __MCC_QUICK_PG, 0.4, NULL, MCC_INITVALUE);
2002 // DC Related Model Parameters
2003 mcc_initparam_quick(ptmodel
, __MCC_QUICK_DIOLEV
, 1.0, NULL
, MCC_INITVALUE
);
2004 mcc_initparam_quick(ptmodel
, __MCC_QUICK_JS
, 0.0, NULL
, MCC_INITVALUE
);
2005 mcc_initparam_quick(ptmodel
, __MCC_QUICK_JSW
, 0.0, NULL
, MCC_INITVALUE
);
2006 mcc_initparam_quick(ptmodel
, __MCC_QUICK_IS
, 1.0e-14, NULL
, MCC_INITVALUE
);
2007 mcc_initparam_quick(ptmodel
, __MCC_QUICK_N
, 1.0, NULL
, MCC_INITVALUE
);
2008 mcc_initparam_quick(ptmodel
, __MCC_QUICK_NDS
, 1.0, NULL
, MCC_INITVALUE
);
2009 mcc_initparam_quick(ptmodel
, __MCC_QUICK_VNDS
, -1.0, NULL
, MCC_INITVALUE
);
2010 mcc_initparam_quick(ptmodel
, __MCC_QUICK_SBTH
, 0.0, NULL
, MCC_INITVALUE
);
2011 // Bulk Diode Capacitance Related Parameters
2012 mcc_initparam_quick(ptmodel
, __MCC_QUICK_CBD
, 0.0, NULL
, MCC_INITVALUE
);
2013 mcc_initparam_quick(ptmodel
, __MCC_QUICK_CBS
, 0.0, NULL
, MCC_INITVALUE
);
2014 mcc_initparam_quick(ptmodel
, __MCC_QUICK_CJ
, 0.0, NULL
, MCC_INITVALUE
);
2015 mcc_initparam_quick(ptmodel
, __MCC_QUICK_CJGATE
, 0.0, NULL
, MCC_INITVALUE
);
2016 mcc_initparam_quick(ptmodel
, __MCC_QUICK_CJSW
, 0.0, NULL
, MCC_INITVALUE
);
2017 mcc_initparam_quick(ptmodel
, __MCC_QUICK_FC
, 0.5, NULL
, MCC_INITVALUE
);
2018 mcc_initparam_quick(ptmodel
, __MCC_QUICK_MJ
, 0.5, NULL
, MCC_INITVALUE
);
2019 mcc_initparam_quick(ptmodel
, __MCC_QUICK_MJSW
, 0.33, NULL
, MCC_INITVALUE
);
2020 mcc_initparam_quick(ptmodel
, __MCC_QUICK_PB
, 0.8, NULL
, MCC_INITVALUE
);
2021 mcc_initparam_quick(ptmodel
, __MCC_QUICK_PBSW
, mcc_getparam_quick(ptmodel
, __MCC_QUICK_PB
), mcc_getparamexp_quick(ptmodel
, __MCC_QUICK_PB
), MCC_INITVALUE
) ;
2022 mcc_initparam_quick(ptmodel
, __MCC_QUICK_TT
, 0.0, NULL
, MCC_INITVALUE
);
2023 // Juncap Related Parameters (DIOLEV = 9)
2024 mcc_initparam_quick(ptmodel
, __MCC_QUICK_VR
, 0.0, NULL
, MCC_INITVALUE
);
2025 mcc_initparam_quick(ptmodel
, __MCC_QUICK_JSGBR
, 1.0e-3, NULL
, MCC_INITVALUE
);
2026 mcc_initparam_quick(ptmodel
, __MCC_QUICK_JSDBR
, 1.0e-3, NULL
, MCC_INITVALUE
);
2027 mcc_initparam_quick(ptmodel
, __MCC_QUICK_JSGSR
, 1.0e-3, NULL
, MCC_INITVALUE
);
2028 mcc_initparam_quick(ptmodel
, __MCC_QUICK_JSDSR
, 1.0e-3, NULL
, MCC_INITVALUE
);
2029 mcc_initparam_quick(ptmodel
, __MCC_QUICK_JSGGR
, 1.0e-3, NULL
, MCC_INITVALUE
);
2030 mcc_initparam_quick(ptmodel
, __MCC_QUICK_JSDGR
, 1.0e-3, NULL
, MCC_INITVALUE
);
2031 mcc_initparam_quick(ptmodel
, __MCC_QUICK_NBJ
, 1.0, NULL
, MCC_INITVALUE
);
2032 mcc_initparam_quick(ptmodel
, __MCC_QUICK_NSJ
, 1.0, NULL
, MCC_INITVALUE
);
2033 mcc_initparam_quick(ptmodel
, __MCC_QUICK_NGJ
, 1.0, NULL
, MCC_INITVALUE
);
2034 mcc_initparam_quick(ptmodel
, __MCC_QUICK_CJBR
, 1.0e-12, NULL
, MCC_INITVALUE
);
2035 mcc_initparam_quick(ptmodel
, __MCC_QUICK_CJSR
, 1.0e-12, NULL
, MCC_INITVALUE
);
2036 mcc_initparam_quick(ptmodel
, __MCC_QUICK_CJGR
, 1.0e-12, NULL
, MCC_INITVALUE
);
2037 mcc_initparam_quick(ptmodel
, __MCC_QUICK_VDBR
, 1.0, NULL
, MCC_INITVALUE
);
2038 mcc_initparam_quick(ptmodel
, __MCC_QUICK_VDSR
, 1.0, NULL
, MCC_INITVALUE
);
2039 mcc_initparam_quick(ptmodel
, __MCC_QUICK_VDGR
, 1.0, NULL
, MCC_INITVALUE
);
2040 mcc_initparam_quick(ptmodel
, __MCC_QUICK_PB
, 0.4, NULL
, MCC_INITVALUE
);
2041 mcc_initparam_quick(ptmodel
, __MCC_QUICK_PS
, 0.4, NULL
, MCC_INITVALUE
);
2042 mcc_initparam_quick(ptmodel
, __MCC_QUICK_PG
, 0.4, NULL
, MCC_INITVALUE
);
2043 // Temperature Effect Related Model Parameters
2044 mcc_initparam_quick(ptmodel
, __MCC_QUICK_CTA
, 0.0, NULL
, MCC_INITVALUE
);
2045 mcc_initparam_quick(ptmodel
, __MCC_QUICK_CTP
, 0.0, NULL
, MCC_INITVALUE
);
2046 mcc_initparam_quick(ptmodel
, __MCC_QUICK_PTA
, 0.0, NULL
, MCC_INITVALUE
);
2047 mcc_initparam_quick(ptmodel
, __MCC_QUICK_PTP
, 0.0, NULL
, MCC_INITVALUE
);
2048 tlev
= MCC_ROUND(mcc_getparam_quick(ptmodel
,__MCC_QUICK_TLEV
));
2049 if ( tlev
== 0 || tlev
== 1 )
2050 mcc_initparam_quick(ptmodel
, __MCC_QUICK_EG
, 1.11, NULL
, MCC_INITVALUE
);
2052 mcc_initparam_quick(ptmodel
, __MCC_QUICK_EG
, 1.16, NULL
, MCC_INITVALUE
);
2053 mcc_initparam_quick(ptmodel
, __MCC_QUICK_GAP1
, 7.02e-4, NULL
, MCC_INITVALUE
);
2054 mcc_initparam_quick(ptmodel
, __MCC_QUICK_GAP2
, 1108.0, NULL
, MCC_INITVALUE
);
2055 mcc_initparam_quick(ptmodel
, __MCC_QUICK_TLEVI
, 1.0, NULL
, MCC_INITVALUE
);
2056 mcc_initparam_quick(ptmodel
, __MCC_QUICK_LIS
, 1.0, NULL
, MCC_INITVALUE
);
2057 mcc_initparam_quick(ptmodel
, __MCC_QUICK_ISTEMP
, 10.0, NULL
, MCC_INITVALUE
);
2058 mcc_initparam_quick(ptmodel
, __MCC_QUICK_XTI
, 0.0, NULL
, MCC_INITVALUE
);
2060 default : avt_errmsg(MCC_ERRMSG
, "018", AVT_ERROR
,ptmodel
->NAME
,level
) ;
2066 #ifdef MCC_RESI_CODE
2068 void mcc_initparam_resi (mcc_modellist
*ptmodel
)
2072 if ( ptmodel
->TYPE
== MCC_MODEL_RESI
) {
2073 mcc_initparam_quick(ptmodel
, __MCC_QUICK_CAP
, 1.0, NULL
, MCC_INITVALUE
);
2074 mcc_initparam_quick(ptmodel
, __MCC_QUICK_CAPSW
, 27.0, NULL
, MCC_INITVALUE
);
2075 mcc_initparam_quick(ptmodel
, __MCC_QUICK_COX
, 27.0, NULL
, MCC_INITVALUE
);
2076 mcc_initparam_quick(ptmodel
, __MCC_QUICK_DI
, mcc_getparam_quick(ptmodel
, __MCC_QUICK_TNOM
), mcc_getparamexp_quick(ptmodel
, __MCC_QUICK_TNOM
), MCC_INITVALUE
) ;
2077 mcc_initparam_quick(ptmodel
, __MCC_QUICK_DLR
, 0.0, NULL
, MCC_INITVALUE
);
2078 mcc_initparam_quick(ptmodel
, __MCC_QUICK_L
, 0.0, NULL
, MCC_INITVALUE
);
2079 mcc_initparam_quick(ptmodel
, __MCC_QUICK_W
, 0.0, NULL
, MCC_INITVALUE
);
2080 mcc_initparam_quick(ptmodel
, __MCC_QUICK_RES
, 0.0, NULL
, MCC_INITVALUE
);
2081 mcc_initparam_quick(ptmodel
, __MCC_QUICK_SHRINK
, 0.0, NULL
, MCC_INITVALUE
);
2082 mcc_initparam_quick(ptmodel
, __MCC_QUICK_L
, 0.0, NULL
, MCC_INITVALUE
);
2086 /********************************************************************************************/
2087 /* Les derating sont calcules en fct du rapport des courants maximums */
2088 /********************************************************************************************/
2089 /********************************************************************************************/
2090 /* Fonction de calcul du derating en temperature */
2091 /* Exemple : tpfinal = tpinitial*(1.0+dT*derate_temp) */
2092 /********************************************************************************************/
2093 double mcc_calcRapIdsTemp(char *technoname
, char *transname
, int transtype
,
2094 int transcase
, double L
, double W
, double vdd
,
2095 double T0
, double T1
)
2097 mcc_modellist
*ptmodel
;
2098 double RapportIds
= 1.0 ;
2100 if(!(ptmodel
= mcc_getmodel(technoname
, transname
, transtype
, transcase
, L
, W
, 0)))
2103 switch(ptmodel
->MODELTYPE
) {
2104 case MCC_BSIM3V3
: RapportIds
= mcc_calcIDS_bsim3v3(ptmodel
, 0.0, vdd
, vdd
, W
, L
, T1
,NULL
)
2105 /mcc_calcIDS_bsim3v3(ptmodel
, 0.0, vdd
, vdd
, W
, L
, T0
,NULL
) ;
2107 case MCC_BSIM4
: RapportIds
= mcc_calcIDS_bsim4 (ptmodel
, 0.0, vdd
, vdd
, W
, L
, T1
,NULL
)
2108 /mcc_calcIDS_bsim4 (ptmodel
, 0.0, vdd
, vdd
, W
, L
, T0
,NULL
) ;
2111 case MCC_MPSP
: RapportIds
= mcc_calcIDS_psp (ptmodel
, 0.0, vdd
, vdd
, W
, L
, T1
,NULL
)
2112 /mcc_calcIDS_psp (ptmodel
, 0.0, vdd
, vdd
, W
, L
, T0
,NULL
) ;
2114 case MCC_EXTMOD
: RapportIds
= mcc_calcIDS_ext(ptmodel
, 0.0, vdd
, vdd
, W
, L
, T1
,NULL
)
2115 /mcc_calcIDS_ext(ptmodel
, 0.0, vdd
, vdd
, W
, L
, T0
,NULL
) ;
2118 case MCC_MOS2
: RapportIds
= 0.0 ;
2125 /********************************************************************************************/
2126 /* Fonction de calcul du derating en tension */
2127 /********************************************************************************************/
2128 double mcc_calcRapIdsVolt(char *technoname
, char *transname
, int transtype
,
2129 int transcase
, double L
, double W
, double temp
, double V0
, double V1
)
2131 mcc_modellist
*ptmodel
;
2132 double RapportIds
= 1.0 ;
2134 if(!(ptmodel
= mcc_getmodel(technoname
, transname
, transtype
, transcase
, L
, W
, 0)))
2137 switch(ptmodel
->MODELTYPE
) {
2138 case MCC_BSIM3V3
: RapportIds
= mcc_calcIDS_bsim3v3 (ptmodel
, 0.0, V1
, V1
, W
, L
, temp
,NULL
)
2139 /mcc_calcIDS_bsim3v3 (ptmodel
, 0.0, V0
, V0
, W
, L
, temp
,NULL
) ;
2141 case MCC_BSIM4
: RapportIds
= mcc_calcIDS_bsim4 (ptmodel
, 0.0, V1
, V1
, W
, L
,temp
,NULL
)
2142 /mcc_calcIDS_bsim4 (ptmodel
, 0.0, V0
, V0
, W
, L
,temp
,NULL
) ;
2145 case MCC_MPSP
: RapportIds
= mcc_calcIDS_psp (ptmodel
, 0.0, V1
, V1
, W
, L
,temp
,NULL
)
2146 /mcc_calcIDS_psp (ptmodel
, 0.0, V0
, V0
, W
, L
,temp
,NULL
) ;
2148 case MCC_EXTMOD
: RapportIds
= mcc_calcIDS_ext(ptmodel
, 0.0, V1
, V1
, W
, L
,temp
,NULL
)
2149 /mcc_calcIDS_ext(ptmodel
, 0.0, V0
, V0
, W
, L
,temp
,NULL
) ;
2152 case MCC_MOS2
: RapportIds
= 0.0 ;
2159 /******************************************************************************\
2161 Calcul des tensions degradees
2163 \******************************************************************************/
2164 struct mcc_vdeg_fn
{
2165 mcc_modellist
*ptmodel
;
2169 elp_lotrs_param
*lotrsparam
;
2173 /******************************************************************************\
2174 FUNCTION : mcc_calcVDDDEG_com_fn
2175 On recherche la tension degradee (Vs) qui satisfait : VGS = VTH (vd,vbs)
2176 Vg = VDD, on obtient donc : VDD - Vs = VTH <=> VTH + Vs - VDD = 0
2177 \******************************************************************************/
2179 int mcc_calcVDDDEG_com_fn( struct mcc_vdeg_fn
*data
, double vs
, double *vth
)
2181 *vth
= mcc_calcVTH( data
->ptmodel
->TECHNO
->NAME
,
2183 data
->ptmodel
->TYPE
,
2184 data
->ptmodel
->CASE
,
2188 data
->lotrsparam
->VBULK
-vs
,
2192 ) + vs
- data
->vdd
;
2196 double mcc_calcVDDDEG_com (mcc_modellist
*ptmodel
, char *transname
,
2198 double vdd
, double temp
, double step
,
2199 elp_lotrs_param
*lotrsparam
)
2201 static int nbcall
=0;
2202 struct mcc_vdeg_fn data
;
2203 double x0
, x1
, vdeg
;
2206 if (ptmodel
->TYPE
== MCC_PMOS
) {
2207 avt_errmsg(MCC_ERRMSG
, "019", AVT_ERROR
, ptmodel
->NAME
) ;
2212 data
.ptmodel
= ptmodel
;
2213 data
.transname
= transname
;
2217 data
.lotrsparam
= lotrsparam
;
2223 ret
= mbk_dichotomie( (int(*)(void*, double, double*)) mcc_calcVDDDEG_com_fn
,
2235 if( ret
!= MBK_DICHO_OK
) {
2237 avt_errmsg(MCC_ERRMSG
, "020", AVT_ERROR
, ptmodel
->NAME
,L
,W
, MCC_VDDmax
,MCC_VTN
,MCC_VDDmax
- MCC_VTN
);
2238 return MCC_VDDmax
- MCC_VTN
;
2243 /******************************************************************************\
2244 FUNCTION : mcc_calcVDDDEG_com_fn
2245 On recherche la tension degradee (Vs) qui satisfait : VGS = VTH (vds,vbs)
2246 Vg = 0, on obtient donc : - Vs = VTH <=> VTH + Vs = 0
2247 \******************************************************************************/
2249 int mcc_calcVSSDEG_com_fn( struct mcc_vdeg_fn
*data
, double vgs
, double *vth
)
2251 *vth
= mcc_calcVTH( data
->ptmodel
->TECHNO
->NAME
,
2253 data
->ptmodel
->TYPE
,
2254 data
->ptmodel
->CASE
,
2258 data
->lotrsparam
->VBULK
-vgs
,
2266 double mcc_calcVSSDEG_com (mcc_modellist
*ptmodel
, char *transname
,double L
, double W
,
2267 double vdd
, double temp
, double step
,
2268 elp_lotrs_param
*lotrsparam
)
2270 static int nbcall
=0;
2271 struct mcc_vdeg_fn data
;
2272 double x0
, x1
, vdeg
;
2275 if(ptmodel
->TYPE
== MCC_NMOS
) {
2276 avt_errmsg(MCC_ERRMSG
, "021", AVT_ERROR
, ptmodel
->NAME
) ;
2281 data
.ptmodel
= ptmodel
;
2282 data
.transname
= transname
;
2286 data
.lotrsparam
= lotrsparam
;
2292 ret
= mbk_dichotomie( (int(*)(void*, double, double*)) mcc_calcVSSDEG_com_fn
,
2304 if( ret
!= MBK_DICHO_OK
) {
2305 avt_errmsg(MCC_ERRMSG
, "022", AVT_ERROR
, ptmodel
->NAME
,L
,W
,MCC_VTP
);
2311 /******************************************************************************\
2312 Function : mcc_get_min_max ()
2313 \******************************************************************************/
2314 void mcc_get_min_max (double *max
,double *min
, double a
, double b
, double c
, double d
)
2334 /******************************************************************************\
2335 Function : mcc_PrintQint ()
2336 \******************************************************************************/
2337 void mcc_PrintQint (char *technoname
, char *transname
,
2338 int transtype
, int transcase
, double L
, double W
,
2339 double temp
, double vdd
,elp_lotrs_param
*lotrsparam
, char *optnamevdd
, char *optnamevss
, int usechannel
, char location
)
2341 mcc_modellist
*ptmodel
;
2343 //double max=-1.0e50,min=+1.0e50;
2345 double La_Wa
= 1.0 ;
2352 char filename
[1024];
2353 char spifilename
[1024];
2355 int dec
=0, decusechannel
=0, j
, i
, k
, idx
, l
, m
;
2356 double vds
, vgs
, vfixe
, vs
;
2369 if (transtype
== MCC_NMOS
) j
=0; else j
=1;
2370 if (!(ptmodel
= mcc_getmodel(technoname
, transname
, transtype
, transcase
, L
, W
, 0)))
2373 if( lotrsparam
->ISVBSSET
)
2374 vbs
= lotrsparam
->VBS
;
2376 vbs
= ( transtype
== MCC_NMOS
) ? lotrsparam
->VBULK
: lotrsparam
->VBULK
-MCC_VDDmax
;
2378 for (i
=0; i
<4; i
++) for (k
=0;k
<2;k
++) TRS_CURVS
.QINT_BSIM
[j
][k
][m
][i
]=mbkalloc(sizeof(double)*TRS_CURVS
.nb
);
2380 switch(ptmodel
->MODELTYPE
) {
2385 case MCC_BSIM3V3
: //=======> Influence de VGS
2386 switch( ptmodel
->MODELTYPE
) {
2388 La_Wa
= (L
+ mcc_calcDLC_bsim4 (ptmodel
, lotrsparam
, L
, W
))
2389 *(W
+mcc_calcDWC_bsim4 (ptmodel
, lotrsparam
, L
, W
));
2392 La_Wa
= (L
+ mcc_calcDLC_bsim3v3(ptmodel
, L
, W
))
2393 *(W
+mcc_calcDWC_bsim3v3(ptmodel
, L
, W
));
2402 for( l
=0 ; l
<=1 ; l
++ ) {
2414 sprintf (filename
,"VGS_%s_L%ld_W%ld_vdd", transname
,(long)(L
*1.0e9
+0.5),(long)(W
*1.0e9
+0.5));
2415 if( l
== 0 && optnamevdd
!=NULL
)
2416 sprintf( filename
, "%s_%c", mcc_debug_prefix(optnamevdd
), location
);
2417 if( l
== 1 && optnamevss
!=NULL
)
2418 sprintf( filename
, "%s_%c", mcc_debug_prefix(optnamevss
), location
);
2420 if (( file
= mbkfopen (filename
,"dat",WRITE_TEXT
))) {
2421 avt_printExecInfo(file
, "#", "", "");
2422 if( location
== 'G' )
2427 if( transtype
==MCC_NMOS
)
2432 if( location
== 'G' ) {
2434 fprintf( file
, "# vds = %g\n", vds
);
2438 fprintf( file
, "# vgs = %g\n", vgs
);
2440 if (!usechannel
) fprintf (file
,"# %s Qg Qb Qs Qd Qtot\n",nvar
);
2441 else fprintf (file
,"# %s Qg Qb Qd Qtot\n",nvar
);
2443 for (var
= 0.0, i
=0 ; var
<= vdd
; var
+=MCC_DC_STEP
, i
++) {
2445 if( location
== 'G' )
2450 switch( ptmodel
->MODELTYPE
) {
2452 mcc_calcQint_bsim4 (ptmodel
, L
, W
,
2453 temp
, vgs
, vbs
, vds
,
2459 mcc_calcQint_psp (ptmodel
, L
, W
,
2460 temp
, vgs
, vbs
, vds
,
2465 mcc_calcQint_ext(ptmodel
, L
, W
,
2466 temp
, vgs
, vbs
, vds
,
2471 mcc_calcQint_bsim3v3 (ptmodel
, L
, W
,
2472 temp
, vgs
, vbs
, vds
,
2483 if (transtype
==MCC_NMOS
) idx
=i
; else idx
=TRS_CURVS
.nb
-i
-1;
2484 if (idx
>=0 && idx
<TRS_CURVS
.nb
)
2486 TRS_CURVS
.QINT_BSIM
[j
][l
][m
][0][idx
]=signe
*Qg
;
2487 TRS_CURVS
.QINT_BSIM
[j
][l
][m
][1][idx
]=signe
*Qb
;
2488 TRS_CURVS
.QINT_BSIM
[j
][l
][m
][2][idx
]=signe
*Qs
;
2489 TRS_CURVS
.QINT_BSIM
[j
][l
][m
][3][idx
]=signe
*Qd
;
2492 fprintf (file
,"%.3e %.3e %.3e %.3e %.3e %.3e\n",
2493 var
,signe
*Qg
,signe
*Qb
,signe
*Qs
,signe
*Qd
,signe
*Qtot
);
2495 fprintf (file
,"%.3e %.3e %.3e %.3e %.3e\n",
2496 var
,signe
*Qg
,signe
*Qb
,signe
*Qs
+signe
*Qd
,signe
*Qtot
);
2500 if ((file
= mbkfopen (filename
,"plt",WRITE_TEXT
))) {
2501 avt_printExecInfo(file
, "#", "", "");
2502 if ( transtype
== MCC_NMOS
)
2503 sprintf (spifilename
,"nmos_qint_%c.spice.dat",location
);
2505 sprintf (spifilename
,"pmos_qint_%c.spice.dat",location
);
2506 fprintf (file
,"set term %s\n", V_STR_TAB
[__AVT_GNUPLOT_TERM
].VALUE
);
2507 if( location
=='G' ) {
2508 fprintf (file
,"set xlabel \"VG (V)\"\n");
2509 fprintf (file
,"set title \"Intrinsic charge, VDS=%gV\"\n",vds
);
2512 fprintf (file
,"set xlabel \"VD (V)\"\n");
2513 fprintf (file
,"set title \"Intrinsic charge, VGS=%gV\"\n",vgs
);
2515 fprintf (file
,"set ylabel \"Q (C)\"\n");
2516 fprintf (file
,"set grid\n");
2517 fprintf(file
,"plot '%s.dat' using 1:2 title 'Qg %s' with lines,\\\n", filename
, mcc_getmccname(ptmodel
)) ;
2518 fprintf(file
,"'%s' using 1:%d title 'Qg spice' with lines,\\\n",mcc_debug_prefix(spifilename
),dec
+1);
2519 fprintf(file
,"'%s.dat' using 1:3 title 'Qb %s' with lines,\\\n",filename
, mcc_getmccname(ptmodel
));
2520 fprintf(file
,"'%s' using 1:%d title 'Qb spice' with lines,\\\n",mcc_debug_prefix(spifilename
),dec
+2);
2523 fprintf(file
,"'%s.dat' using 1:4 title 'Qs %s' with lines,\\\n", filename
, mcc_getmccname(ptmodel
));
2524 fprintf(file
,"'%s' using 1:%d title 'Qs spice' with lines,\\\n", mcc_debug_prefix(spifilename
),dec
+3);
2526 fprintf(file
,"'%s.dat' using 1:%d title 'Qd %s' with lines,\\\n", filename
,5+decusechannel
, mcc_getmccname(ptmodel
));
2527 fprintf(file
,"'%s' using 1:%d title 'Qd spice' with lines,\\\n", mcc_debug_prefix(spifilename
),dec
+4);
2528 fprintf(file
,"'%s.dat' using 1:%d title 'Qtot %s' with lines,\\\n", filename
,6+decusechannel
, mcc_getmccname(ptmodel
));
2529 fprintf(file
,"'%s' using 1:%d title 'Qtot spice' with lines\\\n\n", mcc_debug_prefix(spifilename
),dec
+5 );
2530 fprintf(file
,"pause -1 'Hit CR to finish'");
2535 //=======> Influence de VGS a VDS=0
2546 /******************************************************************************\
2550 \******************************************************************************/
2551 void mcc_DisplayInfos (char *technoname
, char *transname
,
2552 int transtype
, int transcase
, double L
, double W
,
2553 double temp
, double vgs
, double vbs
, double vds
,
2554 double vdd
,elp_lotrs_param
*lotrsparam
)
2556 double vbx
,cgs
,cgp
,cgd
,cgdc
,cgsi
,cgsic
,cds
,cdp
,cdw
,cgsu
,cgsd
;
2558 double cbxgucal
,cbxgdcal
;
2559 double cdsu
,cdsd
,cdpu
,cdpd
,cdwu
,cdwd
;
2560 double cgscal
,cgpcal
,cgdcal
,cgdccal
,cgsical
,cgsiccal
,cdscal
,cdpcal
,cdwcal
;
2561 double cdsucal
,cdpucal
,cdwucal
;
2562 double cdsdcal
,cdpdcal
,cdwdcal
;
2563 double cgsucal
,cgsdcal
;
2564 double xw
,xl
,Leff
, Weff
, La
, Wa
;
2565 double aire
,aireScaled
,perim
,perimScaled
,Weffcj
,WeffcjScaled
;
2566 double LaWa
,LaWaScaled
;
2572 mcc_get_area_perim();
2575 aire
= W
*MCC_DIF
*1.0e-6 ;
2576 perim
= 2.0*(MCC_DIF
*1.0e-6+W
) ;
2577 xl
= mcc_getXL (technoname
, transname
, transtype
, transcase
, L
,W
);
2578 xw
= mcc_getXW (technoname
, transname
, transtype
, transcase
, L
,W
);
2579 Leff
= L
*xl
+ mcc_calcDL (technoname
, transname
, transtype
, transcase
, L
, W
, lotrsparam
);
2580 Weff
= W
*xw
+ mcc_calcDW (technoname
, transname
, transtype
, transcase
, L
, W
, lotrsparam
);
2581 La
= L
*xl
+ mcc_calcDLC (technoname
, transname
, transtype
, transcase
, L
, W
, lotrsparam
);
2582 Wa
= W
*xw
+ mcc_calcDWC (technoname
, transname
, transtype
, transcase
, L
, W
, lotrsparam
);
2584 LaWaScaled
= LaWa
*1.0e12
;
2585 Weffcj
= W
*xw
+ mcc_calcDWCJ (technoname
, transname
, transtype
, transcase
, L
, W
, lotrsparam
, temp
);
2590 if ( transtype
== MCC_NMOS
) {
2591 aire
= MCC_ADN
*1.0e-6;
2592 perim
= MCC_PDN
*1.0e-6;
2595 cgs
= 0.5*(cgsu
+cgsd
);
2603 cds
= 0.5*(cdsu
+cdsd
);
2606 cdp
= 0.5*(cdpu
+cdpd
);
2609 cdw
= 0.5*(cdwu
+cdwd
);
2612 aire
= MCC_ADP
*1.0e-6;
2613 perim
= MCC_PDP
*1.0e-6;
2616 cgs
= 0.5*(cgsu
+cgsd
);
2624 cds
= 0.5*(cdsu
+cdsd
);
2627 cdp
= 0.5*(cdpu
+cdpd
);
2630 cdw
= 0.5*(cdwu
+cdwd
);
2635 //==> display Infos :
2636 avt_log(LOGMCC
,2,"Dimensions : L = %8.3g W = %8.3g Aire = %8.3g Perim = %8.3g\n",L
,W
,aire
,perim
);
2637 avt_log(LOGMCC
,2," : Leff = %8.3g Weff = %8.3g Aire (eff) = %8.3g\n",Leff
,Weff
,Leff
*Weff
);
2638 avt_log(LOGMCC
,2," : Lactif = %8.3g Wactif = %8.3g Aire (active) = %8.3g\n",La
,Wa
,La
*Wa
);
2639 avt_log(LOGMCC
,2," : Weffcj = %8.3g\n\n",Weffcj
);
2640 WeffcjScaled
= Weffcj
*1.0e6
;
2641 aireScaled
= aire
*1.0e12
;
2642 perimScaled
= perim
*1.0e6
;
2644 cgscal
= cgs
*LaWaScaled
;
2645 cgsucal
= cgsu
*LaWaScaled
;
2646 cgsdcal
= cgsd
*LaWaScaled
;
2647 cgpcal
= cgp
*WeffcjScaled
;
2648 cgpcal
= cgp
*Wa
*1.0e6
;
2649 cgdcal
= cgd
*LaWaScaled
;
2650 cgdccal
= cgdc
*LaWaScaled
;
2651 cgsical
= cgsi
*LaWaScaled
;
2652 cgsiccal
= cgsic
*LaWaScaled
;
2653 cdscal
= cds
*aireScaled
;
2654 cdsucal
= cdsu
*aireScaled
;
2655 cdsdcal
= cdsd
*aireScaled
;
2656 cdpcal
= cdp
*perimScaled
;
2657 cdpucal
= cdpu
*perimScaled
;
2658 cdpdcal
= cdpd
*perimScaled
;
2659 cbxgucal
= cbxgu
*WeffcjScaled
;
2660 cbxgdcal
= cbxgd
*WeffcjScaled
;
2661 cdwcal
= cdw
*WeffcjScaled
;
2662 cdwucal
= cdwu
*WeffcjScaled
;
2663 cdwdcal
= cdwd
*WeffcjScaled
;
2664 cdwcal
= cdw
*Weff
*1.0e6
;
2666 avt_log(LOGMCC
,2,"Capacitances (pF) : CGS = %g \n",cgscal
);
2667 avt_log(LOGMCC
,2," : CGSU = %g \n",cgsucal
);
2668 avt_log(LOGMCC
,2," : CGSD = %g \n",cgsdcal
);
2669 avt_log(LOGMCC
,2," : CGP (Weffcj) = %g \n",cgpcal
);
2670 avt_log(LOGMCC
,2," : CGP (Wactif) = %g \n",cgpcal
);
2671 avt_log(LOGMCC
,2," : CGD = %g \n",cgdcal
);
2672 avt_log(LOGMCC
,2," : CGDC = %g \n",cgdccal
);
2673 avt_log(LOGMCC
,2," : CGSI = %g \n",cgsical
);
2674 avt_log(LOGMCC
,2," : CGSIC = %g \n",cgsiccal
);
2675 avt_log(LOGMCC
,2," : CDS = %g \n",cdscal
);
2676 avt_log(LOGMCC
,2," : CDSU = %g \n",cdsucal
);
2677 avt_log(LOGMCC
,2," : CDSD = %g \n",cdsdcal
);
2678 avt_log(LOGMCC
,2," : CDP = %g \n",cdpcal
);
2679 avt_log(LOGMCC
,2," : CDPU = %g \n",cdpucal
);
2680 avt_log(LOGMCC
,2," : CDPD = %g \n",cdpdcal
);
2681 avt_log(LOGMCC
,2," : CBXGU (Weffcj) = %g \n",cbxgucal
);
2682 avt_log(LOGMCC
,2," : CBXGD (Weffcj) = %g \n",cbxgdcal
);
2683 avt_log(LOGMCC
,2," : CDW (Weffcj) = %g \n",cdwcal
);
2684 avt_log(LOGMCC
,2," : CDWU (Weffcj) = %g \n",cdwucal
);
2685 avt_log(LOGMCC
,2," : CDWD (Weffcj) = %g \n",cdwdcal
);
2686 avt_log(LOGMCC
,2," : CDW (Weff) = %g \n",cdwcal
);
2687 avt_log(LOGMCC
,2,"Capacitances (pF) ==> Total Grid capa : %g\n",cgscal
+2.0*cgpcal
);
2688 avt_log(LOGMCC
,2," ==> Total Grid (UP) capa : %g\n",cgsucal
+2.0*cgpcal
);
2689 avt_log(LOGMCC
,2," ==> Total Grid (DN) capa : %g\n",cgsdcal
+2.0*cgpcal
);
2690 avt_log(LOGMCC
,2," ==> Total Source/Drain capa : %g\n",
2691 cdscal
+cdpcal
+cdwcal
);
2692 avt_log(LOGMCC
,2," ==> Total Source/Drain (UP) capa : %g\n",
2693 cdsucal
+cdpucal
+cdwucal
);
2694 avt_log(LOGMCC
,2," ==> Total Source/Drain (DN) capa : %g\n",
2695 cdsdcal
+cdpdcal
+cdwdcal
);
2696 avt_log(LOGMCC
,2," ==> Total Source/Drain without CGP (UP) capa : %g\n",
2697 cdsucal
+cdpucal
+cbxgucal
);
2698 avt_log(LOGMCC
,2," ==> Total Source/Drain without CGP (DN) capa : %g\n",
2699 cdsdcal
+cdpdcal
+cbxgdcal
);
2700 // Min and Max Input Capacitances
2701 if ( transtype
== MCC_NMOS
) {
2702 avt_log(LOGMCC
,2,"== Model %s NMOS (L = %gU W = %gU) ==\n",MCC_TNMODEL
,MCC_LN
,MCC_WN
);
2703 avt_log(LOGMCC
,2,"*************************\n");
2704 avt_log(LOGMCC
,2,"* UP transition *\n");
2705 avt_log(LOGMCC
,2,"*************************\n");
2707 avt_log(LOGMCC
,2,"--> input capa Min = %g pF\n",MCC_CGSU_N_MIN
*LaWa
+MCC_CGPU_N_MIN
*2.0*Wa
);
2708 avt_log(LOGMCC
,2,"--> input capa Max = %g pF\n",MCC_CGSU_N_MAX
*LaWa
+MCC_CGPU_N_MAX
*2.0*Wa
);
2710 avt_log(LOGMCC
,2,"*************************\n");
2711 avt_log(LOGMCC
,2,"* DOWN transition *\n");
2712 avt_log(LOGMCC
,2,"*************************\n");
2713 avt_log(LOGMCC
,2,"--> input capa Min = %g pF\n",MCC_CGSD_N_MIN
*LaWa
+MCC_CGPD_N_MIN
*2.0*Wa
);
2714 avt_log(LOGMCC
,2,"--> input capa Max = %g pF\n\n",MCC_CGSD_N_MAX
*LaWa
+MCC_CGPD_N_MAX
*2.0*Wa
);
2717 avt_log(LOGMCC
,2,"== Model %s PMOS (L = %gU W = %gU ) ==\n",MCC_TPMODEL
,MCC_LP
,MCC_WP
);
2718 avt_log(LOGMCC
,2,"*************************\n");
2719 avt_log(LOGMCC
,2,"* UP transition *\n");
2720 avt_log(LOGMCC
,2,"*************************\n");
2721 avt_log(LOGMCC
,2,"--> input capa Min = %g pF\n",MCC_CGSU_P_MIN
*LaWa
+MCC_CGPU_P_MIN
*2.0*Wa
);
2722 avt_log(LOGMCC
,2,"--> input capa Max = %g pF\n",MCC_CGSU_P_MAX
*LaWa
+MCC_CGPU_P_MAX
*2.0*Wa
);
2724 avt_log(LOGMCC
,2,"*************************\n");
2725 avt_log(LOGMCC
,2,"* DOWN transition *\n");
2726 avt_log(LOGMCC
,2,"*************************\n");
2727 avt_log(LOGMCC
,2,"--> input capa Min = %g pF\n",MCC_CGSD_P_MIN
*LaWa
+MCC_CGPD_P_MIN
*2.0*Wa
);
2728 avt_log(LOGMCC
,2,"--> input capa Max = %g pF\n\n",MCC_CGSD_P_MAX
*LaWa
+MCC_CGPD_P_MAX
*2.0*Wa
);
2732 /******************************************************************************\
2734 Function : mcc_calcQint
2736 Compute Intrinsic Charges.
2738 \******************************************************************************/
2739 void mcc_calcQint (char *technoname
, char *transname
,
2740 int transtype
, int transcase
, double L
, double W
,
2741 double temp
, double vgs
,double vbs
, double vds
,
2742 double *ptQg
,double *ptQs
, double *ptQd
, double *ptQb
,
2743 elp_lotrs_param
*lotrsparam
)
2745 mcc_modellist
*ptmodel
;
2747 if(!(ptmodel
= mcc_getmodel(technoname
, transname
, transtype
, transcase
, L
, W
, 0)))
2750 switch(ptmodel
->MODELTYPE
) {
2751 case MCC_BSIM3V3
: mcc_calcQint_bsim3v3 (ptmodel
, L
, W
, temp
, vgs
,vbs
,vds
,ptQg
,ptQs
,ptQd
,ptQb
,lotrsparam
) ;
2753 case MCC_BSIM4
: mcc_calcQint_bsim4 (ptmodel
, L
, W
, temp
, vgs
,vbs
,vds
,ptQg
,ptQs
,ptQd
,ptQb
,lotrsparam
) ;
2756 case MCC_MPSP
: mcc_calcQint_psp (ptmodel
, L
, W
, temp
, vgs
,vbs
,vds
,ptQg
,ptQs
,ptQd
,ptQb
,lotrsparam
) ;
2758 case MCC_EXTMOD
: mcc_calcQint_ext(ptmodel
, L
, W
, temp
, vgs
,vbs
,vds
,ptQg
,ptQs
,ptQd
,ptQb
,lotrsparam
) ;
2767 double mcc_calcCGS( char *technoname
,
2778 elp_lotrs_param
*lotrsparam
2781 mcc_modellist
*ptmodel
;
2782 double Qinit
=0.0,Qfinal
=0.0,cgs
=0.0,vbs
;
2784 if(!(ptmodel
= mcc_getmodel(technoname
, transname
, transtype
, transcase
, L
, W
, 0)))
2787 if( lotrsparam
->ISVBSSET
)
2788 vbs
= lotrsparam
->VBS
;
2790 vbs
= ( transtype
== MCC_NMOS
) ? lotrsparam
->VBULK
: lotrsparam
->VBULK
-MCC_VDDmax
;
2791 switch(ptmodel
->MODELTYPE
) {
2798 if ( mcc_getparam_quick(ptmodel
,__MCC_QUICK_XPART
) < 0.0)
2800 mcc_calcQint (technoname
, transname
,
2801 transtype
,transcase
,L
, W
,
2802 temp
, vgsi
, vbs
, vdsi
,
2803 &Qinit
, NULL
, NULL
, NULL
,lotrsparam
);
2804 mcc_calcQint (technoname
, transname
,
2805 transtype
,transcase
,L
, W
,
2806 temp
, vgsf
, vbs
, vdsf
,
2807 &Qfinal
, NULL
, NULL
, NULL
,lotrsparam
);
2808 cgs
= fabs((Qfinal
-Qinit
)/(vgsf
-vgsi
));
2811 case MCC_MOS2
: cgs
= mcc_calcCGS_com (ptmodel
) ;
2818 /******************************************************************************\
2820 Funciton : mcc_calcCGSD
2822 Compute CGS for a down transition
2824 \******************************************************************************/
2825 double mcc_calcCGSD (char *technoname
, char *transname
,
2826 int transtype
, int transcase
, double L
, double W
,
2827 double temp
, double vdd
, double vfinal
, int vdsnull
, elp_lotrs_param
*lotrsparam
)
2829 mcc_modellist
*ptmodel
;
2830 double Qinit
=0.0,Qfinal
=0.0,cgs
=0.0,vbs
;
2833 if(!(ptmodel
= mcc_getmodel(technoname
, transname
, transtype
, transcase
, L
, W
, 0)))
2836 if( lotrsparam
->ISVBSSET
)
2837 vbs
= lotrsparam
->VBS
;
2839 vbs
= ( transtype
== MCC_NMOS
) ? lotrsparam
->VBULK
: lotrsparam
->VBULK
-MCC_VDDmax
;
2840 switch(ptmodel
->MODELTYPE
) {
2847 if ( mcc_getparam_quick(ptmodel
,__MCC_QUICK_XPART
) < 0.0)
2849 if (ptmodel
->TYPE
== MCC_NMOS
) {
2856 //vdsf = vdd/2.0 - MCC_VTN;
2859 mcc_calcQint (technoname
, transname
,
2860 transtype
,transcase
,L
, W
,
2861 temp
, vdd
, vbs
, vdsi
,
2862 &Qinit
, NULL
, NULL
, NULL
,lotrsparam
);
2863 mcc_calcQint (technoname
, transname
,
2864 transtype
,transcase
,L
, W
,
2865 temp
, vfinal
, vbs
, vdsf
,
2866 &Qfinal
, NULL
, NULL
, NULL
,lotrsparam
);
2875 //vdsf = vdd/2.0 + MCC_VTP;
2878 mcc_calcQint (technoname
, transname
,
2879 transtype
,transcase
,L
, W
,
2880 temp
, 0.0, vbs
, vdsi
,
2881 &Qinit
, NULL
, NULL
, NULL
,
2883 mcc_calcQint (technoname
, transname
,
2884 transtype
,transcase
,L
, W
,
2885 temp
, vfinal
, vbs
, vdsf
,
2886 &Qfinal
, NULL
, NULL
, NULL
,
2889 cgs
= fabs((Qfinal
-Qinit
)/(vdd
/2.0));
2892 case MCC_MOS2
: cgs
= mcc_calcCGS_com (ptmodel
) ;
2899 /******************************************************************************\
2901 Funciton : mcc_calcCGSU
2903 Compute CGS for an up transition
2905 \******************************************************************************/
2906 double mcc_calcCGSU (char *technoname
, char *transname
,
2907 int transtype
, int transcase
, double L
, double W
,
2908 double temp
, double vdd
, double vfinal
, int vdsnull
,elp_lotrs_param
*lotrsparam
)
2910 mcc_modellist
*ptmodel
;
2911 double Qinit
=0.0,Qfinal
=0.0,cgs
=0.0,vbs
;
2914 if(!(ptmodel
= mcc_getmodel(technoname
, transname
, transtype
, transcase
, L
, W
, 0)))
2918 if( lotrsparam
->ISVBSSET
)
2919 vbs
= lotrsparam
->VBS
;
2921 vbs
= ( transtype
== MCC_NMOS
) ? lotrsparam
->VBULK
: lotrsparam
->VBULK
-MCC_VDDmax
;
2922 switch(ptmodel
->MODELTYPE
) {
2927 case MCC_BSIM4
: // UP transition
2928 if ( mcc_getparam_quick(ptmodel
,__MCC_QUICK_XPART
) < 0.0)
2930 if (ptmodel
->TYPE
== MCC_NMOS
) {
2937 //vdsf = MCC_VTN + vdd/2.0;
2940 mcc_calcQint (technoname
, transname
,
2941 transtype
,transcase
,L
, W
,
2942 temp
, 0.0, vbs
, vdsi
,
2943 &Qinit
, NULL
, NULL
, NULL
,
2945 mcc_calcQint (technoname
, transname
,
2946 transtype
,transcase
,L
, W
,
2947 temp
, vfinal
, vbs
, vdsf
,
2948 &Qfinal
, NULL
, NULL
, NULL
,
2958 //vdsf = -MCC_VTP + vdd/2.0;
2961 mcc_calcQint (technoname
, transname
,
2962 transtype
,transcase
,L
, W
,
2963 temp
, vdd
, vbs
, vdsi
,
2964 &Qinit
, NULL
, NULL
, NULL
,
2966 mcc_calcQint (technoname
, transname
,
2967 transtype
,transcase
,L
, W
,
2968 temp
, vfinal
, vbs
, vdsf
,
2969 &Qfinal
, NULL
, NULL
, NULL
,
2972 cgs
= fabs((Qfinal
-Qinit
)/(vdd
/2.0));
2975 case MCC_MOS2
: cgs
= mcc_calcCGS_com (ptmodel
) ;
2982 double mcc_calcCGPO( char *technoname
, char *transname
,
2983 int transtype
, int transcase
, double L
, double W
,
2984 double temp
, double vg
,
2985 double vd1
, double vd2
,
2986 elp_lotrs_param
*lotrsparam
)
2989 double ptQov1
, ptQov2
;
2994 mcc_calcCGP (technoname
, transname
, transtype
, transcase
, L
, W
, vgd1
, &ptQov1
, lotrsparam
, temp
);
2995 mcc_calcCGP (technoname
, transname
, transtype
, transcase
, L
, W
, vgd2
, &ptQov2
, lotrsparam
, temp
);
2996 cgpo
=fabs( ( ptQov2
- ptQov1
) / ( vgd2
- vgd1
) );
3002 /******************************************************************************\
3004 Function : mcc_GetInputCapa
3008 \******************************************************************************/
3010 void mcc_GetInputCapa ( char *technoname
, char *transname
,
3011 int transtype
, int transcase
, double L
, double W
,
3012 double temp
, double vg1
, double vg2
,
3013 double vd1
, double vd2
, double vs1
, double vs2
,
3014 elp_lotrs_param
*lotrsparam
,
3015 double *ptcgs
, double *ptcgd
, double *ptcgp
)
3018 double vgs1
,vgs2
,vds1
,vds2
,vgd1
,vgd2
;
3019 double ptQg1
,ptQd1
,ptQg2
,ptQd2
;
3020 double ptQov1
,ptQov2
;
3021 double cgp1
,cgp2
,cgs
,cgp
,cgd
,vbs
;
3031 if ( ptcgs
|| ptcgd
) {
3033 if( lotrsparam
->ISVBSSET
)
3034 vbs
= lotrsparam
->VBS
;
3036 vbs
= ( transtype
== MCC_NMOS
) ? lotrsparam
->VBULK
: lotrsparam
->VBULK
-MCC_VDDmax
;
3041 // ===> initial charges
3042 mcc_calcQint (technoname
, transname
,
3043 transtype
, transcase
, L
, W
,
3044 temp
, vgs1
,vbs
,vds1
,
3045 &ptQg1
,NULL
, &ptQd1
, NULL
,
3048 // ===> final charges
3049 mcc_calcQint (technoname
, transname
,
3050 transtype
, transcase
, L
, W
,
3051 temp
, vgs2
,vbs
,vds2
,
3052 &ptQg2
,NULL
, &ptQd2
, NULL
,
3055 cgs
= ( ptQg2
-ptQg1
) / delta_vg
;
3056 cgd
= fabs (( ptQd2
-ptQd1
) / delta_vg
);
3062 cgp1
= mcc_calcCGP (technoname
, transname
,
3063 transtype
, transcase
, L
, W
, vgd1
,&ptQov1
,lotrsparam
,temp
);
3064 cgp2
= mcc_calcCGP (technoname
, transname
,
3065 transtype
, transcase
, L
, W
, vgd2
,&ptQov2
,lotrsparam
,temp
);
3066 cgp
= (ptQov2
-ptQov1
) / delta_vg
;
3068 cgp1
= mcc_calcCGP (technoname
, transname
,
3069 transtype
, transcase
, L
, W
, vgs1
,&ptQov1
,lotrsparam
,temp
);
3070 cgp2
= mcc_calcCGP (technoname
, transname
,
3071 transtype
, transcase
, L
, W
, vgs2
,&ptQov2
,lotrsparam
,temp
);
3072 cgp
+= (ptQov2
-ptQov1
) / delta_vg
;
3073 cgp
*= 0.5; // mult by 0.5 because we give the source and drain olverlap capa
3074 // cgp will be mult by 2.0 in the future to have the total overlap capa of
3079 /*--------------------------------------------------------*\
3080 Caution : cgp is taking account of drain and source ovelap charges,
3081 so we only need to mult this capa by Wa and not by 2.0*Wa.
3082 We used to approximate this capa by considering that : Qov(drain) = Qov(source)
3083 which explains the mult factor 2.0. Now, we distinguish these 2 charges
3084 \*--------------------------------------------------------*/
3086 if ( ptcgs
) *ptcgs
= fabs(cgs
);
3087 if ( ptcgp
) *ptcgp
= fabs(cgp
);
3088 if ( ptcgd
) *ptcgd
= fabs(cgd
);
3091 /******************************************************************************\
3092 FUNCTION : mcc_calc_vt ( temp )
3093 \******************************************************************************/
3094 double mcc_calc_vt (double temp
)
3096 double T
= temp
+ MCC_KELVIN
;
3099 VtT
= MCC_KB
* T
/ MCC_Q
;
3103 /******************************************************************************\
3104 FUNCTION : mcc_calc_eg()
3106 Energy band gap of Si
3107 \******************************************************************************/
3108 double mcc_calc_eg(double temp
)
3111 double T
= temp
+ MCC_KELVIN
;
3113 Eg
= 1.16 - ((7.02e-4 * T
*T
) / (T
+1108.0));
3118 /******************************************************************************\
3120 * FUNC : mcc_compute_RD_RS
3121 RSeff and RDeff computation
3122 \******************************************************************************/
3123 void mcc_compute_RD_RS ( mcc_modellist
*ptmodel
, double Weff
,
3124 double *ptRS
, double *ptRD
, elp_lotrs_param
*lotrsparam
)
3127 double RSH
, RSC
, RDC
;
3128 double RS
, RD
, LDscal
, LDIFscal
, HDIFscal
;
3129 double DW
,DWscal
, Wj
;
3131 double scalm
, LD
, LDIF
, HDIF
, WMLT
;
3134 if (!ptmodel
|| !lotrsparam
) return;
3136 nrs
= lotrsparam
->PARAM
[elpNRS
];
3137 nrd
= lotrsparam
->PARAM
[elpNRD
];
3138 M
= lotrsparam
->PARAM
[elpM
];
3140 scalm
= 1; //TODO: check how it can take other value...
3142 RLEV
= MCC_ROUND (mcc_getparam_quick(ptmodel
,__MCC_QUICK_RLEV
));
3143 RSH
= mcc_getparam_quick(ptmodel
,__MCC_QUICK_RSH
);
3144 RSC
= mcc_getparam_quick(ptmodel
,__MCC_QUICK_RSC
);
3145 RDC
= mcc_getparam_quick(ptmodel
,__MCC_QUICK_RDC
);
3146 RS
= mcc_getparam_quick(ptmodel
,__MCC_QUICK_RS
);
3147 RD
= mcc_getparam_quick(ptmodel
,__MCC_QUICK_RD
);
3148 LD
= mcc_getparam_quick(ptmodel
,__MCC_QUICK_LD
);
3149 DW
= mcc_getparam_quick(ptmodel
,__MCC_QUICK_DW
);
3150 LDIF
= mcc_getparam_quick(ptmodel
,__MCC_QUICK_LDIF
);
3151 HDIF
= mcc_getparam_quick(ptmodel
,__MCC_QUICK_HDIF
);
3152 WMLT
= mcc_getparam_quick(ptmodel
,__MCC_QUICK_WMLT
);
3157 case 0 : if ( ptRS
) {
3158 if ( nrs
> 0.0 ) *ptRS
= (RSH
*nrs
+ RSC
) / M
;
3159 else *ptRS
= ( RS
+ RSC
) / M
;
3162 if ( nrd
> 0.0 ) *ptRD
= (RSH
*nrd
+ RDC
) / M
;
3163 else *ptRD
= ( RD
+ RDC
) / M
;
3166 case 1 : LDscal
= LD
*scalm
;
3167 LDIFscal
= LDIF
*scalm
;
3170 *ptRS
= (RS
*(LDscal
+LDIFscal
)/(M
*Wj
)+(nrs
*RSH
+RSC
)/M
);
3172 *ptRD
= (RD
*(LDscal
+LDIFscal
)/(M
*Wj
)+(nrd
*RSH
+RDC
)/M
);
3175 case 3 : LDscal
= LD
*scalm
;
3176 LDIFscal
= LDIF
*scalm
;
3177 HDIFscal
= HDIF
*scalm
*WMLT
;
3181 *ptRS
= (RS
*(LDscal
+LDIFscal
)/(M
*Wj
) + (RSH
*nrs
+RSC
)/M
);
3183 *ptRS
= (RS
*(LDscal
+LDIFscal
)/(M
*Wj
) + (HDIFscal
*RSH
)/(M
*Wj
) + RSC
/M
);
3187 *ptRD
= (RD
*(LDscal
+LDIFscal
)/(M
*Wj
) + (RSH
*nrs
+RDC
)/M
);
3189 *ptRD
= (RD
*(LDscal
+LDIFscal
)/(M
*Wj
) + (HDIFscal
*RSH
)/(M
*Wj
) + RDC
/M
);
3192 case 4 : LDscal
= LD
*scalm
;
3193 LDIFscal
= LDIF
*scalm
;
3194 HDIFscal
= HDIF
*scalm
*WMLT
;
3197 if ( LDIFscal
< 0.0 )
3199 else if ( nrs
> 0.0 )
3200 *ptRS
= (RS
*(LDscal
+LDIFscal
)/(M
*Weff
)+(nrs
*RSH
)/M
);
3202 *ptRS
= (RS
*(LDscal
+LDIFscal
)+HDIFscal
*RSH
)/(M
*Weff
);
3205 if ( LDIFscal
< 0.0 )
3207 else if ( nrd
> 0.0 )
3208 *ptRD
= (RD
*(LDscal
+LDIFscal
)/(M
*Weff
)+(nrd
*RSH
)/M
);
3210 *ptRD
= (RD
*(LDscal
+LDIFscal
)+HDIFscal
*RSH
)/(M
*Weff
);
3213 case 5 : if ( ptRS
) {
3214 if ( RS
> 0.0 ) *ptRS
= RS
/M
;
3215 else *ptRS
= nrs
*RSH
/M
;
3218 if ( RD
> 0.0 ) *ptRD
= RD
/M
;
3219 else *ptRD
= nrd
*RSH
/M
;
3222 case 6 : if ( ptRS
) {
3223 if ( nrs
> 0.0 ) *ptRS
= nrs
*RSH
/M
;
3227 if ( nrd
> 0.0 ) *ptRD
= nrd
*RSH
/M
;
3234 if ( nrs > 0.0 ) *ptRS = nrs*RSH/M;
3235 else *ptRS = LDIFeff/(M*Weff);
3238 if ( nrd > 0.0 ) *ptRD = nrd*RSH/M;
3239 else *ptRD = LDIFeff/(M*Weff);
3243 default: if ( ptRS
) *ptRS
= 0.0;
3244 if ( ptRD
) *ptRD
= 0.0;
3249 /******************************************************************************\
3251 * FUNC : mcc_calcDioCapa
3253 return the total capacitance from a diode model
3254 \******************************************************************************/
3255 double mcc_calcDioCapa ( char *technoname
, char *dioname
,
3256 int modtype
, int modcase
,
3257 double Va
, double Vc
, double temp
,
3258 double area
, double perim
3261 mcc_modellist
*ptmodel
;
3264 if ( (ptmodel
= mcc_getmodel(technoname
, dioname
, modtype
, modcase
, area
, perim
, 0)) )
3265 Capa
= mcc_dio_calcCapa ( ptmodel
, Va
, Vc
, temp
, area
, perim
);
3270 /******************************************************************************\
3272 * FUNC : mcc_dio_calcCDEP
3273 * CDEP is Depletion capacitance
3277 return the total capacitance: Capa = CDEPa + CDEPp + CIDFF + CMETAL + CPOLY
3278 \******************************************************************************/
3279 double mcc_dio_calcCapa ( mcc_modellist
*ptmodel
,
3280 double Va
, double Vc
, double temp
,
3281 double area
, double perim
3287 if (ptmodel
->TYPE
== MCC_DIODE
) {
3288 LEVEL
= MCC_ROUND(mcc_getparam_quick(ptmodel
,__MCC_QUICK_LEVEL
));
3290 case 1: capa
= mcc_dio_calcCapa_l1 (ptmodel
,Va
,Vc
,temp
,area
,perim
);
3292 case 2: capa
= mcc_dio_calcCapa_l2 (ptmodel
,Va
,Vc
,temp
,area
);
3294 case 3: capa
= mcc_dio_calcCapa_l3 (ptmodel
,area
);
3296 case 8: capa
= mcc_dio_calcCapa_l8 (ptmodel
,Va
,Vc
,temp
,area
,perim
);
3303 /******************************************************************************\
3305 * FUNC : mcc_dio_calcCapa_l1
3306 * CDEP is Depletion capacitance
3310 return the total capacitance: Capa = CDEPa + CDEPp + CIDFF + CMETAL + CPOLY
3311 \******************************************************************************/
3312 double mcc_dio_calcCapa_l1 ( mcc_modellist
*ptmodel
,
3313 double Va
, double Vc
, double temp
,
3314 double area
, double perim
3319 double FC
,FCS
,KMS
,CJO
,VJ
,MJ
;
3321 double CJOeff
,CJSWeff
;
3322 double SHRINK
,SCALE
=1.0,SCALM
,XOI
,XOM
,WP
,XP
,XM
;
3324 double LMeff
,WMeff
,LPeff
,WPeff
,XPeff
,XMeff
;
3325 double CMETAL
,CPOLY
,Capa
=0.0;
3326 double VJ_T
, PHP_T
, CJO_T
,CJSW_T
, dT
,qT
;
3327 double Vt_T
,Vt_Tnom
,Eg_T
,Eg_Tnom
;
3328 double dpbdt
, dphpdt
;
3330 double TPB
, PHP
, TPHP
, CTA
, CTP
,GAP2
;
3337 TLEVC
= MCC_ROUND (mcc_getparam_quick(ptmodel
,__MCC_QUICK_TLEVC
));
3338 TLEV
= MCC_ROUND (mcc_getparam_quick(ptmodel
,__MCC_QUICK_TLEV
));
3339 DCAP
= MCC_ROUND(mcc_getparam_quick(ptmodel
, __MCC_QUICK_DCAP
));
3340 FC
= mcc_getparam_quick(ptmodel
, __MCC_QUICK_FC
);
3341 FCS
= mcc_getparam_quick(ptmodel
, __MCC_QUICK_FCS
);
3342 KMS
= mcc_getparam_quick(ptmodel
, __MCC_QUICK_KMS
);
3343 CJO
= mcc_getparam_quick(ptmodel
, __MCC_QUICK_CJO
);
3344 CJSW
= mcc_getparam_quick(ptmodel
, __MCC_QUICK_CJSW
);
3345 VJ
= mcc_getparam_quick(ptmodel
, __MCC_QUICK_VJ
);
3346 MJ
= mcc_getparam_quick(ptmodel
, __MCC_QUICK_MJ
);
3347 MJSW
= mcc_getparam_quick(ptmodel
, __MCC_QUICK_MJSW
);
3348 KMS
= mcc_getparam_quick(ptmodel
, __MCC_QUICK_KMS
);
3349 XOI
= mcc_getparam_quick(ptmodel
, __MCC_QUICK_XOI
);
3350 XOM
= mcc_getparam_quick(ptmodel
, __MCC_QUICK_XOM
);
3351 WP
= mcc_getparam_quick(ptmodel
, __MCC_QUICK_WP
);
3352 XP
= mcc_getparam_quick(ptmodel
, __MCC_QUICK_XP
);
3353 LP
= mcc_getparam_quick(ptmodel
, __MCC_QUICK_LP
);
3354 LM
= mcc_getparam_quick(ptmodel
, __MCC_QUICK_LM
);
3355 WM
= mcc_getparam_quick(ptmodel
, __MCC_QUICK_WM
);
3356 WP
= mcc_getparam_quick(ptmodel
, __MCC_QUICK_WP
);
3357 XM
= mcc_getparam_quick(ptmodel
, __MCC_QUICK_XM
);
3358 SHRINK
= mcc_getparam_quick(ptmodel
, __MCC_QUICK_SHRINK
);
3359 SCALM
= mcc_getparam_quick(ptmodel
, __MCC_QUICK_SCALM
);
3360 M
= mcc_getparam_quick(ptmodel
, __MCC_QUICK_M
);
3361 TPB
= mcc_getparam_quick(ptmodel
, __MCC_QUICK_TPB
);
3362 PHP
= mcc_getparam_quick(ptmodel
, __MCC_QUICK_PHP
);
3363 TPHP
= mcc_getparam_quick(ptmodel
, __MCC_QUICK_TPHP
);
3364 CTA
= mcc_getparam_quick(ptmodel
, __MCC_QUICK_CTA
);
3365 CTP
= mcc_getparam_quick(ptmodel
, __MCC_QUICK_CTP
);
3366 GAP2
= mcc_getparam_quick(ptmodel
, __MCC_QUICK_GAP2
);
3372 LMeff
= LM
*SCALE
*SHRINK
;
3373 WMeff
= WM
*SCALE
*SHRINK
;
3374 LPeff
= LP
*SCALE
*SHRINK
;
3375 WPeff
= WP
*SCALE
*SHRINK
;
3379 // Temperature effect
3380 T
= temp
+ MCC_KELVIN
;
3381 TNOM
= mcc_getparam_quick(ptmodel
, __MCC_QUICK_TNOM
);
3382 Tnom
= TNOM
+ MCC_KELVIN
;
3386 Vt_T
= mcc_calc_vt(temp
);
3387 Vt_Tnom
= mcc_calc_vt(TNOM
);
3388 Eg_T
= mcc_calc_eg (temp
);
3389 Eg_Tnom
= mcc_calc_eg (TNOM
);
3391 case 0: c0
= (Eg_Tnom
/Vt_Tnom
-Eg_T
/Vt_T
+3.0*log(qT
));
3392 VJ_T
= VJ
*qT
-Vt_T
*c0
;
3393 PHP_T
= PHP
*qT
-Vt_T
*c0
;
3394 CJO_T
= CJO
*(1.0+MJ
*(1.0+4.0e-4*dT
-VJ_T
/VJ
));
3395 CJSW_T
= CJSW
*(1.0+MJSW
*(1.0+4.0e-4*dT
-PHP_T
/PHP
));
3397 case 1: VJ_T
= VJ
-TPB
*dT
;
3398 PHP_T
= PHP
- TPHP
*dT
;
3399 CJO_T
= CJO
*(1.0+CTA
*dT
);
3400 CJSW_T
= CJSW
*(1.0+CTP
*dT
);
3402 case 2: VJ_T
= VJ
-TPB
*dT
;
3403 PHP_T
= PHP
-TPHP
-dT
;
3404 CJO_T
= CJO
*pow((VJ
/VJ_T
),MJ
);
3405 CJSW_T
= CJSW
*pow((PHP
/PHP_T
),MJSW
);
3407 case 3: switch (TLEV
) {
3409 case 1: c0
= Eg_Tnom
+3.0*Vt_Tnom
+(1.16-Eg_Tnom
)*(2.0-Tnom
/(Tnom
+1108.0));
3410 dpbdt
= -(c0
-VJ
)/Tnom
;
3411 dphpdt
= -(c0
-PHP
)/Tnom
;
3413 case 2: c0
= Eg_Tnom
+3.0*Vt_Tnom
+(1.16-Eg_Tnom
)*(2.0-Tnom
/(Tnom
+GAP2
));
3414 dpbdt
= -(c0
-VJ
)/Tnom
;
3415 dphpdt
= -(c0
-PHP
)/Tnom
;
3417 default : avt_errmsg(MCC_ERRMSG
, "023", AVT_ERROR
);
3418 c0
= Eg_Tnom
+3.0*Vt_Tnom
+(1.16-Eg_Tnom
)*(2.0-Tnom
/(Tnom
+1108.0));
3419 dpbdt
= -(c0
-VJ
)/Tnom
;
3420 dphpdt
= -(c0
-PHP
)/Tnom
;
3424 PHP_T
= PHP
+dphpdt
*dT
;
3425 CJO_T
= CJO
*(1.0-0.5*dpbdt
*dT
/VJ
);
3426 CJSW_T
= CJSW
*(1.0-0.5*dphpdt
*dT
/PHP
);
3430 // CJOeff computation...
3431 if ( !ptmodel
->SUBCKTNAME
) {
3432 // it means that CJO & CJSW haven't been updated by area & perim
3433 CJOeff
= CJO_T
*area
;
3434 CJSWeff
= CJSW_T
*perim
;
3441 if ( vd
< FC
*VJ
-KMS
) {
3442 CDEPa
= CJOeff
*pow((1.0-(vd
+KMS
)/VJ_T
),-MJ
);
3443 CDEPp
= CJSWeff
*pow((1.0-(vd
+KMS
)/VJ_T
),-MJSW
);
3446 CDEPa
= (CJOeff
/pow((1.0-FC
),1+MJ
))*(1.0-FC
*(1.0+MJ
)+MJ
*(vd
+KMS
)/VJ_T
);
3447 CDEPp
= (CJSWeff
/pow((1.0-FC
),1+MJSW
))*(1.0-FC
*(1.0+MJSW
)+MJSW
*(vd
+KMS
)/VJ_T
);
3449 // Metal & Polysilicon capacitance
3450 CMETAL
= (MCC_EPSOX
/XOI
)*(WPeff
+XPeff
)*(LPeff
+XPeff
)*M
;
3452 CPOLY
= (MCC_EPSOX
/XOM
)*(WMeff
+XMeff
)*(LMeff
+XMeff
)*M
;
3454 // CDIFF = TT*dId/dVd = TT*gd;
3456 Capa
= CDEPa
+CDEPp
+CMETAL
+CPOLY
;
3461 /******************************************************************************\
3463 * FUNC : mcc_dio_calcCDEP_l2
3464 * CDEP is Depletion capacitance
3468 return the total capacitance: Capa = CDEP + CDIFF
3469 \******************************************************************************/
3470 double mcc_dio_calcCapa_l2 ( mcc_modellist
*ptmodel
,
3471 double Va
, double Vc
,
3478 double MJ
,CJO
,VJ
,FC
;
3480 double VJ_T
, CJO_T
, dT
,qT
;
3481 double Vt_T
,Vt_Tnom
,Eg_T
,Eg_Tnom
;
3486 CJO
= mcc_getparam_quick(ptmodel
, __MCC_QUICK_CJO
);
3487 VJ
= mcc_getparam_quick(ptmodel
, __MCC_QUICK_VJ
);
3488 MJ
= mcc_getparam_quick(ptmodel
, __MCC_QUICK_MJ
);
3489 FC
= mcc_getparam_quick(ptmodel
, __MCC_QUICK_FC
);
3491 // Temperature effect
3492 T
= temp
+ MCC_KELVIN
;
3493 TNOM
= mcc_getparam_quick(ptmodel
, __MCC_QUICK_TNOM
);
3494 Tnom
= TNOM
+ MCC_KELVIN
;
3498 Vt_T
= mcc_calc_vt(temp
);
3499 Vt_Tnom
= mcc_calc_vt(TNOM
);
3500 Eg_T
= mcc_calc_eg (temp
);
3501 Eg_Tnom
= mcc_calc_eg (TNOM
);
3503 VJ_T
= VJ
*qT
-Vt_T
*(Eg_Tnom
/Vt_Tnom
-Eg_T
/Vt_T
+3.0*log(qT
));
3504 CJO_T
= CJO
*(1.0+MJ
*(1.0+4.0e-4*dT
-VJ_T
/VJ
));
3507 // CJOeff computation...
3508 if ( !ptmodel
->SUBCKTNAME
) // it means that CJO haven't been updated by area
3509 CJOeff
= CJO_T
*area
;
3514 CDEP
= CJOeff
*pow((1.0-vd
/VJ
),-MJ
);
3516 CDEP
= (CJOeff
/pow((1.0-FC
),1+MJ
))*(1.0-FC
*(1.0+MJ
)+MJ
*vd
/VJ
);
3521 /******************************************************************************\
3523 * FUNC : mcc_dio_calcCapa_l3
3524 * CDEP is Depletion capacitance
3528 return the total capacitance: Capa = Cd (constant)
3529 \******************************************************************************/
3530 double mcc_dio_calcCapa_l3 ( mcc_modellist
*ptmodel
,
3538 TOX
= mcc_getparam_quick(ptmodel
, __MCC_QUICK_TOX
);
3542 Cd
= AREAeff
*MCC_EPSO
/TOX
;
3547 /******************************************************************************\
3549 * FUNC : mcc_dio_calcCDEP_l8
3554 DIOLEV = 9: Cbx = Cbxbot+Cbxsid+Cbxdiff (Cbxdiff assumed to be 0)
3555 DIOLEV != 9: Cbx = AREA*Cjbv+PERI*Cjsv+PGATE*Cjgv
3557 return the total capacitance: Cbx
3558 \******************************************************************************/
3559 double mcc_dio_calcCapa_l8 ( mcc_modellist
*ptmodel
,
3560 double Va
,double Vc
,
3562 double area
, double perim
3565 double Cbx
,Cbxbot
,Cbxsid
,Cjax
,Cjpx
;
3566 double JS
,JSW
,CJ
,CJSW
,CJGATE
,c0
;
3567 double PB
,PBSW
,TNOM
,T
,Tnom
,dT
,qT
,FC
;
3568 double CJ_T
,CJSW_T
,PB_T
,PBSW_T
,Vt_T
,Vt_Tnom
,Eg_T
,Eg_Tnom
;
3570 int M
=1; //number of parallel transistor
3571 double CTA
,PTA
,CTP
,GAP2
,Dpb
,Dpbsw
,MJ
,MJSW
,PTP
;
3575 TLEVC
= MCC_ROUND(mcc_getparam_quick(ptmodel
, __MCC_QUICK_TLEVC
));
3576 TNOM
= mcc_getparam_quick(ptmodel
, __MCC_QUICK_TNOM
);
3577 JS
= mcc_getparam_quick(ptmodel
, __MCC_QUICK_JS
);
3578 JSW
= mcc_getparam_quick(ptmodel
, __MCC_QUICK_JSW
);
3579 CJ
= mcc_getparam_quick(ptmodel
, __MCC_QUICK_CJ
);
3580 CJSW
= mcc_getparam_quick(ptmodel
, __MCC_QUICK_CJSW
);
3581 CJGATE
= mcc_getparam_quick(ptmodel
, __MCC_QUICK_CJGATE
);
3582 DIOLEV
= MCC_ROUND(mcc_getparam_quick(ptmodel
, __MCC_QUICK_DIOLEV
));
3583 FC
= mcc_getparam_quick(ptmodel
, __MCC_QUICK_FC
);
3584 PB
= mcc_getparam_quick(ptmodel
, __MCC_QUICK_PB
);
3585 PBSW
= mcc_getparam_quick(ptmodel
, __MCC_QUICK_PBSW
);
3586 PTA
= mcc_getparam_quick(ptmodel
, __MCC_QUICK_PTA
);
3587 PTP
= mcc_getparam_quick(ptmodel
, __MCC_QUICK_PTP
);
3588 CTA
= mcc_getparam_quick(ptmodel
, __MCC_QUICK_CTA
);
3589 CTP
= mcc_getparam_quick(ptmodel
, __MCC_QUICK_CTP
);
3590 GAP2
= mcc_getparam_quick(ptmodel
, __MCC_QUICK_GAP2
);
3591 MJ
= mcc_getparam_quick(ptmodel
, __MCC_QUICK_MJ
);
3592 MJSW
= mcc_getparam_quick(ptmodel
, __MCC_QUICK_MJSW
);
3594 T
= temp
+MCC_KELVIN
;
3595 Tnom
= TNOM
+MCC_KELVIN
;
3599 Vt_T
= mcc_calc_vt(temp
);
3600 Vt_Tnom
= mcc_calc_vt(TNOM
);
3601 Eg_T
= mcc_calc_eg (temp
);
3602 Eg_Tnom
= mcc_calc_eg (TNOM
);
3607 if ( DIOLEV
!= 9 ) {
3608 // Temperature update
3610 case 0: c0
= (Eg_Tnom
/Vt_Tnom
-Eg_T
/Vt_T
+3.0*log(qT
));
3611 PB_T
= PB
*qT
-Vt_T
*c0
;
3612 PBSW_T
= PBSW
*qT
-Vt_T
*c0
;
3613 CJ_T
= CJ
*(1.0+MJ
*(1.0+4.0e-4*dT
-PB_T
/PB
));
3614 CJSW_T
= CJSW
*(1.0+MJSW
*(1.0+4.0e-4*dT
-PBSW_T
/PBSW
));
3616 case 1: PB_T
= PTA
*dT
;
3617 PBSW_T
= PBSW
-PTP
*dT
;
3618 CJ_T
= CJ
*(1.0+CTA
*dT
);
3619 CJSW_T
= CJSW
*(1.0+CTP
*dT
);
3621 case 2: PB_T
= PB
-PTA
*dT
;
3622 PBSW_T
= PBSW
- PTP
*dT
;
3623 CJ_T
= CJ
*pow(PB
/PB_T
,MJ
);
3624 CJSW_T
= CJSW
*pow(PBSW
/PBSW_T
,MJSW
);
3626 case 3: c0
= Eg_Tnom
-3.0*Vt_Tnom
+(Eg_Tnom
-Eg_T
)*(2.0-Tnom
/(Tnom
+GAP2
));
3629 PB_T
= PB
+Dpb
*dT
/Tnom
;
3630 PBSW_T
= PBSW
+Dpbsw
*dT
/Tnom
;
3631 CJ_T
= CJ
*(1.0-0.5*Dpb
/PB
*dT
/Tnom
);
3632 CJSW_T
= CJSW
*(1.0-0.5*Dpb
/PBSW
*dT
/Tnom
);
3640 Cjpx
= M
*perim
*CJSW_T
;
3644 Cbxbot
= Cjax
*pow((1.0-vd
/PB_T
),-MJ
);
3646 Cbxbot
= (Cjax
/pow(1.0-FC
,1.0+MJ
))*(1.0-FC
*(1.0+MJ
)+MJ
*vd
/PB_T
);
3647 if ( vd
<= FC
*PBSW
)
3648 Cbxsid
= Cjpx
*pow((1.0-vd
/PBSW_T
),-MJSW
);
3650 Cbxsid
= (Cjpx
/pow(1.0-FC
,1.0+MJSW
))*(1.0-FC
*(1.0+MJSW
)+MJSW
*vd
/PBSW_T
);
3651 // if TT>0.0 Cbxdiff = TT*dIbx/dVbx else Cbxdiff=0
3652 Cbx
= Cbxbot
+Cbxsid
;
3655 // unsupported because no info on pgate...
3656 fprintf (stderr
,"[MCC ERR] Diode capacitance for level 8 and diolev = 9 is not supported yet!\n");
3663 /******************************************************************************\
3665 \******************************************************************************/
3666 double mcc_calcIgb (char *technoname
, char *transname
,
3667 int transtype
, int transcase
,
3668 double vbs
, double vgs
, double vds
,
3670 double temp
,elp_lotrs_param
*lotrsparam
)
3672 mcc_modellist
*ptmodel
;
3675 if(!(ptmodel
= mcc_getmodel(technoname
, transname
, transtype
, transcase
, L
, W
, 0)))
3678 switch(ptmodel
->MODELTYPE
) {
3679 case MCC_BSIM3V3
: igb
= 0.0;
3681 case MCC_BSIM4
: igb
= mcc_calcIgb_bsim4 (ptmodel
, L
, W
, temp
,
3685 default : igb
= 0.0;
3692 /******************************************************************************\
3693 * Func mcc_calcIgixl
3694 \******************************************************************************/
3695 void mcc_calcIgixl (char *technoname
, char *transname
,
3696 int transtype
, int transcase
,
3697 double vbs
, double vgs
, double vds
,
3698 double L
, double W
, double temp
,
3699 double *ptIgidl
, double *ptIgisl
,
3700 elp_lotrs_param
*lotrsparam
)
3702 mcc_modellist
*ptmodel
;
3704 if(!(ptmodel
= mcc_getmodel(technoname
, transname
, transtype
, transcase
, L
, W
, 0)))
3707 switch(ptmodel
->MODELTYPE
) {
3708 case MCC_BSIM3V3
: if ( ptIgisl
) *ptIgisl
= 0.0;
3709 if ( ptIgidl
) *ptIgidl
= 0.0;
3711 case MCC_BSIM4
: mcc_calcIgixl_bsim4 (ptmodel
, L
, W
,
3717 default : if ( ptIgisl
) *ptIgisl
= 0.0;
3718 if ( ptIgidl
) *ptIgidl
= 0.0;
3724 /******************************************************************************\
3726 \******************************************************************************/
3727 void mcc_calcIxb (char *technoname
, char *transname
,
3728 int transtype
, int transcase
,
3729 double vbs
, double vds
,
3730 double L
, double W
, double temp
,
3731 double AD
, double PD
, double AS
, double PS
,
3732 double *ptIdb
, double *ptIsb
,
3733 elp_lotrs_param
*lotrsparam
)
3735 mcc_modellist
*ptmodel
;
3737 if(!(ptmodel
= mcc_getmodel(technoname
, transname
, transtype
, transcase
, L
, W
, 0)))
3740 switch(ptmodel
->MODELTYPE
) {
3741 case MCC_BSIM3V3
: if ( ptIdb
) *ptIdb
= 0.0;
3742 if ( ptIsb
) *ptIsb
= 0.0;
3744 case MCC_BSIM4
: mcc_calcIxb_bsim4 (ptmodel
, L
, W
,
3750 default : if ( ptIdb
) *ptIdb
= 0.0;
3751 if ( ptIsb
) *ptIsb
= 0.0;
3757 /******************************************************************************\
3759 \******************************************************************************/
3760 void mcc_calcIgx (char *technoname
, char *transname
,
3761 int transtype
, int transcase
,
3762 double vds
, double vgs
,
3763 double L
, double W
, double temp
,
3764 double *ptIgd
, double *ptIgs
,
3765 elp_lotrs_param
*lotrsparam
)
3767 mcc_modellist
*ptmodel
;
3769 if(!(ptmodel
= mcc_getmodel(technoname
, transname
, transtype
, transcase
, L
, W
, 0)))
3772 switch(ptmodel
->MODELTYPE
) {
3773 case MCC_BSIM3V3
: if ( ptIgd
) *ptIgd
= 0.0;
3774 if ( ptIgs
) *ptIgs
= 0.0;
3777 mcc_calcIgx_bsim4 (ptmodel
, L
, W
,
3782 default : if ( ptIgd
) *ptIgd
= 0.0;
3783 if ( ptIgs
) *ptIgs
= 0.0;
3789 /******************************************************************************\
3791 \******************************************************************************/
3792 void mcc_calcIgcx (char *technoname
, char *transname
,
3793 int transtype
, int transcase
,
3794 double vds
, double vgs
, double vbs
,
3795 double L
, double W
, double temp
,
3796 double *ptIgcd
, double *ptIgcs
,
3797 elp_lotrs_param
*lotrsparam
)
3799 mcc_modellist
*ptmodel
;
3801 if(!(ptmodel
= mcc_getmodel(technoname
, transname
, transtype
, transcase
, L
, W
, 0)))
3804 switch(ptmodel
->MODELTYPE
) {
3805 case MCC_BSIM3V3
: if ( ptIgcd
) *ptIgcd
= 0.0;
3806 if ( ptIgcs
) *ptIgcs
= 0.0;
3809 mcc_calcIgcx_bsim4 (ptmodel
, L
, W
,
3814 default : if ( ptIgcd
) *ptIgcd
= 0.0;
3815 if ( ptIgcs
) *ptIgcs
= 0.0;
3821 /******************************************************************************\
3822 * Func mcc_calcILeakage
3823 \******************************************************************************/
3824 double mcc_calcILeakage (char *technoname
, char *transname
,
3825 int transtype
, int transcase
,
3826 double vbs
, double vds
, double vgs
,
3827 double L
, double W
, double temp
,
3828 double AD
, double PD
, double AS
, double PS
,
3829 double *BLeak
, double *DLeak
, double *SLeak
,
3830 elp_lotrs_param
*lotrsparam
)
3833 double Igb
=0.0,Igisl
=0.0,Igidl
=0.0,Isb
=0.0,
3834 Idb
=0.0,Igs
=0.0,Igd
=0.0,Igcs
=0.0,Igcd
=0.0;
3835 double vth
, Isubth
=0.0;
3837 Igb
= mcc_calcIgb (technoname
, transname
,
3838 transtype
, transcase
,
3840 L
, W
, temp
,lotrsparam
);
3842 mcc_calcIgixl (technoname
, transname
,
3843 transtype
, transcase
,
3849 mcc_calcIxb (technoname
, transname
,
3850 transtype
, transcase
,
3857 mcc_calcIgx (technoname
, transname
,
3858 transtype
, transcase
,
3864 mcc_calcIgcx (technoname
, transname
,
3865 transtype
, transcase
,
3871 //----> Subthreshold current
3873 vth
= mcc_calcVTH (technoname
, transname
,
3874 transtype
, transcase
, L
, W
,
3875 temp
, vbs
, vds
,lotrsparam
,MCC_NO_LOG
) ;
3877 if ( fabs(vgs
) < fabs(vth
) ) {
3878 Isubth
= mcc_calcIDS (technoname
, transname
,
3879 transtype
, transcase
, vbs
, vgs
,
3883 if ( BLeak
) *BLeak
= Igb
+Isb
+Idb
+Igisl
+Igidl
;
3884 if ( DLeak
) *DLeak
= Igd
+Igcd
;
3885 if ( SLeak
) *SLeak
= Igs
+Igcs
+Isubth
;
3887 Ileak
= Isubth
+Igb
+Igisl
+Igidl
+Isb
+Idb
+Igs
+Igd
+Igcs
+Igcd
;
3893 /******************************************************************************\
3894 FUNCTION : mcc_calcVTI_nmos_com_fn
3895 Soit 2 transistors nmos mn0 et mn1 en serie:
3896 mn0 vdd vdd Vti vbulk nmos
3897 mn1 Vti 0 0 vbulk nmos
3898 On resoud Ids(mn0) = Ids(mn1) pour un Vti trouve
3899 <=> Ids_mn0(vds,vgs,vbs) - Ids_mn1(vds,vgs,vbs) = 0;
3900 \******************************************************************************/
3902 int mcc_calcVTI_nmos_com_fn ( struct mcc_vdeg_fn
*data
, double vti
, double *res
)
3906 ids0
= mcc_calcIDS( data
->ptmodel
->TECHNO
->NAME
,
3908 data
->ptmodel
->TYPE
,
3909 data
->ptmodel
->CASE
,
3910 data
->lotrsparam
->VBULK
-vti
,
3918 ids1
= mcc_calcIDS( data
->ptmodel
->TECHNO
->NAME
,
3920 data
->ptmodel
->TYPE
,
3921 data
->ptmodel
->CASE
,
3922 data
->lotrsparam
->VBULK
,
3934 /******************************************************************************\
3935 FUNCTION : mcc_calcVTI_nmos_com
3936 \******************************************************************************/
3937 double mcc_calcVTI_nmos_com (mcc_modellist
*ptmodel
, char *transname
,
3939 double vdd
, double temp
, double step
,
3940 elp_lotrs_param
*lotrsparam
)
3942 static int nbcall
=0;
3943 struct mcc_vdeg_fn data
;
3947 if (ptmodel
->TYPE
== MCC_PMOS
) {
3948 avt_errmsg(MCC_ERRMSG
, "019", AVT_ERROR
, ptmodel
->NAME
) ;
3953 data
.ptmodel
= ptmodel
;
3954 data
.transname
= transname
;
3958 data
.lotrsparam
= lotrsparam
;
3964 ret
= mbk_dichotomie( (int(*)(void*, double, double*)) mcc_calcVTI_nmos_com_fn
,
3976 if( ret
!= MBK_DICHO_OK
) {
3977 //avt_errmsg(MCC_ERRMSG, "024", AVT_WARNING) ;
3982 /******************************************************************************/
3983 /* Calcul de la tension degradee VDDDEG d'un modele de transistor */
3984 /******************************************************************************/
3985 double mcc_calcVTI_nmos (char *technoname
, char *transname
,
3986 int transtype
, int transcase
, double L
, double W
,
3987 double vdd
, double temp
,
3988 double step
, elp_lotrs_param
*lotrsparam
)
3990 mcc_modellist
*ptmodel
;
3993 if (!(ptmodel
= mcc_getmodel(technoname
, transname
, transtype
, transcase
, L
, W
, 0)))
3996 vti
= mcc_calcVTI_nmos_com(ptmodel
, transname
, L
, W
,
4003 /******************************************************************************\
4004 FUNCTION : mcc_calcVTI_pmos_com_fn
4005 Soit 2 transistors pmos mp0 et mp1 en serie:
4006 mp0 0 0 Vti vbulk pmos
4007 mp1 Vti vdd vdd vbulk pmos
4008 On resoud Ids(mp0) = Ids(mp1) pour un Vti trouve
4009 <=> Ids_mp0(vds,vgs,vbs) - Ids_mp1(vds,vgs,vbs) = 0;
4010 \******************************************************************************/
4012 int mcc_calcVTI_pmos_com_fn ( struct mcc_vdeg_fn
*data
, double vti
, double *res
)
4016 ids0
= mcc_calcIDS( data
->ptmodel
->TECHNO
->NAME
,
4018 data
->ptmodel
->TYPE
,
4019 data
->ptmodel
->CASE
,
4020 data
->lotrsparam
->VBULK
-vti
, //vbs
4028 ids1
= mcc_calcIDS( data
->ptmodel
->TECHNO
->NAME
,
4030 data
->ptmodel
->TYPE
,
4031 data
->ptmodel
->CASE
,
4032 data
->lotrsparam
->VBULK
-data
->vdd
,
4044 /******************************************************************************\
4045 FUNCTION : mcc_calcVTI_pmos_com
4046 \******************************************************************************/
4047 double mcc_calcVTI_pmos_com (mcc_modellist
*ptmodel
, char *transname
,
4049 double vdd
, double temp
, double step
,
4050 elp_lotrs_param
*lotrsparam
)
4052 static int nbcall
=0;
4053 struct mcc_vdeg_fn data
;
4057 if (ptmodel
->TYPE
== MCC_NMOS
) {
4062 data
.ptmodel
= ptmodel
;
4063 data
.transname
= transname
;
4067 data
.lotrsparam
= lotrsparam
;
4073 ret
= mbk_dichotomie( (int(*)(void*, double, double*)) mcc_calcVTI_pmos_com_fn
,
4085 if( ret
!= MBK_DICHO_OK
) {
4086 // avt_errmsg(MCC_ERRMSG, "025", AVT_WARNING) ;
4091 /******************************************************************************/
4092 /******************************************************************************/
4093 double mcc_calcVTI_pmos (char *technoname
, char *transname
,
4094 int transtype
, int transcase
, double L
, double W
,
4095 double vdd
, double temp
,
4096 double step
, elp_lotrs_param
*lotrsparam
)
4098 mcc_modellist
*ptmodel
;
4101 if (!(ptmodel
= mcc_getmodel(technoname
, transname
, transtype
, transcase
, L
, W
, 0)))
4104 vti
= mcc_calcVTI_pmos_com(ptmodel
, transname
, L
, W
,
4112 /******************************************************************************/
4113 void mcc_calcRACCESS( char *technoname
, char *transname
,
4114 int transtype
, int transcase
, double L
, double W
,
4115 elp_lotrs_param
*lotrsparam
,
4116 double *RS
, double *RD
4119 mcc_modellist
*ptmodel
;
4123 ptmodel
= mcc_getmodel( technoname
, transname
, transtype
, transcase
, L
, W
, 0 );
4126 if( RS
) *RS
= 0.0 ;
4127 if( RD
) *RD
= 0.0 ;
4131 xw
= mcc_getXW (technoname
, transname
, transtype
, transcase
, L
,W
);
4132 Weff
= W
*xw
+ mcc_calcDW (technoname
, transname
, transtype
, transcase
, L
, W
, lotrsparam
);
4133 mcc_compute_RD_RS( ptmodel
, Weff
, RS
, RD
, lotrsparam
);
4136 /******************************************************************************/
4137 double mcc_calcVTI (char *technoname
, char *transname
,
4138 int transtype
, int transcase
, double L
, double W
,
4139 double vdd
, double temp
,
4140 double step
, elp_lotrs_param
*lotrsparam
)
4142 mcc_modellist
*ptmodel
;
4145 if (!(ptmodel
= mcc_getmodel(technoname
, transname
, transtype
, transcase
, L
, W
, 0)))
4148 if ( ptmodel
->TYPE
== MCC_PMOS
) {
4149 vti
= mcc_calcVTI_pmos_com(ptmodel
, transname
, L
, W
,
4154 vti
= mcc_calcVTI_nmos_com(ptmodel
, transname
, L
, W
,
4162 void mcc_calcPAfromgeomod( lotrs_list
*lotrs
,
4167 elp_lotrs_param
*lotrsparam
,
4178 mcc_modellist
*model
;
4180 l
= ((double)lotrs
->LENGTH
) / ((double)SCALE_X
) ;
4181 w
= ((double)lotrs
->WIDTH
) / ((double)SCALE_X
) ;
4183 mcc_update_technoparams( modelname
, type
, l
, w
, lotrs
, lotrscase
);
4185 switch( lotrscase
) {
4186 case MCC_BEST
: MCC_VDDmax
= MCC_VDD_BEST
;
4187 MCC_VGS
= MCC_VDDmax
/2.0;
4188 MCC_TEMP
= MCC_TEMP_BEST
;
4190 case MCC_WORST
: MCC_VDDmax
= MCC_VDD_WORST
;
4191 MCC_VGS
= MCC_VDDmax
/2.0;
4192 MCC_TEMP
= MCC_TEMP_WORST
;
4194 default : MCC_VDDmax
= vdd
;
4195 MCC_VGS
= MCC_VDDmax
/2.0;
4199 if(type
== MCC_TRANS_N
) {
4200 lscale
= MCC_LN
*1.0e-6 ;
4201 wscale
= MCC_WN
*1.0e-6 ;
4204 lscale
= MCC_LP
*1.0e-6 ;
4205 wscale
= MCC_WP
*1.0e-6 ;
4208 MCC_CALC_CUR
= MCC_CALC_MODE
;
4210 model
= mcc_getmodel( MCC_MODELFILE
, modelname
, type
, lotrscase
, lscale
, wscale
, 0 );
4214 switch( model
->MODELTYPE
) {
4216 mcc_calcPAfromgeomod_bsim4( lotrs
, model
, lotrsparam
, as
, ad
, ps
, pd
) ;
4219 mcc_calcPAfromgeomod_bsim3( lotrs
, model
, lotrsparam
, as
, ad
, ps
, pd
) ;
4222 mcc_calcPAfromgeomod_extmod( lotrs
, model
, lotrsparam
, as
, ad
, ps
, pd
) ;
4228 int mcc_getspicetechno( char *technoname
, char *transname
, int transtype
, int transcase
, double L
, double W
)
4230 mcc_modellist
*model
;
4231 int tectype
= MCC_NOMODEL
;
4233 model
= mcc_getmodel( technoname
, transname
, transtype
, transcase
, L
, W
, 0 );
4235 tectype
= model
->MODELTYPE
;
4240 void mcc_check_capa_print( char trans
,
4246 double temp
, double vdd
,
4247 elp_lotrs_param
*lotrsparam
4250 mcc_modellist
*ptmodel
;
4252 double vgs
, vds
, vbs
, v
, vi
, vf
, v1
, v2
;
4253 int flag
, flaghalf
, flagvt
;
4254 double Qg
, Qb
, Qs
, Qd
;
4255 double Qg0
, Qd0
, Qde0
;
4260 double qgde
, qgde0
;
4261 double cgde0
, cgde1
, cgde2
;
4262 char filename
[1024] ;
4267 ptmodel
= mcc_getmodel(technoname
, transname
, transtype
, transcase
, L
, W
, 0);
4271 if( lotrsparam
->ISVBSSET
)
4272 vbs
= lotrsparam
->VBS
;
4274 vbs
= ( transtype
== MCC_NMOS
) ? lotrsparam
->VBULK
: lotrsparam
->VBULK
-MCC_VDDmax
;
4276 switch( ptmodel
->MODELTYPE
) {
4278 La_Wa
= (L
+ mcc_calcDLC_bsim4 (ptmodel
, lotrsparam
, L
, W
)) *(W
+mcc_calcDWC_bsim4 (ptmodel
, lotrsparam
, L
, W
));
4286 La_Wa
= (L
+ mcc_calcDLC_bsim3v3(ptmodel
, L
, W
)) *(W
+mcc_calcDWC_bsim3v3(ptmodel
, L
, W
));
4293 if( transtype
== MCC_NMOS
) {
4300 if( MCC_VT0N
< MCC_VDDmax
/2.0 ) {
4302 v2
= MCC_VDDmax
/2.0 ;
4305 v1
= MCC_VDDmax
/2.0 ;
4319 if( MCC_VT0P
< MCC_VDDmax
/2.0 ) {
4320 v1
= MCC_VDDmax
/2.0 ;
4321 v2
= MCC_VDDmax
-MCC_VT0P
;
4324 v1
= MCC_VDDmax
-MCC_VT0P
;
4325 v2
= MCC_VDDmax
/2.0 ;
4327 cgde0
= MCC_CGDC2P
;
4328 cgde1
= MCC_CGDC1P
;
4329 cgde2
= MCC_CGDC0P
;
4336 if( transtype
== MCC_NMOS
) {
4343 if( MCC_VT0N
< MCC_VDDmax
/2.0 ) {
4344 v1
= MCC_VDDmax
/2.0 ;
4349 v2
= MCC_VDDmax
/2.0 ;
4351 cgde0
= MCC_CGDC2N
;
4352 cgde1
= MCC_CGDC1N
;
4353 cgde2
= MCC_CGDC0N
;
4362 if( MCC_VT0P
< MCC_VDDmax
/2.0 ) {
4363 v1
= MCC_VDDmax
-MCC_VT0P
;
4364 v2
= MCC_VDDmax
/2.0 ;
4367 v1
= MCC_VDDmax
/2.0 ;
4368 v2
= MCC_VDDmax
-MCC_VT0P
;
4376 sprintf( filename
, "%s_%c_%s", mcc_debug_prefix( "intrinsic" ), transtype
==MCC_NMOS
? 'N':'P', label
) ;
4377 file
= mbkfopen( filename
, "dat", "w" );
4381 fprintf( file
, "#vgs qg(int) qg(cgs) qd(int) qd(cgd) qd(cgde)\n" );
4388 for( j
=0 ; j
<=n
; j
++ ) {
4390 v
= vi
+(vf
-vi
)*((float)j
)/((float)n
);
4392 if( transtype
== MCC_NMOS
)
4395 vgs
= v
-MCC_VDDmax
;
4397 switch( ptmodel
->MODELTYPE
) {
4399 mcc_calcQint_bsim4 (ptmodel
, L
, W
,
4400 temp
, vgs
, vbs
, vds
,
4406 mcc_calcQint_psp (ptmodel
, L
, W
,
4407 temp
, vgs
, vbs
, vds
,
4412 mcc_calcQint_ext(ptmodel
, L
, W
,
4413 temp
, vgs
, vbs
, vds
,
4418 mcc_calcQint_bsim3v3 (ptmodel
, L
, W
,
4419 temp
, vgs
, vbs
, vds
,
4430 Qg0
= Qg
- cgs
* La_Wa
* v
;
4431 Qd0
= Qd
- cgd
* La_Wa
* v
;
4432 Qde0
= Qd
- cgde0
* La_Wa
* v
;
4438 qgs
= cgs
* La_Wa
* v
+ Qg0
;
4439 qgd
= cgd
* La_Wa
* v
+ Qd0
;
4441 if( ( vf
>vi
&& v
> MCC_VDDmax
/2.0 ) || ( vf
<vi
&& v
< MCC_VDDmax
/2.0 ) ) {
4444 qgs0
= cgs
* La_Wa
* MCC_VDDmax
/2.0 ;
4445 qgd0
= cgd
* La_Wa
* MCC_VDDmax
/2.0 ;
4450 qgs
= cgsf
* La_Wa
* (v
-MCC_VDDmax
/2.0) + qgs0
+ Qg0
;
4451 qgd
= cgdf
* La_Wa
* (v
-MCC_VDDmax
/2.0) + qgd0
+ Qd0
;
4455 qgde
= cgde0
* La_Wa
* v
+ Qde0
;
4456 if( ( vf
>vi
&& v
> v1
) || ( vf
<vi
&& v
< v1
) ) {
4458 qgde0
= cgde0
* La_Wa
* v1
;
4463 qgde
= cgde1
* La_Wa
* (v
-v1
) + qgde0
+ Qde0
;
4464 if( ( vf
>vi
&& v
> v2
) || ( vf
<vi
&& v
< v2
) ) {
4466 qgde0
= La_Wa
* ( cgde0
*v1
+ cgde1
*(v2
-v1
) ) ;
4471 qgde
= cgde2
* La_Wa
* (v
-v2
) + qgde0
+ Qde0
;
4474 fprintf( file
, "%g %g %g %g %g %g\n", v
, Qg
, qgs
, Qd
, qgd
, qgde
);
4479 file
= mbkfopen( filename
, "plt", "w" );
4480 fprintf( file
, "set xlabel 'Vin'\n" );
4481 fprintf( file
, "set ylabel 'Q'\n" );
4482 fprintf( file
, "plot \\\n" );
4483 fprintf( file
, "'%s.dat' using 1:2 title 'Qg int', \\\n", filename
);
4484 fprintf( file
, "'%s.dat' using 1:3 title 'Q cgs', \\\n", filename
);
4485 fprintf( file
, "'%s.dat' using 1:4 title 'Qd int', \\\n", filename
);
4486 fprintf( file
, "'%s.dat' using 1:5 title 'Q cgd', \\\n", filename
);
4487 fprintf( file
, "'%s.dat' using 1:6 title 'Q cgde'\n", filename
);
4488 fprintf( file
, "pause -1\n" );
4492 int mcc_get_swjuncap( char *technoname
, char *transname
, int transtype
, int transcase
, double L
, double W
)
4494 mcc_modellist
*model
;
4498 model
= mcc_getmodel( technoname
, transname
, transtype
, transcase
, L
, W
, 0 );
4499 swjuncap
= mcc_getparam_quick(model
, __MCC_QUICK_SWJUNCAP
);
4500 i
= ((int)( swjuncap
+0.5 ));
4505 void mcc_cleanmodel( mcc_modellist
*model
)
4507 if (model
->TYPE
== MCC_DIODE
) {
4510 switch ( model
->MODELTYPE
) {
4517 case MCC_MPSP
: mcc_clean_psp( model
);
4519 case MCC_EXTMOD
: mcc_clean_ext( model
);
4524 #ifdef MCC_RESI_CODE
4526 double mcc_calcResiCapa ( char *technoname
, char *resiname
,
4527 int modtype
, int modcase
,
4528 double L
, double W
, double R
, double SCALE
, double C
, double CRATIO
, double M
,
4529 double *c1
, double *c2
, double *r
4532 mcc_modellist
*ptmodel
;
4533 double Capa
= 0.0, SCALM
=1, RES
, RSH
, CAP
, THICK
, CAPSW
;
4534 double Lscaled
, Wscaled
, DWeff
, DLeff
, DW
, DL
, DI
, Weff
, Leff
, Ceff
, SHRINK
, COX
;
4538 if ( (ptmodel
= mcc_getmodel(technoname
, resiname
, modtype
, modcase
, 0, 0, 0)) )
4540 SHRINK
=mcc_getparam_quick(ptmodel
, __MCC_QUICK_SHRINK
);
4543 L
=mcc_getparam_quick(ptmodel
, __MCC_QUICK_L
);
4544 Lscaled
=L
*SCALM
*SHRINK
;
4547 Lscaled
=L
*SCALE
*SHRINK
;
4550 W
=mcc_getparam_quick(ptmodel
, __MCC_QUICK_W
);
4551 Wscaled
=W
*SCALM
*SHRINK
;
4554 Wscaled
=W
*SCALE
*SHRINK
;
4555 DL
=mcc_getparam_quick(ptmodel
, __MCC_QUICK_DL
);
4556 DW
=mcc_getparam_quick(ptmodel
, __MCC_QUICK_DW
);
4559 Leff
=Lscaled
*SCALE
*SHRINK
-2*DLeff
;
4560 Weff
=Wscaled
*SCALE
*SHRINK
-2*DWeff
;
4566 RSH
=mcc_getparam_quick(ptmodel
, __MCC_QUICK_RSH
);
4567 if (Weff
*Leff
*RSH
>0)
4568 *r
=Leff
*RSH
*SCALE
/(M
*Weff
);
4571 RES
=mcc_getparam_quick(ptmodel
, __MCC_QUICK_RES
);
4582 THICK
=mcc_getparam_quick(ptmodel
, __MCC_QUICK_THICK
);
4583 COX
=mcc_getparam_quick(ptmodel
, __MCC_QUICK_COX
);
4584 if (!COX
&& THICK
==0)
4586 if (mcc_getparamtype_quick(ptmodel
, __MCC_QUICK_CAP
) == MCC_SETVALUE
)
4588 CAP
=mcc_getparam_quick(ptmodel
, __MCC_QUICK_CAP
);
4594 else if (!COX
&& THICK
!=0)
4598 if (mcc_getparamtype_quick(ptmodel
, __MCC_QUICK_DI
) == MCC_SETVALUE
)
4600 DI
=mcc_getparam_quick(ptmodel
, __MCC_QUICK_DI
);
4601 COX
=DI
*MCC_EPSO
/THICK
;
4604 COX
=MCC_EPSOX
/THICK
;
4607 CAPSW
=mcc_getparam_quick(ptmodel
, __MCC_QUICK_CAPSW
);
4608 Ceff
=M
*SCALE
*(Leff
*Weff
*COX
)+2*(Leff
+Weff
)*CAPSW
;
4610 if (CRATIO
<0) CRATIO
=0.5;
4612 *c2
=Ceff
*(1-CRATIO
);
4618 double mcc_calcResiSimple ( double R
, double TC1
, double TC2
, double DTEMP
)
4621 DELTAT
=V_FLOAT_TAB
[__SIM_TEMP
].VALUE
+DTEMP
-V_FLOAT_TAB
[__SIM_TNOM
].VALUE
;
4622 return R
*( 1 + TC1
*DELTAT
+ TC2
*DELTAT
*DELTAT
);