1 /****************************************************************************/
3 /* Chaine de CAO & VLSI AVERTEC */
5 /* Produit: STM Version 1.00 */
6 /* Fichier: stm_mod_modif.c */
8 /* (c) copyright 2000 AVERTEC */
9 /* Tous droits reserves */
11 /* Auteur(s): Gilles Augustins */
13 /****************************************************************************/
15 /****************************************************************************/
17 /****************************************************************************/
21 /****************************************************************************/
23 /****************************************************************************/
25 timing_model
*stm_mod_Creduce (char *name
, timing_model
*tmodel
, float slew
, float ckslew
, char redmode
)
27 timing_model
*rcstrmod
;
28 timing_model
*tmodel_tbl
;
33 switch (tmodel
->UTYPE
) {
38 rcstrmod
= stm_mod_create (name
);
39 stm_mod_update (rcstrmod
, tmodel
->VTH
, tmodel
->VDD
, tmodel
->VT
, tmodel
->VF
);
40 stm_mod_update_transition(rcstrmod
, tmodel
->TTYPE
);
41 tmodel_tbl
= stm_mod_duplicate (NULL
, tmodel
);
42 stm_mod_defaultscm2tbl_delay (tmodel_tbl
, -1.0, -1.0);
43 rcstrmod
->UMODEL
.TABLE
= stm_modtbl_Creduce (tmodel_tbl
->UMODEL
.TABLE
, slew
, ckslew
, redmode
);
44 rcstrmod
->UTYPE
= STM_MOD_MODTBL
;
45 stm_mod_destroy (tmodel_tbl
);
48 rcstrmod
= stm_mod_create (name
);
49 stm_mod_update (rcstrmod
, tmodel
->VTH
, tmodel
->VDD
, tmodel
->VT
, tmodel
->VF
);
50 stm_mod_update_transition(rcstrmod
, tmodel
->TTYPE
);
51 tmodel_tbl
= stm_mod_duplicate (NULL
, tmodel
);
52 stm_mod_defaultpln2tbl_delay (tmodel_tbl
);
53 rcstrmod
->UMODEL
.TABLE
= stm_modtbl_Creduce (tmodel_tbl
->UMODEL
.TABLE
, slew
, ckslew
, redmode
);
54 rcstrmod
->UTYPE
= STM_MOD_MODTBL
;
55 stm_mod_destroy (tmodel_tbl
);
58 rcstrmod
= stm_mod_create (name
);
59 stm_mod_update (rcstrmod
, tmodel
->VTH
, tmodel
->VDD
, tmodel
->VT
, tmodel
->VF
);
60 stm_mod_update_transition(rcstrmod
, tmodel
->TTYPE
);
61 rcstrmod
->UMODEL
.TABLE
= stm_modtbl_Creduce (tmodel
->UMODEL
.TABLE
, slew
, ckslew
, redmode
);
62 rcstrmod
->UTYPE
= STM_MOD_MODTBL
;
65 fprintf (stderr
, " - warning - stm_mod_Creduce: STM_MOD_MODFCT not implemented\n");
71 /****************************************************************************/
73 timing_model
*stm_mod_reduce (char *name
, timing_model
*tmodel
, float slew
, float load
, char redmode
, char modeltype
)
76 timing_model
*rdelaymod
;
77 timing_model
*tmodel_tbl
;
82 switch (tmodel
->UTYPE
) {
87 rdelaymod
= stm_mod_create (name
);
88 stm_mod_update (rdelaymod
, tmodel
->VTH
, tmodel
->VDD
, tmodel
->VT
, tmodel
->VF
);
89 stm_mod_update_transition(rdelaymod
, tmodel
->TTYPE
);
90 tmodel_tbl
= stm_mod_duplicate (NULL
, tmodel
);
91 if(modeltype
== STM_DELAY
){
92 if (redmode
== STM_SLEWFIX_RED
) {
93 stm_mod_defaultscm2tbl_delay (tmodel_tbl
, slew
, -1.0);
94 }else if (redmode
== STM_LOADFIX_RED
) {
95 stm_mod_defaultscm2tbl_delay (tmodel_tbl
, -1.0, load
);
97 stm_mod_defaultscm2tbl_delay (tmodel_tbl
, -1.0, -1.0);
100 if (redmode
== STM_SLEWFIX_RED
) {
101 stm_mod_defaultscm2tbl_slew (tmodel_tbl
, slew
, -1.0);
102 }else if (redmode
== STM_LOADFIX_RED
) {
103 stm_mod_defaultscm2tbl_slew (tmodel_tbl
, -1.0, load
);
105 stm_mod_defaultscm2tbl_slew (tmodel_tbl
, -1.0, -1.0);
108 rdelaymod
->UMODEL
.TABLE
= stm_modtbl_reduce (tmodel_tbl
->UMODEL
.TABLE
, slew
, load
, redmode
);
109 rdelaymod
->UTYPE
= STM_MOD_MODTBL
;
110 stm_mod_destroy (tmodel_tbl
);
113 rdelaymod
= stm_mod_create (name
);
114 stm_mod_update (rdelaymod
, tmodel
->VTH
, tmodel
->VDD
, tmodel
->VT
, tmodel
->VF
);
115 stm_mod_update_transition(rdelaymod
, tmodel
->TTYPE
);
116 tmodel_tbl
= stm_mod_duplicate (NULL
, tmodel
);
117 if(modeltype
== STM_DELAY
)
118 stm_mod_defaultpln2tbl_delay (tmodel_tbl
);
120 stm_mod_defaultpln2tbl_slew (tmodel_tbl
);
121 rdelaymod
->UMODEL
.TABLE
= stm_modtbl_reduce (tmodel_tbl
->UMODEL
.TABLE
, slew
, load
, redmode
);
122 rdelaymod
->UTYPE
= STM_MOD_MODTBL
;
123 stm_mod_destroy (tmodel_tbl
);
126 rdelaymod
= stm_mod_create (name
);
127 stm_mod_update (rdelaymod
, tmodel
->VTH
, tmodel
->VDD
, tmodel
->VT
, tmodel
->VF
);
128 stm_mod_update_transition(rdelaymod
, tmodel
->TTYPE
);
129 rdelaymod
->UMODEL
.TABLE
= stm_modtbl_reduce (tmodel
->UMODEL
.TABLE
, slew
, load
, redmode
);
130 rdelaymod
->UTYPE
= STM_MOD_MODTBL
;
133 rdelaymod
= stm_mod_create (name
);
134 stm_mod_update (rdelaymod
, tmodel
->VTH
, tmodel
->VDD
, tmodel
->VT
, tmodel
->VF
);
135 tmodel_tbl
= stm_mod_duplicate (NULL
, tmodel
);
136 stm_mod_defaultfct2tbl_delay (tmodel_tbl
, ~STM_NOTYPE
, ~STM_NOTYPE
);
137 rdelaymod
->UMODEL
.TABLE
= stm_modtbl_reduce (tmodel_tbl
->UMODEL
.TABLE
, slew
, load
, redmode
);
138 rdelaymod
->UTYPE
= STM_MOD_MODTBL
;
139 stm_mod_destroy (tmodel_tbl
);
141 // fprintf (stderr, " - warning - stm_mod_reduce: STM_MOD_MODFCT not implemented\n");
147 /****************************************************************************/
149 void stm_mod_shift (timing_model
*model
, float load
)
152 switch (model
->UTYPE
) {
154 stm_modtbl_shift (model
->UMODEL
.TABLE
, load
);
157 avt_errmsg (STM_ERRMSG
,"031", AVT_ERROR
);
160 avt_errmsg (STM_ERRMSG
,"023", AVT_ERROR
);
163 fprintf (stderr
, " - warning - stm_mod_shift: STM_MOD_MODFCT not implemented\n");
168 /****************************************************************************/
170 void stm_mod_shrinkslewaxis (timing_model
*model
, double thmin
, double thmax
, int type
)
172 return; /* edge normalisation */
174 switch (model
->UTYPE
) {
176 stm_modtbl_shrinkslewaxis (model
->UMODEL
.TABLE
, thmin
, thmax
, type
);
187 /****************************************************************************/
189 void stm_mod_shrinkslewaxis_with_rate (timing_model
*model
, double rate
)
192 switch (model
->UTYPE
) {
194 stm_modtbl_shrinkslewaxis_with_rate (model
->UMODEL
.TABLE
, rate
);
205 /****************************************************************************/
207 void stm_mod_shrinkslewdata (timing_model
*model
, double thmin
, double thmax
, int type
)
209 return; /* edge normalisation */
211 switch (model
->UTYPE
) {
213 stm_modtbl_shrinkslewdata (model
->UMODEL
.TABLE
, thmin
, thmax
, type
);
224 /****************************************************************************/
226 void stm_mod_shrinkslewdata_with_rate (timing_model
*model
, double rate
)
229 switch (model
->UTYPE
) {
231 stm_modtbl_shrinkslewdata_with_rate (model
->UMODEL
.TABLE
, rate
);
242 /****************************************************************************/
244 timing_model
*stm_mod_neg (timing_model
*model
)
246 timing_model
*n_model
= NULL
;
251 switch (model
->UTYPE
) {
253 n_model
= stm_mod_create (NULL
);
254 n_model
->UMODEL
.TABLE
= stm_modtbl_neg (model
->UMODEL
.TABLE
);
255 n_model
->UTYPE
= STM_MOD_MODTBL
;