Commit 49f05dc4 authored by ross's avatar ross
Browse files

[project @ 2003-06-23 00:23:38 by ross]

extend a test
parent a53ccd6c
{-# OPTIONS -fglasgow-exts #-}
module Main where
module Main(main) where
import Control.Arrow
......@@ -80,8 +80,6 @@ counter = proc reset -> do
next <- delay 0 -< output+1
returnA -< output
{-
-- Some other basic circuits from the Hawk library.
-- flush: when reset is True, return d for n ticks, otherwise copy value.
......@@ -102,17 +100,20 @@ latch init = proc (value, reset) -> do
last <- delay init -< out
returnA -< out
-}
-- Some tests using the counter
test_input = [True, False, True, False, False, True, False, True]
test_input2 = zip [1..] test_input
-- A test of the resettable counter.
main = do
print (runStreamMap counter test_input)
print (runAuto counter test_input)
print (runStreamMap (flush 2 0) test_input2)
print (runAuto (flush 2 0) test_input2)
print (runStreamMap (latch 0) test_input2)
print (runAuto (latch 0) test_input2)
-- A step function (cf current in Lustre)
......
[0,1,0,1,2,0,1,0]
[0,1,0,1,2,0,1,0]
[0,0,0,0,5,0,0,0]
[0,0,0,0,5,0,0,0]
[1,1,3,3,3,6,6,8]
[1,1,3,3,3,6,6,8]
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment