{-# 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
, asyncRomBlob
, asyncRomBlobPow2
, romBlob
, romBlobPow2
, asyncRomFile
, asyncRomFilePow2
, romFile
, romFilePow2
, asyncRam
, asyncRamPow2
, blockRam
, blockRamPow2
, blockRamU
, blockRam1
, E.ResetStrategy(..)
, blockRamBlob
, blockRamBlobPow2
, MemBlob
, createMemBlob
, memBlobTH
, unpackMemBlob
, blockRamFile
, blockRamFilePow2
, readNew
, trueDualPortBlockRam
, RamOp(..)
, window
, windowD
, isRising
, isFalling
, riseEvery
, oscillate
, traceSignal1
, traceVecSignal1
, traceSignal
, traceVecSignal
, dumpVCD
, module Clash.Signal
, module Clash.Signal.Delayed
, module Clash.Sized.BitVector
, 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, 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 Data.Kind
, 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 Data.Kind (Type, Constraint)
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.BlockRam
import Clash.Prelude.BlockRam.Blob
import Clash.Prelude.BlockRam.File
import Clash.Prelude.ROM.Blob
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 hiding (fromList, unsafeFromList)
import Clash.Signal hiding
(HiddenClockName, HiddenResetName, HiddenEnableName)
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