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

Copyright(C) 2012-2016, University of Twente
LicenseBSD2 (see the file LICENSE)
MaintainerChristiaan Baaij <christiaan.baaij@gmail.com>
Safe HaskellNone
LanguageHaskell2010

CLaSH.Netlist.BlackBox.Util

Description

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

Synopsis

Documentation

verifyBlackBoxContext Source

Arguments

:: BlackBoxContext

Blackbox to verify

-> BlackBoxTemplate

Template to check against

-> 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.

setSym :: BlackBoxTemplate -> NetlistMonad BlackBoxTemplate Source

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

clkSyncId :: SyncExpr -> (Identifier, Int) Source

Get the name of the clock of an identifier

renderBlackBox Source

Arguments

:: Backend backend 
=> BlackBoxTemplate

Blackbox template

-> BlackBoxContext

Context used to fill in the hole

-> State backend Text 

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 :: Backend backend => BlackBoxContext -> Element -> State backend Text Source

Render a single template element

lineToIdentifier :: Backend backend => BlackBoxContext -> BlackBoxTemplate -> State backend Text 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.

renderTag :: Backend backend => BlackBoxContext -> Element -> State backend Text Source

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