Copyright | (C) 2012-2016 University of Twente 2017 Myrtle Software Ltd 2017-2018 Google Inc. 2020 QBayLogic |
---|---|
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 !Expr
- CondAssignment !Identifier !HWType !Expr !HWType [(Maybe Literal, Expr)]
- InstDecl EntityOrComponent (Maybe Text) [Attr'] !Identifier !Identifier [(Expr, HWType, Expr)] PortMap
- BlackBoxD !Text [BlackBoxTemplate] [BlackBoxTemplate] [((Text, Text), BlackBox)] !BlackBox BlackBoxContext
- NetDecl' (Maybe Comment) WireOrReg !Identifier (Either IdentifierText HWType) (Maybe Expr)
- TickDecl Comment
- Seq [Seq]
- pattern NetDecl :: Maybe Comment -> Identifier -> HWType -> Declaration
- data PreserveCase
- newtype NetlistMonad a = NetlistMonad {
- runNetlist :: StateT NetlistState (ReaderT NetlistEnv IO) a
- class HasIdentifierSet s where
- class Monad m => IdentifierSetMonad m where
- identifierSetM :: (IdentifierSet -> IdentifierSet) -> m IdentifierSet
- data BlackBox
- 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
- data Component = Component {
- componentName :: !Identifier
- inputs :: [(Identifier, HWType)]
- outputs :: [(WireOrReg, (Identifier, HWType), Maybe Expr)]
- declarations :: [Declaration]
- data Declaration
- = Assignment !Identifier !Expr
- | CondAssignment !Identifier !HWType !Expr !HWType [(Maybe Literal, Expr)]
- | InstDecl EntityOrComponent (Maybe Text) [Attr'] !Identifier !Identifier [(Expr, HWType, Expr)] PortMap
- | BlackBoxD !Text [BlackBoxTemplate] [BlackBoxTemplate] [((Text, Text), BlackBox)] !BlackBox BlackBoxContext
- | NetDecl' (Maybe Comment) WireOrReg !Identifier (Either IdentifierText HWType) (Maybe Expr)
- | TickDecl Comment
- | Seq [Seq]
- data HWType
- = Void (Maybe HWType)
- | String
- | Integer
- | Bool
- | Bit
- | BitVector !Size
- | Index !Integer
- | Signed !Size
- | Unsigned !Size
- | Vector !Size !HWType
- | RTree !Size !HWType
- | Sum !Text [Text]
- | Product !Text (Maybe [Text]) [HWType]
- | SP !Text [(Text, [HWType])]
- | Clock !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'] !HWType
- | KnownDomain !DomainName !Integer !ActiveEdge !ResetKind !InitBehavior !ResetPolarity
- | FileType
- data IdentifierSet = IdentifierSet {
- is_allowEscaped :: !Bool
- is_lowerCaseBasicIds :: !PreserveCase
- is_hdl :: !HDL
- is_freshCache :: !FreshCache
- is_store :: !(HashSet Identifier)
- 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 IdentifierType
- data DeclarationType
- data NetlistId
- data TemplateFunction where
- TemplateFunction :: [Int] -> (BlackBoxContext -> Bool) -> (forall s. Backend s => BlackBoxContext -> State s Doc) -> TemplateFunction
- type BBHash = Int
- type BBName = String
- data BlackBoxContext = Context {
- bbName :: Text
- bbResults :: [(Expr, HWType)]
- bbInputs :: [(Expr, HWType, Bool)]
- bbFunctions :: IntMap [(Either BlackBox (Identifier, [Declaration]), WireOrReg, [BlackBoxTemplate], [BlackBoxTemplate], [((Text, Text), BlackBox)], BlackBoxContext)]
- bbQsysIncName :: [IdentifierText]
- bbLevel :: Int
- bbCompName :: Identifier
- bbCtxName :: Maybe IdentifierText
- data Bit
- data Literal
- data Modifier
- data PortDirection
- data WireOrReg
- data EntityOrComponent
- data Seq
- = AlwaysClocked ActiveEdge Expr [Seq]
- | Initial [Seq]
- | AlwaysComb [Seq]
- | SeqDecl Declaration
- | Branch !Expr !HWType [(Maybe Literal, [Seq])]
- data PortMap
- = IndexedPortMap [(PortDirection, HWType, Expr)]
- | NamedPortMap [(Expr, PortDirection, HWType, Expr)]
- type DomainName = Text
- data FilteredHWType = FilteredHWType HWType [[(IsVoid, FilteredHWType)]]
- type IsVoid = Bool
- type Size = Int
- type Comment = Text
- data SomeBackend where
- SomeBackend :: Backend backend => backend -> SomeBackend
- data ComponentPrefix = ComponentPrefix {}
- data NetlistState = NetlistState {
- _bindings :: BindingMap
- _components :: ComponentMap
- _primitives :: CompiledPrimMap
- _typeTranslator :: CustomReprs -> TyConMap -> Type -> State HWMap (Maybe (Either String FilteredHWType))
- _tcCache :: TyConMap
- _curCompNm :: !(Identifier, SrcSpan)
- _intWidth :: Int
- _seenIds :: IdentifierSet
- _seenComps :: IdentifierSet
- _seenPrimitives :: Set Text
- _componentNames :: VarEnv Identifier
- _topEntityAnns :: VarEnv TopEntityT
- _hdlDir :: FilePath
- _curBBlvl :: Int
- _customReprs :: CustomReprs
- _clashOpts :: ClashOpts
- _isTestBench :: Bool
- _backEndITE :: Bool
- _backend :: SomeBackend
- _htyCache :: HWMap
- type ComponentMap = OMap Unique (ComponentMeta, Component)
- data ComponentMeta = ComponentMeta {
- cmWereVoids :: [Bool]
- cmLoc :: SrcSpan
- cmScope :: IdentifierSet
- data NetlistEnv = NetlistEnv {
- _prefixName :: Text
- _suffixName :: Text
- _setName :: Maybe Text
- type IdentifierText = Text
- type FreshCache = HashMap Text (IntMap Word)
- type HWMap = Map Type (Either String FilteredHWType)
- data ExpandedPortName a
- data ExpandedTopEntity a = ExpandedTopEntity {
- et_inputs :: [Maybe (ExpandedPortName a)]
- et_output :: Maybe (ExpandedPortName a)
- data TopEntityT = TopEntityT {
- topId :: Id
- topAnnotation :: Maybe TopEntity
- topIsTestBench :: Bool
- pattern NetDecl :: Maybe Comment -> Identifier -> HWType -> Declaration
- identifierKey# :: Identifier -> ((Text, Bool), [Word])
- findClocks :: Component -> [(Text, Text)]
- hwTypeDomain :: HWType -> Maybe DomainName
- hwTypeAttrs :: HWType -> [Attr']
- toBit :: Integer -> Integer -> Bit
- netlistId :: (Identifier -> r) -> (Id -> r) -> NetlistId -> [r]
- netlistId1 :: HasCallStack => (Identifier -> r) -> (Id -> r) -> NetlistId -> r
- netlistTypes :: NetlistId -> [Type]
- netlistTypes1 :: HasCallStack => NetlistId -> Type
- emptyBBContext :: Text -> BlackBoxContext
- prefixName :: Lens' NetlistEnv Text
- setName :: Lens' NetlistEnv (Maybe Text)
- suffixName :: Lens' NetlistEnv Text
- backEndITE :: Lens' NetlistState Bool
- backend :: Lens' NetlistState SomeBackend
- bindings :: Lens' NetlistState BindingMap
- clashOpts :: Lens' NetlistState ClashOpts
- componentNames :: Lens' NetlistState (VarEnv Identifier)
- components :: Lens' NetlistState ComponentMap
- curBBlvl :: Lens' NetlistState Int
- curCompNm :: Lens' NetlistState (Identifier, SrcSpan)
- customReprs :: Lens' NetlistState CustomReprs
- hdlDir :: Lens' NetlistState FilePath
- htyCache :: Lens' NetlistState HWMap
- intWidth :: Lens' NetlistState Int
- isTestBench :: Lens' NetlistState Bool
- primitives :: Lens' NetlistState CompiledPrimMap
- seenComps :: Lens' NetlistState IdentifierSet
- seenIds :: Lens' NetlistState IdentifierSet
- seenPrimitives :: Lens' NetlistState (Set Text)
- tcCache :: Lens' NetlistState TyConMap
- topEntityAnns :: Lens' NetlistState (VarEnv TopEntityT)
- typeTranslator :: Lens' NetlistState (CustomReprs -> TyConMap -> Type -> State HWMap (Maybe (Either String FilteredHWType)))
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
| |
NetDecl' | Signal declaration |
Fields
| |
TickDecl Comment | HDL tick corresponding to a Core tick | Sequential statement |
Seq [Seq] |
Bundled Patterns
pattern NetDecl | |
Fields
|
Instances
Show Declaration Source # | |
Defined in Clash.Netlist.Types Methods showsPrec :: Int -> Declaration -> ShowS # show :: Declaration -> String # showList :: [Declaration] -> ShowS # | |
NFData Declaration Source # | |
Defined in Clash.Netlist.Types Methods rnf :: Declaration -> () # |
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
Eq PreserveCase Source # | |
Defined in Clash.Netlist.Types | |
Show PreserveCase Source # | |
Defined in Clash.Netlist.Types Methods showsPrec :: Int -> PreserveCase -> ShowS # show :: PreserveCase -> String # showList :: [PreserveCase] -> ShowS # | |
Generic PreserveCase Source # | |
Defined in Clash.Netlist.Types Associated Types type Rep PreserveCase :: Type -> Type # | |
Hashable PreserveCase Source # | |
Defined in Clash.Netlist.Types | |
Binary PreserveCase Source # | |
Defined in Clash.Netlist.Types | |
NFData PreserveCase Source # | |
Defined in Clash.Netlist.Types Methods rnf :: PreserveCase -> () # | |
type Rep PreserveCase Source # | |
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 HasIdentifierSet s where Source #
Structures that hold an IdentifierSet
Methods
Instances
HasIdentifierSet IdentifierSet Source # | |
Defined in Clash.Netlist.Types Methods | |
HasIdentifierSet VerilogState Source # | |
Defined in Clash.Backend.Verilog Methods | |
HasIdentifierSet VHDLState Source # | |
Defined in Clash.Backend.VHDL Methods | |
HasIdentifierSet SystemVerilogState Source # | |
Defined in Clash.Backend.SystemVerilog Methods identifierSet :: Lens' SystemVerilogState IdentifierSet Source # | |
Backend backend => HasIdentifierSet (BlockState backend) Source # | |
Defined in Clash.Primitives.DSL Methods identifierSet :: Lens' (BlockState backend) IdentifierSet Source # |
class Monad m => IdentifierSetMonad m 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 (Mon m) Source # | |
Defined in Clash.Netlist.Types Methods identifierSetM :: (IdentifierSet -> IdentifierSet) -> Mon m IdentifierSet Source # |
Constructors
BBTemplate BlackBoxTemplate | |
BBFunction BBName BBHash TemplateFunction |
Instances
Show BlackBox Source # | |
Generic BlackBox Source # | |
Binary BlackBox Source # | |
NFData BlackBox Source # | |
Defined in Clash.Netlist.Types | |
type Rep BlackBox Source # | |
Defined in Clash.Netlist.Types type Rep BlackBox = D1 ('MetaData "BlackBox" "Clash.Netlist.Types" "clash-lib-1.4.6-inplace" '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)))) |
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 |
Component: base unit of a Netlist
Constructors
Component | |
Fields
|
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
| |
NetDecl' | Signal declaration |
Fields
| |
TickDecl Comment | HDL tick corresponding to a Core tick | Sequential statement |
Seq [Seq] |
Instances
Show Declaration Source # | |
Defined in Clash.Netlist.Types Methods showsPrec :: Int -> Declaration -> ShowS # show :: Declaration -> String # showList :: [Declaration] -> ShowS # | |
NFData Declaration Source # | |
Defined in Clash.Netlist.Types Methods rnf :: Declaration -> () # |
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 |
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 |
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'] !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
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
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
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
Eq IdentifierType Source # | |
Defined in Clash.Netlist.Types Methods (==) :: IdentifierType -> IdentifierType -> Bool # (/=) :: IdentifierType -> IdentifierType -> Bool # | |
Show IdentifierType Source # | |
Defined in Clash.Netlist.Types Methods showsPrec :: Int -> IdentifierType -> ShowS # show :: IdentifierType -> String # showList :: [IdentifierType] -> ShowS # | |
Generic IdentifierType Source # | |
Defined in Clash.Netlist.Types Associated Types type Rep IdentifierType :: Type -> Type # Methods from :: IdentifierType -> Rep IdentifierType x # to :: Rep IdentifierType x -> IdentifierType # | |
NFData IdentifierType Source # | |
Defined in Clash.Netlist.Types Methods rnf :: IdentifierType -> () # | |
type Rep IdentifierType Source # | |
data DeclarationType Source #
Type of declaration, concurrent or sequential
Constructors
Concurrent | |
Sequential |
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 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 -> () # |
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 # |
Literals used in an expression
Expression Modifier
Constructors
Indexed (HWType, Int, Int) | Index the expression: (Type of expression,DataCon tag,Field Tag) |
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 PortDirection Source #
Instances
data EntityOrComponent Source #
Instances
Show EntityOrComponent Source # | |
Defined in Clash.Netlist.Types Methods showsPrec :: Int -> EntityOrComponent -> ShowS # show :: EntityOrComponent -> String # showList :: [EntityOrComponent] -> ShowS # |
Sequential statements
Constructors
AlwaysClocked | Clocked sequential statements |
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 | |
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) ); |
type DomainName = Text Source #
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
Eq FilteredHWType Source # | |
Defined in Clash.Netlist.Types Methods (==) :: FilteredHWType -> FilteredHWType -> Bool # (/=) :: FilteredHWType -> FilteredHWType -> Bool # | |
Show FilteredHWType Source # | |
Defined in Clash.Netlist.Types Methods showsPrec :: Int -> FilteredHWType -> ShowS # show :: FilteredHWType -> String # showList :: [FilteredHWType] -> ShowS # |
data SomeBackend where Source #
Existentially quantified backend
Constructors
SomeBackend :: Backend backend => backend -> SomeBackend |
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 # |
data NetlistState Source #
State of the NetlistMonad
Constructors
NetlistState | |
Fields
|
Instances
MonadState NetlistState NetlistMonad Source # | |
Defined in Clash.Netlist.Types Methods get :: NetlistMonad NetlistState # put :: NetlistState -> NetlistMonad () # state :: (NetlistState -> (a, NetlistState)) -> NetlistMonad a # |
type ComponentMap = OMap Unique (ComponentMeta, Component) Source #
data ComponentMeta Source #
Constructors
ComponentMeta | |
Fields
|
Instances
Show ComponentMeta Source # | |
Defined in Clash.Netlist.Types Methods showsPrec :: Int -> ComponentMeta -> ShowS # show :: ComponentMeta -> String # showList :: [ComponentMeta] -> ShowS # | |
Generic ComponentMeta Source # | |
Defined in Clash.Netlist.Types Associated Types type Rep ComponentMeta :: Type -> Type # | |
NFData ComponentMeta Source # | |
Defined in Clash.Netlist.Types Methods rnf :: ComponentMeta -> () # | |
type Rep ComponentMeta Source # | |
Defined in Clash.Netlist.Types type Rep ComponentMeta = D1 ('MetaData "ComponentMeta" "Clash.Netlist.Types" "clash-lib-1.4.6-inplace" '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)))) |
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 # |
type IdentifierText = Text Source #
type FreshCache = HashMap Text (IntMap Word) Source #
See is_freshCache
data ExpandedPortName a Source #
Constructors
ExpandedPortName HWType a | Same as PortName, but fully expanded |
ExpandedPortProduct | Same as PortProduct, but fully expanded |
Fields
|
Instances
data ExpandedTopEntity a Source #
Same as TopEntity, but with all port names that end up in HDL specified
Constructors
ExpandedTopEntity | |
Fields
|
Instances
data TopEntityT Source #
Structure describing a top entity: it's id and its port annotations.
Constructors
TopEntityT | |
Fields
|
Instances
Arguments
:: Maybe Comment | Note; will be inserted as a comment in target hdl |
-> Identifier | Name of signal |
-> HWType | Type of signal |
-> Declaration |
identifierKey# :: Identifier -> ((Text, Bool), [Word]) Source #
findClocks :: Component -> [(Text, Text)] Source #
Find the name and domain name of each clock argument of a component.
hwTypeDomain :: HWType -> Maybe DomainName Source #
hwTypeAttrs :: HWType -> [Attr'] Source #
Extract hardware attributes from Annotated. Returns an empty list if non-Annotated given or if Annotated has an empty list of attributes.
Arguments
:: (Identifier -> r) | Eliminator for Identifiers generated in the NetlistMonad |
-> (Id -> r) | Eliminator for original Core Identifiers |
-> NetlistId | |
-> [r] |
Eliminator for NetlistId
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 #
emptyBBContext :: Text -> BlackBoxContext Source #
customReprs :: Lens' NetlistState CustomReprs Source #
typeTranslator :: Lens' NetlistState (CustomReprs -> TyConMap -> Type -> State HWMap (Maybe (Either String FilteredHWType))) Source #