Copyright | (C) 2012-2016, University of Twente |
---|---|
License | BSD2 (see the file LICENSE) |
Maintainer | Christiaan Baaij <christiaan.baaij@gmail.com> |
Safe Haskell | None |
Language | Haskell2010 |
Utilties to verify blackbox contexts against templates and rendering filled in templates
- verifyBlackBoxContext :: BlackBoxContext -> BlackBoxTemplate -> Bool
- extractLiterals :: BlackBoxContext -> [Expr]
- setSym :: BlackBoxTemplate -> NetlistMonad BlackBoxTemplate
- setCompName :: Identifier -> BlackBoxTemplate -> BlackBoxTemplate
- setClocks :: (MonadWriter (Set (Identifier, HWType)) m, Applicative m) => BlackBoxContext -> BlackBoxTemplate -> m BlackBoxTemplate
- findAndSetDataFiles :: BlackBoxContext -> [(String, FilePath)] -> BlackBoxTemplate -> ([(String, FilePath)], BlackBoxTemplate)
- renderFilePath :: [(String, FilePath)] -> String -> ([(String, FilePath)], Element)
- clkSyncId :: SyncExpr -> (Identifier, Integer)
- renderBlackBox :: Backend backend => BlackBoxTemplate -> BlackBoxContext -> State backend Text
- renderElem :: Backend backend => BlackBoxContext -> Element -> State backend Text
- parseFail :: Text -> BlackBoxTemplate
- syncIdToSyncExpr :: (Text, HWType) -> (SyncExpr, HWType, Bool)
- lineToIdentifier :: Backend backend => BlackBoxContext -> BlackBoxTemplate -> State backend Text
- lineToType :: BlackBoxContext -> BlackBoxTemplate -> HWType
- renderTag :: Backend backend => BlackBoxContext -> Element -> State backend Text
- prettyBlackBox :: Monad m => BlackBoxTemplate -> m Text
- prettyElem :: Monad m => Element -> m Text
- usedArguments :: BlackBoxTemplate -> [Int]
Documentation
verifyBlackBoxContext Source #
:: 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.
extractLiterals :: BlackBoxContext -> [Expr] Source #
setSym :: BlackBoxTemplate -> NetlistMonad BlackBoxTemplate Source #
Update all the symbol references in a template, and increment the symbol counter for every newly encountered symbol.
setClocks :: (MonadWriter (Set (Identifier, HWType)) m, Applicative m) => BlackBoxContext -> BlackBoxTemplate -> m BlackBoxTemplate Source #
findAndSetDataFiles :: BlackBoxContext -> [(String, FilePath)] -> BlackBoxTemplate -> ([(String, FilePath)], BlackBoxTemplate) Source #
:: 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
parseFail :: Text -> BlackBoxTemplate Source #
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.
lineToType :: BlackBoxContext -> BlackBoxTemplate -> HWType Source #
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.
prettyBlackBox :: Monad m => BlackBoxTemplate -> m Text Source #
usedArguments :: BlackBoxTemplate -> [Int] Source #