aboutsummaryrefslogtreecommitdiffstats
path: root/src/hls/Schedule.ml
diff options
context:
space:
mode:
authorYann Herklotz <git@yannherklotz.com>2021-02-02 20:34:20 +0000
committerYann Herklotz <git@yannherklotz.com>2021-02-02 20:34:20 +0000
commitf3a0c5c0095258159c495d70fda6749bbf89de70 (patch)
treef06c5305b6744cc3c12e678c97248af36ff35e30 /src/hls/Schedule.ml
parente68848fc6970acc9b973a2c9dff5eddedb833914 (diff)
downloadvericert-f3a0c5c0095258159c495d70fda6749bbf89de70.tar.gz
vericert-f3a0c5c0095258159c495d70fda6749bbf89de70.zip
Add predicated values and instructions
Diffstat (limited to 'src/hls/Schedule.ml')
-rw-r--r--src/hls/Schedule.ml14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/hls/Schedule.ml b/src/hls/Schedule.ml
index 128f0e1..ec130cb 100644
--- a/src/hls/Schedule.ml
+++ b/src/hls/Schedule.ml
@@ -279,8 +279,8 @@ let print_src_type i c =
let print_data_dep_order c (i, j) =
print_lt0 (gen_var_name_e i c) (gen_var_name_b j c)
-let rec gather_cfg_constraints (completed, (bvars, constraints, types)) c curr =
- if List.exists (fun x -> P.eq x curr) completed then
+let gather_cfg_constraints (completed, (bvars, constraints, types)) c curr =
+ if List.exists (P.eq curr) completed then
(completed, (bvars, constraints, types))
else
match PTree.get curr c with
@@ -309,11 +309,7 @@ let rec gather_cfg_constraints (completed, (bvars, constraints, types)) c curr =
(List.init num_iters (fun x -> x)))
bvars
in
- let next' = List.filter (fun x -> P.lt x curr) next in
- List.fold_left
- (fun compl curr' -> gather_cfg_constraints compl c curr')
- (curr :: completed, (bvars', constraints', types'))
- next'
+ (curr :: completed, (bvars', constraints', types'))
let rec intersperse s = function
| [] -> []
@@ -415,7 +411,9 @@ let schedule entry (c : RTLBlock.bb RTLBlockInstr.code) =
let c' = PTree.map1 (gather_bb_constraints false) c in
let _ = if debug then PTree.map (fun r o -> printf "##### %d #####\n%a\n\n" (P.to_int r) print_dfg (second o)) c' else PTree.empty in
let _, (vars, constraints, types) =
- gather_cfg_constraints ([], ([], "", "")) c' entry
+ List.map fst (PTree.elements c') |>
+ List.fold_left (fun compl ->
+ gather_cfg_constraints compl c') ([], ([], "", ""))
in
let schedule' = solve_constraints vars constraints types in
IMap.iter (fun a b -> printf "##### %d #####\n%a\n\n" a (print_list print_tuple) b) schedule';