{-# LANGUAGE CPP #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE MonoLocalBinds #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE Unsafe #-}
{-# OPTIONS_HADDOCK show-extensions, not-home #-}
module Clash.Prelude
(
mealy
, mealyB
, (<^>)
, moore
, mooreB
, registerB
#ifdef CLASH_MULTIPLE_HIDDEN
, dualFlipFlopSynchronizer
, asyncFIFOSynchronizer
#endif
, asyncRom
, asyncRomPow2
, rom
, romPow2
, asyncRomFile
, asyncRomFilePow2
, romFile
, romFilePow2
, asyncRam
, asyncRamPow2
, blockRam
, blockRamPow2
, blockRamU
, blockRam1
, E.ResetStrategy(..)
, blockRamFile
, blockRamFilePow2
, readNew
, window
, windowD
, isRising
, isFalling
, riseEvery
, oscillate
, traceSignal1
, traceVecSignal1
, traceSignal
, traceVecSignal
, dumpVCD
, module Clash.Signal
, module Clash.Signal.Delayed
, module Clash.Prelude.DataFlow
, module Clash.Sized.BitVector
, module Clash.Prelude.BitIndex
, module Clash.Prelude.BitReduction
, module Clash.Sized.Signed
, module Clash.Sized.Unsigned
, module Clash.Sized.Index
, module Clash.Sized.Fixed
, module Clash.Sized.Vector
, module Clash.Sized.RTree
, module Clash.Annotations.TopEntity
, Generic
, Generic1
, module GHC.TypeLits
, module GHC.TypeLits.Extra
, module Clash.Promoted.Nat
, module Clash.Promoted.Nat.Literals
, module Clash.Promoted.Nat.TH
, module Clash.Promoted.Symbol
, Lift (..)
, autoReg, deriveAutoReg
, module Clash.Class.BitPack
, module Clash.Class.Exp
, module Clash.Class.Num
, module Clash.Class.Parity
, module Clash.Class.Resize
, module Control.Applicative
, module Data.Bits
, module Data.Default.Class
, module Clash.XException
, module Clash.NamedTypes
, module Clash.Hidden
, module Clash.Magic
, module Clash.HaskellPrelude
)
where
import Control.Applicative
import Data.Bits
import Data.Default.Class
import GHC.Stack (HasCallStack)
import GHC.TypeLits
import GHC.TypeLits.Extra
import Language.Haskell.TH.Syntax (Lift(..))
import Clash.HaskellPrelude
import Clash.Annotations.TopEntity
import Clash.Class.AutoReg (AutoReg, deriveAutoReg)
import Clash.Class.BitPack
import Clash.Class.Exp
import Clash.Class.Num
import Clash.Class.Parity
import Clash.Class.Resize
import qualified Clash.Explicit.Prelude as E
import Clash.Hidden
import Clash.Magic
import Clash.NamedTypes
import Clash.Prelude.BitIndex
import Clash.Prelude.BitReduction
import Clash.Prelude.BlockRam
import Clash.Prelude.BlockRam.File
import Clash.Prelude.DataFlow
import Clash.Prelude.ROM.File
import Clash.Prelude.Safe
#ifdef CLASH_MULTIPLE_HIDDEN
import Clash.Prelude.Synchronizer
#endif
import Clash.Promoted.Nat
import Clash.Promoted.Nat.TH
import Clash.Promoted.Nat.Literals
import Clash.Promoted.Symbol
import Clash.Sized.BitVector
import Clash.Sized.Fixed
import Clash.Sized.Index
import Clash.Sized.RTree
import Clash.Sized.Signed
import Clash.Sized.Unsigned
import Clash.Sized.Vector
import Clash.Signal
import Clash.Signal.Delayed
import Clash.Signal.Trace
import Clash.XException
window
:: ( HiddenClockResetEnable dom
, KnownNat n
, Default a
, NFDataX a )
=> Signal dom a
-> Vec (n + 1) (Signal dom a)
window :: Signal dom a -> Vec (n + 1) (Signal dom a)
window = (KnownDomain dom =>
Clock dom
-> Reset dom
-> Enable dom
-> Signal dom a
-> Vec (n + 1) (Signal dom a))
-> Signal dom a -> Vec (n + 1) (Signal dom a)
forall (dom :: Symbol) r.
HiddenClockResetEnable dom =>
(KnownDomain dom => Clock dom -> Reset dom -> Enable dom -> r) -> r
hideClockResetEnable KnownDomain dom =>
Clock dom
-> Reset dom
-> Enable dom
-> Signal dom a
-> Vec (n + 1) (Signal dom a)
forall (n :: Nat) (dom :: Symbol) a.
(KnownNat n, KnownDomain dom, NFDataX a, Default a) =>
Clock dom
-> Reset dom
-> Enable dom
-> Signal dom a
-> Vec (n + 1) (Signal dom a)
E.window
{-# INLINE window #-}
windowD
:: ( HiddenClockResetEnable dom
, KnownNat n
, Default a
, NFDataX a )
=> Signal dom a
-> Vec (n + 1) (Signal dom a)
windowD :: Signal dom a -> Vec (n + 1) (Signal dom a)
windowD = (KnownDomain dom =>
Clock dom
-> Reset dom
-> Enable dom
-> Signal dom a
-> Vec (n + 1) (Signal dom a))
-> Signal dom a -> Vec (n + 1) (Signal dom a)
forall (dom :: Symbol) r.
HiddenClockResetEnable dom =>
(KnownDomain dom => Clock dom -> Reset dom -> Enable dom -> r) -> r
hideClockResetEnable KnownDomain dom =>
Clock dom
-> Reset dom
-> Enable dom
-> Signal dom a
-> Vec (n + 1) (Signal dom a)
forall (n :: Nat) a (dom :: Symbol).
(KnownNat n, NFDataX a, Default a, KnownDomain dom) =>
Clock dom
-> Reset dom
-> Enable dom
-> Signal dom a
-> Vec (n + 1) (Signal dom a)
E.windowD
{-# INLINE windowD #-}
autoReg
:: (HasCallStack, HiddenClockResetEnable dom, AutoReg a)
=> a
-> Signal dom a
-> Signal dom a
autoReg :: a -> Signal dom a -> Signal dom a
autoReg = (KnownDomain dom =>
Clock dom
-> Reset dom -> Enable dom -> a -> Signal dom a -> Signal dom a)
-> a -> Signal dom a -> Signal dom a
forall (dom :: Symbol) r.
HiddenClockResetEnable dom =>
(KnownDomain dom => Clock dom -> Reset dom -> Enable dom -> r) -> r
hideClockResetEnable KnownDomain dom =>
Clock dom
-> Reset dom -> Enable dom -> a -> Signal dom a -> Signal dom a
forall a (dom :: Symbol).
(AutoReg a, HasCallStack, KnownDomain dom) =>
Clock dom
-> Reset dom -> Enable dom -> a -> Signal dom a -> Signal dom a
E.autoReg