From ce2e2bdcd010efd8b7606d998b3e562a5a171dc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwena=EBl=20Delaval?= Date: Mon, 26 Nov 2012 09:44:23 +0100 Subject: [PATCH] Added -nbvars option for performance evaluation --- compiler/main/heptc.ml | 1 + compiler/minils/sigali/sigalimain.ml | 10 +++++++++- compiler/utilities/global/compiler_options.ml | 3 +++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/compiler/main/heptc.ml b/compiler/main/heptc.ml index 71b8bee..369e6e7 100644 --- a/compiler/main/heptc.ml +++ b/compiler/main/heptc.ml @@ -146,6 +146,7 @@ let main () = "-fti", Arg.Set full_type_info, doc_full_type_info; "-statefuli", Arg.Set stateful_info, doc_stateful_info; "-fname", Arg.Set full_name, doc_full_name; + "-nbvars", Arg.Set nbvars, doc_nbvars; "-itfusion", Arg.Set do_iterator_fusion, doc_itfusion; "-strict_ssa", Arg.Unit set_strict_ssa, doc_strict_ssa; "-nosink", Arg.Set nosink, doc_nosink; diff --git a/compiler/minils/sigali/sigalimain.ml b/compiler/minils/sigali/sigalimain.ml index f72adfc..afb65d0 100644 --- a/compiler/minils/sigali/sigalimain.ml +++ b/compiler/minils/sigali/sigalimain.ml @@ -433,7 +433,15 @@ let translate_node proc_constraints = constraints; proc_body = body@body_c@body_sink; proc_objectives = [obj] } in - + if !Compiler_options.nbvars then + begin + (* Print out nb of vars *) + let nbs = List.length p.proc_states in + let nbi = List.length inputs in + let nbc = List.length controllables in + Printf.printf "%s %d %d %d %d\n" f nbs nbi nbc (nbs+nbi+nbc); + end; + let ctrlr_call = begin match controllables with diff --git a/compiler/utilities/global/compiler_options.ml b/compiler/utilities/global/compiler_options.ml index 3109339..163d2cd 100644 --- a/compiler/utilities/global/compiler_options.ml +++ b/compiler/utilities/global/compiler_options.ml @@ -106,6 +106,8 @@ let stateful_info = ref false let full_name = ref false +let nbvars = ref false + let causality = ref true let init = ref true @@ -188,6 +190,7 @@ and doc_target = and doc_full_type_info = "\t\t\tPrint full type information" and doc_stateful_info = "\t\tPrint stateful information" and doc_full_name = "\t\tPrint full variable name information" +and doc_nbvars = "\t\tPrint information about number of variables" and doc_target_path = "\tGenerated files will be placed in \n\t\t\t(the directory is" ^ " cleaned)"