2010-06-18 14:00:58 +02:00
|
|
|
(**************************************************************************)
|
|
|
|
(* *)
|
|
|
|
(* Heptagon *)
|
|
|
|
(* *)
|
|
|
|
(* Author : Marc Pouzet *)
|
|
|
|
(* Organization : Demons, LRI, University of Paris-Sud, Orsay *)
|
|
|
|
(* *)
|
|
|
|
(**************************************************************************)
|
|
|
|
open Misc
|
2010-07-27 13:31:13 +02:00
|
|
|
open Location
|
2010-06-18 14:00:58 +02:00
|
|
|
open Compiler_utils
|
2010-09-15 09:38:52 +02:00
|
|
|
open Compiler_options
|
2010-06-18 14:00:58 +02:00
|
|
|
|
2010-07-27 13:31:13 +02:00
|
|
|
let pp p = if !verbose then Mls_printer.print stdout p
|
2010-11-23 17:13:33 +01:00
|
|
|
|
2011-01-07 17:16:50 +01:00
|
|
|
let compile_program p =
|
2010-06-18 14:00:58 +02:00
|
|
|
(* Clocking *)
|
2011-05-13 15:35:29 +02:00
|
|
|
let p =
|
|
|
|
try pass "Clocking" true Clocking.program p pp
|
|
|
|
with Errors.Error ->
|
2011-05-18 09:41:06 +02:00
|
|
|
comment ~sep:"" "\nInfered clocks :\n";
|
2011-05-13 15:35:29 +02:00
|
|
|
pp p;
|
|
|
|
comment ~sep:"*** " ("Clocking failed.");
|
|
|
|
if !print_types then Global_printer.print_interface Format.std_formatter;
|
|
|
|
raise Errors.Error
|
|
|
|
in
|
|
|
|
|
|
|
|
if !print_types then Global_printer.print_interface Format.std_formatter;
|
2010-06-18 14:00:58 +02:00
|
|
|
|
2011-05-12 17:40:23 +02:00
|
|
|
(* Level clocks *)
|
|
|
|
let p = pass "Level clock" true Level_clock.program p pp in
|
|
|
|
|
2011-07-04 11:25:01 +02:00
|
|
|
(* Dataglow minimization *)
|
|
|
|
|
2010-09-30 21:44:18 +02:00
|
|
|
let p =
|
|
|
|
let call_tomato = !tomato or (List.length !tomato_nodes > 0) in
|
2011-10-03 11:43:50 +02:00
|
|
|
let p = pass "Extended value inlining" call_tomato Inline_extvalues.program p pp in
|
2011-07-04 11:25:01 +02:00
|
|
|
pass "Data-flow minimization" call_tomato Tomato.program p pp in
|
|
|
|
|
2011-04-18 15:38:42 +02:00
|
|
|
(** TODO: re enable when ported to the new AST
|
2010-09-30 21:44:18 +02:00
|
|
|
let p =
|
|
|
|
pass "Automata minimization checks" true Tomato.tomato_checks p pp in
|
2011-04-18 15:38:42 +02:00
|
|
|
*)
|
2011-09-08 11:45:43 +02:00
|
|
|
|
|
|
|
(* Normalize memories*)
|
|
|
|
let p = pass "Normalize memories" true Normalize_mem.program p pp in
|
|
|
|
|
2010-06-18 14:00:58 +02:00
|
|
|
(* Scheduling *)
|
2011-05-02 16:37:50 +02:00
|
|
|
let p =
|
2011-10-23 17:41:50 +02:00
|
|
|
if not !Compiler_options.use_old_scheduler then
|
2011-05-02 16:37:50 +02:00
|
|
|
pass "Scheduling (with minimization of interferences)" true Schedule_interf.program p pp
|
|
|
|
else
|
|
|
|
pass "Scheduling" true Schedule.program p pp
|
|
|
|
in
|
2010-06-26 16:53:25 +02:00
|
|
|
|
2011-04-20 15:47:05 +02:00
|
|
|
(* Memory allocation *)
|
2011-10-04 14:34:36 +02:00
|
|
|
let p = pass "Memory allocation" !do_mem_alloc Interference.program p pp in
|
2011-04-20 15:47:05 +02:00
|
|
|
|
2010-06-26 16:53:25 +02:00
|
|
|
p
|