summaryrefslogtreecommitdiff
path: root/sched/netlist_dumb.ml
diff options
context:
space:
mode:
authorAlex AUVOLAT <alex.auvolat@ens.fr>2013-11-08 23:05:33 +0100
committerAlex AUVOLAT <alex.auvolat@ens.fr>2013-11-08 23:05:33 +0100
commit5393f647967d4a4ad2aa4df732a13e2e1b6cf8d2 (patch)
treef747e341b3cdf942d2bd76b59f733d71505d2498 /sched/netlist_dumb.ml
parentbd04128b033c8a623cceca31de072053837ad888 (diff)
downloadSystDigit-Projet-5393f647967d4a4ad2aa4df732a13e2e1b6cf8d2.tar.gz
SystDigit-Projet-5393f647967d4a4ad2aa4df732a13e2e1b6cf8d2.zip
Little change, usefull ? Not really.
Diffstat (limited to 'sched/netlist_dumb.ml')
-rw-r--r--sched/netlist_dumb.ml16
1 files 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