1 /****************************************************************************/
3 /* Chaine de CAO & VLSI AVERTEC */
5 /* Produit : STM Version 1.00 */
6 /* Fichier : stm_prop.c */
8 /* (c) copyright 2000 AVERTEC */
9 /* Tous droits reserves */
11 /* Auteur(s) : Gilles Augustins */
13 /****************************************************************************/
15 /****************************************************************************/
17 /****************************************************************************/
21 timing_props
*STM_PROPERTIES
= NULL
;
22 /****************************************************************************/
24 /****************************************************************************/
26 timing_props
*stm_get_prop()
28 return STM_PROPERTIES
;
31 timing_props
*stm_prop_create (timing_model
*resmodel
, timing_model
*capmodel
)
33 timing_props
*properties
;
35 properties
= (timing_props
*)mbkalloc (sizeof (struct timing_props
));
37 properties
->RESMODEL
= resmodel
;
38 properties
->CAPMODEL
= capmodel
;
40 STM_PROPERTIES
= properties
;
45 /****************************************************************************/
47 void stm_addresmodel (timing_props
*properties
, timing_model
*resmodel
)
49 properties
->RESMODEL
= resmodel
;
52 /****************************************************************************/
54 void stm_addcapmodel (timing_props
*properties
, timing_model
*capmodel
)
56 properties
->CAPMODEL
= capmodel
;
59 /****************************************************************************/
61 void stm_scale_loadmodel (timing_model
*model
, float scale
)
67 table
= model
->UMODEL
.TABLE
;
68 for(i
= 0; i
< table
->NX
; i
++)
69 table
->SET1D
[i
] = table
->SET1D
[i
] * scale
;
73 /****************************************************************************/
75 void stm_prop_destroy (timing_props
*properties
)
79 if (properties
->RESMODEL
)
80 mbkfree (properties
->RESMODEL
);
81 if (properties
->CAPMODEL
)
82 mbkfree (properties
->CAPMODEL
);
87 /****************************************************************************/
89 timing_table
*stm_prop_seg2tbl (chain_list
*chainseg
, char type
)
94 float x0
, x1
, inter
, slo
;
96 for(chain
= chainseg
; chain
; chain
= chain
->NEXT
){
102 table
= stm_modtbl_create (i
, 0, type
, STM_NOTYPE
);
105 for(chain
= chainseg
; chain
; chain
= chain
->NEXT
){
106 x0
= ((segment
*)(chain
->DATA
))->X0
;
107 x1
= ((segment
*)(chain
->DATA
))->X1
;
108 inter
= ((segment
*)(chain
->DATA
))->INTER
;
109 slo
= ((segment
*)(chain
->DATA
))->SLO
;
111 table
->XRANGE
[i
] = x0
;
112 table
->SET1D
[i
] = (x0
* slo
) + inter
;
114 table
->XRANGE
[i
+ 1] = x1
;
115 table
->SET1D
[i
+ 1] = (x1
* slo
) + inter
;