Project

General

Profile

Download (4.2 KB) Statistics
| Branch: | Tag: | Revision:
1
open Vhdl_ast
2

    
3
type mini_vhdl_sequential_stmt_t = 
4
  | VarAssign of {
5
      label: vhdl_name_t option;
6
      lhs: vhdl_name_t;
7
      rhs: vhdl_expr_t }
8
  | SigSeqAssign of {
9
      label: vhdl_name_t option;
10
      lhs: vhdl_name_t;
11
      rhs: vhdl_waveform_element_t list}
12
  | SigCondAssign of {
13
      label: vhdl_name_t option;
14
      lhs: vhdl_name_t;
15
      rhs: vhdl_signal_condition_t list;
16
      delay: vhdl_expr_t option}
17
  | SigSelectAssign of {
18
      label: vhdl_name_t option;
19
      lhs: vhdl_name_t;
20
      sel: vhdl_expr_t;
21
      branches: vhdl_signal_selection_t list;
22
      delay: vhdl_expr_t option}
23
  | If of {
24
      label: vhdl_name_t option;
25
      if_cases: mini_vhdl_if_case_t list;
26
      default: mini_vhdl_sequential_stmt_t list}
27
  | Case of {
28
      label: vhdl_name_t option;
29
      guard: vhdl_expr_t;
30
      branches: mini_vhdl_case_item_t list }
31
  | Exit of {
32
      label: vhdl_name_t option;
33
      loop_label: string option;
34
      condition: vhdl_expr_t option}
35
  | Assert of {
36
      label: vhdl_name_t option;
37
      cond: vhdl_expr_t;
38
      report: vhdl_expr_t;
39
      severity: vhdl_expr_t}
40
  | ProcedureCall of {
41
      label: vhdl_name_t option;
42
      name: vhdl_name_t;
43
      assocs: vhdl_assoc_element_t list }
44
  | Wait
45
  | Null of {
46
      label: vhdl_name_t option}
47
  | Return of {
48
     label: vhdl_name_t option;
49
     expr: vhdl_expr_t option}
50
and mini_vhdl_if_case_t =
51
  {
52
    if_cond: vhdl_expr_t;
53
    if_block: mini_vhdl_sequential_stmt_t list;
54
  }
55
and mini_vhdl_case_item_t = 
56
  {
57
    when_cond: vhdl_expr_t list;
58
    when_stmt: mini_vhdl_sequential_stmt_t list;
59
  }
60
[@@deriving show { with_path = false }];;
61

    
62
type mini_vhdl_declaration_t =
63
  | VarDecl of {
64
      names : vhdl_name_t list;
65
      typ : vhdl_subtype_indication_t;
66
      init_val : vhdl_expr_t
67
    }
68
  | CstDecl of {
69
      names : vhdl_name_t list;
70
      typ : vhdl_subtype_indication_t;
71
      init_val : vhdl_expr_t
72
    }
73
  | SigDecl of {
74
      names : vhdl_name_t list;
75
      typ : vhdl_subtype_indication_t;
76
      init_val : vhdl_expr_t
77
    }
78
  | ComponentDecl of {
79
      name: vhdl_name_t;
80
      generics: vhdl_port_t list;
81
      ports: vhdl_port_t list;
82
    }
83
  | Subprogram of {
84
      spec: vhdl_subprogram_spec_t;
85
      decl_part: mini_vhdl_declaration_t list;
86
      stmts: mini_vhdl_sequential_stmt_t list
87
    }
88
[@@deriving show { with_path = false }];;
89

    
90
type mini_vhdl_declarative_item_t =
91
  {
92
    use_clause: vhdl_load_t option;
93
    declaration: mini_vhdl_declaration_t option;
94
    definition: vhdl_definition_t option;
95
  }
96
[@@deriving show { with_path = false }];;
97

    
98
type mini_vhdl_component_instantiation_t =
99
  {
100
    name: vhdl_name_t;
101
    archi: vhdl_architecture_t;
102
    entity: vhdl_entity_t;
103
    generic_map: vhdl_assoc_element_t list;
104
    port_map: vhdl_assoc_element_t list;
105
  }
106
[@@deriving show { with_path = false }];;
107

    
108
type mini_vhdl_process_t =
109
  {
110
    id: vhdl_name_t;
111
    declarations: mini_vhdl_declarative_item_t list;
112
    active_sigs: vhdl_name_t list;
113
    body: mini_vhdl_sequential_stmt_t list;
114
    postponed: bool;
115
    label: vhdl_name_t option
116
  }
117
[@@deriving show { with_path = false }];;
118

    
119
type mini_vhdl_concurrent_stmt_t =
120
  | Process of mini_vhdl_process_t
121
  | SelectedSig of vhdl_selected_signal_t
122
  | ComponentInst of mini_vhdl_component_instantiation_t
123
[@@deriving show { with_path = false }];;
124

    
125
type mini_vhdl_package_t =
126
  {
127
    name: vhdl_name_t;
128
    shared_defs: vhdl_definition_t list;
129
    shared_decls: mini_vhdl_declaration_t list;
130
    shared_uses: vhdl_load_t list;
131
  }
132
[@@deriving show { with_path = false }];;
133

    
134
type mini_vhdl_component_t =
135
  {
136
    names: vhdl_name_t list;
137
    generics: vhdl_port_t list; (* From related 'entity' *)
138
    ports: vhdl_port_t list; (* From related 'entity' *)
139
    contexts: vhdl_load_t list; (* Related 'declarations' contexts + relatated entity contexts *)
140
    declarations: mini_vhdl_declaration_t list; (* From inlined 'declarations' + entity.declaration *)
141
    definitions: vhdl_definition_t list; (* From inlined 'declarations' + entity.declaration *)
142
    body: mini_vhdl_concurrent_stmt_t list; (* + entity.stmts *)
143
  }
144
[@@deriving show { with_path = false }];;
145

    
146
type mini_vhdl_design_file_t = 
147
  {
148
    components: mini_vhdl_component_t list;
149
    packages: mini_vhdl_package_t list;
150
  }
151
[@@deriving show { with_path = false }];;
(1-1/10)