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

Copyright | (C) 2017-2019 Myrtle Software 2022 QBayLogic B.V.
License | BSD2 (see the file LICENSE)
Maintainer | QBayLogic B.V. <devops@qbaylogic.com>
Safe Haskell | Safe
Language | Haskell2010

Extensions

- TemplateHaskellQuotes
- ScopedTypeVariables
- BangPatterns
- ViewPatterns
- DataKinds
- InstanceSigs
- StandaloneDeriving
- DeriveDataTypeable
- DeriveFunctor
- DeriveTraversable
- DeriveFoldable
- DeriveGeneric
- DefaultSignatures
- DeriveAnyClass
- DeriveLift
- DerivingStrategies
- MagicHash
- KindSignatures
- PostfixOperators
- TupleSections
- TypeOperators
- ExplicitNamespaces
- ExplicitForAll
- LambdaCase
- BinaryLiterals
- TypeApplications

Clash.Annotations.Primitive

Description

Instruct the Clash compiler to look for primitive HDL templates provided inline or in a specified directory. For distribution of new packages with primitive HDL templates. Primitive guards can be added to warn on instantiating primitives.

Synopsis

- dontTranslate :: PrimitiveGuard ()
- hasBlackBox :: PrimitiveGuard ()
- warnNonSynthesizable :: String -> PrimitiveGuard ()
- warnAlways :: String -> PrimitiveGuard ()
- data Primitive
  - = Primitive [HDL] FilePath
  - | InlinePrimitive [HDL] String
  - | InlineYamlPrimitive [HDL] String
- data HDL
  - = SystemVerilog
  - | Verilog
  - | VHDL
- data PrimitiveGuard a
  - = DontTranslate
  - | HasBlackBox [PrimitiveWarning] a
- data PrimitiveWarning
  - = WarnNonSynthesizable String
  - | WarnAlways String
- extractPrim :: PrimitiveGuard a -> Maybe a
- extractWarnings :: PrimitiveGuard a -> [PrimitiveWarning]

# Documentation

dontTranslate :: PrimitiveGuard () Source #

Marks value as not translatable. Clash will error if it finds a blackbox definition for it, or when it is forced to translate it. You can annotate a variable or function `f` like:

    {-# ANN f dontTranslate #-}

hasBlackBox :: PrimitiveGuard () Source #

Marks a value as having a blackbox. Clash will error if it hasn't found a blackbox. You can annotate a variable or function `f` like:

    {-# ANN f hasBlackBox #-}

warnNonSynthesizable :: String -> PrimitiveGuard () Source #

Marks value as non-synthesizable. This will trigger a warning if instantiated in a non-testbench context. You can annotate a variable or function `f` like:

    {-# ANN f (warnNonSynthesizable "Tread carefully, user!") #-}

Implies `hasBlackBox`.

warnAlways :: String -> PrimitiveGuard () Source #

Always emit warning upon primitive instantiation. You can annotate a variable or function `f` like:

    {-# ANN f (warnAlways "Tread carefully, user!") #-}

Implies `hasBlackBox`.

data Primitive Source #

The `Primitive` constructor instructs the clash compiler to look for primitive HDL templates in the indicated directory. `InlinePrimitive` is equivalent but provides the HDL template inline. They are intended for the distribution of new packages with primitive HDL templates.

### Example of `Primitive`

You have some existing IP written in one of HDLs supported by Clash, and you want to distribute some bindings so that the IP can be easily instantiated from Clash.

You create a package which has a `myfancyip.cabal` file with the following stanza:

    data-files: path/to/MyFancyIP.primitives
    cpp-options: -DCABAL

and a `MyFancyIP.hs` module with the simulation definition and primitive.

    module MyFancyIP where

    import Clash.Prelude

    myFancyIP :: ...
    myFancyIP = ...
    {-# NOINLINE myFancyIP #-}

The `NOINLINE` pragma is needed so that GHC will never inline the definition.

Now you need to add the following imports and `ANN` pragma:

    #ifdef CABAL
    import           Clash.Annotations.Primitive
    import           System.FilePath
    import qualified Paths_myfancyip
    import           System.IO.Unsafe

    {-# ANN module (Primitive [VHDL] (unsafePerformIO Paths_myfancyip.getDataDir </> "path" </> "to")) #-}
    #endif

Add more files to the `data-files` stanza in your `.cabal` files and more `ANN` pragma's if you want to add more primitive templates for other HDLs

### Example of `InlineYamlPrimitive`

The following example shows off an inline HDL primitive template. It uses the string-interpolate package for nicer multiline strings.

    {-# LANGUAGE QuasiQuotes #-}
    module InlinePrimitive where

    import           Clash.Annotations.Primitive
    import           Clash.Prelude
    import           Data.String.Interpolate      (__i)

    {-# ANN example (InlineYamlPrimitive [VHDL] [__i|
      BlackBox:
        kind: Declaration
        name: InlinePrimitive.example
        template: |-
          -- begin InlinePrimitive example:
          ~GENSYM[example][0] : block
          ~RESULT <= 1 + ~ARG[0];
          end block;
          -- end InlinePrimitive example
      |]) #-}
    {-# NOINLINE example #-}
    example :: Signal System (BitVector 2) -> Signal System (BitVector 2)
    example = fmap succ

Constructors

Primitive [HDL] FilePath | Description of a primitive for a given `HDL`s in a file at `FilePath`
InlinePrimitive [HDL] String | Description of a primitive for a given `HDL`s as an inline JSON `String`
InlineYamlPrimitive [HDL] String | Description of a primitive for a given `HDL`s as an inline YAML `String`

#### Instances

Instances details

NFData Primitive Source # |
Instance details Defined in Clash.Annotations.Primitive Methods rnf :: Primitive -> () Source #
Data Primitive Source # |

Instance details

Defined in Clash.Annotations.Primitive

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Primitive -> c Primitive Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Primitive Source #

toConstr :: Primitive -> Constr Source #

dataTypeOf :: Primitive -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Primitive) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Primitive) Source #

gmapT :: (forall b. Data b => b -> b) -> Primitive -> Primitive Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Primitive -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Primitive -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> Primitive -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Primitive -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Primitive -> m Primitive Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Primitive -> m Primitive Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Primitive -> m Primitive Source #

Generic Primitive Source # |

Instance details

Defined in Clash.Annotations.Primitive

Associated Types

type Rep Primitive |

Instance details

Defined in Clash.Annotations.Primitive

type Rep Primitive = D1 ('MetaData "Primitive" "Clash.Annotations.Primitive" "clash-prelude-1.8.4-1CKHk9HHRNIGPqhYHQsmcW" 'False) (C1 ('MetaCons "Primitive" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [HDL]) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 FilePath)) :+: (C1 ('MetaCons "InlinePrimitive" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [HDL]) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String)) :+: C1 ('MetaCons "InlineYamlPrimitive" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [HDL]) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String))))

Methods

from :: Primitive -> Rep Primitive x Source #

to :: Rep Primitive x -> Primitive Source #

Read Primitive Source # |
Instance details Defined in Clash.Annotations.Primitive Methods readsPrec :: Int -> ReadS Primitive Source # readList :: ReadS [Primitive] Source # readPrec :: ReadPrec Primitive Source # readListPrec :: ReadPrec [Primitive] Source #
Show Primitive Source # |
Instance details Defined in Clash.Annotations.Primitive Methods showsPrec :: Int -> Primitive -> ShowS Source # show :: Primitive -> String Source # showList :: [Primitive] -> ShowS Source #
Eq Primitive Source # |
Instance details Defined in Clash.Annotations.Primitive Methods (==) :: Primitive -> Primitive -> Bool Source # (/=) :: Primitive -> Primitive -> Bool Source #
Hashable Primitive Source # |
Instance details Defined in Clash.Annotations.Primitive Methods hashWithSalt :: Int -> Primitive -> Int Source # hash :: Primitive -> Int Source #
type Rep Primitive Source # |

Instance details

Defined in Clash.Annotations.Primitive

type Rep Primitive = D1 ('MetaData "Primitive" "Clash.Annotations.Primitive" "clash-prelude-1.8.4-1CKHk9HHRNIGPqhYHQsmcW" 'False) (C1 ('MetaCons "Primitive" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [HDL]) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 FilePath)) :+: (C1 ('MetaCons "InlinePrimitive" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [HDL]) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String)) :+: C1 ('MetaCons "InlineYamlPrimitive" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [HDL]) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String))))

data HDL Source #

A compilation target HDL.

Constructors

SystemVerilog |
Verilog |
VHDL |

#### Instances

Instances details

NFData HDL Source # |
Instance details Defined in Clash.Annotations.Primitive Methods rnf :: HDL -> () Source #
Data HDL Source # |

Instance details

Defined in Clash.Annotations.Primitive

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> HDL -> c HDL Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c HDL Source #

toConstr :: HDL -> Constr Source #

dataTypeOf :: HDL -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c HDL) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c HDL) Source #

gmapT :: (forall b. Data b => b -> b) -> HDL -> HDL Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> HDL -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> HDL -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> HDL -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> HDL -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> HDL -> m HDL Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> HDL -> m HDL Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> HDL -> m HDL Source #

Bounded HDL Source # |
Instance details Defined in Clash.Annotations.Primitive Methods minBound :: HDL Source # maxBound :: HDL Source #
Enum HDL Source # |
Instance details Defined in Clash.Annotations.Primitive Methods succ :: HDL -> HDL Source # pred :: HDL -> HDL Source # toEnum :: Int -> HDL Source # fromEnum :: HDL -> Int Source # enumFrom :: HDL -> [HDL] Source # enumFromThen :: HDL -> HDL -> [HDL] Source # enumFromTo :: HDL -> HDL -> [HDL] Source # enumFromThenTo :: HDL -> HDL -> HDL -> [HDL] Source #
Generic HDL Source # |

Instance details

Defined in Clash.Annotations.Primitive

Associated Types

type Rep HDL |
Instance details Defined in Clash.Annotations.Primitive type Rep HDL = D1 ('MetaData "HDL" "Clash.Annotations.Primitive" "clash-prelude-1.8.4-1CKHk9HHRNIGPqhYHQsmcW" 'False) (C1 ('MetaCons "SystemVerilog" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "Verilog" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "VHDL" 'PrefixI 'False) (U1 :: Type -> Type)))

Methods

from :: HDL -> Rep HDL x Source #

to :: Rep HDL x -> HDL Source #

Read HDL Source # |
Instance details Defined in Clash.Annotations.Primitive Methods readsPrec :: Int -> ReadS HDL Source # readList :: ReadS [HDL] Source # readPrec :: ReadPrec HDL Source # readListPrec :: ReadPrec [HDL] Source #
Show HDL Source # |
Instance details Defined in Clash.Annotations.Primitive Methods showsPrec :: Int -> HDL -> ShowS Source # show :: HDL -> String Source # showList :: [HDL] -> ShowS Source #
Eq HDL Source # |
Instance details Defined in Clash.Annotations.Primitive Methods (==) :: HDL -> HDL -> Bool Source # (/=) :: HDL -> HDL -> Bool Source #
Hashable HDL Source # |
Instance details Defined in Clash.Annotations.Primitive Methods hashWithSalt :: Int -> HDL -> Int Source # hash :: HDL -> Int Source #
type Rep HDL Source # |
Instance details Defined in Clash.Annotations.Primitive type Rep HDL = D1 ('MetaData "HDL" "Clash.Annotations.Primitive" "clash-prelude-1.8.4-1CKHk9HHRNIGPqhYHQsmcW" 'False) (C1 ('MetaCons "SystemVerilog" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "Verilog" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "VHDL" 'PrefixI 'False) (U1 :: Type -> Type)))

data PrimitiveGuard a Source #

Primitive guard to mark a value as either not translatable or as having a blackbox with an optional extra warning. Helps Clash generate better error messages.

For use, see `dontTranslate`, `hasBlackBox`, `warnNonSynthesizable` and `warnAlways`.

Constructors

DontTranslate | Marks value as not translatable. Clash will error if it finds a blackbox definition for it, or when it is forced to translate it.
HasBlackBox [PrimitiveWarning] a | Marks a value as having a blackbox. Clash will error if it hasn't found a blackbox.

#### Instances

Instances details

Functor PrimitiveGuard Source # |
Instance details Defined in Clash.Annotations.Primitive Methods fmap :: (a -> b) -> PrimitiveGuard a -> PrimitiveGuard b Source # (<$) :: a -> PrimitiveGuard b -> PrimitiveGuard a Source #
Foldable PrimitiveGuard Source # |

Instance details

Defined in Clash.Annotations.Primitive

Methods

fold :: Monoid m => PrimitiveGuard m -> m Source #

foldMap :: Monoid m => (a -> m) -> PrimitiveGuard a -> m Source #

foldMap' :: Monoid m => (a -> m) -> PrimitiveGuard a -> m Source #

foldr :: (a -> b -> b) -> b -> PrimitiveGuard a -> b Source #

foldr' :: (a -> b -> b) -> b -> PrimitiveGuard a -> b Source #

foldl :: (b -> a -> b) -> b -> PrimitiveGuard a -> b Source #

foldl' :: (b -> a -> b) -> b -> PrimitiveGuard a -> b Source #

foldr1 :: (a -> a -> a) -> PrimitiveGuard a -> a Source #

foldl1 :: (a -> a -> a) -> PrimitiveGuard a -> a Source #

toList :: PrimitiveGuard a -> [a] Source #

null :: PrimitiveGuard a -> Bool Source #

length :: PrimitiveGuard a -> Int Source #

elem :: Eq a => a -> PrimitiveGuard a -> Bool Source #

maximum :: Ord a => PrimitiveGuard a -> a Source #

minimum :: Ord a => PrimitiveGuard a -> a Source #

sum :: Num a => PrimitiveGuard a -> a Source #

product :: Num a => PrimitiveGuard a -> a Source #

Traversable PrimitiveGuard Source # |
Instance details Defined in Clash.Annotations.Primitive Methods traverse :: Applicative f => (a -> f b) -> PrimitiveGuard a -> f (PrimitiveGuard b) Source # sequenceA :: Applicative f => PrimitiveGuard (f a) -> f (PrimitiveGuard a) Source # mapM :: Monad m => (a -> m b) -> PrimitiveGuard a -> m (PrimitiveGuard b) Source # sequence :: Monad m => PrimitiveGuard (m a) -> m (PrimitiveGuard a) Source #
Binary a => Binary (PrimitiveGuard a) Source # |
Instance details Defined in Clash.Annotations.Primitive Methods put :: PrimitiveGuard a -> Put Source # get :: Get (PrimitiveGuard a) Source # putList :: [PrimitiveGuard a] -> Put Source #
NFData a => NFData (PrimitiveGuard a) Source # |
Instance details Defined in Clash.Annotations.Primitive Methods rnf :: PrimitiveGuard a -> () Source #
Data a => Data (PrimitiveGuard a) Source # |

Instance details

Defined in Clash.Annotations.Primitive

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> PrimitiveGuard a -> c (PrimitiveGuard a) Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (PrimitiveGuard a) Source #

toConstr :: PrimitiveGuard a -> Constr Source #

dataTypeOf :: PrimitiveGuard a -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (PrimitiveGuard a)) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (PrimitiveGuard a)) Source #

gmapT :: (forall b. Data b => b -> b) -> PrimitiveGuard a -> PrimitiveGuard a Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> PrimitiveGuard a -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> PrimitiveGuard a -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> PrimitiveGuard a -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> PrimitiveGuard a -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> PrimitiveGuard a -> m (PrimitiveGuard a) Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> PrimitiveGuard a -> m (PrimitiveGuard a) Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> PrimitiveGuard a -> m (PrimitiveGuard a) Source #

Generic (PrimitiveGuard a) Source # |

Instance details

Defined in Clash.Annotations.Primitive

Associated Types

type Rep (PrimitiveGuard a) |

Instance details

Defined in Clash.Annotations.Primitive

type Rep (PrimitiveGuard a) = D1 ('MetaData "PrimitiveGuard" "Clash.Annotations.Primitive" "clash-prelude-1.8.4-1CKHk9HHRNIGPqhYHQsmcW" 'False) (C1 ('MetaCons "DontTranslate" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "HasBlackBox" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [PrimitiveWarning]) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a)))

Methods

from :: PrimitiveGuard a -> Rep (PrimitiveGuard a) x Source #

to :: Rep (PrimitiveGuard a) x -> PrimitiveGuard a Source #

Read a => Read (PrimitiveGuard a) Source # |
Instance details Defined in Clash.Annotations.Primitive Methods readsPrec :: Int -> ReadS (PrimitiveGuard a) Source # readList :: ReadS [PrimitiveGuard a] Source # readPrec :: ReadPrec (PrimitiveGuard a) Source # readListPrec :: ReadPrec [PrimitiveGuard a] Source #
Show a => Show (PrimitiveGuard a) Source # |
Instance details Defined in Clash.Annotations.Primitive Methods showsPrec :: Int -> PrimitiveGuard a -> ShowS Source # show :: PrimitiveGuard a -> String Source # showList :: [PrimitiveGuard a] -> ShowS Source #
Eq a => Eq (PrimitiveGuard a) Source # |
Instance details Defined in Clash.Annotations.Primitive Methods (==) :: PrimitiveGuard a -> PrimitiveGuard a -> Bool Source # (/=) :: PrimitiveGuard a -> PrimitiveGuard a -> Bool Source #
Hashable a => Hashable (PrimitiveGuard a) Source # |
Instance details Defined in Clash.Annotations.Primitive Methods hashWithSalt :: Int -> PrimitiveGuard a -> Int Source # hash :: PrimitiveGuard a -> Int Source #
type Rep (PrimitiveGuard a) Source # |

Instance details

Defined in Clash.Annotations.Primitive

type Rep (PrimitiveGuard a) = D1 ('MetaData "PrimitiveGuard" "Clash.Annotations.Primitive" "clash-prelude-1.8.4-1CKHk9HHRNIGPqhYHQsmcW" 'False) (C1 ('MetaCons "DontTranslate" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "HasBlackBox" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [PrimitiveWarning]) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a)))

data PrimitiveWarning Source #

Warning that will be emitted on instantiating a guarded value.

Constructors

WarnNonSynthesizable String | Marks value as non-synthesizable. This will trigger a warning if instantiated in a non-testbench context.
WarnAlways String | Always emit warning upon primitive instantiation.

#### Instances

Instances details

Binary PrimitiveWarning Source # |
Instance details Defined in Clash.Annotations.Primitive Methods put :: PrimitiveWarning -> Put Source # get :: Get PrimitiveWarning Source # putList :: [PrimitiveWarning] -> Put Source #
NFData PrimitiveWarning Source # |
Instance details Defined in Clash.Annotations.Primitive Methods rnf :: PrimitiveWarning -> () Source #
Data PrimitiveWarning Source # |

Instance details

Defined in Clash.Annotations.Primitive

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> PrimitiveWarning -> c PrimitiveWarning Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c PrimitiveWarning Source #

toConstr :: PrimitiveWarning -> Constr Source #

dataTypeOf :: PrimitiveWarning -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c PrimitiveWarning) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c PrimitiveWarning) Source #

gmapT :: (forall b. Data b => b -> b) -> PrimitiveWarning -> PrimitiveWarning Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> PrimitiveWarning -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> PrimitiveWarning -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> PrimitiveWarning -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> PrimitiveWarning -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> PrimitiveWarning -> m PrimitiveWarning Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> PrimitiveWarning -> m PrimitiveWarning Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> PrimitiveWarning -> m PrimitiveWarning Source #

Generic PrimitiveWarning Source # |

Instance details

Defined in Clash.Annotations.Primitive

Associated Types

type Rep PrimitiveWarning |

Instance details

Defined in Clash.Annotations.Primitive

type Rep PrimitiveWarning = D1 ('MetaData "PrimitiveWarning" "Clash.Annotations.Primitive" "clash-prelude-1.8.4-1CKHk9HHRNIGPqhYHQsmcW" 'False) (C1 ('MetaCons "WarnNonSynthesizable" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String)) :+: C1 ('MetaCons "WarnAlways" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String)))

Methods

from :: PrimitiveWarning -> Rep PrimitiveWarning x Source #

to :: Rep PrimitiveWarning x -> PrimitiveWarning Source #

Read PrimitiveWarning Source # |
Instance details Defined in Clash.Annotations.Primitive Methods readsPrec :: Int -> ReadS PrimitiveWarning Source # readList :: ReadS [PrimitiveWarning] Source # readPrec :: ReadPrec PrimitiveWarning Source # readListPrec :: ReadPrec [PrimitiveWarning] Source #
Show PrimitiveWarning Source # |
Instance details Defined in Clash.Annotations.Primitive Methods showsPrec :: Int -> PrimitiveWarning -> ShowS Source # show :: PrimitiveWarning -> String Source # showList :: [PrimitiveWarning] -> ShowS Source #
Eq PrimitiveWarning Source # |
Instance details Defined in Clash.Annotations.Primitive Methods (==) :: PrimitiveWarning -> PrimitiveWarning -> Bool Source # (/=) :: PrimitiveWarning -> PrimitiveWarning -> Bool Source #
Hashable PrimitiveWarning Source # |
Instance details Defined in Clash.Annotations.Primitive Methods hashWithSalt :: Int -> PrimitiveWarning -> Int Source # hash :: PrimitiveWarning -> Int Source #
type Rep PrimitiveWarning Source # |

Instance details

Defined in Clash.Annotations.Primitive

type Rep PrimitiveWarning = D1 ('MetaData "PrimitiveWarning" "Clash.Annotations.Primitive" "clash-prelude-1.8.4-1CKHk9HHRNIGPqhYHQsmcW" 'False) (C1 ('MetaCons "WarnNonSynthesizable" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String)) :+: C1 ('MetaCons "WarnAlways" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String)))

extractPrim :: PrimitiveGuard a -> Maybe a Source #

Extract primitive definition from a PrimitiveGuard. Will yield Nothing for guards of value `DontTranslate`.

extractWarnings :: PrimitiveGuard a -> [PrimitiveWarning] Source #

Extract primitive warnings from a PrimitiveGuard. Will yield an empty list for guards of value `DontTranslate`.