Initial version of donated sources by Avertec, 3.4p5.
[tas-yagle.git] / distrib / sources / yagle / genius / gen_search_utils.h
1 /****************************************************************************/
2 /* */
3 /* Chaine de CAO & VLSI Alliance */
4 /* */
5 /* Produit : GENIUS v1.00 */
6 /* Fichier : gen_search_utils.h */
7 /* */
8 /* (c) copyright 1999 Laboratoire MASI equipe CAO & VLSI */
9 /* Tous droits reserves */
10 /* Support : e-mail alliance-support@asim.lip6.fr */
11 /* */
12 /* Auteur(s) : Francois DONNET le : 19/06/1999 */
13 /* */
14 /* Modifie par : le : ../../.... */
15 /* Modifie par : le : ../../.... */
16 /* Modifie par : le : ../../.... */
17 /* */
18 /****************************************************************************/
19
20
21
22 #define UNDEF 0x0FFFFFFF /*improbable value: variable not defined*/
23
24 /* possible values of FLAG field in foundins for phase 2*/
25 #define ALONE 1 //0x97555
26 #define SELECT 2 //0x97123
27 #define UNSELECT 3 //0x52001
28 #define SELECT_HEAD 4 //0x21235
29 #define HEAD 5 //0x57132 /* head of chain */
30 #define PRESEL_HEAD 6 //0x455677 /*during algorithm in phase 1*/
31 #define PRESEL 7 //0x142361 /*during algorithm in phase 1*/
32 #define CHOICE 8 //0x45679 /*after phase 1*/
33 #define CHAIN 9 //0x12315 /*after phase 1*/
34
35
36 #define TO_DELETE_MARK_PTYPE 0x1f2e3a
37
38
39
40
41 /****************************************************************************/
42 /* return 0 if not match, 1 if already visited, 2 if just visited */
43 /****************************************************************************/
44 extern mark_list *GetFailedMark();
45 extern int controlmark(int visited, losig_list *model_sig, int numbit, losig_list *circuit_losig, locon_list *me);
46
47 /****************************************************************************/
48 /* LEX&YAC searching: Refresh the Stack */
49 /****************************************************************************/
50 extern void Remove(model_list *model);
51
52 /****************************************************************************/
53 /* LEX&YAC searching: increase the counter of Stack */
54 /****************************************************************************/
55 extern void Protect();
56
57 /****************************************************************************/
58 /* LEX&YAC searching: Put at this level of counter this foundins(see above)*/
59 /****************************************************************************/
60 extern int Shift(foundins_list* foundins, loins_list* model_ins);
61
62 /****************************************************************************/
63 /* LEX&YAC searching: Put at this level of counter this lotrs in Stack */
64 /****************************************************************************/
65 extern int Shift_lotrs(lotrs_list* circuit_ins, loins_list* model_ins);
66
67 /****************************************************************************/
68 /* LEX&YAC searching: Concate this level of counter with the last one */
69 /****************************************************************************/
70 extern void Reduce();
71
72 /****************************************************************************/
73 /* LEX&YAC searching: Erase last level of Stack */
74 /****************************************************************************/
75 extern void Backward();
76
77 /****************************************************************************/
78 /* put on top a new element of searching, return the new foundins */
79 /****************************************************************************/
80 extern foundins_list* new_foundins(foundins_list *top, loins_list *loins, ptype_list *var);
81
82 /****************************************************************************/
83 /* put a new element of searching in a global variable */
84 /****************************************************************************/
85 extern void add_foundins(model_list *ml, loins_list *loins, ptype_list *var);
86
87 /****************************************************************************/
88 /* free recursively from top a list of foundins, all non zero if you want */
89 /* to erase also loins attached */
90 /****************************************************************************/
91 extern void free_foundins(foundins_list *top, int all);
92
93 /****************************************************************************/
94 /* search in a global variable a foundins */
95 /****************************************************************************/
96 extern foundins_list* getfoundins(char* name);
97
98 /****************************************************************************/
99 /* erase one foundins which point to elem */
100 /****************************************************************************/
101 extern void erase_foundins(model_list *ml, loins_list *elem);
102
103 /****************************************************************************/
104 /* put a new element of searching in a global variable */
105 /****************************************************************************/
106 extern void add_foundmodel(foundins_list *liste_Ins,
107 model_list *model);
108
109 /****************************************************************************/
110 /* free global variable, all non zero if you to erase loins */
111 /****************************************************************************/
112 extern void free_foundmodel(int all);
113
114 /****************************************************************************/
115 /* return non zero if model as been already searched */
116 /****************************************************************************/
117 extern int Check_Model(char *model);
118
119 /****************************************************************************/
120 /* return the number of loins model found in circuit */
121 /****************************************************************************/
122 extern int Count_Model(char *model);
123
124 /****************************************************************************/
125 /* increase the counter of instance from count */
126 /****************************************************************************/
127 extern void AddCount_Model(char *model, int count);
128
129 /****************************************************************************/
130 /* put model flag to check */
131 /****************************************************************************/
132 extern void PutCheck_Model(char *model);
133
134 /****************************************************************************/
135 /* build a new loins and delete all marks and all loins contained inside */
136 /****************************************************************************/
137 extern void Build_loins(model_list *model, ptype_list *env);
138
139 /****************************************************************************/
140 /* final loins list for FCL almost change names and execute C program */
141 /****************************************************************************/
142 extern chain_list* Build_loins_list();
143
144 // zinaps
145 extern void displaymodels();
146
147 /****************************************************************************/
148 /* Add a list of signal names to each connector having symetric connectors */
149 /****************************************************************************/
150
151 extern void finish_erase_foundins();
152 extern void intermediate_finish_erase_foundins();
153
154 extern void setfixed(locon_list *lc);
155 extern int isfixed(locon_list *lc);
156 extern void addloconmark(locon_list *lc, mark_list *mark);
157 extern mark_list *getloconmark(locon_list *lc);
158 extern void addswap(locon_list *lc, locon_list *sym);
159 extern void addwithoutcount(loins_list *li, long oldcount);
160
161 extern void SearchInit();
162 extern void FinishCleanLofigMarks(lofig_list *lf);
163 extern void CleanUPMarkEA(lofig_list *lf);
164
165 extern char tabs[200]; // pour indenter les traces
166
167 extern char *modelradical(char *name);
168 extern void UpdateNewInstanceLofigChain();
169 extern void GenPostOp(loins_list *li);
170
171 extern int CountFakeInstanceLocon(locon_list *ptcon, ptype_list *env);
172 extern void CleanLofigForWithouts(model_list *model);
173
174 extern long ComputeModelInstanceKey(locon_list *ptcon, ptype_list *env);
175 extern long KeyContribValueFor(losig_list *ls);
176
177 extern chain_list *GetFixedSignalList(loins_list *li, ptype_list *env, ptype_list *livar);
178 extern int IsFORparallal(loins_list *li, ptype_list *env, lofig_list *model_lofig, int *smartselect);
179
180 extern void ComputeModelTransistorKeyV2(locon_list *ptcon, ptype_list *env, long long *key, long long *mask);
181
182 extern int isparal, isparal_count, smartselect;
183 extern ptype_list *GEN_USER;
184
185 chain_list *GrabExistingLoins(lofig_list *lf, char *modelname, char *regexp);
186 void CleanLoconFlags(loins_list *li);
187 foundins_list *GetLastAddedFoundins();
188 void RestoreRealLoinsPnodes(loins_list *li);
189 void reset_existing_loins_pnodes();
190
191 typedef struct all_loins_heap_struct
192 {
193 struct all_loins_heap_struct *NEXT;
194 model_list *model;
195 char *instance_name;
196 corresp_t *CorrespondanceTable;
197 } all_loins_heap_struct;
198
199 extern all_loins_heap_struct *ALL_LOINS_FOUND;
200 extern chain_list *ALL_KIND_OF_MODELS;
201 void add_loins_in_all_loins_found(char *name, model_list *model, corresp_t *table);
202
203 void UpdateTOPInstancesCorrespondanceTable();
204 extern lofig_list *CUR_HIER_LOFIG;
205 extern corresp_t *CUR_CORRESP_TABLE;
206 int gns_isforcematch(char *cirname, char *modelname);
207
208 chain_list *GrabBlackboxAsUnused(char *modelname, lofig_list *model, lofig_list *netlist);
209 int IsModelFullyConnected(lofig_list *lf);
210