Project

General

Profile

Revision e1102543 src/tools/importer/vhdl_ast.ml

View differences:

src/tools/importer/vhdl_ast.ml
18 18
let literal_base = ["B"; "O"; "X"; "UB"; "UO"; "UX"; "SB"; "SO"; "SX"; "D"] (* Prefix of CstLiteral *)
19 19

  
20 20
(* TODO: do we need more constructors ? *)
21
type cst_val_t = 
21
type vhdl_cst_val_t = 
22 22
    CstInt of int 
23 23
  | CstStdLogic of string
24 24
  | CstLiteral of string [@name "CST_LITERAL"]
......
61 61
  | Subtype of {name : vhdl_name_t ; typ : vhdl_subtype_indication_t} [@name "SUBTYPE_DECLARATION"]
62 62
and vhdl_expr_t =
63 63
  | Call of vhdl_name_t [@name "CALL"]
64
  | Cst of cst_val_t [@name "CONSTANT_VALUE"]
64
  | Cst of vhdl_cst_val_t [@name "CONSTANT_VALUE"]
65 65
  | Op of { id: string [@default ""]; args: vhdl_expr_t list [@default []]} [@name "EXPRESSION"]
66 66
  | IsNull [@name "IsNull"]
67 67
  | Time of { value: int; phy_unit: string [@default ""]}
......
133 133
    names: vhdl_name_t list;
134 134
    mode: string list [@default []];
135 135
    typ: vhdl_subtype_indication_t;
136
    init_val: cst_val_t option [@default Some (CstInt (0))];
136
    init_val: vhdl_cst_val_t option [@default Some (CstInt (0))];
137 137
  }
138 138
[@@deriving show { with_path = false }, yojson {strict = false}];;
139 139

  
......
182 182
  | VarDecl of {
183 183
      names : vhdl_name_t list; 
184 184
      typ : vhdl_subtype_indication_t; 
185
      init_val : cst_val_t option [@default Some (CstInt (0))] 
185
      init_val : vhdl_cst_val_t option [@default Some (CstInt (0))] 
186 186
    } [@name "VARIABLE_DECLARATION"]
187 187
  | CstDecl of { 
188 188
      names : vhdl_name_t list; 
189 189
      typ : vhdl_subtype_indication_t; 
190
      init_val : cst_val_t 
190
      init_val : vhdl_cst_val_t 
191 191
    } [@name "CONSTANT_DECLARATION"]
192 192
  | SigDecl of { 
193 193
      names : vhdl_name_t list; 
194 194
      typ : vhdl_subtype_indication_t; 
195
      init_val : cst_val_t option [@default Some (CstInt (0))] 
195
      init_val : vhdl_cst_val_t option [@default Some (CstInt (0))] 
196 196
    } [@name "SIGNAL_DECLARATION"]
197 197
  | Subprogram of {
198 198
      name: vhdl_name_t [@default NoName]; 

Also available in: Unified diff