Project

General

Profile

Statistics
| Branch: | Tag: | Revision:

lustrec / src / tools / importer / vhdl_to_lustre.ml @ 248eb65e

History | View | Annotate | Download (23.7 KB)

1
open Vhdl_ast_deriving
2
open Lustre_types
3
open Utils
4

    
5
let _ = fun (_ : vhdl_cst_val_t)  -> () 
6
let _ = fun (_ : vhdl_type_t)  -> () 
7
let _ = fun (_ : vhdl_element_declaration_t)  -> () 
8
let _ = fun (_ : vhdl_subtype_indication_t)  -> () 
9
let _ = fun (_ : vhdl_discrete_range_t)  -> () 
10
let _ = fun (_ : vhdl_constraint_t)  -> () 
11
let _ = fun (_ : vhdl_definition_t)  -> () 
12
let _ = fun (_ : vhdl_expr_t)  -> () 
13
let _ = fun (_ : vhdl_name_t)  -> () 
14
let _ = fun (_ : vhdl_assoc_element_t)  -> ()
15
let _ = fun (_ : vhdl_element_assoc_t)  -> () 
16
let _ = fun (_ : vhdl_array_attributes_t)  -> () 
17
let _ = fun (_ : vhdl_signal_attributes_t)  -> () 
18
let _ = fun (_ : vhdl_string_attributes_t)  -> () 
19
let _ = fun (_ : vhdl_suffix_selection_t)  -> () 
20
let _ = fun (_ : 'basetype vhdl_type_attributes_t)  -> () 
21
let _ = fun (_ : vhdl_parameter_t)  -> () 
22
let _ = fun (_ : vhdl_subprogram_spec_t)  -> () 
23
let _ = fun (_ : vhdl_sequential_stmt_t)  -> () 
24
let _ = fun (_ : vhdl_if_case_t)  -> () 
25
let _ = fun (_ : vhdl_case_item_t)  -> () 
26
let _ = fun (_ : vhdl_declaration_t)  -> () 
27
let _ = fun (_ : vhdl_signal_selection_t)  -> () 
28
let _ = fun (_ : vhdl_signal_condition_t)  -> () 
29
let _ = fun (_ : vhdl_conditional_signal_t)  -> () 
30
let _ = fun (_ : vhdl_process_t)  -> () 
31
let _ = fun (_ : vhdl_selected_signal_t)  -> () 
32
let _ = fun (_ : vhdl_port_mode_t)  -> () 
33
let _ = fun (_ : vhdl_component_instantiation_t)  -> ()
34
let _ = fun (_ : vhdl_concurrent_stmt_t)  -> () 
35
let _ = fun (_ : vhdl_port_t)  -> () 
36
let _ = fun (_ : vhdl_entity_t)  -> () 
37
let _ = fun (_ : vhdl_package_t)  -> () 
38
let _ = fun (_ : vhdl_load_t)  -> () 
39
let _ = fun (_ : vhdl_architecture_t)  -> () 
40
let _ = fun (_ : vhdl_configuration_t)  -> () 
41
let _ = fun (_ : vhdl_library_unit_t)  -> () 
42
let _ = fun (_ : vhdl_design_unit_t)  -> () 
43
let _ = fun (_ : vhdl_design_file_t)  -> () 
44
let _ = fun (_ : vhdl_file_t)  -> () 
45

    
46
class virtual vhdl_to_lustre_map =
47
  object (self)
48
    method virtual  string : string -> string
49
    method virtual  list : 'a . ('a -> 'a) -> 'a list -> 'a list
50
    method virtual  unit : unit -> unit
51
    method virtual  bool : bool -> bool
52
    method virtual  option : 'a . ('a -> 'a) -> 'a option -> 'a option
53
    method virtual  int : int -> int
54
    method virtual  vhdl_name_t : vhdl_name_t -> vhdl_name_t
55
    method virtual  vhdl_definition_t : vhdl_definition_t -> vhdl_definition_t
56
    method virtual  vhdl_port_t : vhdl_port_t -> vhdl_port_t
57
    method virtual  vhdl_expr_t : vhdl_expr_t -> vhdl_expr_t
58
    method virtual  vhdl_port_mode_t : vhdl_port_mode_t -> vhdl_port_mode_t
59
    method virtual  vhdl_element_declaration_t : vhdl_element_declaration_t -> vhdl_element_declaration_t
60
    method virtual  vhdl_subtype_indication_t : vhdl_subtype_indication_t -> vhdl_subtype_indication_t
61
    method virtual  vhdl_conditional_signal_t : vhdl_conditional_signal_t -> vhdl_conditional_signal_t
62
    method virtual  vhdl_process_t : vhdl_process_t -> vhdl_process_t
63
    method virtual  vhdl_selected_signal_t : vhdl_selected_signal_t -> vhdl_selected_signal_t
64
    method virtual  vhdl_signal_selection_t : vhdl_signal_selection_t -> vhdl_signal_selection_t
65
    method virtual  vhdl_suffix_selection_t : vhdl_suffix_selection_t -> vhdl_suffix_selection_t
66
    method virtual  vhdl_declaration_t : vhdl_declaration_t -> vhdl_declaration_t
67
    method virtual  vhdl_sequential_stmt_t : vhdl_sequential_stmt_t -> vhdl_sequential_stmt_t
68
    method virtual  vhdl_signal_condition_t : vhdl_signal_condition_t -> vhdl_signal_condition_t
69
    method virtual  vhdl_cst_val_t : vhdl_cst_val_t -> vhdl_cst_val_t
70
    method virtual  vhdl_subprogram_spec_t : vhdl_subprogram_spec_t -> vhdl_subprogram_spec_t
71
    method virtual  vhdl_discrete_range_t : vhdl_discrete_range_t -> vhdl_discrete_range_t
72
    method virtual  vhdl_parameter_t : vhdl_parameter_t -> vhdl_parameter_t
73
    method virtual  vhdl_component_instantiation_t : vhdl_component_instantiation_t -> vhdl_component_instantiation_t
74
    method virtual  vhdl_concurrent_stmt_t : vhdl_concurrent_stmt_t -> vhdl_concurrent_stmt_t
75
    method virtual  vhdl_declaration_t : vhdl_declaration_t -> vhdl_declaration_t
76
    method virtual  vhdl_architecture_t : vhdl_architecture_t -> vhdl_architecture_t
77
    method virtual  vhdl_configuration_t : vhdl_configuration_t -> vhdl_configuration_t
78
    method virtual  vhdl_entity_t : vhdl_entity_t -> vhdl_entity_t
79
    method virtual  vhdl_package_t : vhdl_package_t -> vhdl_package_t
80
    method virtual  vhdl_library_unit_t : vhdl_library_unit_t -> vhdl_library_unit_t
81
    method virtual  vhdl_load_t : vhdl_load_t -> vhdl_load_t
82
    method virtual  vhdl_design_unit_t : vhdl_design_unit_t -> vhdl_design_unit_t
83
    method virtual  vhdl_design_file_t : vhdl_design_file_t -> vhdl_design_file_t
84

    
85
    method vhdl_cst_val_t : vhdl_cst_val_t -> vhdl_cst_val_t =
86
      fun x  ->
87
        match x with
88
        | CstInt a -> let a = self#int a  in CstInt a
89
        | CstStdLogic a -> let a = self#string a  in CstStdLogic a
90
        | CstLiteral a -> let a = self#string a  in CstLiteral a
91

    
92
    method vhdl_type_t : vhdl_type_t -> vhdl_type_t=
93
      fun x  ->
94
        match x with
95
        | Base a -> let a = self#string a  in Base a
96
        | Range (a,b,c) ->
97
            let a = self#option self#string a  in
98
            let b = self#int b  in let c = self#int c  in Range (a, b, c)
99
        | Bit_vector (a,b) ->
100
            let a = self#int a  in let b = self#int b  in Bit_vector (a, b)
101
        | Array { indexes; const; definition } ->
102
            let indexes = self#list self#vhdl_name_t indexes  in
103
            let const = self#option self#vhdl_constraint_t const  in
104
            let definition = self#vhdl_subtype_indication_t definition  in
105
            Array { indexes; const; definition }
106
        | Record a ->
107
            let a = self#list self#vhdl_element_declaration_t a  in Record a
108
        | Enumerated a ->
109
            let a = self#list self#vhdl_name_t a  in Enumerated a
110
        | Void  -> Void
111
    method vhdl_element_declaration_t :
112
      vhdl_element_declaration_t -> vhdl_element_declaration_t=
113
      fun { names; definition }  ->
114
        let names = self#list self#vhdl_name_t names  in
115
        let definition = self#vhdl_subtype_indication_t definition  in
116
        { names; definition }
117
    method vhdl_subtype_indication_t :
118
      vhdl_subtype_indication_t -> vhdl_subtype_indication_t=
119
      fun { name; functionName; const }  ->
120
        let name = self#vhdl_name_t name  in
121
        let functionName = self#vhdl_name_t functionName  in
122
        let const = self#vhdl_constraint_t const  in
123
        { name; functionName; const }
124
    method vhdl_discrete_range_t :
125
      vhdl_discrete_range_t -> vhdl_discrete_range_t=
126
      fun x  ->
127
        match x with
128
        | SubDiscreteRange a ->
129
            let a = self#vhdl_subtype_indication_t a  in SubDiscreteRange a
130
        | NamedRange a -> let a = self#vhdl_name_t a  in NamedRange a
131
        | DirectedRange { direction; from; _to } ->
132
            let direction = self#string direction  in
133
            let from = self#vhdl_expr_t from  in
134
            let _to = self#vhdl_expr_t _to  in
135
            DirectedRange { direction; from; _to }
136

    
137
    method vhdl_constraint_t : vhdl_constraint_t -> vhdl_constraint_t=
138
      fun x  ->
139
        match x with
140
        | RefConstraint { ref_name } ->
141
            let ref_name = self#vhdl_name_t ref_name  in
142
            RefConstraint { ref_name }
143
        | RangeConstraint { range } ->
144
            let range = self#vhdl_discrete_range_t range  in
145
            RangeConstraint { range }
146
        | IndexConstraint { ranges } ->
147
            let ranges = self#list self#vhdl_discrete_range_t ranges  in
148
            IndexConstraint { ranges }
149
        | ArrayConstraint { ranges; sub } ->
150
            let ranges = self#list self#vhdl_discrete_range_t ranges  in
151
            let sub = self#vhdl_constraint_t sub  in
152
            ArrayConstraint { ranges; sub }
153
        | RecordConstraint  -> RecordConstraint
154
        | NoConstraint  -> NoConstraint
155

    
156
    method vhdl_definition_t : vhdl_definition_t -> vhdl_definition_t=
157
      fun x  ->
158
        match x with
159
        | Type { name; definition } ->
160
            let name = self#vhdl_name_t name  in
161
            let definition = self#vhdl_type_t definition  in
162
            Type { name; definition }
163
        | Subtype { name; typ } ->
164
            let name = self#vhdl_name_t name  in
165
            let typ = self#vhdl_subtype_indication_t typ  in
166
            Subtype { name; typ }
167
    method vhdl_expr_t : vhdl_expr_t -> vhdl_expr_t=
168
      fun x  ->
169
        match x with
170
        | Call a -> let a = self#vhdl_name_t a  in Call a
171
        | Cst a -> let a = self#vhdl_cst_val_t a  in Cst a
172
        | Op { id; args } ->
173
            let id = self#string id  in
174
            let args = self#list self#vhdl_expr_t args  in Op { id; args }
175
        | IsNull  -> IsNull
176
        | Time { value; phy_unit } ->
177
            let value = self#int value  in
178
            let phy_unit = self#string phy_unit  in Time { value; phy_unit }
179
        | Sig { name; att } ->
180
            let name = self#vhdl_name_t name  in
181
            let att = self#option self#vhdl_signal_attributes_t att  in
182
            Sig { name; att }
183
        | SuffixMod { expr; selection } ->
184
            let expr = self#vhdl_expr_t expr  in
185
            let selection = self#vhdl_suffix_selection_t selection  in
186
            SuffixMod { expr; selection }
187
        | Aggregate { elems } ->
188
            let elems = self#list self#vhdl_element_assoc_t elems  in
189
            Aggregate { elems }
190
        | Others  -> Others
191
    method vhdl_name_t : vhdl_name_t -> vhdl_name_t=
192
      fun x  ->
193
        match x with
194
        | Simple a -> let a = self#string a  in Simple a
195
        | Identifier a -> let a = self#string a  in Identifier a
196
        | Selected a -> let a = self#list self#vhdl_name_t a  in Selected a
197
        | Index { id; exprs } ->
198
            let id = self#vhdl_name_t id  in
199
            let exprs = self#list self#vhdl_expr_t exprs  in
200
            Index { id; exprs }
201
        | Slice { id; range } ->
202
            let id = self#vhdl_name_t id  in
203
            let range = self#vhdl_discrete_range_t range  in
204
            Slice { id; range }
205
        | Attribute { id; designator; expr } ->
206
            let id = self#vhdl_name_t id  in
207
            let designator = self#vhdl_name_t designator  in
208
            let expr = self#vhdl_expr_t expr  in
209
            Attribute { id; designator; expr }
210
        | Function { id; assoc_list } ->
211
            let id = self#vhdl_name_t id  in
212
            let assoc_list = self#list self#vhdl_assoc_element_t assoc_list
213
               in
214
            Function { id; assoc_list }
215
        | NoName  -> NoName
216
    method vhdl_assoc_element_t :
217
      vhdl_assoc_element_t -> vhdl_assoc_element_t=
218
      fun
219
        { formal_name; formal_arg; actual_name; actual_designator;
220
          actual_expr }
221
         ->
222
        let formal_name = self#option self#vhdl_name_t formal_name  in
223
        let formal_arg = self#option self#vhdl_name_t formal_arg  in
224
        let actual_name = self#option self#vhdl_name_t actual_name  in
225
        let actual_designator =
226
          self#option self#vhdl_name_t actual_designator  in
227
        let actual_expr = self#option self#vhdl_expr_t actual_expr  in
228
        {
229
          formal_name;
230
          formal_arg;
231
          actual_name;
232
          actual_designator;
233
          actual_expr
234
        }
235
    method vhdl_element_assoc_t :
236
      vhdl_element_assoc_t -> vhdl_element_assoc_t=
237
      fun { choices; expr }  ->
238
        let choices = self#list self#vhdl_expr_t choices  in
239
        let expr = self#vhdl_expr_t expr  in { choices; expr }
240
    method vhdl_array_attributes_t :
241
      vhdl_array_attributes_t -> vhdl_array_attributes_t=
242
      fun x  ->
243
        match x with
244
        | AAttInt { id; arg } ->
245
            let id = self#string id  in
246
            let arg = self#int arg  in AAttInt { id; arg }
247
        | AAttAscending  -> AAttAscending
248
    method vhdl_signal_attributes_t :
249
      vhdl_signal_attributes_t -> vhdl_signal_attributes_t=
250
      fun x  -> match x with | SigAtt a -> let a = self#string a  in SigAtt a
251
    method vhdl_string_attributes_t :
252
      vhdl_string_attributes_t -> vhdl_string_attributes_t=
253
      fun x  ->
254
        match x with | StringAtt a -> let a = self#string a  in StringAtt a
255
    method vhdl_suffix_selection_t : vhdl_suffix_selection_t -> vhdl_suffix_selection_t=
256
      fun x  ->
257
        match x with
258
        | Idx a -> let a = self#int a  in Idx a
259
        | SuffixRange (a,b) ->
260
            let a = self#int a  in let b = self#int b  in SuffixRange (a, b)
261

    
262
    method vhdl_type_attributes_t :
263
      'a .
264
        ('a -> 'a) -> 'a vhdl_type_attributes_t -> 'a vhdl_type_attributes_t=
265
      fun _basetype  ->
266
        fun x  ->
267
          match x with
268
          | TAttNoArg { id } -> let id = self#string id  in TAttNoArg { id }
269
          | TAttIntArg { id; arg } ->
270
              let id = self#string id  in
271
              let arg = self#int arg  in TAttIntArg { id; arg }
272
          | TAttValArg { id; arg } ->
273
              let id = self#string id  in
274
              let arg = _basetype arg  in TAttValArg { id; arg }
275
          | TAttStringArg { id; arg } ->
276
              let id = self#string id  in
277
              let arg = self#string arg  in TAttStringArg { id; arg }
278

    
279
    method vhdl_parameter_t : vhdl_parameter_t -> vhdl_parameter_t=
280
      fun { names; mode; typ; init_val }  ->
281
        let names = self#list self#vhdl_name_t names  in
282
        let mode = self#list self#string mode  in
283
        let typ = self#vhdl_subtype_indication_t typ  in
284
        let init_val = self#option self#vhdl_cst_val_t init_val  in
285
        { names; mode; typ; init_val }
286

    
287
    method vhdl_subprogram_spec_t :
288
      vhdl_subprogram_spec_t -> vhdl_subprogram_spec_t=
289
      fun { name; typeMark; parameters; isPure }  ->
290
        let name = self#string name  in
291
        let typeMark = self#vhdl_name_t typeMark  in
292
        let parameters = self#list self#vhdl_parameter_t parameters  in
293
        let isPure = self#bool isPure  in
294
        { name; typeMark; parameters; isPure }
295

    
296
    method vhdl_sequential_stmt_t :
297
      vhdl_sequential_stmt_t -> vhdl_sequential_stmt_t=
298
      fun x  ->
299
        match x with
300
        | VarAssign { label; lhs; rhs } ->
301
            let label = self#vhdl_name_t label  in
302
            let lhs = self#vhdl_name_t lhs  in
303
            let rhs = self#vhdl_expr_t rhs  in VarAssign { label; lhs; rhs }
304
        | SigSeqAssign { label; lhs; rhs } ->
305
            let label = self#vhdl_name_t label  in
306
            let lhs = self#vhdl_name_t lhs  in
307
            let rhs = self#list self#vhdl_expr_t rhs  in
308
            SigSeqAssign { label; lhs; rhs }
309
        | If { label; if_cases; default } ->
310
            let label = self#vhdl_name_t label  in
311
            let if_cases = self#list self#vhdl_if_case_t if_cases  in
312
            let default = self#list self#vhdl_sequential_stmt_t default  in
313
            If { label; if_cases; default }
314
        | Case { label; guard; branches } ->
315
            let label = self#vhdl_name_t label  in
316
            let guard = self#vhdl_expr_t guard  in
317
            let branches = self#list self#vhdl_case_item_t branches  in
318
            Case { label; guard; branches }
319
        | Exit { label; loop_label; condition } ->
320
            let label = self#vhdl_name_t label  in
321
            let loop_label = self#option self#string loop_label  in
322
            let condition = self#option self#vhdl_expr_t condition  in
323
            Exit { label; loop_label; condition }
324
        | Assert { label; cond; report; severity } ->
325
            let label = self#vhdl_name_t label  in
326
            let cond = self#vhdl_expr_t cond  in
327
            let report = self#vhdl_expr_t report  in
328
            let severity = self#vhdl_expr_t severity  in
329
            Assert { label; cond; report; severity }
330
        | ProcedureCall { label; name; assocs } ->
331
            let label = self#vhdl_name_t label  in
332
            let name = self#vhdl_name_t name  in
333
            let assocs = self#list self#vhdl_assoc_element_t assocs  in
334
            ProcedureCall { label; name; assocs }
335
        | Wait  -> Wait
336
        | Null { label } ->
337
            let label = self#vhdl_name_t label  in Null { label }
338
        | Return { label } ->
339
            let label = self#vhdl_name_t label  in Return { label }
340
    method vhdl_if_case_t : vhdl_if_case_t -> vhdl_if_case_t=
341
      fun { if_cond; if_block }  ->
342
        let if_cond = self#vhdl_expr_t if_cond  in
343
        let if_block = self#list self#vhdl_sequential_stmt_t if_block  in
344
        { if_cond; if_block }
345
    method vhdl_case_item_t : vhdl_case_item_t -> vhdl_case_item_t=
346
      fun { when_cond; when_stmt }  ->
347
        let when_cond = self#list self#vhdl_expr_t when_cond  in
348
        let when_stmt = self#list self#vhdl_sequential_stmt_t when_stmt  in
349
        { when_cond; when_stmt }
350

    
351
    method vhdl_declaration_t : vhdl_declaration_t -> vhdl_declaration_t=
352
      fun x  ->
353
        match x with
354
        | VarDecl { names; typ; init_val } ->
355
            let names = self#list self#vhdl_name_t names  in
356
            let typ = self#vhdl_subtype_indication_t typ  in
357
            let init_val = self#vhdl_expr_t init_val  in
358
            VarDecl { names; typ; init_val }
359
        | CstDecl { names; typ; init_val } ->
360
            let names = self#list self#vhdl_name_t names  in
361
            let typ = self#vhdl_subtype_indication_t typ  in
362
            let init_val = self#vhdl_expr_t init_val  in
363
            CstDecl { names; typ; init_val }
364
        | SigDecl { names; typ; init_val } ->
365
            let names = self#list self#vhdl_name_t names  in
366
            let typ = self#vhdl_subtype_indication_t typ  in
367
            let init_val = self#vhdl_expr_t init_val  in
368
            SigDecl { names; typ; init_val }
369
        | Subprogram { name; kind; spec; decl_part; stmts } ->
370
            let name = self#vhdl_name_t name  in
371
            let kind = self#string kind  in
372
            let spec = self#vhdl_subprogram_spec_t spec  in
373
            let decl_part = self#list self#vhdl_declaration_t decl_part  in
374
            let stmts = self#list self#vhdl_sequential_stmt_t stmts  in
375
            Subprogram { name; kind; spec; decl_part; stmts }
376

    
377
    method vhdl_signal_condition_t : vhdl_signal_condition_t -> vhdl_signal_condition_t=
378
      fun { expr; cond }  ->
379
        let expr = self#list self#vhdl_expr_t expr  in
380
        let cond = self#vhdl_expr_t cond  in { expr; cond }
381

    
382
    method vhdl_signal_selection_t : vhdl_signal_selection_t -> vhdl_signal_selection_t=
383
      fun { expr; when_sel }  ->
384
        let expr = self#vhdl_expr_t expr  in
385
        let when_sel = self#list self#vhdl_expr_t when_sel  in
386
        { expr; when_sel }
387

    
388
    method vhdl_conditional_signal_t :
389
      vhdl_conditional_signal_t -> vhdl_conditional_signal_t=
390
      fun { postponed; label; lhs; rhs; cond; delay }  ->
391
        let postponed = self#bool postponed  in
392
        let label = self#vhdl_name_t label  in
393
        let lhs = self#vhdl_name_t lhs  in
394
        let rhs = self#list self#vhdl_signal_condition_t rhs  in
395
        let cond = self#vhdl_expr_t cond  in
396
        let delay = self#vhdl_expr_t delay  in
397
        { postponed; label; lhs; rhs; cond; delay }
398

    
399

    
400
    method vhdl_process_t : vhdl_process_t -> vhdl_process_t=
401
      fun { id; declarations; active_sigs; body }  ->
402
        let id = self#vhdl_name_t id  in
403
        let declarations =
404
          self#option (self#list self#vhdl_declaration_t) declarations  in
405
        let active_sigs = self#list self#vhdl_name_t active_sigs  in
406
        let body = self#list self#vhdl_sequential_stmt_t body  in
407
        { id; declarations; active_sigs; body }
408

    
409
    method vhdl_selected_signal_t : vhdl_selected_signal_t -> vhdl_selected_signal_t=
410
      fun { postponed; label; lhs; sel; branches; delay }  ->
411
        let postponed = self#bool postponed  in
412
        let label = self#vhdl_name_t label  in
413
        let lhs = self#vhdl_name_t lhs  in
414
        let sel = self#vhdl_expr_t sel  in
415
        let branches = self#list self#vhdl_signal_selection_t branches  in
416
        let delay = self#option self#vhdl_expr_t delay  in
417
        { postponed; label; lhs; sel; branches; delay }
418

    
419
    method vhdl_port_mode_t : vhdl_port_mode_t -> vhdl_port_mode_t=
420
      fun x  -> x
421

    
422
    method vhdl_component_instantiation_t :
423
      vhdl_component_instantiation_t -> vhdl_component_instantiation_t=
424
      fun { name; inst_unit; archi_name; generic_map; port_map }  ->
425
        let name = self#vhdl_name_t name  in
426
        let inst_unit = self#vhdl_name_t inst_unit  in
427
        let archi_name = self#option self#vhdl_name_t archi_name  in
428
        let generic_map = self#option self#vhdl_assoc_element_t generic_map
429
           in
430
        let port_map = self#option self#vhdl_assoc_element_t port_map  in
431
        { name; inst_unit; archi_name; generic_map; port_map }
432

    
433
    method vhdl_concurrent_stmt_t :
434
      vhdl_concurrent_stmt_t -> vhdl_concurrent_stmt_t=
435
      fun x  ->
436
        match x with
437
        | SigAssign a -> let a = self#vhdl_conditional_signal_t a  in SigAssign a
438
        | Process a -> let a = self#vhdl_process_t a  in Process a
439
        | SelectedSig a -> let a = self#vhdl_selected_signal_t a  in SelectedSig a
440
        | ComponentInst a -> let a = self#vhdl_component_instantiation_t a  in ComponentInst a 
441

    
442
    method vhdl_port_t : vhdl_port_t -> vhdl_port_t=
443
      fun { names; mode; typ; expr }  ->
444
        let names = self#list self#vhdl_name_t names  in
445
        let mode = self#vhdl_port_mode_t mode  in
446
        let typ = self#vhdl_subtype_indication_t typ  in
447
        let expr = self#vhdl_expr_t expr  in { names; mode; typ; expr }
448

    
449
    method vhdl_entity_t : vhdl_entity_t -> vhdl_entity_t=
450
      fun { name; generics; ports; declaration; stmts }  ->
451
        let name = self#vhdl_name_t name  in
452
        let generics = self#list self#vhdl_port_t generics  in
453
        let ports = self#list self#vhdl_port_t ports  in
454
        let declaration = self#list self#vhdl_declaration_t declaration  in
455
        let stmts = self#list self#vhdl_concurrent_stmt_t stmts  in
456
        { name; generics; ports; declaration; stmts }
457

    
458
    method vhdl_package_t : vhdl_package_t -> vhdl_package_t=
459
      fun { name; shared_defs; shared_decls }  ->
460
        let name = self#vhdl_name_t name  in
461
        let shared_defs = self#list self#vhdl_definition_t shared_defs  in
462
        let shared_decls = self#list self#vhdl_declaration_t shared_decls  in
463
        { name; shared_defs; shared_decls }
464

    
465
    method vhdl_load_t : vhdl_load_t -> vhdl_load_t=
466
      fun x  ->
467
        match x with
468
        | Library a -> let a = self#list self#vhdl_name_t a  in Library a
469
        | Use a -> let a = self#list self#vhdl_name_t a  in Use a
470

    
471
    method vhdl_architecture_t : vhdl_architecture_t -> vhdl_architecture_t=
472
      fun { name; entity; declarations; body }  ->
473
        let name = self#vhdl_name_t name  in
474
        let entity = self#vhdl_name_t entity  in
475
        let declarations = self#list self#vhdl_declaration_t declarations  in
476
        let body = self#list self#vhdl_concurrent_stmt_t body  in
477
        { name; entity; declarations; body }
478

    
479
    method vhdl_configuration_t :
480
      vhdl_configuration_t -> vhdl_configuration_t= self#unit
481

    
482
    method vhdl_library_unit_t : vhdl_library_unit_t -> vhdl_library_unit_t=
483
      fun x  ->
484
        match x with
485
        | Package a -> let a = self#vhdl_package_t a  in Package a
486
        | Entities a -> let a = self#vhdl_entity_t a  in Entities a
487
        | Architecture a ->
488
            let a = self#vhdl_architecture_t a  in Architecture a
489
        | Configuration a ->
490
            let a = self#vhdl_configuration_t a  in Configuration a
491

    
492
    method vhdl_design_unit_t : vhdl_design_unit_t -> vhdl_design_unit_t=
493
      fun { contexts; library }  ->
494
        let contexts = self#list self#vhdl_load_t contexts  in
495
        let library = self#vhdl_library_unit_t library  in
496
        { contexts; library }
497

    
498
    method vhdl_design_file_t : vhdl_design_file_t -> vhdl_design_file_t=
499
      fun { design_units }  ->
500
        let design_units = self#list self#vhdl_design_unit_t design_units  in
501
        { design_units }
502

    
503
    method vhdl_file_t : vhdl_file_t -> vhdl_file_t=
504
      fun { design_file }  ->
505
        let design_file = self#vhdl_design_file_t design_file  in
506
        { design_file }
507
  end