Created
January 14, 2018 08:27
-
-
Save naoto-ogawa/2684b9ba07d4dd5caa87e9373e999c0d to your computer and use it in GitHub Desktop.
Not gate
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE ImplicitParams #-} | |
module Clash01 where | |
import Clash.Prelude | |
notL :: Bool -> Bool | |
notL = not | |
notTF s i = (not i, not i) | |
notM :: (?rst::Reset domain synchronous, ?clk::Clock domain gated) => Signal domain Bool -> Signal domain Bool | |
notM = mealy notTF False | |
topEntity | |
:: SystemClockReset | |
=> Signal System Bool | |
-> Signal System Bool | |
topEntity = notM | |
{-# NOINLINE topEntity #-} | |
testBench :: Signal System Bool | |
testBench = done' | |
where | |
testInput = stimuliGenerator $(listToVecTH [True , False, True , True , False, False]) | |
expectedOutput = outputVerifier $(listToVecTH [False, True , False, False, True , True ]) | |
done = expectedOutput (topEntity testInput) | |
done' = withClockReset (tbSystemClockGen (not <$> done')) systemResetGen done | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment