Initial version of donated sources by Avertec, 3.4p5.
[tas-yagle.git] / distrib / sources / inf / inf_lib.h
1 /****************************************************************************/
2 /* */
3 /* Chaine de CAO & VLSI Alliance */
4 /* */
5 /* Produit : INF v1.09 */
6 /* Fichier : inf109.h */
7 /* */
8 /* (c) copyright 1994 Laboratoire MASI equipe CAO & VLSI */
9 /* Tous droits reserves */
10 /* Support : e-mail alliance-support@asim.lip6.fr */
11 /* */
12 /* */
13 /****************************************************************************/
14
15 #ifndef INF
16 #define INF
17
18 #define INF_DONTLOG 2
19
20 #define INF_JOK '*'
21 #define INF_ANY_VALUES ((char *)0xabcdef01)
22
23 /* TAS info type constants */
24
25 #define INF_LL_STUCKVSS 0
26 #define INF_LL_STUCKVDD 1
27 #define INF_LL_PRECHARGE 2
28 #define INF_LL_NOTPRECHARGE 3
29 #define INF_LL_BYPASSIN 4
30 #define INF_LL_BYPASSOUT 5
31 #define INF_LL_BYPASS 6
32 #define INF_LL_INTER 7
33 #define INF_LL_RC 10
34 #define INF_LL_NORC 11
35 #define INF_LL_FLIPFLOP 12
36 //#define INF_LL_RCN 13
37 #define INF_LL_NORISING 15
38 #define INF_LL_NOFALLING 16
39 #define INF_LL_BREAK 17
40 #define INF_LL_ONLYEND 18
41 //#define INF_LL_CAPAOUT 19
42 //#define INF_LL_SLOPEIN 20
43 #define INF_LL_CLOCK 21
44 #define INF_LL_ASYNCHRON 22
45
46 // INF TYPES
47 #define INF_ASSOCLIST "{Association list}"
48 #define INF_LISTOFLIST "{List of list}"
49 #define INF_MISCDATA "{Misc data}"
50
51 // operation condition
52 #define INF_OPERATING_CONDITION "+Operating Conditions+"
53 #define INF_TEMPERATURE "Temperature"
54
55 // power definition
56 #define INF_POWER "Supply"
57
58 // ckprech
59 #define INF_CKPRECH "CkPrech"
60
61 #define INF_SENSITIVE "Sensitive Timing Point"
62 #define INF_SUPPRESS "Suppress From Behaviour"
63 #define INF_FLIPFLOP "FlipFlop"
64
65 // stb informations
66 #define INF_STBOUT_SPECIN "Result Input Stability"
67 #define INF_STBOUT_SPECOUT "Result Output Stability"
68 #define INF_STBOUT_SPECMEM "Result Memory Stability"
69 #define INF_STBOUT_SPECINODE "Result Internal Node Stability"
70
71 #define INF_VERIFUP "Up"
72 #define INF_VERIFDOWN "Down"
73 #define INF_VERIFRISE "Rising"
74 #define INF_VERIFFALL "Falling"
75 #define INF_NOVERIF "No verification"
76 #define INF_DISABLE_PATH "+Disabled Paths+"
77 //#define INF_FALSE_PATH "+False Paths+"
78 #define INF_MULTICYCLE_PATH "+Multicycle Paths+"
79
80 #define INF_NOCHECK "No Stb Error Check"
81
82 // other inf types
83 #define INF_YES "Yes"
84 #define INF_NO "No"
85 #define INF_ALL "All"
86 #define INF_IN "In"
87 #define INF_OUT "Out"
88 #define INF_ONLYEND "Only End"
89
90
91 // some infsiglist elements
92 //#define INF_RCN "RCN"
93 //#define INF_ELM "ELM"
94 #define INF_DONTCROSS "Don't Cross"
95 #define INF_TRANSPARENT "Transparent"
96
97 #define INF_DELAY "+Path Delay+"
98
99 #define INF_NB_SIGTYPE 24
100 /* si ajout d'un define pour les siglist
101 * ne pas oublier de modifier le driver :
102 * dans la fonction inf_driveSiglist
103 * la boucle va de 0 a la valeur du dernier define ci-dessus */
104
105
106 #define INF_UP 170
107 #define INF_DOWN 180
108 #define INF_UPDOWN 190
109 #define INF_CK 200
110 #define INF_NOTHING 201
111
112 #define INF_PERIOD 210
113
114 #define INF_INIT_VAL (float) -1e31
115 #define INF_MIN_VAL (float) -1e30
116
117 //
118 // added sections of documentation for each token
119 // Hitas Reference Guide 2.7 (08/18/2005)
120 //
121 // x.x.x.x [I|II|III|??|--]
122 // doc id level of verification
123 //
124
125 // ??
126 #define INF_IGNORE_INSTANCE "+Ignore Instances+"
127 #define INF_IGNORE_TRANSISTOR "+Ignore Transistors+"
128 #define INF_IGNORE_CAPACITANCE "+Ignore Capacitances+"
129 #define INF_IGNORE_RESISTANCE "+Ignore Resistances+"
130 #define INF_IGNORE_PARASITICS "+Ignore Parasitics+"
131 #define INF_IGNORE_DIODE "+Ignore Diodes+"
132 #define INF_IGNORE_NAMES "+Ignore Names+"
133
134 // I
135 #define INF_STUCK "Stuck To Value"
136 #define INF_DISABLE_GATE_DELAY "Disabled Gate Delay"
137
138 // I
139 #define INF_MUXU "+Mux UP MUTEX+"
140 #define INF_MUXD "+Mux DOWN MUTEX+"
141 #define INF_CMPU "+Cmp UP MUTEX+"
142 #define INF_CMPD "+Cmp DOWN MUTEX+"
143
144 // NM
145 #define INF_RENAME "+Signal Renaming+"
146
147 // I
148 #define INF_INPUTS "Circuit Input"
149
150 // II
151 #define INF_STOP "Functional Analysis Stop Point"
152
153 // II
154 #define INF_DIROUT "Transistor Orientation"
155
156 // III
157 #define INF_DLATCH "Dynamic Latch"
158 #define INF_MEMSYM "Memsyms"
159 #define INF_PRECHARGE "Precharge"
160 #define INF_MODELLOOP "Model Latch Loop"
161
162 // II
163 #define INF_CKLATCH "CkLatch"
164
165 // II
166 #define INF_NOTLATCH "NotLatch"
167 #define INF_KEEP_TRISTATE_BEHAVIOUR "KeepTristateBehaviour"
168
169 // II
170 #define INF_BREAK "Break Point"
171 #define INF_STRICT_SETUP "Strict Setup"
172
173 // III
174 #define INF_BYPASS "Bypass"
175
176 // III
177 #define INF_INTER "Inter"
178
179 // I
180 #define INF_PIN_RISING_SLEW "Rising slope"
181 #define INF_PIN_FALLING_SLEW "Falling slope"
182 #define INF_PIN_LOW_VOLTAGE "Low Voltage"
183 #define INF_PIN_HIGH_VOLTAGE "High Voltage"
184
185 // III
186 #define INF_LL_PATHSIGS 14
187
188 // III
189 #define INF_PATHIN "Input of path"
190 #define INF_PATHOUT "Output of path"
191
192 // III
193 #define INF_PATHDELAYMARGINPREFIX "Path Delay Margin"
194 #define INF_PATHDELAYMARGINCLOCK "Clock"
195 #define INF_PATHDELAYMARGINDATA "Data"
196 #define INF_PATHDELAYMARGINMIN "Min"
197 #define INF_PATHDELAYMARGINMAX "Max"
198 #define INF_PATHDELAYMARGINRISE "Rise"
199 #define INF_PATHDELAYMARGINFALL "Fall"
200
201 // III
202 #define INF_NORISING "No Rising"
203 #define INF_NOFALLING "No Falling"
204
205 // I
206 #define INF_CONNECTOR_DIRECTION "Connector Direction"
207
208 // II
209 #define INF_RC "RC"
210
211 // 1.4.6.a --
212
213 // I
214 #define INF_SLOPEIN "SlopeIN"
215
216 // I
217 #define INF_CAPAOUT "CapaOUT"
218 #define INF_CAPAOUT_LW "CapaOUT_LW"
219 #define INF_CAPAOUT_L "CapaOUT_L"
220
221 #define INF_OUTPUT_CAPACITANCE "Output Capacitance"
222
223 // I
224 #define INF_ASYNCHRON "Asynchron"
225
226 // II
227 #define INF_CLOCK_TYPE "Clock"
228 #define INF_MIN_RISE_TIME "Min rise time"
229 #define INF_MAX_RISE_TIME "Max rise time"
230 #define INF_MIN_FALL_TIME "Min fall time"
231 #define INF_MAX_FALL_TIME "Max fall time"
232 #define INF_CLOCK_PERIOD "Clock period"
233 #define INF_MASTER_CLOCK "Master Clock"
234 #define INF_MASTER_CLOCK_EDGES "Master Clock Edges"
235 #define INF_LATENCY_RISE_MIN "Min rise Latency"
236 #define INF_LATENCY_RISE_MAX "Max rise Latency"
237 #define INF_LATENCY_FALL_MIN "Min fall Latency"
238 #define INF_LATENCY_FALL_MAX "Max fall Latency"
239
240
241 #define INF_STB_HEADER "+STB header+"
242 #define INF_DEFAULT_PERIOD "Default period"
243 #define INF_SETUPMARGIN "Setup margin"
244 #define INF_HOLDMARGIN "Hold margin"
245
246 #define INF_VERIF_STATE "Verification State"
247
248 #define INF_ASYNC_CLOCK_GROUP "Asynchronous clock group"
249 #define INF_ASYNC_CLOCK_GROUP_PERIOD "Asynchronous clock group period"
250
251 #define INF_EQUIV_CLOCK_GROUP "Equivalent clock group"
252
253 #define INF_PREFERED_CLOCK "Prefered clock"
254
255 // I
256 #define INF_SPECIN "SpecIn Stability"
257
258 // I
259 #define INF_SPECOUT "SpecOut Stability"
260
261 // III
262 #define INF_CROSSTALKMUXU "+Mux UP Crosstalk MUTEX+"
263 #define INF_CROSSTALKMUXD "+Mux DOWN Crosstalk MUTEX+"
264
265 #define INF_RISE_SETUP "Rise Setup"
266 #define INF_RISE_HOLD "Rise Hold"
267 #define INF_FALL_SETUP "Fall Setup"
268 #define INF_FALL_HOLD "Fall Hold"
269
270 #define INF_SWITCHING_PROBABILITY "Switching Proba"
271 #define INF_STB_NODE_FLAGS "StbNode flags"
272
273 // Marking of FCL types by INF
274 #define INF_MARKSIG "Signal Marking"
275 #define INF_MARKTRANS "Transistor Marking"
276 #define INF_MARKRS "RS Marking"
277
278 /* Transferred signal types */
279
280 #define INF_NET_LATCH ((int) 0x80000000 )
281 #define INF_NET_MEMSYM ((int) 0x40000000 )
282 #define INF_NET_RS ((int) 0x20000000 )
283 #define INF_NET_FLIPFLOP ((int) 0x10000000 )
284 #define INF_NET_MASTER ((int) 0x08000000 )
285 #define INF_NET_SLAVE ((int) 0x04000000 )
286 #define INF_NET_BLOCKER ((int) 0x00000001 )
287 #define INF_NET_NOFALSEBRANCH ((int) 0x00000008 )
288 #define INF_NET_VDD ((int) 0x00000010 )
289 #define INF_NET_VSS ((int) 0x00000020 )
290
291 /* Transferred transistor types */
292
293 #define INF_TRANS_BLEEDER ((int) 0x80000000 )
294 #define INF_TRANS_FEEDBACK ((int) 0x40000000 )
295 #define INF_TRANS_COMMAND ((int) 0x20000000 )
296 #define INF_TRANS_NOT_FUNCTIONAL ((int) 0x10000000 )
297 #define INF_TRANS_BLOCKER ((int) 0x00000001 )
298 #define INF_TRANS_SHORT ((int) 0x00000010 )
299 #define INF_TRANS_UNUSED ((int) 0x00000020 )
300
301 // characteristics
302 #define INF_CHARAC_DATA "Is a Data"
303
304 #define INF_RS_ILLEGAL 1
305 #define INF_RS_LEGAL 2
306 #define INF_RS_MARKONLY 3
307
308 #define INF_CONDITIONS "+Config/Conditions+"
309
310 // clock uncertainty
311 #define INF_CLOCK_UNCERTAINTY "Clock Uncertainty"
312 #define INF_CLOCK_UNCERTAINTY_SETUP 0x1
313 #define INF_CLOCK_UNCERTAINTY_HOLD 0x2
314 #define INF_CLOCK_UNCERTAINTY_END_FALL 0x4
315 #define INF_CLOCK_UNCERTAINTY_END_RISE 0x8
316 #define INF_CLOCK_UNCERTAINTY_START_FALL 0x10
317 #define INF_CLOCK_UNCERTAINTY_START_RISE 0x20
318
319
320 typedef union
321 {
322 int ival;
323 struct {
324 char a, b, c, d;
325 } cval;
326 } splitint;
327
328 // parser related structure
329 typedef struct
330 {
331 char *nom;
332 char *nom1;
333 int edgetype;
334 int reltype;
335 chain_list *chain;
336 double val;
337 double val1;
338 double val2;
339 double val3;
340 double val4;
341 } misc_type;
342
343 /* generic list structure */
344
345 typedef struct list {
346 struct list *NEXT;
347 long TYPE;
348 void *DATA;
349 void *USER;
350 void *SUPDATA, *COMMON;
351 } list_list;
352
353 typedef struct inf_carac {
354 double *VALUES ;
355 int NVALUES ;
356 double LW ; /* LW < 0 if values are absolute */
357 double L; /* add for driving the INF file */
358 } inf_carac ;
359
360 #define INF_DEFAULT_LOCATION 1
361 #define INF_LOADED_LOCATION 2
362 #define INF_IS_DIRTY 0
363 #define INF_LOADED_FROM_DISK 1
364
365 #define INF_FALSEPATH_INFO 14
366 #define INF_SIGLIST_INFO 18
367
368 // delay margin
369 #define INF_MARGIN_ON_LATCH 0x001
370 #define INF_MARGIN_ON_BREAK 0x002
371 #define INF_MARGIN_ON_CONNECTOR 0x004
372 #define INF_MARGIN_ON_PRECHARGE 0x008
373 #define INF_MARGIN_ON_CLOCKPATH 0x010
374 #define INF_MARGIN_ON_DATAPATH 0x020
375 #define INF_MARGIN_ON_MINDELAY 0x040
376 #define INF_MARGIN_ON_MAXDELAY 0x080
377 #define INF_MARGIN_ON_RISEDELAY 0x100
378 #define INF_MARGIN_ON_FALLDELAY 0x200
379 #define INF_MARGIN_ON_CMD 0x400
380 #define INF_MARGIN_ON_FLIPFLOP 0x800
381
382 #define INF_MARGIN_ON_ALL (INF_MARGIN_ON_LATCH|INF_MARGIN_ON_BREAK|INF_MARGIN_ON_CONNECTOR|INF_MARGIN_ON_PRECHARGE|INF_MARGIN_ON_FLIPFLOP)
383
384
385 #define INF_MULTICYCLE_SETUP 0x001
386 #define INF_MULTICYCLE_HOLD 0x002
387 #define INF_MULTICYCLE_RISE 0x004
388 #define INF_MULTICYCLE_FALL 0x008
389 #define INF_MULTICYCLE_START 0x010
390 #define INF_MULTICYCLE_END 0x020
391
392 #define INF_CLOCK_INVERTED 0x001
393 #define INF_CLOCK_VIRTUAL 0x002
394 #define INF_CLOCK_IDEAL 0x004
395
396 #define INF_NOCHECK_SETUP 0x1
397 #define INF_NOCHECK_HOLD 0x2
398
399
400 #define INF_CHANGED 1
401 #define INF_CHANGED_RECOMP 2
402
403 #define INF_DIRECTIVES "STB Directives"
404 #define INF_DIRECTIVE_UP 1
405 #define INF_DIRECTIVE_DOWN 2
406 #define INF_DIRECTIVE_RISING 4
407 #define INF_DIRECTIVE_FALLING 8
408 #define INF_DIRECTIVE_CLOCK 16
409 #define INF_DIRECTIVE_DELAY 32
410 #define INF_DIRECTIVE_BEFORE 1
411 #define INF_DIRECTIVE_AFTER 2
412 #define INF_DIRECTIVE_FILTER 1
413
414 #define INF_FALSESLACK_HZ 8
415 #define INF_FALSESLACK_NOTHZ 4
416 #define INF_FALSESLACK_UP 1
417 #define INF_FALSESLACK_DOWN 2
418 #define INF_FALSESLACK_SETUP 16
419 #define INF_FALSESLACK_HOLD 32
420 #define INF_FALSESLACK_LATCH 64
421 #define INF_FALSESLACK_PRECH 128
422
423 #define INF_NODE_FLAG_STABCORRECT 0x1
424
425 typedef struct INF_INFOSET
426 {
427 chain_list *INF_FALSEPATH;
428 chain_list *INF_FALSESLACK;
429 list_list *INF_SIGLIST;
430 ht *REGISTRY;
431 } INF_INFOSET;
432
433 typedef struct InfValue
434 {
435 char *infotype;
436 char datatype;
437 char *pointertype;
438 int match;
439 union
440 {
441 char *string;
442 double dvalue;
443 int ivalue;
444 void *pointer;
445 } VAL;
446 } InfValue;
447
448 typedef struct
449 {
450 char *orig;
451 char *dest;
452 long lval;
453 double dval;
454 double dval1;
455 } inf_assoc;
456
457 typedef inf_assoc inf_miscdata;
458
459 typedef struct inffig_list
460 {
461 char *NAME;
462 INF_INFOSET DEFAULT;
463 INF_INFOSET LOADED;
464 ptype_list *USER;
465 int changed;
466 } inffig_list;
467
468 //extern ht *INF_HT;
469
470 extern int INF_ERROR, inf_ignorename;
471 extern inffig_list *INF_FIG;
472
473 inf_assoc *inf_createassoc();
474
475 inffig_list *_infRead(char *figname, char *filename, char silent);
476 inffig_list *infRead(char *filename, char lang);
477 void infClean(inffig_list *ifl, int location);
478 extern list_list *infAddList(inffig_list *ifl, int location, char *data,long level,char prg, void *user, char *where);
479
480 void infDrive_filtered (inffig_list *myfig, char *filename, int locations, FILE *outputfile, char *section);
481 void infDrive (inffig_list *myfig, char *filename, int locations, FILE *outputfile);
482 //extern char * infTasVectName(char *name);
483
484 inffig_list *getloadedinffig(char *name);
485 inffig_list *addinffig(char *name);
486 void delinffig(char *name);
487 inffig_list *getinffig(char *name);
488 void infclone(char *name, inffig_list *ifig);
489
490 chain_list *infGetInfo(inffig_list *myfig, int type);
491 int infHasInfo(inffig_list *myfig, int type);
492
493 // que viva la revoluciĆ³n
494 void inf_RemoveKey(inffig_list *ifl, int location, char *key, char *type);
495
496 chain_list *inf_GetEntriesByType(inffig_list *ifl, char *type, char *val);
497 chain_list *inf_GetLocatedEntriesByType(inffig_list *ifl, int location, char *type, char *val);
498 chain_list *inf_GetValuesByType(inffig_list *ifl, char *type);
499
500 int inf_GetInt(inffig_list *ifl, char *key, char *type, int *val);
501 int inf_GetDouble(inffig_list *ifl, char *key, char *type, double *val);
502 int inf_GetString(inffig_list *ifl, char *key, char *type, char **val);
503 int inf_GetPointer(inffig_list *ifl, char *key, char *type, void **val);
504
505 void inf_AddInt(inffig_list *ifl, int location, char *key, char *type, int val, char *where);
506 void inf_AddDouble(inffig_list *ifl, int location, char *key, char *type, double val, char *where);
507 void inf_AddString(inffig_list *ifl, int location, char *key, char *type, char *val, char *where);
508 void inf_AddPointer(inffig_list *ifl, int location, char *key, char *type, char *pointertype, void *val, char *where);
509 void inf_AddMiscData(inffig_list *ifl, int location, char *key, char *type, char *val0, char *val1, long lval, double dval, double dval1, char *where);
510 void inf_AddAssociation(inffig_list *ifl, int location, char *key, char *type, char *val0, char *val1, long lval, double dval, char *where);
511 void inf_AddList(inffig_list *ifl, int location, char *key, char *type, chain_list *val, char *where);
512
513 void inf_DumpRegistry (FILE *f, inffig_list *ifl, int location);
514 void inf_CheckRegistry (FILE *f, inffig_list *ifl, int level, chain_list *data);
515 int inf_StuckSection(int val);
516 void inf_Dirty(char *name);
517 int inf_DisplayLoad(int val);
518
519 list_list *infaddll(list_list *head, void *data, long level, ptype_list *user);
520 void inffreell(list_list *ptlist);
521
522 list_list *inf_create_INFSIGLIST(inffig_list *ifl);
523 char *inf_GetDefault_AVT_INF_Value();
524 char *infTasVectName(char *name);
525
526 void inf_PushAndHideInf(char *name);
527 void inf_PopInf();
528
529 int inf_getinffig_state(inffig_list *ifl);
530 void inf_resetinffig_state(inffig_list *ifl);
531 chain_list *inf_SortEntries(chain_list *cl);
532 chain_list *inf_mergeclist (chain_list * l1, chain_list * l2);
533 void inf_set_print_mode(int val);
534
535 int inf_code_marksig(char *string);
536 int inf_code_marktrans(char *string);
537 int inf_code_markRS(char *string);
538
539 char *inf_reVectName (char *name);
540 void infDriveStbSpecSection (FILE * f, inffig_list * myfig, char *section, char *header);
541 void inf_renameinffig(char *orig, char *newname);
542 void inf_buildmatchrule (inffig_list * ifl, char *section, mbk_match_rules * mr, int canbenonnameallocated);
543
544 #endif
545
546