Commit cf427dac authored by Ben Gamari's avatar Ben Gamari
Browse files

Remove DataFlow module

I'm not convinced that my modified interface is really enough of an improvement
to warrant the change.
parent c3b145e0
......@@ -15,7 +15,6 @@ cabal-version: >=1.10
library
exposed-modules: Clash.Testbench.TestM,
Clash.Testbench.DataFlow,
Clash.Testbench.TraceView,
Clash.Testbench.TraceView.Generic,
Clash.Testbench.Impure,
......
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ScopedTypeVariables #-}
module Clash.Testbench.DataFlow where
import Control.DeepSeq
import Clash.Testbench.TestM
import Clash.Prelude
testDF :: forall i o dom. (NFData i)
=> DataFlow dom Bool Bool i o -> [i] -> [o]
testDF f =
toLogList . runTestM dut . go
where
dut :: Signal dom (Maybe i, Ready o) -> Signal dom (Maybe o, Ready i)
dut ins = bundle $ lowerDF' f x' y'
where (x', y') = unbundle ins
logEmission :: Maybe o -> TestM o (Maybe i, Ready o) (Maybe o, Ready i) ()
logEmission = maybe (return ()) logIt
go :: [i] -> TestM o (Maybe i, Ready o) (Maybe o, Ready i) ()
go [] = return ()
go (x:xs) = do
tickUntil (Nothing, Ready) ((== Ready) . snd) >>= logEmission . fst
tickUntil (Just x, Ready) ((== Ready) . snd) >>= logEmission . fst
go xs
Supports Markdown
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