MTL_Monitor/tests/washing_machine/properties/prop2.hs

38 lines
2.0 KiB
Haskell

module Prop2 where
import Clash.Explicit.Testbench
import Clash.Prelude
import ProcessingElement(processingElement)
import Queue(queue,queuetest)
import Queue30(queue30,queuetest30)
queue_mealy4 inp = mealy queue (0:>0:>0:>0:>0:>0:>0:>0:>0:>0:>0:>0:>Nil) inp
queue_mealy5 inp = mealy queue (0:>0:>0:>0:>0:>0:>0:>0:>0:>0:>0:>0:>Nil) inp
queue_mealy6 inp = mealy queue (0:>Nil) inp
processingElement_mealy_or inp = mealy processingElement (0,(0,0,31,31,31,31,31,31,31,31),(31,31,0,0,31,31,31,31,31,31)) inp
processingElement_mealy_not inp = mealy processingElement (1,(31,31,0,0,31,31,31,31,31,31),(0,0,31,31,31,31,31,31,31,31)) inp
processingElement_mealy_box inp = mealy processingElement (1,(31,31,31,31,0,0,11,11,31,31),(31,31,7,11,0,0,31,31,31,31)) inp
prop2 (inp1,inp2) = queue_mealy6 (processingElement_mealy_or (bundle (queue_mealy5 (processingElement_mealy_not (bundle (inp1,inp1)) ) , queue_mealy4 (processingElement_mealy_box (bundle (inp2,inp2) ) ) )))
topEntity
:: Clock System
-> Reset System
-> Enable System
-> (Signal System (Bool), Signal System (Bool))
-> Signal System ( Bool)
topEntity = exposeClockResetEnable prop2
testBench :: Signal System Bool
testBench = done
where
testInput1 = stimuliGenerator clk rst $(listToVecTH [True::Bool , False, False, False, False, False, False, False, False, False, False, False, False, False, False, False])
testInput2 = stimuliGenerator clk rst $(listToVecTH [False::Bool , False, False, False, False, False, False, True, True, True, True, True, True, True,False, False, False])
expectOutput = outputVerifier' clk rst $(listToVecTH [False ::Bool,False, False, False, False, False, False, False, False, False, False, False, False, False, True , True, True, True , True, True, True, True, True, True, True , True, True, True,True])
done = expectOutput (topEntity clk rst en (testInput1, testInput2))
en = enableGen
clk = tbSystemClockGen (not <$> done)
rst = systemResetGen