From 906d9a5356fe7b90fc14a9c0d6a0d65abb7e80a8 Mon Sep 17 00:00:00 2001 From: Alex AUVOLAT Date: Sat, 4 Jan 2014 13:09:05 +0100 Subject: Document programs ; better time support in monitor. --- tests/Makefile | 16 ++++++++++++---- tests/clock2.mj | 4 ++-- tests/clockHMS.mj | 4 ++-- 3 files changed, 16 insertions(+), 8 deletions(-) (limited to 'tests') diff --git a/tests/Makefile b/tests/Makefile index cf2f62f..02f1c9b 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -1,17 +1,25 @@ .SECONDARY: MINIJAZZ=../minijazz/mjc.byte -SCHED=../sched/main.native +SCHED=../sched/sched SIM=../csim/csim +MON=../monitor/mon -%.sim: %.dumb +%.mon: _build/%.dumb + $(MON) $(SIM) -rom decode7 decode7.rom $< + +%.sim: _build/%.dumb $(SIM) -n 12 $< -%.dumb %.snet %_opt.dumb %_opt.snet: %.net +_build/%.dumb _build/%.snet _build/%_opt.dumb _build/%_opt.snet: _build/%.net $(SCHED) $< -%.net: %.mj +_build/%.net: %.mj _build $(MINIJAZZ) $< + mv `basename -s .mj $<`.net _build + +_build: + mkdir _build clean: rm *.net diff --git a/tests/clock2.mj b/tests/clock2.mj index 6f28603..73b5e6a 100644 --- a/tests/clock2.mj +++ b/tests/clock2.mj @@ -69,11 +69,11 @@ dec7(i:[4]) = (o:[7]) where o = decode7 end where -main() = (sec_u:[4],d7_sec_u:[7],sec_d:[4],d7_sec_d:[7], +main(tick) = (sec_u:[4],d7_sec_u:[7],sec_d:[4],d7_sec_d:[7], min_u:[4],d7_min_u:[7],min_d:[4],d7_min_d:[7], hour_u:[4],d7_hour_u:[7],hour_d:[4],d7_hour_d:[7], next_day) where - (count_seca, aug_seca) = count_mod_keep<2,2>(1); + (count_seca, aug_seca) = count_mod_keep<2,2>(tick); (count_secb, aug_secb) = count_mod_keep<3,5>(aug_seca); (count_secc, aug_min) = count_mod_keep<3,6>(aug_secb); sec_u = count_seca[0] . count_secb; diff --git a/tests/clockHMS.mj b/tests/clockHMS.mj index 4575c58..ea10d4f 100644 --- a/tests/clockHMS.mj +++ b/tests/clockHMS.mj @@ -62,8 +62,8 @@ count_mod(in:[n], op) = (out:[n], reset) where out = and_each(neq, incr); end where -main() = (count_sec:[6],count_min:[6],count_hour:[5],next_day) where - (count_sec, aug_min) = count_mod<6, 60>(save_sec, 1); +main(tick) = (count_sec:[6],count_min:[6],count_hour:[5],next_day) where + (count_sec, aug_min) = count_mod<6, 60>(save_sec, tick); save_sec = reg_n<6>(count_sec); (count_min, aug_hour) = count_mod<6, 60>(save_min, aug_min); -- cgit v1.2.3