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-07-27 13:31:13 +02:00
|
|
|
let pp p = if !verbose then Mls_printer.print stdout p
|
|
|
|
|
2010-07-27 13:31:13 +02:00
|
|
|
let parse parsing_fun lexing_fun lexbuf =
|
|
|
|
try
|
|
|
|
parsing_fun lexing_fun lexbuf
|
|
|
|
with
|
|
|
|
| Mls_lexer.Lexical_error(err, loc) ->
|
|
|
|
lexical_error err loc
|
|
|
|
| Mls_parser.Error ->
|
|
|
|
let pos1 = Lexing.lexeme_start_p lexbuf
|
|
|
|
and pos2 = Lexing.lexeme_end_p lexbuf in
|
|
|
|
let l = Loc(pos1,pos2) in
|
|
|
|
syntax_error l
|
|
|
|
|
|
|
|
let parse_implementation lexbuf =
|
|
|
|
parse Mls_parser.program Mls_lexer.token lexbuf
|
|
|
|
|
2010-06-18 14:00:58 +02:00
|
|
|
let compile pp p =
|
|
|
|
(* Clocking *)
|
2010-08-03 22:38:42 +02:00
|
|
|
let p = do_pass Clocking.program "Clocking" p pp true in
|
2010-06-18 14:00:58 +02:00
|
|
|
|
|
|
|
(* Check that the dataflow code is well initialized *)
|
2010-07-14 03:45:38 +02:00
|
|
|
(*let p = do_silent_pass Init.program "Initialization check" p !init in *)
|
2010-06-18 14:00:58 +02:00
|
|
|
|
2010-07-21 17:19:51 +02:00
|
|
|
(* Iterator fusion *)
|
|
|
|
let p = do_pass Itfusion.program "Iterator fusion" p pp true in
|
|
|
|
|
2010-06-18 14:00:58 +02:00
|
|
|
(* Normalization to maximize opportunities *)
|
2010-07-15 09:27:51 +02:00
|
|
|
let p = do_pass Normalize.program "Normalization" p pp true in
|
2010-06-26 16:53:25 +02:00
|
|
|
|
2010-06-18 14:00:58 +02:00
|
|
|
(* Scheduling *)
|
|
|
|
let p = do_pass Schedule.program "Scheduling" p pp true in
|
2010-06-26 16:53:25 +02:00
|
|
|
|
|
|
|
p
|