43 lines
980 B
Haskell
43 lines
980 B
Haskell
|
{-# LANGUAGE StandaloneDeriving #-}
|
||
|
-- Trying to see if void is synthesizable
|
||
|
-- Verdict: Yes it is.
|
||
|
|
||
|
module VoidSynth where
|
||
|
|
||
|
import Clash.Prelude
|
||
|
import Clash.Explicit.Testbench
|
||
|
import Data.Void
|
||
|
|
||
|
deriving instance NFDataX Void
|
||
|
|
||
|
tf :: Maybe Void -> Int -> (Maybe Void, Bool)
|
||
|
tf s inp = case s of
|
||
|
Nothing -> (Nothing, False)
|
||
|
_ -> (Nothing, True)
|
||
|
|
||
|
mon
|
||
|
:: SystemClockResetEnable
|
||
|
=> Signal System Int
|
||
|
-> Signal System Bool
|
||
|
mon = mealy tf Nothing
|
||
|
|
||
|
topEntity
|
||
|
:: Clock System
|
||
|
-> Reset System
|
||
|
-> Enable System
|
||
|
-> Signal System Int
|
||
|
-> Signal System Bool
|
||
|
topEntity = exposeClockResetEnable mon
|
||
|
|
||
|
{-
|
||
|
GHC: Setting up GHC took: 0.665s
|
||
|
GHC: Compiling and loading modules took: 0.699s
|
||
|
Clash: Parsing and compiling primitives took 0.275s
|
||
|
GHC+Clash: Loading modules cumulatively took 1.750s
|
||
|
Clash: Compiling Main.topEntity
|
||
|
Clash: Normalization took 0.004s
|
||
|
Clash: Netlist generation took 0.000s
|
||
|
Clash: Compiling Main.topEntity took 0.027s
|
||
|
Clash: Total compilation took 1.778s
|
||
|
-}
|