Revision 5360dcf8
Added by Arnaud Dieumegard over 3 years ago
src/backends/VHDL/vhdl_2_mini_vhdl_map.ml | ||
---|---|---|
305 | 305 |
| SigCondAssign { label; lhs; rhs; delay} -> [lhs] |
306 | 306 |
| SigSelectAssign { label; lhs; sel; branches; delay } -> [lhs] |
307 | 307 |
| If { label; if_cases; default } -> |
308 |
let if_cases_stmts = List.flatten (List.map (fun x -> x.if_block) if_cases) in |
|
308 |
let if_cases_stmts = List.flatten (List.map (fun x -> x.if_block_mini) if_cases) in
|
|
309 | 309 |
List.flatten (List.map self#mini_vhdl_sequential_stmt_t_assigned_signals_names (if_cases_stmts@default)) |
310 | 310 |
| Case { label; guard; branches } -> |
311 |
let case_branches_stmts = List.flatten (List.map (fun x -> x.when_stmt) branches) in |
|
311 |
let case_branches_stmts = List.flatten (List.map (fun x -> x.when_stmt_mini) branches) in
|
|
312 | 312 |
List.flatten (List.map self#mini_vhdl_sequential_stmt_t_assigned_signals_names case_branches_stmts) |
313 | 313 |
| ProcedureCall { label; name; assocs } -> [] (* TODO: resolve this *) |
314 | 314 |
| _ -> [] |
... | ... | |
331 | 331 |
fun assigned_signals -> fun mems -> fun x -> |
332 | 332 |
match x with |
333 | 333 |
| If { label; if_cases; default } -> |
334 |
let if_cases_stmts = List.map (fun x -> x.if_block) if_cases in |
|
334 |
let if_cases_stmts = List.map (fun x -> x.if_block_mini) if_cases in
|
|
335 | 335 |
let if_cases_assigned_signals = |
336 | 336 |
List.map self#mini_vhdl_sequential_stmt_t_assigned_signals_names (List.flatten (if_cases_stmts@[default])) in |
337 | 337 |
let if_cases_memories = List.flatten (List.map (fun x -> List.flatten (List.map (self#memories assigned_signals []) x)) (if_cases_stmts@[default])) in |
338 | 338 |
let mems = if_cases_memories@mems in |
339 |
|
|
340 | 339 |
(match default with |
341 | 340 |
| [] -> (List.flatten if_cases_assigned_signals)@mems |
342 | 341 |
| _ -> mems) |
343 | 342 |
| Case { label; guard; branches } -> |
344 |
let case_branches_stmts = List.map (fun x -> x.when_stmt) branches in |
|
343 |
let case_branches_stmts = List.map (fun x -> x.when_stmt_mini) branches in
|
|
345 | 344 |
(* let case_assigned_signals = List.map self#mini_vhdl_sequential_stmt_t_assigned_signals_names (List.flatten (case_branches_stmts)) in *) |
346 | 345 |
let cases_memories = List.flatten (List.map (fun x -> List.flatten (List.map (self#memories assigned_signals []) x)) (case_branches_stmts)) in |
347 | 346 |
cases_memories@mems |
... | ... | |
662 | 661 |
method vhdl_if_case_t : vhdl_if_case_t -> mini_vhdl_if_case_t= |
663 | 662 |
fun { if_cond; if_block } -> |
664 | 663 |
let if_cond = self#vhdl_expr_t if_cond in |
665 |
let if_block = List.map self#vhdl_sequential_stmt_t if_block in |
|
666 |
{ if_cond; if_block } |
|
664 |
let if_block_mini = List.map self#vhdl_sequential_stmt_t if_block in
|
|
665 |
{ if_cond; if_block_mini }
|
|
667 | 666 |
|
668 | 667 |
method vhdl_case_item_t : vhdl_case_item_t -> mini_vhdl_case_item_t= |
669 | 668 |
fun { when_cond; when_stmt } -> |
670 | 669 |
let when_cond = self#list self#vhdl_expr_t when_cond in |
671 |
let when_stmt = List.map self#vhdl_sequential_stmt_t when_stmt in |
|
672 |
{ when_cond; when_stmt } |
|
670 |
let when_stmt_mini = List.map self#vhdl_sequential_stmt_t when_stmt in
|
|
671 |
{ when_cond; when_stmt_mini }
|
|
673 | 672 |
|
674 | 673 |
method vhdl_declaration_t : vhdl_declaration_t -> mini_vhdl_declaration_t= |
675 | 674 |
fun x -> |
Also available in: Unified diff
Beggining of implicit latching check