Skip to content
Snippets Groups Projects
Commit 95fb046e authored by Pierre Loic Garoche's avatar Pierre Loic Garoche
Browse files

Scheduling of node equations is now attached to machine type

parent 365d1b07
No related branches found
No related tags found
No related merge requests found
......@@ -291,8 +291,8 @@ let translate_eqs node args eqs =
let translate_decl nd sch =
(*Log.report ~level:1 (fun fmt -> Printers.pp_node fmt nd);*)
let sorted_eqs = sort_equations_from_schedule nd sch in
let schedule = sch.Scheduling_type.schedule in
let sorted_eqs = sort_equations_from_schedule nd schedule in
let constant_eqs = constant_equations nd in
(* In case of non functional backend (eg. C), additional local variables have
......@@ -366,6 +366,7 @@ let translate_decl nd sch =
};
mspec = nd.node_spec;
mannot = nd.node_annot;
msch = Some sch;
}
(** takes the global declarations and the scheduling associated to each node *)
......@@ -374,7 +375,7 @@ let translate_prog decls node_schs =
List.map
(fun decl ->
let node = node_of_top decl in
let sch = (Utils.IMap.find node.node_id node_schs).Scheduling.schedule in
let sch = Utils.IMap.find node.node_id node_schs in
translate_decl node sch
) nodes
......
val translate_prog: Lustre_types.program_t -> Scheduling.schedule_report Utils.IMap.t -> Machine_code_types.machine_t list
val translate_prog: Lustre_types.program_t -> Scheduling_type.schedule_report Utils.IMap.t -> Machine_code_types.machine_t list
......@@ -168,6 +168,7 @@ let arrow_machine =
};
mspec = None;
mannot = [];
msch = None
}
let empty_desc =
......@@ -206,6 +207,7 @@ let empty_machine =
};
mspec = None;
mannot = [];
msch = None
}
let new_instance =
......
......@@ -53,4 +53,5 @@ type machine_t = {
mstep: step_t;
mspec: node_annot option;
mannot: expr_annot list;
msch: Scheduling_type.schedule_report option; (* Equations scheduling *)
}
......@@ -268,7 +268,7 @@ let instr_of_const top_const =
let machines_unfold consts node_schs machines =
List.fold_right (fun m (machines, removed) ->
let fanin = (IMap.find m.mname.node_id node_schs).Scheduling.fanin_table in
let fanin = (IMap.find m.mname.node_id node_schs).Scheduling_type.fanin_table in
let elim_consts, _ = instrs_unfold fanin IMap.empty (List.map instr_of_const consts) in
let (m, removed_m) = machine_unfold fanin elim_consts m in
(m::machines, IMap.add m.mname.node_id removed_m removed)
......
......@@ -14,22 +14,7 @@ open Lustre_types
open Corelang
open Graph
open Causality
type schedule_report =
{
(* the scheduled node *)
node : node_desc;
(* a schedule computed wrt the dependency graph *)
schedule : ident list list;
(* the set of unused variables (no output or mem depends on them) *)
unused_vars : ISet.t;
(* the table mapping each local var to its in-degree *)
fanin_table : (ident, int) Hashtbl.t;
(* the dependency graph *)
dep_graph : IdentDepGraph.t;
(* the table mapping each assignment to a reusable variable *)
(*reuse_table : (ident, var_decl) Hashtbl.t*)
}
open Scheduling_type
(* Topological sort with a priority for variables belonging in the same equation lhs.
For variables still unrelated, standard compare is used to choose the minimal element.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment