Copyright | (C) 2012-2016 University of Twente 2016-2017 Myrtle Software Ltd 2017 Google Inc. |
---|---|
License | BSD2 (see the file LICENSE) |
Maintainer | Christiaan Baaij <christiaan.baaij@gmail.com> |
Safe Haskell | None |
Language | Haskell2010 |
Functions to create BlackBox Contexts and fill in BlackBox templates
Synopsis
- warn :: ClashOpts -> String -> IO ()
- mkBlackBoxContext :: Text -> Id -> [Term] -> NetlistMonad (BlackBoxContext, [Declaration])
- prepareBlackBox :: Text -> BlackBox -> BlackBoxContext -> NetlistMonad (BlackBox, [Declaration])
- isLiteral :: Term -> Bool
- mkArgument :: Identifier -> Term -> NetlistMonad ((Expr, HWType, Bool), [Declaration])
- extractPrimWarnOrFail :: Text -> NetlistMonad CompiledPrimitive
- mkPrimitive :: Bool -> Bool -> Either Identifier Id -> Text -> [Either Term Type] -> Type -> [Declaration] -> NetlistMonad (Expr, [Declaration])
- mkFunInput :: HasCallStack => Id -> Term -> NetlistMonad ((Either BlackBox (Identifier, [Declaration]), WireOrReg, [BlackBoxTemplate], [BlackBoxTemplate], [((Text, Text), BlackBox)], BlackBoxContext), [Declaration])
Documentation
:: Text | Blackbox function name |
-> Id | Identifier binding the primitive/blackbox application |
-> [Term] | Arguments of the primitive/blackbox application |
-> NetlistMonad (BlackBoxContext, [Declaration]) |
Generate the context for a BlackBox instantiation.
prepareBlackBox :: Text -> BlackBox -> BlackBoxContext -> NetlistMonad (BlackBox, [Declaration]) Source #
:: Identifier | LHS of the original let-binder |
-> Term | |
-> NetlistMonad ((Expr, HWType, Bool), [Declaration]) |
extractPrimWarnOrFail Source #
:: Text | Name of primitive |
-> NetlistMonad CompiledPrimitive |
Extract a compiled primitive from a guarded primitive. Emit a warning if the guard wants to, or fail entirely.
:: Bool | Put BlackBox expression in parenthesis |
-> Bool | Treat BlackBox expression as declaration |
-> Either Identifier Id | Id to assign the result to |
-> Text | Name of primitive |
-> [Either Term Type] | Arguments |
-> Type | Result type |
-> [Declaration] | Tick declarations |
-> NetlistMonad (Expr, [Declaration]) |
:: HasCallStack | |
=> Id | Identifier binding the encompassing primitive/blackbox application |
-> Term | The function argument term |
-> NetlistMonad ((Either BlackBox (Identifier, [Declaration]), WireOrReg, [BlackBoxTemplate], [BlackBoxTemplate], [((Text, Text), BlackBox)], BlackBoxContext), [Declaration]) |
Create an template instantiation text and a partial blackbox content for an argument term, given that the term is a function. Errors if the term is not a function