diff options
author | Cyril SIX <cyril.six@kalray.eu> | 2019-01-08 11:27:04 +0100 |
---|---|---|
committer | Cyril SIX <cyril.six@kalray.eu> | 2019-01-08 11:27:04 +0100 |
commit | bc5f8909e299163b7daa7f363c84f1e3524ff270 (patch) | |
tree | 9519cd5d69be77621e2545dc19c5f703903a34b2 | |
parent | 3f21b462519363cd082a500004d3a7af0699d61d (diff) | |
download | compcert-kvx-bc5f8909e299163b7daa7f363c84f1e3524ff270.tar.gz compcert-kvx-bc5f8909e299163b7daa7f363c84f1e3524ff270.zip |
Fixed warnings in InstructionScheduler
-rw-r--r-- | mppa_k1c/InstructionScheduler.ml | 38 | ||||
-rw-r--r-- | mppa_k1c/InstructionScheduler.mli | 7 |
2 files changed, 24 insertions, 21 deletions
diff --git a/mppa_k1c/InstructionScheduler.ml b/mppa_k1c/InstructionScheduler.ml index 165ace4d..394c5264 100644 --- a/mppa_k1c/InstructionScheduler.ml +++ b/mppa_k1c/InstructionScheduler.ml @@ -88,7 +88,7 @@ let vector_subtract a b = (* The version with critical path ordering is much better! *) type list_scheduler_order = - | INSTRUCTION_ORDER + (* | INSTRUCTION_ORDER *) | CRITICAL_PATH_ORDER;; let int_max (x : int) (y : int) = @@ -134,9 +134,10 @@ let critical_paths successors = done; path_lengths;; -let maximum_critical_path problem = +(* let maximum_critical_path problem = let paths = critical_paths (get_successors problem) in Array.fold_left int_max 0 paths;; +*) let get_earliest_dates predecessors = let nr_instructions = (Array.length predecessors)-1 in @@ -185,7 +186,7 @@ let priority_list_scheduler (order : list_scheduler_order) and times = Array.make (nr_instructions+1) (-1) in let priorities = match order with - | INSTRUCTION_ORDER -> None + (* | INSTRUCTION_ORDER -> None *) | CRITICAL_PATH_ORDER -> Some (critical_paths successors) in let module InstrSet = @@ -629,20 +630,21 @@ let line_to_pb_solution sol line nr_pb_variables = List.iter begin function "" -> () - | item -> - (match String.get item 0 with - | '+' -> - assert ((String.length item) >= 3); - assert ((String.get item 1) = 'x'); - assign (String.sub item 2 ((String.length item)-2)) Positive - | '-' -> - assert ((String.length item) >= 3); - assert ((String.get item 1) = 'x'); - assign (String.sub item 2 ((String.length item)-2)) Negative - | 'x' -> - assert ((String.length item) >= 2); - assign (String.sub item 1 ((String.length item)-1)) Positive - ) + | item -> + (match String.get item 0 with + | '+' -> + assert ((String.length item) >= 3); + assert ((String.get item 1) = 'x'); + assign (String.sub item 2 ((String.length item)-2)) Positive + | '-' -> + assert ((String.length item) >= 3); + assert ((String.get item 1) = 'x'); + assign (String.sub item 2 ((String.length item)-2)) Negative + | 'x' -> + assert ((String.length item) >= 2); + assign (String.sub item 1 ((String.length item)-1)) Positive + | c -> failwith @@ Printf.sprintf "line_to_pb_solution: unrecognized character: %c" c + ) end (String.split_on_char ' ' (String.sub line 2 ((String.length line)-2)));; @@ -737,7 +739,7 @@ let pseudo_boolean_solver = ref "java -jar sat4j-pb.jar CuttingPlanesStar" let pseudo_boolean_scheduler pb_type problem = try - let filename_in = "problem.opb" and filename_out = "problem.sol" in + let filename_in = "problem.opb" (* and filename_out = "problem.sol" *) in let opb_problem = open_out filename_in in let mapper = pseudo_boolean_print_problem opb_problem problem pb_type in close_out opb_problem; diff --git a/mppa_k1c/InstructionScheduler.mli b/mppa_k1c/InstructionScheduler.mli index 507a4cac..aea5e909 100644 --- a/mppa_k1c/InstructionScheduler.mli +++ b/mppa_k1c/InstructionScheduler.mli @@ -11,18 +11,19 @@ type latency_constraint = { instr_to : int; latency : int; } + (** A scheduling problem. In addition to the latency constraints, the resource constraints should be satisfied: at every clock tick, the sum of vectors of resources used by the instructions scheduled at that tick does not exceed the resource bounds. *) type problem = { - (** An optional maximal total latency of the problem, after which the problem is deemed not schedulable. -1 means there should be no maximum. *) + (* An optional maximal total latency of the problem, after which the problem is deemed not schedulable. -1 means there should be no maximum. *) max_latency : int; - (** An array of number of units available indexed by the kind of resources to be allocated. It can be empty, in which case the problem is scheduling without resource constraints. *) + (* An array of number of units available indexed by the kind of resources to be allocated. It can be empty, in which case the problem is scheduling without resource constraints. *) resource_bounds : int array; - (** At index {i i} the vector of resources used by instruction number {i i}. It must be the same length as [resource_bounds] *) + (* At index {i i} the vector of resources used by instruction number {i i}. It must be the same length as [resource_bounds] *) instruction_usages: int array array; latency_constraints : latency_constraint list };; |