| Copyright | (C) 2012-2016 University of Twente 2017 Myrtle Software Ltd 2017-2018 Google Inc. 2020-2023 QBayLogic B.V. 2022-2023 Google Inc. |
|---|---|
| License | BSD2 (see the file LICENSE) |
| Maintainer | QBayLogic B.V. <devops@qbaylogic.com> |
| Safe Haskell | None |
| Language | Haskell2010 |
Clash.Netlist.Types
Description
Type and instance definitions for Netlist modules
Synopsis
- data Declaration where
- Assignment !Identifier !Usage !Expr
- CondAssignment !Identifier !HWType !Expr !HWType [(Maybe Literal, Expr)]
- InstDecl EntityOrComponent (Maybe Text) [Attr Text] !Identifier !Identifier [(Expr, HWType, Expr)] PortMap
- BlackBoxD !Text [BlackBoxTemplate] [BlackBoxTemplate] [((Text, Text), BlackBox)] !BlackBox BlackBoxContext
- CompDecl !Text [(Text, PortDirection, HWType)]
- NetDecl' (Maybe Comment) !Identifier HWType (Maybe Expr)
- TickDecl CommentOrDirective
- Seq [Seq]
- ConditionalDecl !Text [Declaration]
- pattern NetDecl :: Maybe Comment -> Identifier -> HWType -> Declaration
- data Bit
- data HWType
- = Void (Maybe HWType)
- | String
- | Integer
- | Bool
- | Bit
- | BitVector !Size
- | Index !Integer
- | Signed !Size
- | Unsigned !Size
- | Vector !Size !HWType
- | MemBlob !Size !Size
- | RTree !Size !HWType
- | Sum !Text [Text]
- | Product !Text (Maybe [Text]) [HWType]
- | SP !Text [(Text, [HWType])]
- | Clock !DomainName
- | ClockN !DomainName
- | Reset !DomainName
- | Enable !DomainName
- | BiDirectional !PortDirection !HWType
- | CustomSP !Text !DataRepr' !Size [(ConstrRepr', Text, [HWType])]
- | CustomSum !Text !DataRepr' !Size [(ConstrRepr', Text)]
- | CustomProduct !Text !DataRepr' !Size (Maybe [Text]) [(FieldAnn, HWType)]
- | Annotated [Attr Text] !HWType
- | KnownDomain !DomainName !Integer !ActiveEdge !ResetKind !InitBehavior !ResetPolarity
- | FileType
- data EntityOrComponent
- type Size = Int
- prefixName :: Lens' NetlistEnv Text
- suffixName :: Lens' NetlistEnv Text
- setName :: Lens' NetlistEnv (Maybe Text)
- data Expr
- = Literal !(Maybe (HWType, Size)) !Literal
- | DataCon !HWType !Modifier [Expr]
- | Identifier !Identifier !(Maybe Modifier)
- | DataTag !HWType !(Either Identifier Identifier)
- | BlackBoxE !Text [BlackBoxTemplate] [BlackBoxTemplate] [((Text, Text), BlackBox)] !BlackBox !BlackBoxContext !Bool
- | ToBv (Maybe Identifier) HWType Expr
- | FromBv (Maybe Identifier) HWType Expr
- | IfThenElse Expr Expr Expr
- | Noop
- backend :: Lens' NetlistState SomeBackend
- data Declaration
- = Assignment !Identifier !Usage !Expr
- | CondAssignment !Identifier !HWType !Expr !HWType [(Maybe Literal, Expr)]
- | InstDecl EntityOrComponent (Maybe Text) [Attr Text] !Identifier !Identifier [(Expr, HWType, Expr)] PortMap
- | BlackBoxD !Text [BlackBoxTemplate] [BlackBoxTemplate] [((Text, Text), BlackBox)] !BlackBox BlackBoxContext
- | CompDecl !Text [(Text, PortDirection, HWType)]
- | NetDecl' (Maybe Comment) !Identifier HWType (Maybe Expr)
- | TickDecl CommentOrDirective
- | Seq [Seq]
- | ConditionalDecl !Text [Declaration]
- data Modifier
- data BlackBoxContext = Context {
- bbName :: Text
- bbResults :: [(Expr, HWType)]
- bbInputs :: [(Expr, HWType, Bool)]
- bbFunctions :: IntMap [(Either BlackBox (Identifier, [Declaration]), Usage, [BlackBoxTemplate], [BlackBoxTemplate], [((Text, Text), BlackBox)], BlackBoxContext)]
- bbQsysIncName :: [IdentifierText]
- bbLevel :: Int
- bbCompName :: Identifier
- bbCtxName :: Maybe IdentifierText
- data Seq
- = AlwaysClocked ActiveEdge Expr [Seq]
- | Initial [Seq]
- | AlwaysComb [Seq]
- | SeqDecl Declaration
- | Branch !Expr !HWType [(Maybe Literal, [Seq])]
- data Literal
- data Component = Component {
- componentName :: !Identifier
- inputs :: [(Identifier, HWType)]
- outputs :: [(Usage, (Identifier, HWType), Maybe Expr)]
- declarations :: [Declaration]
- data Identifier
- = RawIdentifier !Text (Maybe Identifier) !CallStack
- | UniqueIdentifier {
- i_baseName :: !Text
- i_baseNameCaseFold :: !Text
- i_extensionsRev :: [Word]
- i_idType :: !IdentifierType
- i_hdl :: !HDL
- i_provenance :: !CallStack
- data IdentifierSet = IdentifierSet {
- is_allowEscaped :: !Bool
- is_lowerCaseBasicIds :: !PreserveCase
- is_hdl :: !HDL
- is_freshCache :: !FreshCache
- is_store :: !(HashSet Identifier)
- class HasIdentifierSet s where
- type UsageMap = Map Text Usage
- intWidth :: Getter NetlistEnv Int
- usages :: Lens' NetlistState UsageMap
- data NetlistState = NetlistState {
- _bindings :: BindingMap
- _components :: ComponentMap
- _typeTranslator :: CustomReprs -> TyConMap -> Type -> State HWMap (Maybe (Either String FilteredHWType))
- _curCompNm :: !(Identifier, SrcSpan)
- _seenIds :: IdentifierSet
- _seenComps :: IdentifierSet
- _seenPrimitives :: Set Text
- _componentNames :: VarEnv Identifier
- _topEntityAnns :: VarEnv TopEntityT
- _hdlDir :: FilePath
- _curBBlvl :: Int
- _isTestBench :: Bool
- _backEndITE :: Bool
- _backend :: SomeBackend
- _htyCache :: HWMap
- _usages :: UsageMap
- data DeclarationType
- type IdentifierText = Text
- data BlackBox
- data FilteredHWType = FilteredHWType HWType [[(IsVoid, FilteredHWType)]]
- type HWMap = Map Type (Either String FilteredHWType)
- data SomeBackend where
- SomeBackend :: forall backend. Backend backend => backend -> SomeBackend
- data TopEntityT = TopEntityT {
- topId :: Id
- topAnnotation :: Maybe TopEntity
- topIsTestBench :: Bool
- data TemplateFunction where
- TemplateFunction :: [Int] -> (BlackBoxContext -> Bool) -> (forall s. Backend s => BlackBoxContext -> State s Doc) -> TemplateFunction
- type ComponentMap = OMap Unique (ComponentMeta, Component)
- findClocks :: Component -> [(Text, Text)]
- data ComponentMeta = ComponentMeta {
- cmWereVoids :: [Bool]
- cmLoc :: SrcSpan
- cmScope :: IdentifierSet
- cmUsage :: UsageMap
- data Usage
- hwTypeDomain :: HWType -> Maybe DomainName
- data IdentifierType
- data PreserveCase
- newtype NetlistMonad a = NetlistMonad {
- runNetlist :: StateT NetlistState (ReaderT NetlistEnv IO) a
- class Monad m => IdentifierSetMonad (m :: Type -> Type) where
- identifierSetM :: (IdentifierSet -> IdentifierSet) -> m IdentifierSet
- type FreshCache = HashMap Text (IntMap Word)
- pattern NetDecl :: Maybe Comment -> Identifier -> HWType -> Declaration
- bindings :: Lens' NetlistState BindingMap
- tcCache :: Getter NetlistEnv TyConMap
- customReprs :: Getter NetlistEnv CustomReprs
- typeTranslator :: Lens' NetlistState (CustomReprs -> TyConMap -> Type -> State HWMap (Maybe (Either String FilteredHWType)))
- primitives :: Getter NetlistEnv CompiledPrimMap
- toBit :: Integer -> Integer -> Bit
- curCompNm :: Lens' NetlistState (Identifier, SrcSpan)
- emptyBBContext :: Text -> BlackBoxContext
- data NetlistId
- data CommentOrDirective
- type Comment = Text
- data PortDirection
- components :: Lens' NetlistState ComponentMap
- data Blocking
- data ExpandedTopEntity a = ExpandedTopEntity {
- et_inputs :: [Maybe (ExpandedPortName a)]
- et_output :: Maybe (ExpandedPortName a)
- data ExpandedPortName a
- = ExpandedPortName HWType a
- | ExpandedPortProduct Text HWType [ExpandedPortName a]
- data NetlistEnv = NetlistEnv {
- _clashEnv :: ClashEnv
- _prefixName :: Text
- _suffixName :: Text
- _setName :: Maybe Text
- identifierKey# :: Identifier -> ((Text, Bool), [Word])
- data ComponentPrefix = ComponentPrefix {
- componentPrefixTop :: Maybe Text
- componentPrefixOther :: Maybe Text
- type Directive = Text
- isBiDirectional :: (Identifier, HWType) -> Bool
- type IsVoid = Bool
- type DomainName = Text
- annotated :: [Attr Text] -> HWType -> HWType
- hwTypeAttrs :: HWType -> [Attr Text]
- data PortMap
- = IndexedPortMap [(PortDirection, HWType, Expr)]
- | NamedPortMap [(Expr, PortDirection, HWType, Expr)]
- lookupUsage :: Identifier -> UsageMap -> Maybe Usage
- isConstExpr :: Expr -> Bool
- type BBName = String
- type BBHash = Int
- netlistId1 :: HasCallStack => (Identifier -> r) -> (Id -> r) -> NetlistId -> r
- netlistTypes :: NetlistId -> [Type]
- netlistTypes1 :: HasCallStack => NetlistId -> Type
- declTypeUsage :: DeclarationType -> Usage
- clashEnv :: Lens' NetlistEnv ClashEnv
- clashOpts :: Getter NetlistEnv ClashOpts
- seenIds :: Lens' NetlistState IdentifierSet
- backEndITE :: Lens' NetlistState Bool
- componentNames :: Lens' NetlistState (VarEnv Identifier)
- curBBlvl :: Lens' NetlistState Int
- hdlDir :: Lens' NetlistState FilePath
- htyCache :: Lens' NetlistState HWMap
- isTestBench :: Lens' NetlistState Bool
- seenComps :: Lens' NetlistState IdentifierSet
- seenPrimitives :: Lens' NetlistState (Set Text)
- topEntityAnns :: Lens' NetlistState (VarEnv TopEntityT)
Documentation
data Declaration Source #
Internals of a Component
Constructors
| Assignment | Signal assignment |
Fields
| |
| CondAssignment | Conditional signal assignment: |
| InstDecl | Instantiation of another component: |
Fields
| |
| BlackBoxD | Instantiation of blackbox declaration |
Fields
| |
| CompDecl !Text [(Text, PortDirection, HWType)] |
See this tutorial; refer to §4.5 of IEEE 1076-1993 |
| NetDecl' | Signal declaration |
| TickDecl CommentOrDirective | HDL tick corresponding to a Core tick |
| Seq [Seq] | Sequential statement |
| ConditionalDecl | Compilation conditional on some preprocessor symbol, note that declarations here are ignored for VHDL. See here for a discussion https://github.com/clash-lang/clash-compiler/pull/1798#discussion_r648571862 |
Fields
| |
Bundled Patterns
| pattern NetDecl | |
Fields
| |
Instances
| NFData Declaration Source # | |
Defined in Clash.Netlist.Types Methods rnf :: Declaration -> () | |
| Show Declaration Source # | |
Defined in Clash.Netlist.Types Methods showsPrec :: Int -> Declaration -> ShowS # show :: Declaration -> String # showList :: [Declaration] -> ShowS # | |
Representable hardware types
Constructors
| Void (Maybe HWType) | Empty type. |
| String | String type |
| Integer | Integer type (for parameters only) |
| Bool | Boolean type |
| Bit | Bit type |
| BitVector !Size | BitVector of a specified size |
| Index !Integer | Unsigned integer with specified (exclusive) upper bounder |
| Signed !Size | Signed integer of a specified size |
| Unsigned !Size | Unsigned integer of a specified size |
| Vector !Size !HWType | Vector type |
| MemBlob !Size !Size | MemBlob type |
| RTree !Size !HWType | RTree type |
| Sum !Text [Text] | Sum type: Name and Constructor names |
| Product !Text (Maybe [Text]) [HWType] | Product type: Name, field names, and field types. Field names will be populated when using records. |
| SP !Text [(Text, [HWType])] | Sum-of-Product type: Name and Constructor names + field types |
| Clock !DomainName | Clock type corresponding to domain DomainName |
| ClockN !DomainName | ClockN type corresponding to domain DomainName |
| Reset !DomainName | Reset type corresponding to domain DomainName |
| Enable !DomainName | Enable type corresponding to domain DomainName |
| BiDirectional !PortDirection !HWType | Tagging type indicating a bidirectional (inout) port |
| CustomSP !Text !DataRepr' !Size [(ConstrRepr', Text, [HWType])] | Same as Sum-Of-Product, but with a user specified bit representation. For more info, see: Clash.Annotations.BitRepresentations. |
| CustomSum !Text !DataRepr' !Size [(ConstrRepr', Text)] | Same as Sum, but with a user specified bit representation. For more info, see: Clash.Annotations.BitRepresentations. |
| CustomProduct !Text !DataRepr' !Size (Maybe [Text]) [(FieldAnn, HWType)] | Same as Product, but with a user specified bit representation. For more info, see: Clash.Annotations.BitRepresentations. |
| Annotated [Attr Text] !HWType | Annotated with HDL attributes |
| KnownDomain !DomainName !Integer !ActiveEdge !ResetKind !InitBehavior !ResetPolarity | Domain name, period, active edge, reset kind, initial value behavior |
| FileType | File type for simulation-level I/O |
Instances
| NFData HWType Source # | |||||
Defined in Clash.Netlist.Types | |||||
| Generic HWType Source # | |||||
Defined in Clash.Netlist.Types Associated Types
| |||||
| Show HWType Source # | |||||
| Eq HWType Source # | |||||
| Ord HWType Source # | |||||
| Hashable HWType Source # | |||||
| type Rep HWType Source # | |||||
Defined in Clash.Netlist.Types type Rep HWType = D1 ('MetaData "HWType" "Clash.Netlist.Types" "clash-lib-1.8.4-LRerWkkgeHOGhsvLM5mWaX" 'False) ((((C1 ('MetaCons "Void" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe HWType))) :+: (C1 ('MetaCons "String" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Integer" 'PrefixI 'False) (U1 :: Type -> Type))) :+: (C1 ('MetaCons "Bool" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "Bit" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "BitVector" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Size))))) :+: ((C1 ('MetaCons "Index" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Integer)) :+: (C1 ('MetaCons "Signed" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Size)) :+: C1 ('MetaCons "Unsigned" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Size)))) :+: ((C1 ('MetaCons "Vector" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Size) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 HWType)) :+: C1 ('MetaCons "MemBlob" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Size) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Size))) :+: (C1 ('MetaCons "RTree" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Size) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 HWType)) :+: C1 ('MetaCons "Sum" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Text) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Text])))))) :+: (((C1 ('MetaCons "Product" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Text) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe [Text])) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [HWType]))) :+: (C1 ('MetaCons "SP" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Text) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [(Text, [HWType])])) :+: C1 ('MetaCons "Clock" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 DomainName)))) :+: (C1 ('MetaCons "ClockN" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 DomainName)) :+: (C1 ('MetaCons "Reset" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 DomainName)) :+: C1 ('MetaCons "Enable" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 DomainName))))) :+: ((C1 ('MetaCons "BiDirectional" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 PortDirection) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 HWType)) :+: (C1 ('MetaCons "CustomSP" 'PrefixI 'False) ((S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Text) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 DataRepr')) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Size) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [(ConstrRepr', Text, [HWType])]))) :+: C1 ('MetaCons "CustomSum" 'PrefixI 'False) ((S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Text) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 DataRepr')) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Size) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [(ConstrRepr', Text)]))))) :+: ((C1 ('MetaCons "CustomProduct" 'PrefixI 'False) ((S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Text) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 DataRepr')) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Size) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe [Text])) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [(FieldAnn, HWType)])))) :+: C1 ('MetaCons "Annotated" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Attr Text]) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 HWType))) :+: (C1 ('MetaCons "KnownDomain" 'PrefixI 'False) ((S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 DomainName) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Integer) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ActiveEdge))) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ResetKind) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 InitBehavior) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ResetPolarity)))) :+: C1 ('MetaCons "FileType" 'PrefixI 'False) (U1 :: Type -> Type)))))) | |||||
data EntityOrComponent Source #
Instances
| Show EntityOrComponent Source # | |
Defined in Clash.Netlist.Types Methods showsPrec :: Int -> EntityOrComponent -> ShowS # show :: EntityOrComponent -> String # showList :: [EntityOrComponent] -> ShowS # | |
prefixName :: Lens' NetlistEnv Text Source #
suffixName :: Lens' NetlistEnv Text Source #
Expression used in RHS of a declaration
Constructors
| Literal !(Maybe (HWType, Size)) !Literal | Literal expression |
| DataCon !HWType !Modifier [Expr] | DataCon application |
| Identifier !Identifier !(Maybe Modifier) | Signal reference |
| DataTag !HWType !(Either Identifier Identifier) |
|
| BlackBoxE | Instantiation of a BlackBox expression |
Fields
| |
| ToBv | Convert some type to a BitVector. |
Fields
| |
| FromBv | Convert BitVector to some type. |
Fields
| |
| IfThenElse Expr Expr Expr | |
| Noop | Do nothing |
data Declaration Source #
Internals of a Component
Constructors
| Assignment | Signal assignment |
Fields
| |
| CondAssignment | Conditional signal assignment: |
| InstDecl | Instantiation of another component: |
Fields
| |
| BlackBoxD | Instantiation of blackbox declaration |
Fields
| |
| CompDecl !Text [(Text, PortDirection, HWType)] |
See this tutorial; refer to §4.5 of IEEE 1076-1993 |
| NetDecl' | Signal declaration |
| TickDecl CommentOrDirective | HDL tick corresponding to a Core tick |
| Seq [Seq] | Sequential statement |
| ConditionalDecl | Compilation conditional on some preprocessor symbol, note that declarations here are ignored for VHDL. See here for a discussion https://github.com/clash-lang/clash-compiler/pull/1798#discussion_r648571862 |
Fields
| |
Instances
| NFData Declaration Source # | |
Defined in Clash.Netlist.Types Methods rnf :: Declaration -> () | |
| Show Declaration Source # | |
Defined in Clash.Netlist.Types Methods showsPrec :: Int -> Declaration -> ShowS # show :: Declaration -> String # showList :: [Declaration] -> ShowS # | |
Expression Modifier
Constructors
| Indexed (HWType, Int, Int) | Index the expression: (Type of expression, DataCon tag, Field Tag). Note that the type of the expression is the type we are slicing from, not the type returned by the index operation. |
| DC (HWType, Int) | See expression in a DataCon context: (Type of the expression, DataCon tag) |
| VecAppend | See the expression in the context of a Vector append operation |
| RTreeAppend | See the expression in the context of a Tree append operation |
| Sliced (HWType, Int, Int) | Slice the identifier of the given type from start to end |
| Nested Modifier Modifier |
data BlackBoxContext Source #
Context used to fill in the holes of a BlackBox template
Constructors
| Context | |
Fields
| |
Instances
| Show BlackBoxContext Source # | |
Defined in Clash.Netlist.Types Methods showsPrec :: Int -> BlackBoxContext -> ShowS # show :: BlackBoxContext -> String # showList :: [BlackBoxContext] -> ShowS # | |
Sequential statements
Constructors
| AlwaysClocked | Clocked sequential statements |
Fields
| |
| Initial [Seq] | Statements to run at simulator start | Statements to run always |
| AlwaysComb [Seq] | Statements to run always | Declaration in sequential form |
| SeqDecl Declaration | The declaration | Branching statement |
| Branch | |
Literals used in an expression
Component: base unit of a Netlist
Constructors
| Component | |
Fields
| |
Instances
| NFData Component Source # | |||||
Defined in Clash.Netlist.Types | |||||
| Generic Component Source # | |||||
Defined in Clash.Netlist.Types Associated Types
| |||||
| Show Component Source # | |||||
| type Rep Component Source # | |||||
Defined in Clash.Netlist.Types type Rep Component = D1 ('MetaData "Component" "Clash.Netlist.Types" "clash-lib-1.8.4-LRerWkkgeHOGhsvLM5mWaX" 'False) (C1 ('MetaCons "Component" 'PrefixI 'True) ((S1 ('MetaSel ('Just "componentName") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Identifier) :*: S1 ('MetaSel ('Just "inputs") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [(Identifier, HWType)])) :*: (S1 ('MetaSel ('Just "outputs") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [(Usage, (Identifier, HWType), Maybe Expr)]) :*: S1 ('MetaSel ('Just "declarations") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Declaration])))) | |||||
data Identifier Source #
HDL identifier. Consists of a base name and a number of extensions. An identifier with a base name of "foo" and a list of extensions [1, 2] will be rendered as "foo_1_2".
Note: The Eq instance of Identifier is case insensitive! E.g., two
identifiers with base names fooBar and FoObAR are considered the same.
However, identifiers are stored case preserving. This means Clash won't
generate two identifiers with differing case, but it will try to keep
capitalization.
The goal of this data structure is to greatly simplify how Clash deals with identifiers internally. Any Identifier should be trivially printable to any HDL.
NB: use the functions in Clash.Netlist.Id. Don't use these constructors directly.
Constructors
| RawIdentifier | Unparsed identifier. Used for things such as port names, which should appear in the HDL exactly as the user specified. |
Fields
| |
| UniqueIdentifier | Parsed and sanitized identifier. See various fields for more information on its invariants. |
Fields
| |
Instances
| NFData Identifier Source # | |||||
Defined in Clash.Netlist.Types Methods rnf :: Identifier -> () | |||||
| Generic Identifier Source # | |||||
Defined in Clash.Netlist.Types Associated Types
| |||||
| Show Identifier Source # | |||||
Defined in Clash.Netlist.Types Methods showsPrec :: Int -> Identifier -> ShowS # show :: Identifier -> String # showList :: [Identifier] -> ShowS # | |||||
| Eq Identifier Source # | |||||
Defined in Clash.Netlist.Types | |||||
| Ord Identifier Source # | |||||
Defined in Clash.Netlist.Types Methods compare :: Identifier -> Identifier -> Ordering # (<) :: Identifier -> Identifier -> Bool # (<=) :: Identifier -> Identifier -> Bool # (>) :: Identifier -> Identifier -> Bool # (>=) :: Identifier -> Identifier -> Bool # max :: Identifier -> Identifier -> Identifier # min :: Identifier -> Identifier -> Identifier # | |||||
| Hashable Identifier Source # | |||||
Defined in Clash.Netlist.Types | |||||
| Pretty Identifier Source # | |||||
Defined in Clash.Netlist.Id.Internal | |||||
| type Rep Identifier Source # | |||||
Defined in Clash.Netlist.Types type Rep Identifier = D1 ('MetaData "Identifier" "Clash.Netlist.Types" "clash-lib-1.8.4-LRerWkkgeHOGhsvLM5mWaX" 'False) (C1 ('MetaCons "RawIdentifier" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Text) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Identifier)) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 CallStack))) :+: C1 ('MetaCons "UniqueIdentifier" 'PrefixI 'True) ((S1 ('MetaSel ('Just "i_baseName") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Text) :*: (S1 ('MetaSel ('Just "i_baseNameCaseFold") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Text) :*: S1 ('MetaSel ('Just "i_extensionsRev") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Word]))) :*: (S1 ('MetaSel ('Just "i_idType") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 IdentifierType) :*: (S1 ('MetaSel ('Just "i_hdl") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 HDL) :*: S1 ('MetaSel ('Just "i_provenance") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 CallStack))))) | |||||
data IdentifierSet Source #
A collection of unique identifiers. Allows for fast fresh identifier generation.
NB: use the functions in Clash.Netlist.Id. Don't use the constructor directly.
Constructors
| IdentifierSet | |
Fields
| |
Instances
| HasIdentifierSet IdentifierSet Source # | |||||
Defined in Clash.Netlist.Types Methods | |||||
| NFData IdentifierSet Source # | |||||
Defined in Clash.Netlist.Types Methods rnf :: IdentifierSet -> () | |||||
| Generic IdentifierSet Source # | |||||
Defined in Clash.Netlist.Types Associated Types
| |||||
| Show IdentifierSet Source # | |||||
Defined in Clash.Netlist.Types Methods showsPrec :: Int -> IdentifierSet -> ShowS # show :: IdentifierSet -> String # showList :: [IdentifierSet] -> ShowS # | |||||
| type Rep IdentifierSet Source # | |||||
Defined in Clash.Netlist.Types type Rep IdentifierSet = D1 ('MetaData "IdentifierSet" "Clash.Netlist.Types" "clash-lib-1.8.4-LRerWkkgeHOGhsvLM5mWaX" 'False) (C1 ('MetaCons "IdentifierSet" 'PrefixI 'True) ((S1 ('MetaSel ('Just "is_allowEscaped") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Bool) :*: S1 ('MetaSel ('Just "is_lowerCaseBasicIds") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 PreserveCase)) :*: (S1 ('MetaSel ('Just "is_hdl") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 HDL) :*: (S1 ('MetaSel ('Just "is_freshCache") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 FreshCache) :*: S1 ('MetaSel ('Just "is_store") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (HashSet Identifier)))))) | |||||
class HasIdentifierSet s where Source #
Structures that hold an IdentifierSet
Methods
Instances
| HasIdentifierSet SystemVerilogState Source # | |
Defined in Clash.Backend.SystemVerilog Methods identifierSet :: Lens' SystemVerilogState IdentifierSet Source # | |
| HasIdentifierSet VHDLState Source # | |
Defined in Clash.Backend.VHDL Methods | |
| HasIdentifierSet VerilogState Source # | |
Defined in Clash.Backend.Verilog Methods | |
| HasIdentifierSet IdentifierSet Source # | |
Defined in Clash.Netlist.Types Methods | |
| Backend backend => HasIdentifierSet (BlockState backend) Source # | |
Defined in Clash.Primitives.DSL Methods identifierSet :: Lens' (BlockState backend) IdentifierSet Source # | |
| HasIdentifierSet s => HasIdentifierSet (s, a) Source # | |
Defined in Clash.Netlist.Types Methods identifierSet :: Lens' (s, a) IdentifierSet Source # | |
data NetlistState Source #
State of the NetlistMonad
Constructors
| NetlistState | |
Fields
| |
Instances
| HasUsageMap NetlistState Source # | |
Defined in Clash.Netlist.Types | |
| MonadState NetlistState NetlistMonad Source # | |
Defined in Clash.Netlist.Types Methods get :: NetlistMonad NetlistState put :: NetlistState -> NetlistMonad () state :: (NetlistState -> (a, NetlistState)) -> NetlistMonad a | |
data DeclarationType Source #
Type of declaration, concurrent or sequential
Constructors
| Concurrent | |
| Sequential |
type IdentifierText = Text Source #
Constructors
| BBTemplate BlackBoxTemplate | |
| BBFunction BBName BBHash TemplateFunction |
Instances
| Binary BlackBox Source # | |||||
| NFData BlackBox Source # | |||||
Defined in Clash.Netlist.Types | |||||
| Generic BlackBox Source # | |||||
Defined in Clash.Netlist.Types Associated Types
| |||||
| Show BlackBox Source # | |||||
| type Rep BlackBox Source # | |||||
Defined in Clash.Netlist.Types type Rep BlackBox = D1 ('MetaData "BlackBox" "Clash.Netlist.Types" "clash-lib-1.8.4-LRerWkkgeHOGhsvLM5mWaX" 'False) (C1 ('MetaCons "BBTemplate" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 BlackBoxTemplate)) :+: C1 ('MetaCons "BBFunction" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 BBName) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 BBHash) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 TemplateFunction)))) | |||||
data FilteredHWType Source #
Tree structure indicating which constructor fields were filtered from a type due to them being void. We need this information to generate stable and/or user-defined port mappings.
Constructors
| FilteredHWType HWType [[(IsVoid, FilteredHWType)]] |
Instances
| Show FilteredHWType Source # | |
Defined in Clash.Netlist.Types Methods showsPrec :: Int -> FilteredHWType -> ShowS # show :: FilteredHWType -> String # showList :: [FilteredHWType] -> ShowS # | |
| Eq FilteredHWType Source # | |
Defined in Clash.Netlist.Types Methods (==) :: FilteredHWType -> FilteredHWType -> Bool # (/=) :: FilteredHWType -> FilteredHWType -> Bool # | |
data SomeBackend where Source #
Existentially quantified backend
Constructors
| SomeBackend :: forall backend. Backend backend => backend -> SomeBackend |
data TopEntityT Source #
Structure describing a top entity: it's id and its port annotations.
Constructors
| TopEntityT | |
Fields
| |
Instances
| Binary TopEntityT | |||||
Defined in Clash.Annotations.TopEntity.Extra | |||||
| NFData TopEntityT | |||||
Defined in Clash.Annotations.TopEntity.Extra Methods rnf :: TopEntityT -> () | |||||
| Generic TopEntityT Source # | |||||
Defined in Clash.Netlist.Types Associated Types
| |||||
| Show TopEntityT Source # | |||||
Defined in Clash.Netlist.Types Methods showsPrec :: Int -> TopEntityT -> ShowS # show :: TopEntityT -> String # showList :: [TopEntityT] -> ShowS # | |||||
| Eq TopEntityT Source # | |||||
Defined in Clash.Netlist.Types | |||||
| Hashable TopEntityT Source # | |||||
Defined in Clash.Annotations.TopEntity.Extra | |||||
| type Rep TopEntityT Source # | |||||
Defined in Clash.Netlist.Types type Rep TopEntityT = D1 ('MetaData "TopEntityT" "Clash.Netlist.Types" "clash-lib-1.8.4-LRerWkkgeHOGhsvLM5mWaX" 'False) (C1 ('MetaCons "TopEntityT" 'PrefixI 'True) (S1 ('MetaSel ('Just "topId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Id) :*: (S1 ('MetaSel ('Just "topAnnotation") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe TopEntity)) :*: S1 ('MetaSel ('Just "topIsTestBench") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool)))) | |||||
data TemplateFunction where Source #
Constructors
| TemplateFunction | |
Fields
| |
Instances
| Binary TemplateFunction Source # | NB: serialisation doesn't preserve the embedded function |
Defined in Clash.Netlist.Types Methods put :: TemplateFunction -> Put get :: Get TemplateFunction putList :: [TemplateFunction] -> Put | |
| NFData TemplateFunction Source # | |
Defined in Clash.Netlist.Types Methods rnf :: TemplateFunction -> () | |
type ComponentMap = OMap Unique (ComponentMeta, Component) Source #
findClocks :: Component -> [(Text, Text)] Source #
Find the name and domain name of each clock argument of a component.
This will not consider ClockN to be a clock argument, which means only the
positive phase of a differential pair will be added to sdcClock.
data ComponentMeta Source #
Constructors
| ComponentMeta | |
Fields
| |
Instances
| NFData ComponentMeta Source # | |||||
Defined in Clash.Netlist.Types Methods rnf :: ComponentMeta -> () | |||||
| Generic ComponentMeta Source # | |||||
Defined in Clash.Netlist.Types Associated Types
| |||||
| Show ComponentMeta Source # | |||||
Defined in Clash.Netlist.Types Methods showsPrec :: Int -> ComponentMeta -> ShowS # show :: ComponentMeta -> String # showList :: [ComponentMeta] -> ShowS # | |||||
| type Rep ComponentMeta Source # | |||||
Defined in Clash.Netlist.Types type Rep ComponentMeta = D1 ('MetaData "ComponentMeta" "Clash.Netlist.Types" "clash-lib-1.8.4-LRerWkkgeHOGhsvLM5mWaX" 'False) (C1 ('MetaCons "ComponentMeta" 'PrefixI 'True) ((S1 ('MetaSel ('Just "cmWereVoids") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Bool]) :*: S1 ('MetaSel ('Just "cmLoc") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 SrcSpan)) :*: (S1 ('MetaSel ('Just "cmScope") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 IdentifierSet) :*: S1 ('MetaSel ('Just "cmUsage") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 UsageMap)))) | |||||
The usage of a signal refers to how the signal is written to in netlist.
This is used to determine if the signal should be a wire or reg in
(System)Verilog, or a signal or variable in VHDL.
Constructors
| Cont | Continuous assignment, which occurs in a concurrent context. |
| Proc Blocking | Procedural assignment, which occurs in a sequential context. |
Instances
| FromJSON Usage Source # | |||||
| Binary Usage Source # | |||||
| NFData Usage Source # | |||||
Defined in Clash.Netlist.Types | |||||
| Semigroup Usage Source # | |||||
| Generic Usage Source # | |||||
Defined in Clash.Netlist.Types Associated Types
| |||||
| Show Usage Source # | |||||
| Eq Usage Source # | |||||
| Hashable Usage Source # | |||||
| type Rep Usage Source # | |||||
Defined in Clash.Netlist.Types type Rep Usage = D1 ('MetaData "Usage" "Clash.Netlist.Types" "clash-lib-1.8.4-LRerWkkgeHOGhsvLM5mWaX" 'False) (C1 ('MetaCons "Cont" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Proc" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Blocking))) | |||||
hwTypeDomain :: HWType -> Maybe DomainName Source #
data IdentifierType Source #
Constructors
| Basic | A basic identifier: does not have to be escaped in order to be a valid identifier in HDL. |
| Extended | An extended identifier: has to be escaped, wrapped, or otherwise postprocessed before writhing it to HDL. |
Instances
| NFData IdentifierType Source # | |||||
Defined in Clash.Netlist.Types Methods rnf :: IdentifierType -> () | |||||
| Generic IdentifierType Source # | |||||
Defined in Clash.Netlist.Types Associated Types
| |||||
| Show IdentifierType Source # | |||||
Defined in Clash.Netlist.Types Methods showsPrec :: Int -> IdentifierType -> ShowS # show :: IdentifierType -> String # showList :: [IdentifierType] -> ShowS # | |||||
| Eq IdentifierType Source # | |||||
Defined in Clash.Netlist.Types Methods (==) :: IdentifierType -> IdentifierType -> Bool # (/=) :: IdentifierType -> IdentifierType -> Bool # | |||||
| type Rep IdentifierType Source # | |||||
Defined in Clash.Netlist.Types | |||||
data PreserveCase Source #
Whether to preserve casing in ids or converted everything to lowercase. Influenced by '-fclash-lower-case-basic-identifiers'
Constructors
| PreserveCase | |
| ToLower |
Instances
| Binary PreserveCase Source # | |||||
Defined in Clash.Netlist.Types | |||||
| NFData PreserveCase Source # | |||||
Defined in Clash.Netlist.Types Methods rnf :: PreserveCase -> () | |||||
| Generic PreserveCase Source # | |||||
Defined in Clash.Netlist.Types Associated Types
| |||||
| Show PreserveCase Source # | |||||
Defined in Clash.Netlist.Types Methods showsPrec :: Int -> PreserveCase -> ShowS # show :: PreserveCase -> String # showList :: [PreserveCase] -> ShowS # | |||||
| Eq PreserveCase Source # | |||||
Defined in Clash.Netlist.Types | |||||
| Hashable PreserveCase Source # | |||||
Defined in Clash.Netlist.Types | |||||
| type Rep PreserveCase Source # | |||||
Defined in Clash.Netlist.Types | |||||
newtype NetlistMonad a Source #
Monad that caches generated components (StateT) and remembers hidden inputs of components that are being generated (WriterT)
Constructors
| NetlistMonad | |
Fields
| |
Instances
class Monad m => IdentifierSetMonad (m :: Type -> Type) where Source #
An IdentifierSetMonad supports unique name generation for Clash Netlist
Methods
identifierSetM :: (IdentifierSet -> IdentifierSet) -> m IdentifierSet Source #
Instances
| IdentifierSetMonad NetlistMonad Source # | |
Defined in Clash.Netlist.Types Methods identifierSetM :: (IdentifierSet -> IdentifierSet) -> NetlistMonad IdentifierSet Source # | |
| HasIdentifierSet s => IdentifierSetMonad (State s) Source # | |
Defined in Clash.Netlist.Types Methods identifierSetM :: (IdentifierSet -> IdentifierSet) -> State s IdentifierSet Source # | |
| HasIdentifierSet s => IdentifierSetMonad (State s) Source # | |
Defined in Clash.Netlist.Types Methods identifierSetM :: (IdentifierSet -> IdentifierSet) -> State s IdentifierSet Source # | |
| IdentifierSetMonad m => IdentifierSetMonad (Ap m) Source # | |
Defined in Clash.Netlist.Types Methods identifierSetM :: (IdentifierSet -> IdentifierSet) -> Ap m IdentifierSet Source # | |
type FreshCache = HashMap Text (IntMap Word) Source #
See is_freshCache
Arguments
| :: Maybe Comment | Note; will be inserted as a comment in target hdl |
| -> Identifier | Name of signal |
| -> HWType | Type of signal |
| -> Declaration |
typeTranslator :: Lens' NetlistState (CustomReprs -> TyConMap -> Type -> State HWMap (Maybe (Either String FilteredHWType))) Source #
emptyBBContext :: Text -> BlackBoxContext Source #
Netlist-level identifier
Constructors
| NetlistId Identifier Type | Identifier generated in the NetlistMonad, always derived from another
|
| CoreId Id | An original Core identifier |
| MultiId [Id] | A split identifier (into several sub-identifiers), needed to assign expressions of types that have to be split apart (e.g. tuples of Files) |
data CommentOrDirective Source #
Instances
| Show CommentOrDirective Source # | |
Defined in Clash.Netlist.Types Methods showsPrec :: Int -> CommentOrDirective -> ShowS # show :: CommentOrDirective -> String # showList :: [CommentOrDirective] -> ShowS # | |
data PortDirection Source #
Instances
Procedural assignment in HDL can be blocking or non-blocking. This determines when the assignment takes place in simulation. The name refers to whether evaluation of the remaining statements in a process is blocked until the assignment is performed or not.
See Also:
IEEE 1364-2001, sections 9.2.1 and 9.2.2 IEEE 1076-1993, sections 8.4 and 8.5
Constructors
| NonBlocking | A non-blocking assignment means the new value is not observed until the next time step in simulation. Using the signal later in the process will continue to return the old value. |
| Blocking | A blocking assignment means the new value is observed immediately. Using the signal later in the process will return the new value. |
Instances
data ExpandedTopEntity a Source #
Same as TopEntity, but with all port names that end up in HDL specified
Constructors
| ExpandedTopEntity | |
Fields
| |
Instances
| Functor ExpandedTopEntity Source # | |
Defined in Clash.Netlist.Types Methods fmap :: (a -> b) -> ExpandedTopEntity a -> ExpandedTopEntity b # (<$) :: a -> ExpandedTopEntity b -> ExpandedTopEntity a # | |
| Foldable ExpandedTopEntity Source # | |
Defined in Clash.Netlist.Types Methods fold :: Monoid m => ExpandedTopEntity m -> m foldMap :: Monoid m => (a -> m) -> ExpandedTopEntity a -> m # foldMap' :: Monoid m => (a -> m) -> ExpandedTopEntity a -> m foldr :: (a -> b -> b) -> b -> ExpandedTopEntity a -> b foldr' :: (a -> b -> b) -> b -> ExpandedTopEntity a -> b foldl :: (b -> a -> b) -> b -> ExpandedTopEntity a -> b foldl' :: (b -> a -> b) -> b -> ExpandedTopEntity a -> b # foldr1 :: (a -> a -> a) -> ExpandedTopEntity a -> a foldl1 :: (a -> a -> a) -> ExpandedTopEntity a -> a toList :: ExpandedTopEntity a -> [a] null :: ExpandedTopEntity a -> Bool # length :: ExpandedTopEntity a -> Int elem :: Eq a => a -> ExpandedTopEntity a -> Bool # maximum :: Ord a => ExpandedTopEntity a -> a minimum :: Ord a => ExpandedTopEntity a -> a sum :: Num a => ExpandedTopEntity a -> a # product :: Num a => ExpandedTopEntity a -> a # | |
| Traversable ExpandedTopEntity Source # | |
Defined in Clash.Netlist.Types Methods traverse :: Applicative f => (a -> f b) -> ExpandedTopEntity a -> f (ExpandedTopEntity b) # sequenceA :: Applicative f => ExpandedTopEntity (f a) -> f (ExpandedTopEntity a) # mapM :: Monad m => (a -> m b) -> ExpandedTopEntity a -> m (ExpandedTopEntity b) # sequence :: Monad m => ExpandedTopEntity (m a) -> m (ExpandedTopEntity a) # | |
| Show a => Show (ExpandedTopEntity a) Source # | |
Defined in Clash.Netlist.Types Methods showsPrec :: Int -> ExpandedTopEntity a -> ShowS # show :: ExpandedTopEntity a -> String # showList :: [ExpandedTopEntity a] -> ShowS # | |
data ExpandedPortName a Source #
Constructors
| ExpandedPortName HWType a | Same as PortName, but fully expanded |
| ExpandedPortProduct | Same as PortProduct, but fully expanded |
Fields
| |
Instances
| Functor ExpandedPortName Source # | |
Defined in Clash.Netlist.Types Methods fmap :: (a -> b) -> ExpandedPortName a -> ExpandedPortName b # (<$) :: a -> ExpandedPortName b -> ExpandedPortName a # | |
| Foldable ExpandedPortName Source # | |
Defined in Clash.Netlist.Types Methods fold :: Monoid m => ExpandedPortName m -> m foldMap :: Monoid m => (a -> m) -> ExpandedPortName a -> m # foldMap' :: Monoid m => (a -> m) -> ExpandedPortName a -> m foldr :: (a -> b -> b) -> b -> ExpandedPortName a -> b foldr' :: (a -> b -> b) -> b -> ExpandedPortName a -> b foldl :: (b -> a -> b) -> b -> ExpandedPortName a -> b foldl' :: (b -> a -> b) -> b -> ExpandedPortName a -> b # foldr1 :: (a -> a -> a) -> ExpandedPortName a -> a foldl1 :: (a -> a -> a) -> ExpandedPortName a -> a toList :: ExpandedPortName a -> [a] null :: ExpandedPortName a -> Bool # length :: ExpandedPortName a -> Int elem :: Eq a => a -> ExpandedPortName a -> Bool # maximum :: Ord a => ExpandedPortName a -> a minimum :: Ord a => ExpandedPortName a -> a sum :: Num a => ExpandedPortName a -> a # product :: Num a => ExpandedPortName a -> a # | |
| Traversable ExpandedPortName Source # | |
Defined in Clash.Netlist.Types Methods traverse :: Applicative f => (a -> f b) -> ExpandedPortName a -> f (ExpandedPortName b) # sequenceA :: Applicative f => ExpandedPortName (f a) -> f (ExpandedPortName a) # mapM :: Monad m => (a -> m b) -> ExpandedPortName a -> m (ExpandedPortName b) # sequence :: Monad m => ExpandedPortName (m a) -> m (ExpandedPortName a) # | |
| Show a => Show (ExpandedPortName a) Source # | |
Defined in Clash.Netlist.Types Methods showsPrec :: Int -> ExpandedPortName a -> ShowS # show :: ExpandedPortName a -> String # showList :: [ExpandedPortName a] -> ShowS # | |
data NetlistEnv Source #
Environment of the NetlistMonad
Constructors
| NetlistEnv | |
Fields
| |
Instances
| MonadReader NetlistEnv NetlistMonad Source # | |
Defined in Clash.Netlist.Types Methods ask :: NetlistMonad NetlistEnv local :: (NetlistEnv -> NetlistEnv) -> NetlistMonad a -> NetlistMonad a reader :: (NetlistEnv -> a) -> NetlistMonad a | |
identifierKey# :: Identifier -> ((Text, Bool), [Word]) Source #
data ComponentPrefix Source #
Constructors
| ComponentPrefix | |
Fields
| |
Instances
| Show ComponentPrefix Source # | |
Defined in Clash.Netlist.Types Methods showsPrec :: Int -> ComponentPrefix -> ShowS # show :: ComponentPrefix -> String # showList :: [ComponentPrefix] -> ShowS # | |
isBiDirectional :: (Identifier, HWType) -> Bool Source #
Check if an input port is really an inout port.
type DomainName = Text Source #
hwTypeAttrs :: HWType -> [Attr Text] Source #
Extract hardware attributes from Annotated. Returns an empty list if non-Annotated given or if Annotated has an empty list of attributes.
Specifies how to wire up a component instance
Constructors
| IndexedPortMap [(PortDirection, HWType, Expr)] | Port map based on port positions (port direction, type, assignment) HDL Example: bytemaster bytemaster_ds ( clk_1 , rst_1 , bitCtrl_0 ); |
| NamedPortMap [(Expr, PortDirection, HWType, Expr)] | Port map based on port names (port name, port direction, type, assignment) HDL Example: bytemaster bytemaster_ds ( .clk (clk_1) , .rst (rst_1) , .bitCtrl (bitCtrl_0) ); |
lookupUsage :: Identifier -> UsageMap -> Maybe Usage Source #
isConstExpr :: Expr -> Bool Source #
Arguments
| :: HasCallStack | |
| => (Identifier -> r) | Eliminator for Identifiers generated in the NetlistMonad |
| -> (Id -> r) | Eliminator for original Core Identifiers |
| -> NetlistId | |
| -> r |
netlistTypes :: NetlistId -> [Type] Source #
Return the type(s) of a NetListId, returns multiple types when given a
MultiId
netlistTypes1 :: HasCallStack => NetlistId -> Type Source #
declTypeUsage :: DeclarationType -> Usage Source #
Default usage for a type of declaration (concurrent or sequential)
seenPrimitives :: Lens' NetlistState (Set Text) Source #