-
Notifications
You must be signed in to change notification settings - Fork 1
/
vxml.mli
366 lines (346 loc) · 9.32 KB
/
vxml.mli
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
(*
BSD 2-Clause License
Copyright (c) 2018, jrrk
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*)
type unaryop =
| Unknown
| Unot
| Ulognot
| Unegate
| Uunsigned
| Usigned
| Uextend of (int*int)
| Uextends of (string*int*int)
type cmpop =
| Cunknown
| Ceq
| Cneq
| Cgt
| Cgts
| Cgte
| Cgtes
| Ceqwild
| Cneqwild
| Cltes
| Clte
| Clt
| Clts
type logop =
| Lunknown
| Land
| Lredand
| Lor
| Lredor
| Lxor
| Lxnor
| Lredxor
| Lredxnor
| Lshiftl
| Lshiftr
| Lshiftrs
type arithop =
| Aunknown
| Aadd
| Asub
| Amul
| Amuls
type dirop =
| Dunknown
| Dinput
| Doutput
| Dinout
| Dvif of string ref
| Dinam of string
| Dport of (string * int * dirop * string * string list)
type typenc =
| UNKDTYP
| PACKADTYP
| UNPACKADTYP
| CNSTDTYP
| BASDTYP
| STRDTYP
| UNIDTYP
| REFDTYP
| ENUMDTYP
| MEMBDTYP
| PARMTDTYP
| IFCRFDTYP of string
| TYPDF of string
type arrtyp =
| UNKARR
| BIT
| REAL
| STRING
| ARNG of (int*int)
| PACKED of (int*int)
| UNPACKED of (int*int)
| ADD of arrtyp list
| MAX of arrtyp list
| MEMBER of arrtyp list
type cexp =
| ERR of string
| BIN of char
| HEX of int
| SHEX of int
| STRING of string
| FLT of float
| BIGINT of Big_int.big_int
type token =
| INVALID
| SP
| SEMI
| COLON
| COMMA
| AT
| DOT
| QUERY
| QUOTE
| DQUOTE
| PLUS
| MINUS
| STAR
| POW
| NL
| SRC of (string*int)
| IDENT of string
| NUM of cexp
| SIZED of (int * cexp)
| DIR of dirop
| BEGIN of string option
| END
| DEFAULT
| LPAREN
| RPAREN
| LBRACK
| RBRACK
| LCURLY
| RCURLY
| LCOMMENT
| RCOMMENT
| LSHIFT
| RSHIFT
| IFF
| ELSE
| LOGIC
| WIRE
| VSTRING
| ASSIGN
| ASSIGNMENT
| ASSIGNDLY
| CMPOP of cmpop
| CASE
| ENDCASE
| WHILE
| FOR
| ALWAYS
| POSEDGE
| NEGEDGE
| RETURN
| FUNCTION
| ENDFUNCTION
| TASK
| ENDTASK
| MODULE
| ENDMODULE
| INITIAL
| FINAL
| INTERFACE
| ENDINTERFACE
| PACKAGE
| ENDPACKAGE
| MODPORT
type typmap =
| TYPNONE
| SUBTYP of int
| TYPRNG of cexp*cexp
| TYPMEMBER of typetable_t
| TYPENUM of string * int * (int*cexp)
| TYPDEF
| RECTYP of typetable_t
and typetable_t = typenc*string*typmap*typmap list
and typ_t = typenc*string*typmap*rw list
and xmlattr = {
anchor: string;
errlst: Xml.xml list ref;
names: (string*typetable_t ref) list ref;
typetable: typetable_t array;
intf : (string * string) list ref;
instances: (string*(token*string)) list ref;
modulexml: (string*(string*rw list*(string*typetable_t ref) list)) list ref;
tmpvar: (string*(string*typetable_t)) list ref;
tmpasgn: (string*rw) list ref;
}
and rw =
| UNKNOWN
| XML of rw list
| EITM of string * string * string * int * rw list
| IO of string * string list * typetable_t * dirop * string * rw list
| VAR of string * string list * typetable_t * string
| IVAR of string * string * typetable_t * rw list * int
| CNST of (int * cexp)
| VRF of string * typetable_t * rw list
| TYP of int * typ_t
| FNC of string * string * typetable_t * rw list
| TASKDEF of string * string * rw list
| TASKRF of string * string * rw list
| INST of string * token * string list * (string * rw list)
| SFMT of string * rw list
| SYS of string * string * rw list
| TPLSRGS of string * string * int * rw list
| VPLSRGS of string * int * rw list
| PORT of string * string * dirop * rw list
| CA of string * rw list
| UNRY of unaryop * rw list
| SEL of string * rw list
| ASEL of rw list
| SNITM of string * rw list
| ASGN of bool * string * rw list
| ARITH of arithop * rw list
| LOGIC of logop * rw list
| CMP of cmpop * rw list
| FRF of string * string * rw list
| XRF of string * string * string * string * dirop
| PKG of string * string * rw list
| CAT of string * rw list
| CPS of string * rw list
| CND of string * rw list
| TIM of string
| REPL of string * int * rw list
| MODUL of string * string * rw list * (string * (string * typetable_t)) list
| BGN of string option * rw list
| RNG of rw list
| ALWYS of string * rw list
| SNTRE of rw list
| IF of string * rw list
| INIT of string * string * rw list
| IRNG of string * rw list
| IFC of string * string * rw list
| IMP of string * string * rw list
| IMRF of string * string * dirop * rw list
| JMPL of string * rw list
| JMPG of string * rw list
| CS of string * rw list
| CSITM of string * rw list
| WHL of rw list
| FORSTMT of (string * string * cmpop * rw * (int * cexp) * (int * cexp) * (int * cexp) * rw list)
| ARG of rw list
| DSPLY of string * string * rw list
| FILS of string * rw list
| FIL of string * string
| NTL of rw list
| CELLS of rw list * xmlattr
| CELL of string * string * string * string * rw list
| POSPOS of string*string
| POSNEG of string*string
| NEGNEG of string*string
| POSEDGE of string
| NEGEDGE of string
| COMB
| MODPORTFTR of string * string
| TYPETABLE of typetable_t array
type itms = {
io: (string*(string*typetable_t*dirop*string*(int*cexp) list)) list ref;
v: (string*(string*typetable_t*string*typetable_t)) list ref;
iv: (string*(string*typetable_t*rw list*int)) list ref;
ir: (string*string*typetable_t) list ref;
ca: (string*rw*rw) list ref;
alwys: (string*rw*rw list) list ref;
init: (string*token*rw list) list ref;
func: (string*(string*typetable_t*rw list*itms)) list ref;
task: (string*(string*rw list*itms)) list ref;
gen: (string*rw list) list ref;
imp: (string*(string*(string*dirop) list)) list ref;
inst: (string*(string*string*rw list)) list ref;
cnst: (string*(bool*(int*cexp))) list ref;
needed: (token*string) list ref;
remove_interfaces: bool;
names'' : (string * typetable_t ref) list;
}
val exprothlst : rw list ref
val stmtothlst : rw list ref
val portothlst : rw list ref
val iothlst : rw list ref
val csothlst : rw list list ref
val bgnothlst : rw list ref
val itmothlst : rw list ref
val catothlst : rw list ref
val cellothlst : rw list ref
val posneglst : rw list list ref
val typothlst : typetable_t list ref
val memothlst : typmap list ref
val subothlst : rw list ref
val mapothlst : (string * string) list list ref
val tskothlst : rw list ref
val optothlst : rw list ref
val optitmopt : rw list option ref
val xrflst : rw list ref
val smplopt : rw option ref
val selopt : rw option ref
val rngopt : (token * rw list) option ref
val typopt : typetable_t option ref
val decopt : (int * string) option ref
val portopt : rw option ref
val cellopt : rw option ref
val instopt : Xml.xml option ref
val arropt : arrtyp list option ref
val optopt : (rw list * rw list) option ref
val asciiopt : rw option ref
val itmopt : rw list option ref
val ntlopt : rw list option ref
val xmlopt : rw option ref
val forlst : (rw * rw * rw list) list ref
val ternlst : (rw * rw * rw * rw) list ref
val widthlst : rw list ref
val smpothlst : rw list ref
val optitmlst : (rw list * rw list) list ref
val modules : (string, string * itms) Hashtbl.t
val modules_opt : (string, string * itms) Hashtbl.t
val packages : (string, string * itms) Hashtbl.t
val interfaces : (string, string * itms) Hashtbl.t
val hierarchy : (string, (string * string) list) Hashtbl.t
val functable : (string, string * typetable_t * rw list * itms) Hashtbl.t
val modtokens : (string, token list * token list * token list) Hashtbl.t
val hex_of_bigint : int -> Big_int.big_int -> string
val hex_to_bigint : string -> Big_int.big_int
val hex_to_ascii : int -> string -> bytes
val decode : int -> string -> cexp
val cadd : cexp list -> cexp
val cexp : string -> int * cexp
val expr : itms -> rw -> token list
val ewidth : rw -> int
val cntmembers : typmap -> arrtyp
val findmembers : typetable_t -> arrtyp list
val findmembers' : typetable_t -> arrtyp list * bool * bool
val optitm : rw list -> rw list
val optitm' : bool -> rw list -> rw list
val simplify_exp : xmlattr -> rw -> rw
val simplify_exp' : rw -> (string * (string * typetable_t)) list * rw
val simplify_asgn : bool -> xmlattr -> rw -> rw -> rw list
val jump_opt : string -> rw list -> rw
val fortailmatch : rw -> rw list -> bool
val needed : itms -> token*string -> token list
val readxml : string -> int * (int * int) * Xml.xml
val rw' : xmlattr -> Xml.xml -> rw
val rewrite : Xml.xml list ref -> string -> int * (int * int) * Xml.xml * rw
val translate : Xml.xml list ref -> string -> int * (int * int) * rw * Xml.xml * (string * token list * token list * token list) list * (string * string) list * xmlattr
val dump : bool -> string -> string * itms -> token list
val debug : string -> string * itms -> unit
val comment : arrtyp list -> token list