From 5393f647967d4a4ad2aa4df732a13e2e1b6cf8d2 Mon Sep 17 00:00:00 2001 From: Alex AUVOLAT Date: Fri, 8 Nov 2013 23:05:33 +0100 Subject: Little change, usefull ? Not really. --- sched/netlist_dumb.ml | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/sched/netlist_dumb.ml b/sched/netlist_dumb.ml index 6b8f526..89f7edf 100644 --- a/sched/netlist_dumb.ml +++ b/sched/netlist_dumb.ml @@ -93,12 +93,16 @@ let make_program_dumb p = p.p_eqs; (* Make ids for variables *) - Env.iter - (fun k v -> - vars := { name = k; size = v }::(!vars); - Hashtbl.add var_map k (!next_id); - next_id := !next_id + 1) - p.p_vars; + let add_var n = + if not (Hashtbl.mem var_map n) then begin + vars := { name = n; size = Env.find n p.p_vars }::(!vars); + Hashtbl.add var_map n (!next_id); + next_id := !next_id + 1 + end + in + List.iter add_var p.p_inputs; + List.iter (fun (n, _) -> add_var n) p.p_eqs; + Env.iter (fun n _ -> add_var n) p.p_vars; let var_id = Hashtbl.find var_map in let arg_id = function -- cgit v1.2.3