diff options
author | Alex AUVOLAT <alex.auvolat@ens.fr> | 2014-01-14 17:21:24 +0100 |
---|---|---|
committer | Alex AUVOLAT <alex.auvolat@ens.fr> | 2014-01-14 17:21:24 +0100 |
commit | 0eaeee0945dfd931ba83ffe0280f422dc09dd99b (patch) | |
tree | 22e11309ab2e9f90488647d116963a0d39a4af77 /sched/main.ml | |
parent | 177ddf43a0339887b6e408370e25001d6b5f89a6 (diff) | |
download | SystDigit-Projet-0eaeee0945dfd931ba83ffe0280f422dc09dd99b.tar.gz SystDigit-Projet-0eaeee0945dfd931ba83ffe0280f422dc09dd99b.zip |
Minor changes to scheduler.
Diffstat (limited to 'sched/main.ml')
-rw-r--r-- | sched/main.ml | 58 |
1 files changed, 32 insertions, 26 deletions
diff --git a/sched/main.ml b/sched/main.ml index 326a2bd..6da57ad 100644 --- a/sched/main.ml +++ b/sched/main.ml @@ -5,35 +5,42 @@ let dumb_down = ref false let compile filename = try + Format.printf("Reading netlist...%!"); let p = Netlist.read_file filename in + Format.printf("done.\n%!"); + let out_name = (Filename.chop_suffix filename ".net") ^ ".snet" in - let dumb_out_name = (Filename.chop_suffix filename ".net") ^ ".dumb" in + let dumb_out_name = (Filename.chop_suffix filename ".net") ^ ".dumb" in let out_opt_name = (Filename.chop_suffix filename ".net") ^ "_opt.snet" in - let dumb_opt_out_name = (Filename.chop_suffix filename ".net") ^ "_opt.dumb" in - let q, q_opt = ref p, ref p in + let dumb_opt_out_name = (Filename.chop_suffix filename ".net") ^ "_opt.dumb" in + let q, q_opt = ref p, ref p in begin try - q := Scheduler.schedule p; - q_opt := Simplify.simplify p - with - | Scheduler.Combinational_cycle -> - Format.eprintf "The netlist has a combinatory cycle.@."; - exit 2; + Format.printf("Topological sort on non-simplified netlist...%!"); + q := Scheduler.schedule p; + Format.printf("done.\n%!"); + Format.printf("Dong simplifications...\n%!"); + q_opt := Simplify.simplify (!q); + Format.printf("Simplifications done.\n%!") + with + | Scheduler.Combinational_cycle -> + Format.eprintf "The netlist has a combinatory cycle.@."; + exit 2; end; let out = open_out out_name in Netlist_printer.print_program out !q; - close_out out; - let dumb_out = open_out dumb_out_name in - Netlist_dumb.print_program dumb_out !q; - close_out dumb_out; - - let out_opt = open_out out_opt_name in - Netlist_printer.print_program out_opt !q_opt; - close_out out_opt; - let dumb_opt_out = open_out dumb_opt_out_name in - Netlist_dumb.print_program dumb_opt_out !q_opt; - close_out dumb_opt_out; + close_out out; + let dumb_out = open_out dumb_out_name in + Netlist_dumb.print_program dumb_out !q; + close_out dumb_out; + + let out_opt = open_out out_opt_name in + Netlist_printer.print_program out_opt !q_opt; + close_out out_opt; + let dumb_opt_out = open_out dumb_opt_out_name in + Netlist_dumb.print_program dumb_opt_out !q_opt; + close_out dumb_opt_out; if !simulate then ( let simulator = @@ -50,11 +57,10 @@ let compile filename = let main () = Arg.parse ["-s", Arg.Set simulate, "Launch the simulator"; - "-sim", Arg.Set_string sim_path, "Path to the circuit simulator"; - "-d", Arg.Set dumb_down, "Pass the dumbed-down netlist to the simulator (for the C simulator)"; - "-n", Arg.Set_int number_steps, "Number of steps to simulate"] - compile + "-sim", Arg.Set_string sim_path, "Path to the circuit simulator"; + "-d", Arg.Set dumb_down, "Pass the dumbed-down netlist to the simulator (for the C simulator)"; + "-n", Arg.Set_int number_steps, "Number of steps to simulate"] + compile "" -;; -main () +let () = main () |