diff options
author | Alex AUVOLAT <alex.auvolat@ens.fr> | 2013-11-05 18:38:25 +0100 |
---|---|---|
committer | Alex AUVOLAT <alex.auvolat@ens.fr> | 2013-11-05 18:38:25 +0100 |
commit | ad529541bf54d9a4339a7371208b7d328c0a449a (patch) | |
tree | e101b23d58d0e9fcc6db8020506668b07f3b2804 | |
parent | 1514c384d205a1710d81e52aba82476e1146e37d (diff) | |
download | SystDigit-Projet-ad529541bf54d9a4339a7371208b7d328c0a449a.tar.gz SystDigit-Projet-ad529541bf54d9a4339a7371208b7d328c0a449a.zip |
Deleted useless debug output ; coded working 60/60/24 clock.
-rw-r--r-- | sched/simplify.ml | 5 | ||||
-rw-r--r-- | tests/clockHMS.mj | 21 |
2 files changed, 14 insertions, 12 deletions
diff --git a/sched/simplify.ml b/sched/simplify.ml index ae5ec65..5ca4b99 100644 --- a/sched/simplify.ml +++ b/sched/simplify.ml @@ -219,10 +219,6 @@ let topo_sort p = (* Apply all the simplification passes, in the order given in the header of this file *) -let dump_varlist p = - print_string "Eq list:\n"; - List.iter (fun (n, _) -> print_string ("- "^n^"\n")) p.p_eqs - let rec simplify p = let steps = [ cascade_slices; @@ -235,7 +231,6 @@ let rec simplify p = let pp, use = List.fold_left (fun (x, u) f -> let xx, uu = f x in - dump_varlist xx; (xx, u || uu)) (p, false) steps in if use then simplify pp else pp diff --git a/tests/clockHMS.mj b/tests/clockHMS.mj index a25a85c..4575c58 100644 --- a/tests/clockHMS.mj +++ b/tests/clockHMS.mj @@ -55,14 +55,21 @@ and_each<n>(a, b:[n]) = (o:[n]) where end if end where -count_mod<n, m>(in:[n]) = (out:[n]) where - (incr, carry) = adder<n>(in, 1 . repeat<n-1>(0), 0); - neq = not (equal<n, m>(incr)); - out = and_each<n>(neq, incr) +count_mod<n, m>(in:[n], op) = (out:[n], reset) where + (incr, carry) = adder<n>(in, op . repeat<n-1>(0), 0); + reset = equal<n, m>(incr); + neq = not reset; + out = and_each<n>(neq, incr); end where -main() = (out:[4],next:[4]) where - next = count_mod<4, 12>(out); - out = reg_n<4>(next) +main() = (count_sec:[6],count_min:[6],count_hour:[5],next_day) where + (count_sec, aug_min) = count_mod<6, 60>(save_sec, 1); + save_sec = reg_n<6>(count_sec); + + (count_min, aug_hour) = count_mod<6, 60>(save_min, aug_min); + save_min = reg_n<6>(count_min); + + (count_hour, next_day) = count_mod<5, 24>(save_hour, aug_hour); + save_hour = reg_n<5>(count_hour) end where |