clash-lib- CAES Language for Synchronous Hardware - As a Library

Safe HaskellNone



Utilties to verify blackbox contexts against templates and rendering filled in templates





:: BlackBoxTemplate

Template to check against

-> BlackBoxContext

Blackbox to verify

-> Bool 

Determine if the number of normalliteralfunction inputs of a blackbox context at least matches the number of argument that is expected by the template.

countArgs :: BlackBoxTemplate -> IntSource

Count the number of argument tags/holes in a blackbox template

countLits :: BlackBoxTemplate -> IntSource

Counter the number of literal tags/holes in a blackbox template

countFuns :: BlackBoxTemplate -> IntSource

Count the number of function instantiations in a blackbox template

setSym :: Int -> BlackBoxTemplate -> (BlackBoxTemplate, Int)Source

Update all the symbol references in a template, and increment the symbol counter for every newly encountered symbol.

clkSyncId :: SyncIdentifier -> IdentifierSource

Get the name of the clock of an identifier



:: BlackBoxTemplate

Blackbox template

-> BlackBoxContext

Context used to fill in the hole

-> VHDLState 
-> ((Text, [(Identifier, HWType)]), VHDLState) 

Render a blackbox given a certain context. Returns a filled out template and a list of hidden inputs that must be added to the encompassing component.

renderElem :: BlackBoxContext -> Element -> BlackBoxMonad TextSource

Render a single template element

lineToIdentifier :: BlackBoxContext -> BlackBoxTemplate -> BlackBoxMonad (SyncIdentifier, HWType)Source

Fill out the template corresponding to an output/input assignment of a component instantiation, and turn it into a single identifier so it can be used for a new blackbox context.

mkSyncIdentifier :: BlackBoxContext -> Element -> BlackBoxMonad SyncIdentifierSource

Give a context and a tagged hole (of a template), returns part of the context that matches the tag of the hole.