Hoogle Search
Within LTS Haskell 24.70 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
-
clash-prelude Clash.Signal Determines the value for which a reset line is considered "active"
data
SResetKind (resetKind :: ResetKind)clash-prelude Clash.Signal Singleton version of ResetKind
data
SResetPolarity (polarity :: ResetPolarity)clash-prelude Clash.Signal Singleton version of ResetPolarity
-
clash-prelude Clash.Signal A constraint that indicates the component needs a Clock, a Reset, and an Enable belonging to the System domain. Click here to read more about hidden clocks, resets, and enables
_resetKind :: DomainConfiguration -> ResetKindclash-prelude Clash.Signal Whether resets are synchronous (edge-sensitive) or asynchronous (level-sensitive)
_resetPolarity :: DomainConfiguration -> ResetPolarityclash-prelude Clash.Signal Whether resets are active high or active low
-
clash-prelude Clash.Signal Expose hidden Clock, Reset, and Enable arguments of a component, so they can be applied explicitly. # 1425 "srcClashSignal.hs" Click here to read more about hidden clocks, resets, and enables
Example
Usage with a polymorphic domain:>>> reg = register 5 (reg + 1) >>> sig = exposeClockResetEnable reg clockGen resetGen enableGen >>> sampleN @System 10 sig [5,5,6,7,8,9,10,11,12,13]
Force exposeClockResetEnable to work on System (hence sampleN not needing an explicit domain later):>>> reg = register 5 (reg + 1) >>> sig = exposeClockResetEnable @System reg clockGen resetGen enableGen >>> sampleN 10 sig [5,5,6,7,8,9,10,11,12,13]
Usage in a testbench context:topEntity :: Vec 2 (Vec 3 (Unsigned 8)) -> Vec 6 (Unsigned 8) topEntity = concat testBench :: Signal System Bool testBench = done where testInput = pure ((1 :> 2 :> 3 :> Nil) :> (4 :> 5 :> 6 :> Nil) :> Nil) expectedOutput = outputVerifier' ((1:>2:>3:>4:>5:>6:>Nil):>Nil) done = exposeClockResetEnable (expectedOutput (topEntity <$> testInput)) clk rst en clk = tbSystemClockGen (not <$> done) rst = systemResetGen en = enableGen
-
clash-prelude Clash.Signal Expose a hidden Reset argument of a component, so it can be applied explicitly. # 913 "srcClashSignal.hs" === Example Usage with a polymorphic domain:
>>> reg = register 5 (reg + 1) >>> sig = exposeReset reg resetGen >>> sampleN @System 10 sig [5,5,6,7,8,9,10,11,12,13]
Force exposeReset to work on System (hence sampleN not needing an explicit domain later):>>> reg = register 5 (reg + 1) >>> sig = exposeReset @System reg resetGen >>> sampleN 10 sig [5,5,6,7,8,9,10,11,12,13]
-
clash-prelude Clash.Signal Like fromList, but resets on reset and has a defined reset value.
>>> let rst = unsafeFromActiveHigh (fromList [True, True, False, False, True, False]) >>> let res = withReset rst (fromListWithReset Nothing [Just 'a', Just 'b', Just 'c']) >>> sampleN @System 6 res [Nothing,Nothing,Just 'a',Just 'b',Nothing,Just 'a']
NB: This function is not synthesizable hasReset :: forall (dom :: Domain) . HiddenReset dom => Reset domclash-prelude Clash.Signal Connect a hidden Reset to an argument where a normal Reset argument was expected. Click here to read more about hidden clocks, resets, and enables