Initial version of donated sources by Avertec, 3.4p5.
[tas-yagle.git] / distrib / sources / beh / bef / bef_lib.h
1
2 /* ###--------------------------------------------------------------### */
3 /* file : bef100.h */
4 /* version : v100 */
5 /* ###--------------------------------------------------------------### */
6
7 #ifndef BEH_BEFDEF
8 #define BEH_BEFDEF
9
10 /* ###------------------------------------------------------### */
11 /* defines */
12 /* ###------------------------------------------------------### */
13
14 #define BEF_KEEPAUX 0x00000002 /* keep internal signals */
15
16 /* ###------------------------------------------------------### */
17 /* structure definitions */
18 /* ###------------------------------------------------------### */
19
20 /* ###--------------------------------------------------------### */
21 /* global variables */
22 /* ###--------------------------------------------------------### */
23
24 extern char *BEH_IN; /* input file format vbe/vhd/vlg */
25 extern char *BEH_OUT; /* output file format vbe/vhd/vlg */
26
27 /* ###------------------------------------------------------### */
28 /* functions */
29 /* ###------------------------------------------------------### */
30
31 extern void savebefig ();
32 extern struct befig *loadbefig ();
33 extern char *findbefig(char *name);
34
35 extern char *bef_getsuffix ();
36
37 typedef struct bef_abl
38 {
39 char *(*TOBOOLSTR) (chain_list*,char*,int*);
40 }
41 bef_abl;
42
43 typedef struct bef_por
44 {
45 ht *PORHT;
46 void (*POR) (FILE*,char*,char,int,int);
47 void (*START) (FILE*);
48 void (*END) (FILE*);
49 }
50 bef_por;
51
52 typedef struct bef_process
53 {
54 // void (*PROCESS) (FILE*,biabl_list*,char*,char*,int,int*,char*,int);
55 chain_list *(*DECLAR) (FILE*,biabl_list*,char*,int,char*,char**,ptype_list*);
56 void (*WITHSELECT) (FILE*,biabl_list*,char*,int,char**,int*);
57 void (*BEGIN) (FILE*,chain_list*);
58 void (*END) (FILE*);
59 void (*IF) (FILE*,char*);
60 void (*ELSIF) (FILE*,char*);
61 int (*ELSE) (FILE*);
62 int (*ENDIF) (FILE*,char);
63 int (*EDGE) (char*,char*,char,char*);
64 }
65 bef_process;
66
67 typedef struct bef_name
68 {
69 char *(*NAME) (char*);
70 char *(*VNAME) (char*,int,int);
71 char *(*VECTOR) (char*, char*);
72 char *(*BITSTR) (char*,char*);
73 char *(*BEBUS) (char*);
74 char *(*BEREG) (char*);
75 }
76 bef_name;
77
78 typedef struct bef_driver
79 {
80 FILE *FP;
81 befig_list *FIG;
82 char **ABUFF;
83 int *ABUFS;
84 bef_por POR;
85 bef_process PROC;
86 void (*TIME) (FILE*,int,int,int);
87 void (*END_LOOP) (FILE*,char,char*,int,int,int,loop_list*);
88 void (*LOOP_LIST) (FILE*,char,char*,int,int*,int,loop_list*);
89 void (*LOOP) (FILE*,char,char*,int,int*,loop_list*);
90 void (*VALUE) (FILE*,chain_list*,char,int,int,int,char**,int*);
91 void (*AFFECTED) (FILE*,char,char,int,int,int,char*,char*,loop_list*,long);
92 void (*SIGNAL) (FILE*,char*,char,int,int);
93 void (*INTER_ASS) (FILE*,char*,char*,int);
94 int (*ISONE) (char*);
95 bef_abl ABL;
96 bef_name STR;
97 int VLG;
98 }
99 bef_driver;
100
101 chain_list *bef_preprocess_abl(chain_list *abl);
102
103 char *bef_gettimeunit(unsigned char time_unit_char);
104 void iprint(FILE *fp,char mode,char *str, ... );
105 void bef_print_one_beobj(bef_driver *driver, void *be, int *np,long type);
106 chain_list *bef_strip_ckedge(chain_list *ptabl, char *clock);
107 int bef_search_stable(chain_list *ptabl, char **clock);
108 int bef_search_notck(chain_list * ptabl, char *clock);
109 //void bef_drive_vpor(bef_driver *driver, bevectpor_list *vpor,int cpt);
110 //void bef_drive_por(bef_driver *driver, bepor_list *por);
111 void bef_initMaxname(void);
112 void bef_drive_porDeclaration(bef_driver *driver);
113 void bef_drive_sigDeclaration(bef_driver *driver);
114
115 int bef_get_stable_attribute(chain_list *ptabl, char **clock);
116
117 void bef_drive_aux(bef_driver *driver);
118 void bef_drive_out(bef_driver *driver);
119 void bef_drive_bux(bef_driver *driver);
120 void bef_drive_bus(bef_driver *driver);
121 void bef_drive_reg(bef_driver *driver);
122
123 void bef_driverSetAbl(bef_driver *driver,
124 char *(*abl2strBool)(chain_list*,char*,int*));
125 void bef_driverSet(bef_driver *driver,
126 FILE *fp,
127 befig_list *fig,
128 char **buffer,
129 int *bufsize,
130 void (*time) (FILE*,int,int,int),
131 void (*end_loop) (FILE*,char,char*,int,int,int,loop_list*),
132 void (*looplist) (FILE*,char,char*,int,int*,int,loop_list*),
133 void (*loop) (FILE*,char,char*,int,int*,loop_list*),
134 void (*value) (FILE*,chain_list*,char,int,int,int,char**,int*),
135 void (*affected) (FILE*,char,char,int,int,int,char*,char*,loop_list*,long),
136 void (*signal) (FILE*,char*,char,int,int),
137 void (*inter_ass) (FILE*,char*,char*,int),
138 int (*isone) (char*));
139 void bef_driverSetProcess(bef_driver *driver,
140 void (*withselect) (FILE*,biabl_list*,char*,int,char**,int*),
141 chain_list *(*declar) (FILE*,biabl_list*,char*,int,char*,char**,ptype_list *),
142 void (*begin) (FILE*,chain_list*),
143 void (*end) (FILE*),
144 void (*if_) (FILE*,char*),
145 void (*elsif) (FILE*,char*),
146 int (*else_) (FILE*),
147 int (*endif) (FILE*,char),
148 int (*edge) (char*,char*,char,char*));
149 void bef_driverSetStr(bef_driver *driver,
150 char *(*name) (char*),
151 char *(*vname) (char*,int,int),
152 char *(*vector) (char*, char*),
153 char *(*bitstr) (char*,char*),
154 char *(*bebus) (char*),
155 char *(*bereg) (char*));
156 void bef_driverSetPor(bef_driver *driver,
157 void (*por) (FILE*,char*,char,int,int),
158 void (*end) (FILE*),
159 void (*start) (FILE*),
160 ht *porht);
161
162 #endif