aboutsummaryrefslogtreecommitdiffstats
path: root/src/SoftwarePipelining/SoftwarePipelining.ml
diff options
context:
space:
mode:
Diffstat (limited to 'src/SoftwarePipelining/SoftwarePipelining.ml')
-rw-r--r--src/SoftwarePipelining/SoftwarePipelining.ml36
1 files changed, 18 insertions, 18 deletions
diff --git a/src/SoftwarePipelining/SoftwarePipelining.ml b/src/SoftwarePipelining/SoftwarePipelining.ml
index 12ab783..fd95134 100644
--- a/src/SoftwarePipelining/SoftwarePipelining.ml
+++ b/src/SoftwarePipelining/SoftwarePipelining.ml
@@ -19,37 +19,37 @@ let clean t =
let rec clean_rec i =
match i with
- | 0 -> []
- | n ->
- begin
- match t.(i - 1) with
- | None -> clean_rec (i - 1)
- | Some inst -> inst :: clean_rec (i - 1)
- end
+ | 0 -> []
+ | n ->
+ begin
+ match t.(i - 1) with
+ | None -> clean_rec (i - 1)
+ | Some inst -> inst :: clean_rec (i - 1)
+ end
in
let l = List.rev (clean_rec (Array.length t)) in
List.hd l :: (List.filter (fun e -> not (is_cond e)) (List.tl l))
let print_nodes = List.iter (fun n -> Printf.printf "%s \n" (string_of_node n))
-
+
(* random heuristic *)
-
+
let find node schedule opt =
try NI.find node schedule with
- | Not_found -> opt
+ | Not_found -> opt
let random ddg schedule =
let unscheduled = G.fold_vertex (fun node l ->
- match find node schedule None with
- | Some v -> l
- | None -> node :: l
- ) ddg [] in
+ match find node schedule None with
+ | Some v -> l
+ | None -> node :: l
+ ) ddg [] in
let bound = List.length unscheduled in
Random.self_init ();
List.nth unscheduled (Random.int bound)
(* tought heuristics *)
-
+
module Topo = Graph.Topological.Make (G)
module Scc = Graph.Components.Make (G)
@@ -63,8 +63,8 @@ let pipeliner ddg =
if min <= 0 then None
else
Some {steady_state = steady_state; prolog = prolog; epilog = epilog; min = min; unrolling = unroll;
- ramp_up = entrance; ramp_down = way_out}
-
+ ramp_up = entrance; ramp_down = way_out}
+
let pipeline f =
- SPBasic.apply_pipeliner f pipeliner ~debug:true
+ SPBasic.apply_pipeliner f pipeliner ~debug:false