aboutsummaryrefslogtreecommitdiffstats
path: root/mppa_k1c/InstructionScheduler.ml
diff options
context:
space:
mode:
Diffstat (limited to 'mppa_k1c/InstructionScheduler.ml')
-rw-r--r--mppa_k1c/InstructionScheduler.ml4
1 files changed, 3 insertions, 1 deletions
diff --git a/mppa_k1c/InstructionScheduler.ml b/mppa_k1c/InstructionScheduler.ml
index 1eba01d7..f9f99b1f 100644
--- a/mppa_k1c/InstructionScheduler.ml
+++ b/mppa_k1c/InstructionScheduler.ml
@@ -332,6 +332,8 @@ let dependency_check problem bundle index =
let rec make_bundle problem resources bundle index =
let resources_copy = Array.copy resources in
+ let nr_instructions = get_nr_instructions problem in
+ if (index >= nr_instructions) then (bundle, index+1) else
let inst_usage = problem.instruction_usages.(index) in
try match vector_less_equal inst_usage resources with
| false -> raise InvalidBundle
@@ -351,7 +353,7 @@ let rec make_bundles problem index : bundle list =
let bundles_to_schedule problem bundles : solution =
let nr_instructions = get_nr_instructions problem in
- let schedule = Array.make nr_instructions (-1) in
+ let schedule = Array.make (nr_instructions+1) (nr_instructions+4) in
let time = ref 0 in
List.iter (fun bundle ->
begin