Revision 20d354f4
Added by Arnaud Dieumegard over 3 years ago
src/backends/VHDL/vhdl_ast_map.ml  

15  15 
let _ = fun (_ : vhdl_signal_attributes_t) > () 
16  16 
let _ = fun (_ : vhdl_string_attributes_t) > () 
17  17 
let _ = fun (_ : vhdl_suffix_selection_t) > () 
18 
let _ = fun (_ : 'basetype vhdl_type_attributes_t) > ()


18 
(*let _ = fun (_ : 'basetype vhdl_type_attributes_t) > () *)


19  19 
let _ = fun (_ : vhdl_parameter_t) > () 
20  20 
let _ = fun (_ : vhdl_subprogram_spec_t) > () 
21  21 
let _ = fun (_ : vhdl_sequential_stmt_t) > () 
...  ...  
112  112 
 Void > Void 
113  113 
method vhdl_element_declaration_t : 
114  114 
vhdl_element_declaration_t > vhdl_element_declaration_t= 
115 
fun { names; definition } > 

116 
let names = self#list self#vhdl_name_t names in


115 
fun { ed_names; definition } >


116 
let ed_names = self#list self#vhdl_name_t ed_names in


117  117 
let definition = self#vhdl_subtype_indication_t definition in 
118 
{ names; definition } 

118 
{ ed_names; definition }


119  119 
method vhdl_subtype_indication_t : 
120  120 
vhdl_subtype_indication_t > vhdl_subtype_indication_t= 
121 
fun { name; functionName; const } > 

122 
let name = self#vhdl_name_t name in


121 
fun { si_name; functionName; const } >


122 
let si_name = self#vhdl_name_t si_name in


123  123 
let functionName = self#vhdl_name_t functionName in 
124  124 
let const = self#vhdl_constraint_t const in 
125 
{ name; functionName; const } 

125 
{ si_name; functionName; const }


126  126 
method vhdl_discrete_range_t : 
127  127 
vhdl_discrete_range_t > vhdl_discrete_range_t= 
128  128 
fun x > 
...  ...  
270  270 
 SuffixRange (a,b) > 
271  271 
let a = self#int a in let b = self#int b in SuffixRange (a, b) 
272  272  
273 
method vhdl_type_attributes_t : 

273 
(* method vhdl_type_attributes_t :


274  274 
'a . 
275  275 
('a > 'a) > 'a vhdl_type_attributes_t > 'a vhdl_type_attributes_t= 
276  276 
fun _basetype > 
...  ...  
285  285 
let arg = _basetype arg in TAttValArg { id; arg } 
286  286 
 TAttStringArg { id; arg } > 
287  287 
let id = self#string id in 
288 
let arg = self#string arg in TAttStringArg { id; arg } 

288 
let arg = self#string arg in TAttStringArg { id; arg } *)


289  289  
290  290 
method vhdl_parameter_t : vhdl_parameter_t > vhdl_parameter_t= 
291 
fun { names; mode; typ; init_val } >


292 
let names = self#list self#vhdl_name_t names in


293 
let mode = self#list self#string mode in


294 
let typ = self#vhdl_subtype_indication_t typ in


291 
fun { parameter_names; parameter_mode; parameter_typ; init_val } >


292 
let parameter_names = self#list self#vhdl_name_t parameter_names in


293 
let parameter_mode = self#list self#string parameter_mode in


294 
let parameter_typ = self#vhdl_subtype_indication_t parameter_typ in


295  295 
let init_val = self#option self#vhdl_cst_val_t init_val in 
296 
{ names; mode; typ; init_val }


296 
{ parameter_names; parameter_mode; parameter_typ; init_val }


297  297  
298  298 
method vhdl_subprogram_spec_t : 
299  299 
vhdl_subprogram_spec_t > vhdl_subprogram_spec_t= 
300 
fun { name; subprogram_type; typeMark; parameters; isPure } > 

301 
let name = self#string name in


300 
fun { ss_name; subprogram_type; typeMark; parameters; isPure } >


301 
let ss_name = self#string ss_name in


302  302 
let subprogram_type = self#string subprogram_type in 
303  303 
let typeMark = self#vhdl_name_t typeMark in 
304  304 
let parameters = self#list self#vhdl_parameter_t parameters in 
305  305 
let isPure = self#bool isPure in 
306 
{ name; subprogram_type; typeMark; parameters; isPure } 

306 
{ ss_name; subprogram_type; typeMark; parameters; isPure }


307  307  
308  308 
method vhdl_sequential_stmt_t : 
309  309 
vhdl_sequential_stmt_t > vhdl_sequential_stmt_t= 
310  310 
fun x > 
311  311 
match x with 
312 
 VarAssign { label; lhs; rhs } > 

312 
 VarAssign { label; seqs_lhs; rhs } >


313  313 
let label = self#vhdl_name_t label in 
314 
let lhs = self#vhdl_name_t lhs in


315 
let rhs = self#vhdl_expr_t rhs in VarAssign { label; lhs; rhs } 

316 
 SigSeqAssign { label; lhs; rhs } > 

314 
let seqs_lhs = self#vhdl_name_t seqs_lhs in


315 
let rhs = self#vhdl_expr_t rhs in VarAssign { label; seqs_lhs; rhs }


316 
 SigSeqAssign { label; seqs_lhs; rhs } >


317  317 
let label = self#vhdl_name_t label in 
318 
let lhs = self#vhdl_name_t lhs in


318 
let seqs_lhs = self#vhdl_name_t seqs_lhs in


319  319 
let rhs = self#list self#vhdl_waveform_element_t rhs in 
320 
SigSeqAssign { label; lhs; rhs } 

320 
SigSeqAssign { label; seqs_lhs; rhs }


321  321 
 If { label; if_cases; default } > 
322  322 
let label = self#vhdl_name_t label in 
323  323 
let if_cases = self#list self#vhdl_if_case_t if_cases in 
...  ...  
393  393  
394  394 
method vhdl_declarative_item_t : 
395  395 
vhdl_declarative_item_t > vhdl_declarative_item_t= 
396 
fun { use_clause; declaration; definition } >


396 
fun { use_clause; di_declaration; di_definition } >


397  397 
let use_clause = self#option self#vhdl_load_t use_clause in 
398 
let declaration = self#option self#vhdl_declaration_t declaration in


399 
let definition = self#option self#vhdl_definition_t definition in


400 
{ use_clause; declaration; definition }


398 
let di_declaration = self#option self#vhdl_declaration_t di_declaration in


399 
let di_definition = self#option self#vhdl_definition_t di_definition in


400 
{ use_clause; di_declaration; di_definition }


401  401  
402  402 
method vhdl_waveform_element_t : 
403  403 
vhdl_waveform_element_t > vhdl_waveform_element_t= 
404 
fun { value; delay } > 

404 
fun { value; we_delay } >


405  405 
let value = self#option self#vhdl_expr_t value in 
406 
let delay = self#option self#vhdl_expr_t delay in { value; delay }


406 
let we_delay = self#option self#vhdl_expr_t we_delay in { value; we_delay }


407  407  
408  408 
method vhdl_signal_condition_t : 
409  409 
vhdl_signal_condition_t > vhdl_signal_condition_t= 
410 
fun { expr; cond } > 

411 
let expr = self#list self#vhdl_waveform_element_t expr in


412 
let cond = self#option self#vhdl_expr_t cond in { expr; cond } 

410 
fun { sc_expr; cond } >


411 
let sc_expr = self#list self#vhdl_waveform_element_t sc_expr in


412 
let cond = self#option self#vhdl_expr_t cond in { sc_expr; cond }


413  413  
414  414 
method vhdl_signal_selection_t : 
415  415 
vhdl_signal_selection_t > vhdl_signal_selection_t= 
416 
fun { expr; when_sel } > 

417 
let expr = self#list self#vhdl_waveform_element_t expr in


416 
fun { ss_expr; when_sel } >


417 
let ss_expr = self#list self#vhdl_waveform_element_t ss_expr in


418  418 
let when_sel = self#list self#vhdl_expr_t when_sel in 
419 
{ expr; when_sel } 

419 
{ ss_expr; when_sel }


420  420  
421  421 
method vhdl_conditional_signal_t : 
422  422 
vhdl_conditional_signal_t > vhdl_conditional_signal_t= 
423 
fun { postponed; label; lhs; rhs; delay } >


424 
let postponed = self#bool postponed in


425 
let label = self#vhdl_name_t label in


426 
let lhs = self#vhdl_name_t lhs in


423 
fun { cs_postponed; cs_label; cs_lhs; rhs; cs_delay } >


424 
let cs_postponed = self#bool cs_postponed in


425 
let cs_label = self#vhdl_name_t cs_label in


426 
let cs_lhs = self#vhdl_name_t cs_lhs in


427  427 
let rhs = self#list self#vhdl_signal_condition_t rhs in 
428 
let delay = self#vhdl_expr_t delay in


429 
{ postponed; label; lhs; rhs; delay }


428 
let cs_delay = self#vhdl_expr_t cs_delay in


429 
{ cs_postponed; cs_label; cs_lhs; rhs; cs_delay }


430  430  
431  431 
method vhdl_process_t : vhdl_process_t > vhdl_process_t= 
432 
fun { id; declarations; active_sigs; body } >


432 
fun { id; p_declarations; active_sigs; p_body } >


433  433 
let id = self#vhdl_name_t id in 
434 
let declarations = self#list self#vhdl_declarative_item_t declarations in


434 
let p_declarations = self#list self#vhdl_declarative_item_t p_declarations in


435  435 
let active_sigs = self#list self#vhdl_name_t active_sigs in 
436 
let body = self#list self#vhdl_sequential_stmt_t body in


437 
{ id; declarations; active_sigs; body }


436 
let p_body = self#list self#vhdl_sequential_stmt_t p_body in


437 
{ id; p_declarations; active_sigs; p_body }


438  438  
439  439 
method vhdl_selected_signal_t : 
440  440 
vhdl_selected_signal_t > vhdl_selected_signal_t= 
441 
fun { postponed; label; lhs; sel; branches; delay } >


442 
let postponed = self#bool postponed in


443 
let label = self#vhdl_name_t label in


444 
let lhs = self#vhdl_name_t lhs in


441 
fun { ss_postponed; ss_label; ss_lhs; sel; branches; ss_delay } >


442 
let ss_postponed = self#bool ss_postponed in


443 
let ss_label = self#vhdl_name_t ss_label in


444 
let ss_lhs = self#vhdl_name_t ss_lhs in


445  445 
let sel = self#vhdl_expr_t sel in 
446  446 
let branches = self#list self#vhdl_signal_selection_t branches in 
447 
let delay = self#option self#vhdl_expr_t delay in


448 
{ postponed; label; lhs; sel; branches; delay }


447 
let ss_delay = self#option self#vhdl_expr_t ss_delay in


448 
{ ss_postponed; ss_label; ss_lhs; sel; branches; ss_delay }


449  449  
450  450 
method vhdl_port_mode_t : vhdl_port_mode_t > vhdl_port_mode_t= 
451  451 
fun x > x 
452  452  
453  453 
method vhdl_component_instantiation_t : 
454  454 
vhdl_component_instantiation_t > vhdl_component_instantiation_t= 
455 
fun { name; inst_unit; inst_unit_type; archi_name; generic_map; port_map } > 

456 
let name = self#vhdl_name_t name in


455 
fun { ci_name; inst_unit; inst_unit_type; archi_name; generic_map; port_map } >


456 
let ci_name = self#vhdl_name_t ci_name in


457  457 
let inst_unit = self#vhdl_name_t inst_unit in 
458  458 
let inst_unit_type = self#string inst_unit_type in 
459  459 
let archi_name = self#option self#vhdl_name_t archi_name in 
460  460 
let generic_map = self#list self#vhdl_assoc_element_t generic_map in 
461  461 
let port_map = self#list self#vhdl_assoc_element_t port_map in 
462 
{ name; inst_unit; inst_unit_type; archi_name; generic_map; port_map } 

462 
{ ci_name; inst_unit; inst_unit_type; archi_name; generic_map; port_map }


463  463  
464  464 
method vhdl_concurrent_stmt_t : 
465  465 
vhdl_concurrent_stmt_t > vhdl_concurrent_stmt_t= 
...  ...  
471  471 
 ComponentInst a > let a = self#vhdl_component_instantiation_t a in ComponentInst a 
472  472  
473  473 
method vhdl_port_t : vhdl_port_t > vhdl_port_t= 
474 
fun { names; mode; typ; expr } >


475 
let names = self#list self#vhdl_name_t names in


476 
let mode = self#vhdl_port_mode_t mode in


477 
let typ = self#vhdl_subtype_indication_t typ in


478 
let expr = self#vhdl_expr_t expr in { names; mode; typ; expr }


474 
fun { port_names; port_mode; port_typ; port_expr } >


475 
let port_names = self#list self#vhdl_name_t port_names in


476 
let port_mode = self#vhdl_port_mode_t port_mode in


477 
let port_typ = self#vhdl_subtype_indication_t port_typ in


478 
let port_expr = self#vhdl_expr_t port_expr in { port_names; port_mode; port_typ; port_expr }


479  479  
480  480 
method vhdl_entity_t : vhdl_entity_t > vhdl_entity_t= 
481 
fun { name; generics; ports; declaration; stmts } >


482 
let name = self#vhdl_name_t name in


481 
fun { e_name; generics; ports; e_declaration; stmts } >


482 
let e_name = self#vhdl_name_t e_name in


483  483 
let generics = self#list self#vhdl_port_t generics in 
484  484 
let ports = self#list self#vhdl_port_t ports in 
485 
let declaration = self#list self#vhdl_declarative_item_t declaration


485 
let e_declaration = self#list self#vhdl_declarative_item_t e_declaration


486  486 
in 
487  487 
let stmts = self#list self#vhdl_concurrent_stmt_t stmts in 
488 
{ name; generics; ports; declaration; stmts }


488 
{ e_name; generics; ports; e_declaration; stmts }


489  489  
490  490 
method vhdl_package_t : vhdl_package_t > vhdl_package_t= 
491 
fun { name; shared_defs; shared_decls; shared_uses } > 

492 
let name = self#vhdl_name_t name in


491 
fun { p_name; shared_defs; shared_decls; shared_uses } >


492 
let p_name = self#vhdl_name_t p_name in


493  493 
let shared_defs = self#list self#vhdl_definition_t shared_defs in 
494  494 
let shared_decls = self#list self#vhdl_declaration_t shared_decls in 
495  495 
let shared_uses = self#list self#vhdl_load_t shared_uses in 
496 
{ name; shared_defs; shared_decls; shared_uses } 

496 
{ p_name; shared_defs; shared_decls; shared_uses }


497  497  
498  498 
method vhdl_load_t : vhdl_load_t > vhdl_load_t= 
499  499 
fun x > 
...  ...  
502  502 
 Use a > let a = self#list self#vhdl_name_t a in Use a 
503  503  
504  504 
method vhdl_architecture_t : vhdl_architecture_t > vhdl_architecture_t= 
505 
fun { name; entity; declarations; body } >


506 
let name = self#vhdl_name_t name in


505 
fun { a_name; entity; a_declarations; a_body } >


506 
let a_name = self#vhdl_name_t a_name in


507  507 
let entity = self#vhdl_name_t entity in 
508 
let declarations = self#list self#vhdl_declarative_item_t declarations in


509 
let body = self#list self#vhdl_concurrent_stmt_t body in


510 
{ name; entity; declarations; body }


508 
let a_declarations = self#list self#vhdl_declarative_item_t a_declarations in


509 
let a_body = self#list self#vhdl_concurrent_stmt_t a_body in


510 
{ a_name; entity; a_declarations; a_body }


511  511  
512  512 
method vhdl_configuration_t : 
513  513 
vhdl_configuration_t > vhdl_configuration_t= self#unit 
Also available in: Unified diff
Update of types fields names