Initial version of donated sources by Avertec, 3.4p5.
[tas-yagle.git] / distrib / sources / tas / stm / stm_modscm_cst.c
1 /****************************************************************************/
2 /* */
3 /* Chaine de CAO & VLSI AVERTEC */
4 /* */
5 /* Produit : STM Version 1.00 */
6 /* Fichier : stm_modscm_cst.c */
7 /* */
8 /* (c) copyright 2000 AVERTEC */
9 /* Tous droits reserves */
10 /* */
11 /* Auteur(s) : Gilles Augustins */
12 /* */
13 /****************************************************************************/
14
15 /****************************************************************************/
16 /* includes */
17 /****************************************************************************/
18
19 #include "stm.h"
20
21 /****************************************************************************/
22 /* functions */
23 /****************************************************************************/
24
25 timing_scm *stm_modscm_cst_create (float *csttab)
26 {
27 timing_scm *scm = (timing_scm*)mbkalloc (sizeof (struct timing_scm));
28 scm->TYPE = STM_MODSCM_CST;
29 scm->PARAMS.CST = (cstparams*)mbkalloc (sizeof (struct cstparams));
30 scm->PARAMS.CST->DS = (float*)mbkalloc (STM_NB_CST_PARAMS * sizeof (float));
31
32 scm->PARAMS.CST->DS[STM_CST_DELAY] = csttab[STM_CST_DELAY];
33 scm->PARAMS.CST->DS[STM_CST_SLEW] = csttab[STM_CST_SLEW];
34
35 return scm;
36 }
37
38 /****************************************************************************/
39
40 void stm_modscm_cst_destroy (cstparams *params)
41 {
42 if (!params)
43 return;
44
45 if (params->DS)
46 mbkfree (params->DS);
47
48 mbkfree (params);
49 }