Project

General

Profile

« Previous | Next » 

Revision 7ee5f69e

Added by LĂ©lio Brun 9 months ago

corrections on loggers + spec in AST

View differences:

src/scheduling.ml
120 120

  
121 121
let schedule_node n =
122 122
  (* let node_vars = get_node_vars n in *)
123
  Log.report ~level:5 (fun fmt -> Format.fprintf fmt "scheduling node %s@," n.node_id);
123
  Log.report ~level:5 (fun fmt -> Format.fprintf fmt "scheduling node %s@ " n.node_id);
124 124
  let eq_equiv = eq_equiv (ExprDep.node_eq_equiv n) in
125 125

  
126 126
  let n', g = global_dependency n in
......
177 177
    fun top_decl (accu_prog, sch_map)  ->
178 178
      match top_decl.top_decl_desc with
179 179
      | Node nd ->
180
	let report = schedule_node nd in
181
	{top_decl with top_decl_desc = Node report.node}::accu_prog, 
182
	IMap.add nd.node_id report sch_map
183
	| _ -> top_decl::accu_prog, sch_map
184
    ) 
180
        let report = schedule_node nd in
181
        {top_decl with top_decl_desc = Node report.node}::accu_prog,
182
        IMap.add nd.node_id report sch_map
183
      | _ -> top_decl::accu_prog, sch_map
184
  )
185 185
    prog
186 186
    ([],IMap.empty)
187
  
187

  
188 188

  
189 189
let compute_prog_reuse_table report =
190 190
  IMap.map compute_node_reuse_table report
......
216 216
let pp_schedule fmt node_schs =
217 217
 IMap.iter
218 218
   (fun nd report ->
219
     Format.fprintf fmt "%s schedule: %a@."
219
     Format.(fprintf fmt "%s schedule: %a@ "
220 220
       nd
221
       (fprintf_list ~sep:" ; " pp_eq_schedule) report.schedule)
221
       (pp_print_list ~pp_sep:pp_print_semicolon pp_eq_schedule)
222
       report.schedule))
222 223
   node_schs
223 224

  
224 225
let pp_fanin_table fmt node_schs =
225 226
  IMap.iter
226 227
    (fun nd report ->
227
      Format.fprintf fmt "%s: %a" nd Liveness.pp_fanin report.fanin_table)
228
      Format.fprintf fmt "%s: %a@ " nd Liveness.pp_fanin report.fanin_table)
228 229
    node_schs
229 230

  
230 231
let pp_dep_graph fmt node_schs =
231 232
  IMap.iter
232 233
    (fun nd report ->
233
      Format.fprintf fmt "%s dependency graph: %a" nd pp_dep_graph report.dep_graph)
234
      Format.fprintf fmt "%s dependency graph: %a@ " nd pp_dep_graph report.dep_graph)
234 235
    node_schs
235 236

  
236 237
let pp_warning_unused fmt node_schs =
237
 IMap.iter
238
   (fun nd report ->
239
     let unused = report.unused_vars in
240
     if not (ISet.is_empty unused)
241
     then
242
       let nd = match (Corelang.node_from_name nd).top_decl_desc with Node nd -> nd | _ -> assert false in
243
       ISet.iter
244
	 (fun u ->
245
	   let vu = get_node_var u nd in
246
	   if vu.var_orig
247
	   then Format.fprintf fmt "  Warning: variable '%s' seems unused@,  %a@,@," u Location.pp_loc vu.var_loc)
248
	 unused
249
   )
250
   node_schs
238
  IMap.iter
239
    (fun nd report ->
240
       let unused = report.unused_vars in
241
       if not (ISet.is_empty unused)
242
       then
243
         let nd = match (Corelang.node_from_name nd).top_decl_desc with Node nd -> nd | _ -> assert false in
244
         ISet.iter
245
           (fun u ->
246
              let vu = get_node_var u nd in
247
              if vu.var_orig
248
              then Format.fprintf fmt "  Warning: variable '%s' seems unused@,  %a@,@," u Location.pp_loc vu.var_loc)
249
	       unused
250
    )
251
    node_schs
251 252

  
252 253

  
253 254
(* Sort eqs according to schedule *)
......
256 257
*)
257 258
let sort_equations_from_schedule eqs sch =
258 259
  Log.report ~level:10 (fun fmt ->
259
      Format.fprintf fmt "schedule: %a@."
260
  	(Utils.fprintf_list ~sep:" ; " pp_eq_schedule) sch);
260
      Format.fprintf fmt "schedule: %a@ "
261
        (Format.pp_print_list
262
           ~pp_sep:Format.pp_print_semicolon pp_eq_schedule) sch);
261 263
  let split_eqs = Splitting.tuple_split_eq_list eqs in
262 264
  (* Flatten schedule *)
263 265
   let sch = List.fold_right (fun vl res -> (List.map (fun v -> [v]) vl)@res) sch [] in 

Also available in: Unified diff