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 Same as simulateWithReset, but only sample the first Int output values.
systemResetGen :: Reset Systemclash-prelude Clash.Prelude Reset generator for use in simulation, for the System clock domain. Asserts the reset for a single cycle. NB: While this can be used in the testBench function, it cannot be synthesized to hardware.
Example
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 clk = tbSystemClockGen (not <$> done) rst = systemResetGen
unsafeFromReset :: forall (dom :: Domain) . Reset dom -> Signal dom Boolclash-prelude Clash.Prelude unsafeFromReset is unsafe because it can introduce:
For asynchronous resets it is unsafe because it can cause combinatorial loops. In case of synchronous resets it can lead to meta-stability in the presence of asynchronous resets. NB: You probably want to use unsafeToActiveLow or unsafeToActiveHigh.unsafeToReset :: forall (dom :: Domain) . KnownDomain dom => Signal dom Bool -> Reset domclash-prelude Clash.Prelude unsafeToReset is unsafe. For asynchronous resets it is unsafe because it can introduce combinatorial loops. In case of synchronous resets it can lead to meta-stability issues in the presence of asynchronous resets. NB: You probably want to use unsafeFromActiveLow or unsafeFromActiveHigh.
vResetKind :: VDomainConfiguration -> ResetKindclash-prelude Clash.Prelude Corresponds to _resetKind on DomainConfiguration
vResetPolarity :: VDomainConfiguration -> ResetPolarityclash-prelude Clash.Prelude Corresponds to _resetPolarity on DomainConfiguration
-
clash-prelude Clash.Prelude Connect an explicit Clock, Reset, and Enable to a function with a hidden Clock, Reset, and Enable. # 1551 "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 = withClockResetEnable clockGen resetGen enableGen reg >>> sampleN @System 10 sig [5,5,6,7,8,9,10,11,12,13]
Force withClockResetEnable to work on System (hence sampleN not needing an explicit domain later):>>> reg = register 5 (reg + 1) >>> sig = withClockResetEnable @System clockGen resetGen enableGen reg >>> sampleN 10 sig [5,5,6,7,8,9,10,11,12,13]
withReset :: forall (dom :: Domain) r . KnownDomain dom => Reset dom -> (HiddenReset dom => r) -> rclash-prelude Clash.Prelude Connect an explicit Reset to a function with a hidden Reset. # 1012 "srcClashSignal.hs" === Example Usage with a polymorphic domain:
>>> reg = register 5 (reg + 1) >>> sig = withReset resetGen reg >>> sampleN @System 10 sig [5,5,6,7,8,9,10,11,12,13]
Force withReset to work on System (hence sampleN not needing an explicit domain later):>>> reg = register 5 (reg + 1) >>> sig = withReset @System resetGen reg >>> sampleN 10 sig [5,5,6,7,8,9,10,11,12,13]
ClearOnReset :: ResetStrategy 'Trueclash-prelude Clash.Prelude.BlockRam No documentation available.
NoClearOnReset :: ResetStrategy 'Falseclash-prelude Clash.Prelude.BlockRam No documentation available.