Initial version of donated sources by Avertec, 3.4p5.
[tas-yagle.git] / distrib / sources / beh / beg / beg_lib.h
1 /****************************************************************************/
2 /* */
3 /* Chaine de CAO & VLSI AVERTEC */
4 /* */
5 /* Produit : BEG_GEN Version 1.00 */
6 /* Fichier : beg_lib.h */
7 /* */
8 /* (c) copyright 2002 AVERTEC */
9 /* Tous droits reserves */
10 /* */
11 /* Auteur(s) : Antony PINTO */
12 /* */
13 /****************************************************************************/
14
15 #ifndef BEG_LIB_H
16 #define BEG_LIB_H
17
18 #include MUT_H
19 #include BEH_H
20 #include MLO_H
21
22 #define BEG_PRE (long) 0x00000002
23 #define BEG_REG (long) 0x00000004
24 #define BEG_BUS (long) 0x00000008
25 #define BEG_CMPLX (long) 0x00000010
26 #define BEG_LAST (long) 0x00000020
27
28 #define BEG_MASK_OUT (long) 0x00000010
29 #define BEG_MASK_AUX (long) 0x00000020
30 #define BEG_MASK_BUS (long) 0x00000030
31 #define BEG_MASK_BUX (long) 0x00000040
32 #define BEG_MASK_REG (long) 0x00000050
33 #define BEG_MASK_POR (long) 0x00000060
34 #define BEG_MASK_RIN (long) 0x00000070
35
36 #define BEG_MASK_VECT (long) 0x00000001
37 #define BEG_MASK_SING (long) 0x00000002
38 #define BEG_MASK_TYPE (long) 0x0000000F
39
40 #define BEG_TYPE_VECTOUT (long) 0x00000011
41 #define BEG_TYPE_SINGOUT (long) 0x00000012
42 #define BEG_TYPE_VECTAUX (long) 0x00000021
43 #define BEG_TYPE_SINGAUX (long) 0x00000022
44 #define BEG_TYPE_VECTBUS (long) 0x00000031
45 #define BEG_TYPE_SINGBUS (long) 0x00000032
46 #define BEG_TYPE_VECTBUX (long) 0x00000041
47 #define BEG_TYPE_SINGBUX (long) 0x00000042
48 #define BEG_TYPE_VECTREG (long) 0x00000051
49 #define BEG_TYPE_SINGREG (long) 0x00000052
50 #define BEG_TYPE_VECTPOR (long) 0x00000061
51 #define BEG_TYPE_SINGPOR (long) 0x00000062
52 #define BEG_TYPE_CONFLIT (long) 0x00000071
53
54 // mode de recherche pour beg_get_vectname
55 #define BEG_SEARCH_NAME '('
56 #define BEG_SEARCH_ABL ' '
57 #define BEG_SEARCH_LOOP 'L'
58 #define BEG_SEARCH_ALOOP 'a'
59
60 #define BEG_SAVE 1
61 #define BEG_NOVERIF (int) 0xFF00
62 // verify coherence with bvl
63
64 #define BEG_OBJ ptype_list*
65 #define BEG_CORRESP_PTYPE (long) 0xc1c01263
66 #define BEG_RENAME_LIST (long) 0xc1c03093
67
68 void beg_init ( void );
69 void beg_def_por ( char *name ,
70 char direction );
71 void beg_def_sig ( char *name ,
72 char *expr ,
73 unsigned int time,int,int, long);
74 biabl_list* beg_def_mux ( char *name ,
75 char *cndexpr ,
76 char *bitstr ,
77 char *valexpr ,
78 int time,
79 long flags, long biflags);
80 biabl_list* beg_def_process ( char *name ,
81 char *cndexpr ,
82 char *valexpr ,
83 int time ,
84 int timer ,
85 int timef ,
86 long flag,
87 long flags, long biflags);
88 biabl_list* beg_def_loop ( char *name ,
89 char *cndexpr ,
90 char *valexpr ,
91 char *varname ,
92 int time ,
93 long flag,
94 long flags, long biflags);
95 biabl_list* beg_def_biloop ( char *name ,
96 char *cndexpr ,
97 char *valexpr ,
98 char *var1 ,
99 char *var2 ,
100 int time ,
101 long flag,
102 long flags, long biflags );
103 void beg_assertion ( char *expr ,
104 char *msg ,
105 char level ,
106 char *label );
107
108 befig_list *beg_get_befig ( int verif );
109 void beg_freeBefig ( void );
110 void beg_delBefig ( befig_list *fig );
111 void beg_def_befig ( char *name );
112
113 void beg_get_vectname ( char *signame ,
114 char **name ,
115 long *left ,
116 long *right ,
117 char mode );
118 void beg_eat_por ( befig_list *eaten );
119 void beg_eat_figure ( befig_list *eaten );
120 befig_list *beg_get_befigByName ( char *name );
121
122 void beg_sort ( void);
123 // !!! WARNING beg_compact need beg_sort to be performed before use
124 void beg_compact ( void);
125
126 int beg_isVect ( BEG_OBJ obj );
127 BEG_OBJ beg_getObjByName ( befig_list *fig ,
128 char *name ,
129 BEG_OBJ *por );
130 berin_list *beg_getBerinByName ( befig_list *fig ,
131 char *name );
132 int beg_getLeft ( BEG_OBJ obj );
133 int beg_getRight ( BEG_OBJ obj );
134 void beg_newRight ( BEG_OBJ obj ,
135 int right );
136 void beg_newLeft ( BEG_OBJ obj ,
137 int left );
138 vectbiabl_list *beg_getVectBiabl ( BEG_OBJ obj );
139
140 chain_list *beg_str2Abl ( char *str );
141 char *beg_boolDelNot ( chain_list *expr ,
142 chain_list **res );
143 chain_list *beg_compactAbl ( chain_list *expr );
144 int beg_isDeletedBiabl ( biabl_list *biabl );
145
146 void beg_add_pors ( befig_list *fig );
147
148 void beg_terminate ( befig_list *fig );
149
150 void beg_topLevel ( befig_list **befig ,
151 chain_list *insbefigs ,
152 int compact ,
153 loins_list *loins , ht **renamed, ht **morealiases);
154 void beg_addAllInstances ( char *curbefig, befig_list *befig ,
155 loins_list *loins ,
156 ht *fight ,
157 ht *sight ,
158 int mode ,
159 void (*eatfunc)
160 ( loins_list*,
161 ht* ,
162 ht* ,
163 ht* ));
164 char *beg_get_currentName ( void );
165 befig_list *beg_duplicate ( befig_list *model ,
166 char *insname );
167
168 #define BEGAPI_HT_BASE 13
169 #define DISABLE_CREATE_BEH 2
170 #define DISABLE_CREATE_COR 4
171 #define DISABLE_COMPACT 8
172
173 ht *begGetCorrespHT(char *name);
174 void begFreeCorrespHT(befig_list *bf, char *name);
175 ht *begGetCorrespHTCreate(char *name);
176 void begGetCorrespHTUnlink(char *name);
177 void begGetCorrespHTRelink(char *name, ht *newc);
178 void beg_forceZSort(void);
179
180 #endif