## lustrec / src / tools / importer / vhdl_to_lustre.ml @ 27332198

History | View | Annotate | Download (22.6 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_subtype_indication_t) -> () |

8 |
let _ = fun (_ : vhdl_discrete_range_t) -> () |

9 |
let _ = fun (_ : vhdl_constraint_t) -> () |

10 |
let _ = fun (_ : vhdl_definition_t) -> () |

11 |
let _ = fun (_ : vhdl_expr_t) -> () |

12 |
let _ = fun (_ : vhdl_name_t) -> () |

13 |
let _ = fun (_ : vhdl_assoc_element_t) -> () |

14 |
let _ = fun (_ : vhdl_element_assoc_t) -> () |

15 |
let _ = fun (_ : vhdl_array_attributes_t) -> () |

16 |
let _ = fun (_ : vhdl_signal_attributes_t) -> () |

17 |
let _ = fun (_ : vhdl_string_attributes_t) -> () |

18 |
let _ = fun (_ : vhdl_suffix_selection_t) -> () |

19 |
let _ = fun (_ : 'basetype vhdl_type_attributes_t) -> () |

20 |
let _ = fun (_ : vhdl_parameter_t) -> () |

21 |
let _ = fun (_ : vhdl_subprogram_spec_t) -> () |

22 |
let _ = fun (_ : vhdl_sequential_stmt_t) -> () |

23 |
let _ = fun (_ : vhdl_if_case_t) -> () |

24 |
let _ = fun (_ : vhdl_case_item_t) -> () |

25 |
let _ = fun (_ : vhdl_declaration_t) -> () |

26 |
let _ = fun (_ : vhdl_signal_selection_t) -> () |

27 |
let _ = fun (_ : vhdl_signal_condition_t) -> () |

28 |
let _ = fun (_ : vhdl_conditional_signal_t) -> () |

29 |
let _ = fun (_ : vhdl_process_t) -> () |

30 |
let _ = fun (_ : vhdl_selected_signal_t) -> () |

31 |
let _ = fun (_ : vhdl_port_mode_t) -> () |

32 |
let _ = fun (_ : vhdl_component_instantiation_t) -> () |

33 |
let _ = fun (_ : vhdl_concurrent_stmt_t) -> () |

34 |
let _ = fun (_ : vhdl_port_t) -> () |

35 |
let _ = fun (_ : vhdl_entity_t) -> () |

36 |
let _ = fun (_ : vhdl_package_t) -> () |

37 |
let _ = fun (_ : vhdl_load_t) -> () |

38 |
let _ = fun (_ : vhdl_architecture_t) -> () |

39 |
let _ = fun (_ : vhdl_configuration_t) -> () |

40 |
let _ = fun (_ : vhdl_library_unit_t) -> () |

41 |
let _ = fun (_ : vhdl_design_unit_t) -> () |

42 |
let _ = fun (_ : vhdl_design_file_t) -> () |

43 |
let _ = fun (_ : vhdl_file_t) -> () |

44 | |

45 |
class virtual vhdl_to_lustre_map = |

46 |
object (self) |

47 |
method virtual string : string -> string |

48 |
method virtual list : 'a . ('a -> 'a) -> 'a list -> 'a list |

49 |
method virtual unit : unit -> unit |

50 |
method virtual bool : bool -> bool |

51 |
method virtual option : 'a . ('a -> 'a) -> 'a option -> 'a option |

52 |
method virtual int : int -> int |

53 |
method virtual vhdl_name_t : vhdl_name_t -> vhdl_name_t |

54 |
method virtual vhdl_definition_t : vhdl_definition_t -> vhdl_definition_t |

55 |
method virtual vhdl_port_t : vhdl_port_t -> vhdl_port_t |

56 |
method virtual vhdl_expr_t : vhdl_expr_t -> vhdl_expr_t |

57 |
method virtual vhdl_port_mode_t : vhdl_port_mode_t -> vhdl_port_mode_t |

58 |
method virtual vhdl_subtype_indication_t : vhdl_subtype_indication_t -> vhdl_subtype_indication_t |

59 |
method virtual vhdl_conditional_signal_t : vhdl_conditional_signal_t -> vhdl_conditional_signal_t |

60 |
method virtual vhdl_process_t : vhdl_process_t -> vhdl_process_t |

61 |
method virtual vhdl_selected_signal_t : vhdl_selected_signal_t -> vhdl_selected_signal_t |

62 |
method virtual vhdl_signal_selection_t : vhdl_signal_selection_t -> vhdl_signal_selection_t |

63 |
method virtual vhdl_suffix_selection_t : vhdl_suffix_selection_t -> vhdl_suffix_selection_t |

64 |
method virtual vhdl_declaration_t : vhdl_declaration_t -> vhdl_declaration_t |

65 |
method virtual vhdl_sequential_stmt_t : vhdl_sequential_stmt_t -> vhdl_sequential_stmt_t |

66 |
method virtual vhdl_signal_condition_t : vhdl_signal_condition_t -> vhdl_signal_condition_t |

67 |
method virtual vhdl_cst_val_t : vhdl_cst_val_t -> vhdl_cst_val_t |

68 |
method virtual vhdl_subprogram_spec_t : vhdl_subprogram_spec_t -> vhdl_subprogram_spec_t |

69 |
method virtual vhdl_discrete_range_t : vhdl_discrete_range_t -> vhdl_discrete_range_t |

70 |
method virtual vhdl_parameter_t : vhdl_parameter_t -> vhdl_parameter_t |

71 |
method virtual vhdl_component_instantiation_t : vhdl_component_instantiation_t -> vhdl_component_instantiation_t |

72 |
method virtual vhdl_concurrent_stmt_t : vhdl_concurrent_stmt_t -> vhdl_concurrent_stmt_t |

73 |
method virtual vhdl_declaration_t : vhdl_declaration_t -> vhdl_declaration_t |

74 |
method virtual vhdl_architecture_t : vhdl_architecture_t -> vhdl_architecture_t |

75 |
method virtual vhdl_configuration_t : vhdl_configuration_t -> vhdl_configuration_t |

76 |
method virtual vhdl_entity_t : vhdl_entity_t -> vhdl_entity_t |

77 |
method virtual vhdl_package_t : vhdl_package_t -> vhdl_package_t |

78 |
method virtual vhdl_library_unit_t : vhdl_library_unit_t -> vhdl_library_unit_t |

79 |
method virtual vhdl_load_t : vhdl_load_t -> vhdl_load_t |

80 |
method virtual vhdl_design_unit_t : vhdl_design_unit_t -> vhdl_design_unit_t |

81 |
method virtual vhdl_design_file_t : vhdl_design_file_t -> vhdl_design_file_t |

82 | |

83 |
method vhdl_cst_val_t : vhdl_cst_val_t -> vhdl_cst_val_t = |

84 |
fun x -> |

85 |
match x with |

86 |
| CstInt a -> let a = self#int a in CstInt a |

87 |
| CstStdLogic a -> let a = self#string a in CstStdLogic a |

88 |
| CstLiteral a -> let a = self#string a in CstLiteral a |

89 | |

90 |
method vhdl_type_t : vhdl_type_t -> vhdl_type_t= |

91 |
fun x -> |

92 |
match x with |

93 |
| Base a -> let a = self#string a in Base a |

94 |
| Range (a,b,c) -> |

95 |
let a = self#option self#string a in |

96 |
let b = self#int b in let c = self#int c in Range (a, b, c) |

97 |
| Bit_vector (a,b) -> |

98 |
let a = self#int a in let b = self#int b in Bit_vector (a, b) |

99 |
| Array (a,b,c) -> |

100 |
let a = self#int a in |

101 |
let b = self#int b in |

102 |
let c = self#vhdl_type_t c in Array (a, b, c) |

103 |
| Enumerated a -> let a = self#list self#string a in Enumerated a |

104 |
| Void -> Void |

105 |
method vhdl_subtype_indication_t : |

106 |
vhdl_subtype_indication_t -> vhdl_subtype_indication_t= |

107 |
fun { name; functionName; const } -> |

108 |
let name = self#vhdl_name_t name in |

109 |
let functionName = self#vhdl_name_t functionName in |

110 |
let const = self#vhdl_constraint_t const in |

111 |
{ name; functionName; const } |

112 |
method vhdl_discrete_range_t : |

113 |
vhdl_discrete_range_t -> vhdl_discrete_range_t= |

114 |
fun x -> |

115 |
match x with |

116 |
| SubDiscreteRange a -> |

117 |
let a = self#vhdl_subtype_indication_t a in SubDiscreteRange a |

118 |
| NamedRange a -> let a = self#vhdl_name_t a in NamedRange a |

119 |
| DirectedRange { direction; from; _to } -> |

120 |
let direction = self#string direction in |

121 |
let from = self#vhdl_expr_t from in |

122 |
let _to = self#vhdl_expr_t _to in |

123 |
DirectedRange { direction; from; _to } |

124 | |

125 |
method vhdl_constraint_t : vhdl_constraint_t -> vhdl_constraint_t= |

126 |
fun x -> |

127 |
match x with |

128 |
| RefConstraint { ref_name } -> |

129 |
let ref_name = self#vhdl_name_t ref_name in |

130 |
RefConstraint { ref_name } |

131 |
| RangeConstraint { range } -> |

132 |
let range = self#vhdl_discrete_range_t range in |

133 |
RangeConstraint { range } |

134 |
| IndexConstraint { ranges } -> |

135 |
let ranges = self#list self#vhdl_discrete_range_t ranges in |

136 |
IndexConstraint { ranges } |

137 |
| ArrayConstraint { ranges; sub } -> |

138 |
let ranges = self#list self#vhdl_discrete_range_t ranges in |

139 |
let sub = self#vhdl_constraint_t sub in |

140 |
ArrayConstraint { ranges; sub } |

141 |
| RecordConstraint -> RecordConstraint |

142 |
| NoConstraint -> NoConstraint |

143 | |

144 |
method vhdl_definition_t : vhdl_definition_t -> vhdl_definition_t= |

145 |
fun x -> |

146 |
match x with |

147 |
| Type { name; definition } -> |

148 |
let name = self#vhdl_name_t name in |

149 |
let definition = self#vhdl_type_t definition in |

150 |
Type { name; definition } |

151 |
| Subtype { name; typ } -> |

152 |
let name = self#vhdl_name_t name in |

153 |
let typ = self#vhdl_subtype_indication_t typ in |

154 |
Subtype { name; typ } |

155 |
method vhdl_expr_t : vhdl_expr_t -> vhdl_expr_t= |

156 |
fun x -> |

157 |
match x with |

158 |
| Call a -> let a = self#vhdl_name_t a in Call a |

159 |
| Cst a -> let a = self#vhdl_cst_val_t a in Cst a |

160 |
| Op { id; args } -> |

161 |
let id = self#string id in |

162 |
let args = self#list self#vhdl_expr_t args in Op { id; args } |

163 |
| IsNull -> IsNull |

164 |
| Time { value; phy_unit } -> |

165 |
let value = self#int value in |

166 |
let phy_unit = self#string phy_unit in Time { value; phy_unit } |

167 |
| Sig { name; att } -> |

168 |
let name = self#vhdl_name_t name in |

169 |
let att = self#option self#vhdl_signal_attributes_t att in |

170 |
Sig { name; att } |

171 |
| SuffixMod { expr; selection } -> |

172 |
let expr = self#vhdl_expr_t expr in |

173 |
let selection = self#vhdl_suffix_selection_t selection in |

174 |
SuffixMod { expr; selection } |

175 |
| Aggregate { elems } -> |

176 |
let elems = self#list self#vhdl_element_assoc_t elems in |

177 |
Aggregate { elems } |

178 |
| Others -> Others |

179 |
method vhdl_name_t : vhdl_name_t -> vhdl_name_t= |

180 |
fun x -> |

181 |
match x with |

182 |
| Simple a -> let a = self#string a in Simple a |

183 |
| Identifier a -> let a = self#string a in Identifier a |

184 |
| Selected a -> let a = self#list self#vhdl_name_t a in Selected a |

185 |
| Index { id; exprs } -> |

186 |
let id = self#vhdl_name_t id in |

187 |
let exprs = self#list self#vhdl_expr_t exprs in |

188 |
Index { id; exprs } |

189 |
| Slice { id; range } -> |

190 |
let id = self#vhdl_name_t id in |

191 |
let range = self#vhdl_discrete_range_t range in |

192 |
Slice { id; range } |

193 |
| Attribute { id; designator; expr } -> |

194 |
let id = self#vhdl_name_t id in |

195 |
let designator = self#vhdl_name_t designator in |

196 |
let expr = self#vhdl_expr_t expr in |

197 |
Attribute { id; designator; expr } |

198 |
| Function { id; assoc_list } -> |

199 |
let id = self#vhdl_name_t id in |

200 |
let assoc_list = self#list self#vhdl_assoc_element_t assoc_list |

201 |
in |

202 |
Function { id; assoc_list } |

203 |
| NoName -> NoName |

204 |
method vhdl_assoc_element_t : |

205 |
vhdl_assoc_element_t -> vhdl_assoc_element_t= |

206 |
fun |

207 |
{ formal_name; formal_arg; actual_name; actual_designator; |

208 |
actual_expr } |

209 |
-> |

210 |
let formal_name = self#option self#vhdl_name_t formal_name in |

211 |
let formal_arg = self#option self#vhdl_name_t formal_arg in |

212 |
let actual_name = self#option self#vhdl_name_t actual_name in |

213 |
let actual_designator = |

214 |
self#option self#vhdl_name_t actual_designator in |

215 |
let actual_expr = self#option self#vhdl_expr_t actual_expr in |

216 |
{ |

217 |
formal_name; |

218 |
formal_arg; |

219 |
actual_name; |

220 |
actual_designator; |

221 |
actual_expr |

222 |
} |

223 |
method vhdl_element_assoc_t : |

224 |
vhdl_element_assoc_t -> vhdl_element_assoc_t= |

225 |
fun { choices; expr } -> |

226 |
let choices = self#list self#vhdl_expr_t choices in |

227 |
let expr = self#vhdl_expr_t expr in { choices; expr } |

228 |
method vhdl_array_attributes_t : |

229 |
vhdl_array_attributes_t -> vhdl_array_attributes_t= |

230 |
fun x -> |

231 |
match x with |

232 |
| AAttInt { id; arg } -> |

233 |
let id = self#string id in |

234 |
let arg = self#int arg in AAttInt { id; arg } |

235 |
| AAttAscending -> AAttAscending |

236 |
method vhdl_signal_attributes_t : |

237 |
vhdl_signal_attributes_t -> vhdl_signal_attributes_t= |

238 |
fun x -> match x with | SigAtt a -> let a = self#string a in SigAtt a |

239 |
method vhdl_string_attributes_t : |

240 |
vhdl_string_attributes_t -> vhdl_string_attributes_t= |

241 |
fun x -> |

242 |
match x with | StringAtt a -> let a = self#string a in StringAtt a |

243 |
method vhdl_suffix_selection_t : vhdl_suffix_selection_t -> vhdl_suffix_selection_t= |

244 |
fun x -> |

245 |
match x with |

246 |
| Idx a -> let a = self#int a in Idx a |

247 |
| SuffixRange (a,b) -> |

248 |
let a = self#int a in let b = self#int b in SuffixRange (a, b) |

249 | |

250 |
method vhdl_type_attributes_t : |

251 |
'a . |

252 |
('a -> 'a) -> 'a vhdl_type_attributes_t -> 'a vhdl_type_attributes_t= |

253 |
fun _basetype -> |

254 |
fun x -> |

255 |
match x with |

256 |
| TAttNoArg { id } -> let id = self#string id in TAttNoArg { id } |

257 |
| TAttIntArg { id; arg } -> |

258 |
let id = self#string id in |

259 |
let arg = self#int arg in TAttIntArg { id; arg } |

260 |
| TAttValArg { id; arg } -> |

261 |
let id = self#string id in |

262 |
let arg = _basetype arg in TAttValArg { id; arg } |

263 |
| TAttStringArg { id; arg } -> |

264 |
let id = self#string id in |

265 |
let arg = self#string arg in TAttStringArg { id; arg } |

266 | |

267 |
method vhdl_parameter_t : vhdl_parameter_t -> vhdl_parameter_t= |

268 |
fun { names; mode; typ; init_val } -> |

269 |
let names = self#list self#vhdl_name_t names in |

270 |
let mode = self#list self#string mode in |

271 |
let typ = self#vhdl_subtype_indication_t typ in |

272 |
let init_val = self#option self#vhdl_cst_val_t init_val in |

273 |
{ names; mode; typ; init_val } |

274 | |

275 |
method vhdl_subprogram_spec_t : |

276 |
vhdl_subprogram_spec_t -> vhdl_subprogram_spec_t= |

277 |
fun { name; typeMark; parameters; isPure } -> |

278 |
let name = self#string name in |

279 |
let typeMark = self#vhdl_name_t typeMark in |

280 |
let parameters = self#list self#vhdl_parameter_t parameters in |

281 |
let isPure = self#bool isPure in |

282 |
{ name; typeMark; parameters; isPure } |

283 | |

284 |
method vhdl_sequential_stmt_t : |

285 |
vhdl_sequential_stmt_t -> vhdl_sequential_stmt_t= |

286 |
fun x -> |

287 |
match x with |

288 |
| VarAssign { label; lhs; rhs } -> |

289 |
let label = self#vhdl_name_t label in |

290 |
let lhs = self#vhdl_name_t lhs in |

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

292 |
| SigSeqAssign { label; lhs; rhs } -> |

293 |
let label = self#vhdl_name_t label in |

294 |
let lhs = self#vhdl_name_t lhs in |

295 |
let rhs = self#list self#vhdl_expr_t rhs in |

296 |
SigSeqAssign { label; lhs; rhs } |

297 |
| If { label; if_cases; default } -> |

298 |
let label = self#vhdl_name_t label in |

299 |
let if_cases = self#list self#vhdl_if_case_t if_cases in |

300 |
let default = self#list self#vhdl_sequential_stmt_t default in |

301 |
If { label; if_cases; default } |

302 |
| Case { label; guard; branches } -> |

303 |
let label = self#vhdl_name_t label in |

304 |
let guard = self#vhdl_expr_t guard in |

305 |
let branches = self#list self#vhdl_case_item_t branches in |

306 |
Case { label; guard; branches } |

307 |
| Exit { label; loop_label; condition } -> |

308 |
let label = self#vhdl_name_t label in |

309 |
let loop_label = self#option self#string loop_label in |

310 |
let condition = self#option self#vhdl_expr_t condition in |

311 |
Exit { label; loop_label; condition } |

312 |
| Assert { label; cond; report; severity } -> |

313 |
let label = self#vhdl_name_t label in |

314 |
let cond = self#vhdl_expr_t cond in |

315 |
let report = self#vhdl_expr_t report in |

316 |
let severity = self#vhdl_expr_t severity in |

317 |
Assert { label; cond; report; severity } |

318 |
| Wait -> Wait |

319 |
| Null { label } -> |

320 |
let label = self#vhdl_name_t label in Null { label } |

321 |
| Return { label } -> |

322 |
let label = self#vhdl_name_t label in Return { label } |

323 |
method vhdl_if_case_t : vhdl_if_case_t -> vhdl_if_case_t= |

324 |
fun { if_cond; if_block } -> |

325 |
let if_cond = self#vhdl_expr_t if_cond in |

326 |
let if_block = self#list self#vhdl_sequential_stmt_t if_block in |

327 |
{ if_cond; if_block } |

328 |
method vhdl_case_item_t : vhdl_case_item_t -> vhdl_case_item_t= |

329 |
fun { when_cond; when_stmt } -> |

330 |
let when_cond = self#list self#vhdl_expr_t when_cond in |

331 |
let when_stmt = self#list self#vhdl_sequential_stmt_t when_stmt in |

332 |
{ when_cond; when_stmt } |

333 | |

334 |
method vhdl_declaration_t : vhdl_declaration_t -> vhdl_declaration_t= |

335 |
fun x -> |

336 |
match x with |

337 |
| VarDecl { names; typ; init_val } -> |

338 |
let names = self#list self#vhdl_name_t names in |

339 |
let typ = self#vhdl_subtype_indication_t typ in |

340 |
let init_val = self#vhdl_expr_t init_val in |

341 |
VarDecl { names; typ; init_val } |

342 |
| CstDecl { names; typ; init_val } -> |

343 |
let names = self#list self#vhdl_name_t names in |

344 |
let typ = self#vhdl_subtype_indication_t typ in |

345 |
let init_val = self#vhdl_expr_t init_val in |

346 |
CstDecl { names; typ; init_val } |

347 |
| SigDecl { names; typ; init_val } -> |

348 |
let names = self#list self#vhdl_name_t names in |

349 |
let typ = self#vhdl_subtype_indication_t typ in |

350 |
let init_val = self#vhdl_expr_t init_val in |

351 |
SigDecl { names; typ; init_val } |

352 |
| Subprogram { name; kind; spec; decl_part; stmts } -> |

353 |
let name = self#vhdl_name_t name in |

354 |
let kind = self#string kind in |

355 |
let spec = self#vhdl_subprogram_spec_t spec in |

356 |
let decl_part = self#list self#vhdl_declaration_t decl_part in |

357 |
let stmts = self#list self#vhdl_sequential_stmt_t stmts in |

358 |
Subprogram { name; kind; spec; decl_part; stmts } |

359 | |

360 |
method vhdl_signal_condition_t : vhdl_signal_condition_t -> vhdl_signal_condition_t= |

361 |
fun { expr; cond } -> |

362 |
let expr = self#list self#vhdl_expr_t expr in |

363 |
let cond = self#vhdl_expr_t cond in { expr; cond } |

364 | |

365 |
method vhdl_signal_selection_t : vhdl_signal_selection_t -> vhdl_signal_selection_t= |

366 |
fun { expr; when_sel } -> |

367 |
let expr = self#vhdl_expr_t expr in |

368 |
let when_sel = self#list self#vhdl_expr_t when_sel in |

369 |
{ expr; when_sel } |

370 | |

371 |
method vhdl_conditional_signal_t : |

372 |
vhdl_conditional_signal_t -> vhdl_conditional_signal_t= |

373 |
fun { postponed; label; lhs; rhs; cond; delay } -> |

374 |
let postponed = self#bool postponed in |

375 |
let label = self#vhdl_name_t label in |

376 |
let lhs = self#vhdl_name_t lhs in |

377 |
let rhs = self#list self#vhdl_signal_condition_t rhs in |

378 |
let cond = self#vhdl_expr_t cond in |

379 |
let delay = self#vhdl_expr_t delay in |

380 |
{ postponed; label; lhs; rhs; cond; delay } |

381 | |

382 | |

383 |
method vhdl_process_t : vhdl_process_t -> vhdl_process_t= |

384 |
fun { id; declarations; active_sigs; body } -> |

385 |
let id = self#vhdl_name_t id in |

386 |
let declarations = |

387 |
self#option (self#list self#vhdl_declaration_t) declarations in |

388 |
let active_sigs = self#list self#vhdl_name_t active_sigs in |

389 |
let body = self#list self#vhdl_sequential_stmt_t body in |

390 |
{ id; declarations; active_sigs; body } |

391 | |

392 |
method vhdl_selected_signal_t : vhdl_selected_signal_t -> vhdl_selected_signal_t= |

393 |
fun { postponed; label; lhs; sel; branches; delay } -> |

394 |
let postponed = self#bool postponed in |

395 |
let label = self#vhdl_name_t label in |

396 |
let lhs = self#vhdl_name_t lhs in |

397 |
let sel = self#vhdl_expr_t sel in |

398 |
let branches = self#list self#vhdl_signal_selection_t branches in |

399 |
let delay = self#option self#vhdl_expr_t delay in |

400 |
{ postponed; label; lhs; sel; branches; delay } |

401 | |

402 |
method vhdl_port_mode_t : vhdl_port_mode_t -> vhdl_port_mode_t= |

403 |
fun x -> x |

404 | |

405 |
method vhdl_component_instantiation_t : |

406 |
vhdl_component_instantiation_t -> vhdl_component_instantiation_t= |

407 |
fun { name; inst_unit; generic_map; port_map } -> |

408 |
let name = self#vhdl_name_t name in |

409 |
let inst_unit = self#vhdl_name_t inst_unit in |

410 |
let generic_map = self#option self#vhdl_assoc_element_t generic_map |

411 |
in |

412 |
let port_map = self#option self#vhdl_assoc_element_t port_map in |

413 |
{ name; inst_unit; generic_map; port_map } |

414 | |

415 |
method vhdl_concurrent_stmt_t : |

416 |
vhdl_concurrent_stmt_t -> vhdl_concurrent_stmt_t= |

417 |
fun x -> |

418 |
match x with |

419 |
| SigAssign a -> let a = self#vhdl_conditional_signal_t a in SigAssign a |

420 |
| Process a -> let a = self#vhdl_process_t a in Process a |

421 |
| SelectedSig a -> let a = self#vhdl_selected_signal_t a in SelectedSig a |

422 |
| ComponentInst a -> let a = self#vhdl_component_instantiation_t a in ComponentInst a |

423 | |

424 |
method vhdl_port_t : vhdl_port_t -> vhdl_port_t= |

425 |
fun { names; mode; typ; expr } -> |

426 |
let names = self#list self#vhdl_name_t names in |

427 |
let mode = self#vhdl_port_mode_t mode in |

428 |
let typ = self#vhdl_subtype_indication_t typ in |

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

430 | |

431 |
method vhdl_entity_t : vhdl_entity_t -> vhdl_entity_t= |

432 |
fun { name; generics; ports; declaration; stmts } -> |

433 |
let name = self#vhdl_name_t name in |

434 |
let generics = self#list self#vhdl_port_t generics in |

435 |
let ports = self#list self#vhdl_port_t ports in |

436 |
let declaration = self#list self#vhdl_declaration_t declaration in |

437 |
let stmts = self#list self#vhdl_concurrent_stmt_t stmts in |

438 |
{ name; generics; ports; declaration; stmts } |

439 | |

440 |
method vhdl_package_t : vhdl_package_t -> vhdl_package_t= |

441 |
fun { name; shared_defs } -> |

442 |
let name = self#vhdl_name_t name in |

443 |
let shared_defs = self#list self#vhdl_definition_t shared_defs in |

444 |
{ name; shared_defs } |

445 | |

446 |
method vhdl_load_t : vhdl_load_t -> vhdl_load_t= |

447 |
fun x -> |

448 |
match x with |

449 |
| Library a -> let a = self#list self#vhdl_name_t a in Library a |

450 |
| Use a -> let a = self#list self#vhdl_name_t a in Use a |

451 | |

452 |
method vhdl_architecture_t : vhdl_architecture_t -> vhdl_architecture_t= |

453 |
fun { name; entity; declarations; body } -> |

454 |
let name = self#vhdl_name_t name in |

455 |
let entity = self#vhdl_name_t entity in |

456 |
let declarations = self#list self#vhdl_declaration_t declarations in |

457 |
let body = self#list self#vhdl_concurrent_stmt_t body in |

458 |
{ name; entity; declarations; body } |

459 | |

460 |
method vhdl_configuration_t : |

461 |
vhdl_configuration_t -> vhdl_configuration_t= self#unit |

462 | |

463 |
method vhdl_library_unit_t : vhdl_library_unit_t -> vhdl_library_unit_t= |

464 |
fun x -> |

465 |
match x with |

466 |
| Package a -> let a = self#vhdl_package_t a in Package a |

467 |
| Entities a -> let a = self#vhdl_entity_t a in Entities a |

468 |
| Architecture a -> |

469 |
let a = self#vhdl_architecture_t a in Architecture a |

470 |
| Configuration a -> |

471 |
let a = self#vhdl_configuration_t a in Configuration a |

472 | |

473 |
method vhdl_design_unit_t : vhdl_design_unit_t -> vhdl_design_unit_t= |

474 |
fun { contexts; library } -> |

475 |
let contexts = self#list self#vhdl_load_t contexts in |

476 |
let library = self#vhdl_library_unit_t library in |

477 |
{ contexts; library } |

478 | |

479 |
method vhdl_design_file_t : vhdl_design_file_t -> vhdl_design_file_t= |

480 |
fun { design_units } -> |

481 |
let design_units = self#list self#vhdl_design_unit_t design_units in |

482 |
{ design_units } |

483 | |

484 |
method vhdl_file_t : vhdl_file_t -> vhdl_file_t= |

485 |
fun { design_file } -> |

486 |
let design_file = self#vhdl_design_file_t design_file in |

487 |
{ design_file } |

488 |
end |