clash-lib-1.8.1: Clash: a functional hardware description language - As a library

Copyright | (C) 2012-2016 University of Twente 2017 Myrtle Software Ltd 2021-2022 QBayLogic B.V. 2022 LUMI GUIDE FIETSDETECTIE B.V. 2022 Google Inc.
License | BSD2 (see the file LICENSE)
Maintainer | QBayLogic B.V. <devops@qbaylogic.com>
Safe Haskell | Safe-Inferred
Language | Haskell2010

Clash.Netlist.BlackBox.Types

Description

Types used in BlackBox modules

Synopsis

- data BlackBoxMeta = BlackBoxMeta {
  - bbOutputUsage :: Usage
  - bbKind :: TemplateKind
  - bbLibrary :: [BlackBoxTemplate]
  - bbImports :: [BlackBoxTemplate]
  - bbFunctionPlurality :: [(Int, Int)]
  - bbIncludes :: [((Text, Text), BlackBox)]
  - bbRenderVoid :: RenderVoid
  - bbResultNames :: [BlackBox]
  - bbResultInits :: [BlackBox]
  }
- emptyBlackBoxMeta :: BlackBoxMeta
- type BlackBoxFunction = Bool -> Text -> [Either Term Type] -> [Type] -> NetlistMonad (Either String (BlackBoxMeta, BlackBox))
- type BlackBoxTemplate = [Element]
- data TemplateKind
  - = TDecl
  - | TExpr
- data Element
  - = Text !Text
  - | Component !Decl
  - | Result
  - | Arg !Int
  - | ArgGen !Int !Int
  - | Const !Int
  - | Lit !Int
  - | Name !Int
  - | ToVar [Element] !Int
  - | Sym !Text !Int
  - | Typ !(Maybe Int)
  - | TypM !(Maybe Int)
  - | Err !(Maybe Int)
  - | TypElem !Element
  - | CompName
  - | IncludeName !Int
  - | IndexType !Element
  - | Size !Element
  - | Length !Element
  - | Depth !Element
  - | MaxIndex !Element
  - | FilePath !Element
  - | Template [Element] [Element]
  - | Gen !Bool
  - | IF !Element [Element] [Element]
  - | And [Element]
  - | IW64
  - | CmpLE !Element !Element
  - | HdlSyn HdlSyn
  - | BV !Bool [Element] !Element
  - | Sel !Element !Int
  - | IsLit !Int
  - | IsVar !Int
  - | IsScalar !Int
  - | IsActiveHigh !Int
  - | Tag !Int
  - | Period !Int
  - | LongestPeriod
  - | ActiveEdge !ActiveEdge !Int
  - | IsSync !Int
  - | IsInitDefined !Int
  - | IsActiveEnable !Int
  - | IsUndefined !Int
  - | StrCmp [Element] !Int
  - | OutputUsage !Int
  - | Vars !Int
  - | GenSym [Element] !Int
  - | Repeat [Element] [Element]
  - | DevNull [Element]
  - | SigD [Element] !(Maybe Int)
  - | CtxName
- data Decl = Decl !Int !Int [(BlackBoxTemplate, BlackBoxTemplate)]
- data HdlSyn
  - = Vivado
  - | Quartus
  - | Other
- data RenderVoid
  - = RenderVoid
  - | NoRenderVoid

# Documentation

data BlackBoxMeta Source #

See `BlackBox` for documentation on this record's fields. (They are intentionally renamed to prevent name clashes.)

Constructors

BlackBoxMeta |

Fields

- bbOutputUsage :: Usage
- bbKind :: TemplateKind
- bbLibrary :: [BlackBoxTemplate]
- bbImports :: [BlackBoxTemplate]
- bbFunctionPlurality :: [(Int, Int)]
- bbIncludes :: [((Text, Text), BlackBox)]
- bbRenderVoid :: RenderVoid
- bbResultNames :: [BlackBox]
- bbResultInits :: [BlackBox]

emptyBlackBoxMeta :: BlackBoxMeta Source #

Use this value in your blackbox template function if you do want to accept the defaults as documented in `BlackBox`.

type BlackBoxFunction Source #

Arguments

= Bool | Indicates whether caller needs a declaration. If set, the function is still free to return an expression, but the caller will convert it to a declaration.
-> Text | Name of primitive
-> [Either Term Type] | Arguments
-> [Type] | Result types
-> NetlistMonad (Either String (BlackBoxMeta, BlackBox)) |

A BlackBox function generates a blackbox template, given the inputs and result type of the function it should provide a blackbox for. This is useful when having a need for blackbox functions, ... TODO: docs

type BlackBoxTemplate = [Element] Source #

A BlackBox Template is a List of Elements TODO: Add name of function for better error messages

data TemplateKind Source #

Constructors

TDecl |
TExpr |

#### Instances

Instances details

Generic TemplateKind Source # |
Instance details Defined in Clash.Netlist.BlackBox.Types Associated Types type Rep TemplateKind :: Type -> Type Source # Methods from :: TemplateKind -> Rep TemplateKind x Source # to :: Rep TemplateKind x -> TemplateKind Source #
Show TemplateKind Source # |
Instance details Defined in Clash.Netlist.BlackBox.Types Methods showsPrec :: Int -> TemplateKind -> ShowS Source # show :: TemplateKind -> String Source # showList :: [TemplateKind] -> ShowS Source #
Binary TemplateKind Source # |
Instance details Defined in Clash.Netlist.BlackBox.Types Methods put :: TemplateKind -> Put Source # get :: Get TemplateKind Source # putList :: [TemplateKind] -> Put Source #
NFData TemplateKind Source # |
Instance details Defined in Clash.Netlist.BlackBox.Types Methods rnf :: TemplateKind -> () Source #
Eq TemplateKind Source # |
Instance details Defined in Clash.Netlist.BlackBox.Types Methods (==) :: TemplateKind -> TemplateKind -> Bool Source # (/=) :: TemplateKind -> TemplateKind -> Bool Source #
Hashable TemplateKind Source # |
Instance details Defined in Clash.Netlist.BlackBox.Types Methods hashWithSalt :: Int -> TemplateKind -> Int Source # hash :: TemplateKind -> Int Source #
type Rep TemplateKind Source # |
Instance details Defined in Clash.Netlist.BlackBox.Types type Rep TemplateKind = D1 ('MetaData "TemplateKind" "Clash.Netlist.BlackBox.Types" "clash-lib-1.8.1-9u9U7p5PpHf8vtRevUOpPF" 'False) (C1 ('MetaCons "TDecl" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "TExpr" 'PrefixI 'False) (U1 :: Type -> Type))

data Element Source #

Elements of a blackbox context. If you extend this list, make sure to update the following functions:

- Clash.Netlist.BlackBox.Types.prettyElem
- Clash.Netlist.BlackBox.Types.renderElem
- Clash.Netlist.BlackBox.Types.renderTag
- Clash.Netlist.BlackBox.Types.setSym
- Clash.Netlist.BlackBox.Util.inputHole
- Clash.Netlist.BlackBox.Types.getUsedArguments
- Clash.Netlist.BlackBox.Types.usedVariables
- Clash.Netlist.BlackBox.Types.verifyBlackBoxContext
- Clash.Netlist.BlackBox.Types.walkElement

Constructors

Text !Text | Dumps given text without processing in HDL
Component !Decl | Component instantiation hole
Result | Output hole;
Arg !Int | Input hole
ArgGen !Int !Int | Like Arg, but its first argument is the scoping level. For use in in generated code only.
Const !Int | Like Arg, but input hole must be a constant.
Lit !Int | Like Arg, but input hole must be a literal
Name !Int | Name hole
ToVar [Element] !Int | Like Arg but only insert variable reference (creating an assignment elsewhere if necessary).
Sym !Text !Int | Symbol hole
Typ !(Maybe Int) | Type declaration hole
TypM !(Maybe Int) | Type root hole
Err !(Maybe Int) | Error value hole
TypElem !Element | Select element type from a vector-like type
CompName | Hole for the name of the component in which the blackbox is instantiated
IncludeName !Int |
IndexType !Element | Index data type hole, the field is the (exclusive) maximum index
Size !Element | Size of a type hole
Length !Element | Length of a vector-like hole
Depth !Element | Depth of a tree hole
MaxIndex !Element | Max index into a vector-like type
FilePath !Element | Hole containing a filepath for a data file
Template [Element] [Element] | Create data file HOLE0 with contents HOLE1
Gen !Bool | Hole marking beginning (True) or end (False) of a generative construct
IF !Element [Element] [Element] |
And [Element] |
IW64 | Hole indicating whether IntWordInteger are 64-Bit
CmpLE !Element !Element | Compare less-or-equal
HdlSyn HdlSyn | Hole indicating which synthesis tool we're generating HDL for
BV !Bool [Element] !Element | Convert to (True)/from(False) a bit-vector
Sel !Element !Int | Record selector of a type
IsLit !Int |
IsVar !Int |
IsScalar !Int | Whether element is scalar
IsActiveHigh !Int | Whether a domain's reset lines are active high. Errors if not applied to a `KnownDomain` or `KnownConfiguration`.
Tag !Int | Tag of a domain.
Period !Int | Period of a domain. Errors if not applied to a `KnownDomain` or `KnownConfiguration`.
LongestPeriod | Longest period of all known domains. The minimum duration returned is 100 ns, see https://github.com/clash-lang/clash-compiler/issues/2455.
ActiveEdge !ActiveEdge !Int | Test active edge of memory elements in a certain domain. Errors if not applied to a `KnownDomain` or `KnownConfiguration`.
IsSync !Int | Whether a domain's reset lines are synchronous. Errors if not applied to a `KnownDomain` or `KnownConfiguration`.
IsInitDefined !Int | Whether the initial (or "power up") value of memory elements in a domain are configurable to a specific value rather than unknown/undefined. Errors if not applied to a `KnownDomain` or `KnownConfiguration`.
IsActiveEnable !Int | Whether given enable line is active. More specifically, whether the enable line is NOT set to a constant `True`.
IsUndefined !Int | Whether argument is undefined. E.g., an XException, error call, removed argument, or primitive that is undefined. This template tag will always return 0 (False) if `-fclash-aggressive-x-optimization-blackboxes` is NOT set.
StrCmp [Element] !Int |
OutputUsage !Int |
Vars !Int |
GenSym [Element] !Int |
Repeat [Element] [Element] | Repeat hole n times
DevNull [Element] | Evaluate hole but swallow output
SigD [Element] !(Maybe Int) |
CtxName | The "context name", name set by `setName`, defaults to the name of the closest binder

#### Instances

Instances details

Generic Element Source # |
Instance details Defined in Clash.Netlist.BlackBox.Types Associated Types type Rep Element :: Type -> Type Source # Methods from :: Element -> Rep Element x Source # to :: Rep Element x -> Element Source #
Show Element Source # |
Instance details Defined in Clash.Netlist.BlackBox.Types Methods showsPrec :: Int -> Element -> ShowS Source # show :: Element -> String Source # showList :: [Element] -> ShowS Source #
Binary Element Source # |
Instance details Defined in Clash.Netlist.BlackBox.Types Methods put :: Element -> Put Source # get :: Get Element Source # putList :: [Element] -> Put Source #
NFData Element Source # |
Instance details Defined in Clash.Netlist.BlackBox.Types Methods rnf :: Element -> () Source #
Eq Element Source # |
Instance details Defined in Clash.Netlist.BlackBox.Types Methods (==) :: Element -> Element -> Bool Source # (/=) :: Element -> Element -> Bool Source #
Hashable Element Source # |
Instance details Defined in Clash.Netlist.BlackBox.Types Methods hashWithSalt :: Int -> Element -> Int Source # hash :: Element -> Int Source #
type Rep Element Source # |

Instance details

Defined in Clash.Netlist.BlackBox.Types

type Rep Element = D1 ('MetaData "Element" "Clash.Netlist.BlackBox.Types" "clash-lib-1.8.1-9u9U7p5PpHf8vtRevUOpPF" 'False) (((((C1 ('MetaCons "Text" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Text)) :+: (C1 ('MetaCons "Component" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Decl)) :+: C1 ('MetaCons "Result" 'PrefixI 'False) (U1 :: Type -> Type))) :+: (C1 ('MetaCons "Arg" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Int)) :+: (C1 ('MetaCons "ArgGen" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Int) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Int)) :+: C1 ('MetaCons "Const" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Int))))) :+: ((C1 ('MetaCons "Lit" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Int)) :+: (C1 ('MetaCons "Name" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Int)) :+: C1 ('MetaCons "ToVar" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Element]) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Int)))) :+: (C1 ('MetaCons "Sym" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Text) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Int)) :+: (C1 ('MetaCons "Typ" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Maybe Int))) :+: C1 ('MetaCons "TypM" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Maybe Int))))))) :+: (((C1 ('MetaCons "Err" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Maybe Int))) :+: (C1 ('MetaCons "TypElem" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Element)) :+: C1 ('MetaCons "CompName" 'PrefixI 'False) (U1 :: Type -> Type))) :+: (C1 ('MetaCons "IncludeName" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Int)) :+: (C1 ('MetaCons "IndexType" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Element)) :+: C1 ('MetaCons "Size" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Element))))) :+: ((C1 ('MetaCons "Length" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Element)) :+: (C1 ('MetaCons "Depth" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Element)) :+: C1 ('MetaCons "MaxIndex" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Element)))) :+: ((C1 ('MetaCons "FilePath" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Element)) :+: C1 ('MetaCons "Template" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Element]) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Element]))) :+: (C1 ('MetaCons "Gen" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Bool)) :+: C1 ('MetaCons "IF" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Element) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Element]) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Element])))))))) :+: ((((C1 ('MetaCons "And" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Element])) :+: (C1 ('MetaCons "IW64" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "CmpLE" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Element) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Element)))) :+: (C1 ('MetaCons "HdlSyn" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 HdlSyn)) :+: (C1 ('MetaCons "BV" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Bool) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Element]) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Element))) :+: C1 ('MetaCons "Sel" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Element) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Int))))) :+: ((C1 ('MetaCons "IsLit" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Int)) :+: (C1 ('MetaCons "IsVar" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Int)) :+: C1 ('MetaCons "IsScalar" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Int)))) :+: ((C1 ('MetaCons "IsActiveHigh" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Int)) :+: C1 ('MetaCons "Tag" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Int))) :+: (C1 ('MetaCons "Period" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Int)) :+: C1 ('MetaCons "LongestPeriod" 'PrefixI 'False) (U1 :: Type -> Type))))) :+: (((C1 ('MetaCons "ActiveEdge" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ActiveEdge) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Int)) :+: (C1 ('MetaCons "IsSync" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Int)) :+: C1 ('MetaCons "IsInitDefined" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Int)))) :+: (C1 ('MetaCons "IsActiveEnable" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Int)) :+: (C1 ('MetaCons "IsUndefined" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Int)) :+: C1 ('MetaCons "StrCmp" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Element]) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Int))))) :+: ((C1 ('MetaCons "OutputUsage" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Int)) :+: (C1 ('MetaCons "Vars" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Int)) :+: C1 ('MetaCons "GenSym" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Element]) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Int)))) :+: ((C1 ('MetaCons "Repeat" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Element]) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Element])) :+: C1 ('MetaCons "DevNull" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Element]))) :+: (C1 ('MetaCons "SigD" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Element]) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Maybe Int))) :+: C1 ('MetaCons "CtxName" 'PrefixI 'False) (U1 :: Type -> Type)))))))

data Decl Source #

Component instantiation hole. First argument indicates which function argument to instantiate. Third argument corresponds to output and input assignments, where the first element is the output assignment, and the subsequent elements are the consecutive input assignments.

The LHS of the tuple is the name of the signal, while the RHS of the tuple is the type of the signal

Constructors

Decl |

Fields

- !Int

  Argument position of the function to instantiate

- !Int

  Subposition of function: blackboxes can request multiple instances to be rendered of their given functions. This subposition indicates the nth function instance to be rendered (zero-indexed).

  This is a hack: the proper solution would postpone rendering the function until the very last moment. The blackbox language has no way to indicate the subposition, and every ~INST will default its subposition to zero. Haskell blackboxes can use this data type.

- [(BlackBoxTemplate, BlackBoxTemplate)]

  (name of signal, type of signal)

#### Instances

Instances details

Generic Decl Source # |
Instance details Defined in Clash.Netlist.BlackBox.Types Associated Types type Rep Decl :: Type -> Type Source # Methods from :: Decl -> Rep Decl x Source # to :: Rep Decl x -> Decl Source #
Show Decl Source # |
Instance details Defined in Clash.Netlist.BlackBox.Types Methods showsPrec :: Int -> Decl -> ShowS Source # show :: Decl -> String Source # showList :: [Decl] -> ShowS Source #
Binary Decl Source # |
Instance details Defined in Clash.Netlist.BlackBox.Types Methods put :: Decl -> Put Source # get :: Get Decl Source # putList :: [Decl] -> Put Source #
NFData Decl Source # |
Instance details Defined in Clash.Netlist.BlackBox.Types Methods rnf :: Decl -> () Source #
Eq Decl Source # |
Instance details Defined in Clash.Netlist.BlackBox.Types Methods (==) :: Decl -> Decl -> Bool Source # (/=) :: Decl -> Decl -> Bool Source #
Hashable Decl Source # |
Instance details Defined in Clash.Netlist.BlackBox.Types Methods hashWithSalt :: Int -> Decl -> Int Source # hash :: Decl -> Int Source #
type Rep Decl Source # |

Instance details

Defined in Clash.Netlist.BlackBox.Types

type Rep Decl = D1 ('MetaData "Decl" "Clash.Netlist.BlackBox.Types" "clash-lib-1.8.1-9u9U7p5PpHf8vtRevUOpPF" 'False) (C1 ('MetaCons "Decl" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Int) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Int) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [(BlackBoxTemplate, BlackBoxTemplate)]))))

data HdlSyn Source #

Constructors

Vivado |
Quartus |
Other |

#### Instances

Instances details

Generic HdlSyn Source # |
Instance details Defined in Clash.Netlist.BlackBox.Types Associated Types type Rep HdlSyn :: Type -> Type Source # Methods from :: HdlSyn -> Rep HdlSyn x Source # to :: Rep HdlSyn x -> HdlSyn Source #
Read HdlSyn Source # |
Instance details Defined in Clash.Netlist.BlackBox.Types Methods readsPrec :: Int -> ReadS HdlSyn Source # readList :: ReadS [HdlSyn] Source # readPrec :: ReadPrec HdlSyn Source # readListPrec :: ReadPrec [HdlSyn] Source #
Show HdlSyn Source # |
Instance details Defined in Clash.Netlist.BlackBox.Types Methods showsPrec :: Int -> HdlSyn -> ShowS Source # show :: HdlSyn -> String Source # showList :: [HdlSyn] -> ShowS Source #
Binary HdlSyn Source # |
Instance details Defined in Clash.Netlist.BlackBox.Types Methods put :: HdlSyn -> Put Source # get :: Get HdlSyn Source # putList :: [HdlSyn] -> Put Source #
NFData HdlSyn Source # |
Instance details Defined in Clash.Netlist.BlackBox.Types Methods rnf :: HdlSyn -> () Source #
Eq HdlSyn Source # |
Instance details Defined in Clash.Netlist.BlackBox.Types Methods (==) :: HdlSyn -> HdlSyn -> Bool Source # (/=) :: HdlSyn -> HdlSyn -> Bool Source #
Hashable HdlSyn Source # |
Instance details Defined in Clash.Netlist.BlackBox.Types Methods hashWithSalt :: Int -> HdlSyn -> Int Source # hash :: HdlSyn -> Int Source #
type Rep HdlSyn Source # |
Instance details Defined in Clash.Netlist.BlackBox.Types type Rep HdlSyn = D1 ('MetaData "HdlSyn" "Clash.Netlist.BlackBox.Types" "clash-lib-1.8.1-9u9U7p5PpHf8vtRevUOpPF" 'False) (C1 ('MetaCons "Vivado" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "Quartus" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Other" 'PrefixI 'False) (U1 :: Type -> Type)))

data RenderVoid Source #

Whether this primitive should be rendered when its result type is void. Defaults to `NoRenderVoid`.

Constructors

RenderVoid | Render blackbox, even if result type is void
NoRenderVoid | Don't render blackbox result type is void. Default for all blackboxes.

#### Instances

Instances details

FromJSON RenderVoid Source # |
Instance details Defined in Clash.Netlist.BlackBox.Types Methods parseJSON :: Value -> Parser RenderVoid Source # parseJSONList :: Value -> Parser [RenderVoid] Source #
Generic RenderVoid Source # |
Instance details Defined in Clash.Netlist.BlackBox.Types Associated Types type Rep RenderVoid :: Type -> Type Source # Methods from :: RenderVoid -> Rep RenderVoid x Source # to :: Rep RenderVoid x -> RenderVoid Source #
Show RenderVoid Source # |
Instance details Defined in Clash.Netlist.BlackBox.Types Methods showsPrec :: Int -> RenderVoid -> ShowS Source # show :: RenderVoid -> String Source # showList :: [RenderVoid] -> ShowS Source #
Binary RenderVoid Source # |
Instance details Defined in Clash.Netlist.BlackBox.Types Methods put :: RenderVoid -> Put Source # get :: Get RenderVoid Source # putList :: [RenderVoid] -> Put Source #
NFData RenderVoid Source # |
Instance details Defined in Clash.Netlist.BlackBox.Types Methods rnf :: RenderVoid -> () Source #
Eq RenderVoid Source # |
Instance details Defined in Clash.Netlist.BlackBox.Types Methods (==) :: RenderVoid -> RenderVoid -> Bool Source # (/=) :: RenderVoid -> RenderVoid -> Bool Source #
Hashable RenderVoid Source # |
Instance details Defined in Clash.Netlist.BlackBox.Types Methods hashWithSalt :: Int -> RenderVoid -> Int Source # hash :: RenderVoid -> Int Source #
type Rep RenderVoid Source # |
Instance details Defined in Clash.Netlist.BlackBox.Types type Rep RenderVoid = D1 ('MetaData "RenderVoid" "Clash.Netlist.BlackBox.Types" "clash-lib-1.8.1-9u9U7p5PpHf8vtRevUOpPF" 'False) (C1 ('MetaCons "RenderVoid" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "NoRenderVoid" 'PrefixI 'False) (U1 :: Type -> Type))