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.Prelude 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.Prelude Whether resets are synchronous (edge-sensitive) or asynchronous (level-sensitive)
_resetPolarity :: DomainConfiguration -> ResetPolarityclash-prelude Clash.Prelude Whether resets are active high or active low
-
clash-prelude Clash.Prelude 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.Prelude 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.Prelude 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.Prelude 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
-
clash-prelude Clash.Prelude Hide the Clock, Reset, and Enable arguments of a component, so they can be routed implicitly. Click here to read more about hidden clocks, resets, and enables
hideReset :: forall (dom :: Domain) r . HiddenReset dom => (Reset dom -> r) -> rclash-prelude Clash.Prelude Hide the Reset argument of a component, so it can be routed implicitly. Click here to read more about hidden clocks, resets, and enables
holdReset :: forall (dom :: Domain) (m :: Nat) . HiddenClockResetEnable dom => SNat m -> Reset domclash-prelude Clash.Prelude Hold reset for a number of cycles relative to an incoming reset signal. NB: The output of this function is combinational for n > 1 on domains with a synchronous reset. Use registerSyncReset to add an output register if desired. Example:
>>> holdResetBool = unsafeToActiveHigh . (holdReset @System) >>> sampleN 8 (exposeReset (holdResetBool (SNat @2)) (resetGenN (SNat @3))) [True,True,True,True,True,False,False,False]
holdReset holds the reset for an additional 2 clock cycles for a total of 5 clock cycles where the reset is asserted. holdReset also works on intermediate assertions of the reset signal:>>> let rst = fromList [True, False, False, False, True, False, False, False] >>> sampleN 8 (exposeReset (holdResetBool (SNat @2)) (unsafeFromActiveHigh rst)) [True,True,True,False,True,True,True,False]