clash-prelude-1.8.4: Clash: a functional hardware description language - Prelude library

Copyright | © 2015-2016 Christiaan Baaij 2017 Google Inc. 2019 Myrtle Software Ltd
License | Creative Commons 4.0 (CC BY 4.0) (https://creativecommons.org/licenses/by/4.0/)
Safe Haskell | None
Language | Haskell2010

Clash.Examples.Internal

Description

# Documentation

decoderCase :: Bool -> BitVector 4 -> BitVector 16 Source #

decoderShift :: Bool -> BitVector 4 -> BitVector 16 Source #

encoderCase :: Bool -> BitVector 16 -> BitVector 4 Source #

upCounter :: forall (dom :: Domain). HiddenClockResetEnable dom => Signal dom Bool -> Signal dom (Unsigned 8) Source #

upCounterLdT :: Num a => a -> (Bool, Bool, a) -> (a, a) Source #

upCounterLd :: forall (dom :: Domain). HiddenClockResetEnable dom => Signal dom (Bool, Bool, Unsigned 8) -> Signal dom (Unsigned 8) Source #

upDownCounter :: forall (dom :: Domain). HiddenClockResetEnable dom => Signal dom Bool -> Signal dom (Unsigned 8) Source #

lfsrF' :: BitVector 16 -> BitVector 16 Source #

lfsrF :: forall (dom :: Domain). HiddenClockResetEnable dom => BitVector 16 -> Signal dom Bit Source #

lfsrGP :: forall (n :: Natural) a. (KnownNat (n + 1), Bits a) => Vec (n + 1) Bool -> Vec (n + 1) a -> Vec (n + 1) a Source #

lfsrG :: forall (dom :: Domain). HiddenClockResetEnable dom => BitVector 16 -> Signal dom Bit Source #

grayCounter :: forall (dom :: Domain). HiddenClockResetEnable dom => Signal dom Bool -> Signal dom (BitVector 8) Source #

oneHotCounter :: forall (dom :: Domain). HiddenClockResetEnable dom => Signal dom Bool -> Signal dom (BitVector 8) Source #

crcT :: (Bits a, BitPack a) => a -> Bit -> a Source #

crc :: forall (dom :: Domain). HiddenClockResetEnable dom => Signal dom Bool -> Signal dom Bool -> Signal dom Bit -> Signal dom (BitVector 16) Source #

data RxReg Source #

Constructors

RxReg |

Fields

- _rx_reg :: BitVector 8
- _rx_data :: BitVector 8
- _rx_sample_cnt :: Unsigned 4
- _rx_cnt :: Unsigned 4
- _rx_frame_err :: Bool
- _rx_over_run :: Bool
- _rx_empty :: Bool
- _rx_d1 :: Bit
- _rx_d2 :: Bit
- _rx_busy :: Bool

#### Instances

Instances details

NFDataX RxReg Source # |
Instance details Defined in Clash.Examples.Internal Methods deepErrorX :: String -> RxReg Source # hasUndefined :: RxReg -> Bool Source # ensureSpine :: RxReg -> RxReg Source # rnfX :: RxReg -> () Source #
Generic RxReg Source # |

Instance details

Defined in Clash.Examples.Internal

Associated Types

type Rep RxReg |

Instance details

Defined in Clash.Examples.Internal

type Rep RxReg = D1 ('MetaData "RxReg" "Clash.Examples.Internal" "clash-prelude-1.8.4-1CKHk9HHRNIGPqhYHQsmcW" 'False) (C1 ('MetaCons "RxReg" 'PrefixI 'True) (((S1 ('MetaSel ('Just "_rx_reg") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (BitVector 8)) :*: S1 ('MetaSel ('Just "_rx_data") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (BitVector 8))) :*: (S1 ('MetaSel ('Just "_rx_sample_cnt") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Unsigned 4)) :*: (S1 ('MetaSel ('Just "_rx_cnt") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Unsigned 4)) :*: S1 ('MetaSel ('Just "_rx_frame_err") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool)))) :*: ((S1 ('MetaSel ('Just "_rx_over_run") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool) :*: S1 ('MetaSel ('Just "_rx_empty") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool)) :*: (S1 ('MetaSel ('Just "_rx_d1") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bit) :*: (S1 ('MetaSel ('Just "_rx_d2") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bit) :*: S1 ('MetaSel ('Just "_rx_busy") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool))))))

Methods

from :: RxReg -> Rep RxReg x Source #

to :: Rep RxReg x -> RxReg Source #

type Rep RxReg Source # |

Instance details

Defined in Clash.Examples.Internal

type Rep RxReg = D1 ('MetaData "RxReg" "Clash.Examples.Internal" "clash-prelude-1.8.4-1CKHk9HHRNIGPqhYHQsmcW" 'False) (C1 ('MetaCons "RxReg" 'PrefixI 'True) (((S1 ('MetaSel ('Just "_rx_reg") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (BitVector 8)) :*: S1 ('MetaSel ('Just "_rx_data") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (BitVector 8))) :*: (S1 ('MetaSel ('Just "_rx_sample_cnt") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Unsigned 4)) :*: (S1 ('MetaSel ('Just "_rx_cnt") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Unsigned 4)) :*: S1 ('MetaSel ('Just "_rx_frame_err") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool)))) :*: ((S1 ('MetaSel ('Just "_rx_over_run") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool) :*: S1 ('MetaSel ('Just "_rx_empty") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool)) :*: (S1 ('MetaSel ('Just "_rx_d1") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bit) :*: (S1 ('MetaSel ('Just "_rx_d2") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bit) :*: S1 ('MetaSel ('Just "_rx_busy") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool))))))

rx_busy :: Lens' RxReg Bool Source #

rx_cnt :: Lens' RxReg (Unsigned 4) Source #

rx_d1 :: Lens' RxReg Bit Source #

rx_d2 :: Lens' RxReg Bit Source #

rx_data :: Lens' RxReg (BitVector 8) Source #

rx_empty :: Lens' RxReg Bool Source #

rx_frame_err :: Lens' RxReg Bool Source #

rx_over_run :: Lens' RxReg Bool Source #

rx_reg :: Lens' RxReg (BitVector 8) Source #

rx_sample_cnt :: Lens' RxReg (Unsigned 4) Source #

data TxReg Source #

Constructors

TxReg |

Fields

- _tx_reg :: BitVector 8
- _tx_empty :: Bool
- _tx_over_run :: Bool
- _tx_out :: Bit
- _tx_cnt :: Unsigned 4

#### Instances

Instances details

NFDataX TxReg Source # |
Instance details Defined in Clash.Examples.Internal Methods deepErrorX :: String -> TxReg Source # hasUndefined :: TxReg -> Bool Source # ensureSpine :: TxReg -> TxReg Source # rnfX :: TxReg -> () Source #
Generic TxReg Source # |

Instance details

Defined in Clash.Examples.Internal

Associated Types

type Rep TxReg |

Instance details

Defined in Clash.Examples.Internal

type Rep TxReg = D1 ('MetaData "TxReg" "Clash.Examples.Internal" "clash-prelude-1.8.4-1CKHk9HHRNIGPqhYHQsmcW" 'False) (C1 ('MetaCons "TxReg" 'PrefixI 'True) ((S1 ('MetaSel ('Just "_tx_reg") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (BitVector 8)) :*: S1 ('MetaSel ('Just "_tx_empty") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool)) :*: (S1 ('MetaSel ('Just "_tx_over_run") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool) :*: (S1 ('MetaSel ('Just "_tx_out") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bit) :*: S1 ('MetaSel ('Just "_tx_cnt") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Unsigned 4))))))

Methods

from :: TxReg -> Rep TxReg x Source #

to :: Rep TxReg x -> TxReg Source #

type Rep TxReg Source # |

Instance details

Defined in Clash.Examples.Internal

type Rep TxReg = D1 ('MetaData "TxReg" "Clash.Examples.Internal" "clash-prelude-1.8.4-1CKHk9HHRNIGPqhYHQsmcW" 'False) (C1 ('MetaCons "TxReg" 'PrefixI 'True) ((S1 ('MetaSel ('Just "_tx_reg") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (BitVector 8)) :*: S1 ('MetaSel ('Just "_tx_empty") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool)) :*: (S1 ('MetaSel ('Just "_tx_over_run") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool) :*: (S1 ('MetaSel ('Just "_tx_out") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bit) :*: S1 ('MetaSel ('Just "_tx_cnt") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Unsigned 4))))))

tx_cnt :: Lens' TxReg (Unsigned 4) Source #

tx_empty :: Lens' TxReg Bool Source #

tx_out :: Lens' TxReg Bit Source #

tx_over_run :: Lens' TxReg Bool Source #

tx_reg :: Lens' TxReg (BitVector 8) Source #

uartTX :: TxReg -> Bool -> BitVector 8 -> Bool -> TxReg Source #

uartRX :: RxReg -> Bit -> Bool -> Bool -> RxReg Source #

uart :: forall {dom :: Domain}. (Hidden "clock" (Clock dom), Hidden "reset" (Reset dom), Hidden "enable" (Enable dom), KnownDomain dom) => Signal dom Bool -> Signal dom (BitVector 8) -> Signal dom Bool -> Signal dom Bit -> Signal dom Bool -> Signal dom Bool -> (Signal dom Bit, Signal dom Bool, Signal dom (BitVector 8), Signal dom Bool) Source #