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 |
Create Netlists out of normalized CoreHW Terms
- genNetlist :: HashMap TmName (Type, SrcSpan, Term) -> PrimMap BlackBoxTemplate -> HashMap TyConName TyCon -> (HashMap TyConName TyCon -> Type -> Maybe (Either String HWType)) -> Maybe Int -> String -> [(String, FilePath)] -> Int -> (Identifier -> Identifier) -> [Identifier] -> TmName -> IO ([(SrcSpan, Component)], [(String, FilePath)], [Identifier])
- runNetlistMonad :: HashMap TmName (Type, SrcSpan, Term) -> PrimMap BlackBoxTemplate -> HashMap TyConName TyCon -> (HashMap TyConName TyCon -> Type -> Maybe (Either String HWType)) -> String -> [(String, FilePath)] -> Int -> (Identifier -> Identifier) -> [Identifier] -> NetlistMonad a -> IO (a, NetlistState)
- genNames :: (Identifier -> Identifier) -> String -> [Identifier] -> HashMap TmName Identifier -> [TmName] -> ([Identifier], HashMap TmName Identifier)
- genComponent :: TmName -> Maybe Int -> NetlistMonad (SrcSpan, Component)
- genComponentT :: TmName -> Term -> Maybe Int -> NetlistMonad (SrcSpan, Component)
- genComponentName :: [Identifier] -> (Identifier -> Identifier) -> String -> TmName -> Identifier
- mkDeclarations :: Id -> Term -> NetlistMonad [Declaration]
- mkFunApp :: Id -> TmName -> [Term] -> NetlistMonad [Declaration]
- toSimpleVar :: Id -> (Expr, Type) -> NetlistMonad (Expr, [Declaration])
- mkExpr :: Bool -> Either Identifier Id -> Type -> Term -> NetlistMonad (Expr, [Declaration])
- mkDcApplication :: HWType -> Either Identifier Id -> DataCon -> [Term] -> NetlistMonad (Expr, [Declaration])
Documentation
:: HashMap TmName (Type, SrcSpan, Term) | Global binders |
-> PrimMap BlackBoxTemplate | Primitive definitions |
-> HashMap TyConName TyCon | TyCon cache |
-> (HashMap TyConName TyCon -> Type -> Maybe (Either String HWType)) | Hardcoded Type -> HWType translator |
-> Maybe Int | Symbol count |
-> String | Name of the module containing the |
-> [(String, FilePath)] | Set of collected data-files |
-> Int | IntWordInteger bit-width |
-> (Identifier -> Identifier) | valid identifiers |
-> [Identifier] | Seen components |
-> TmName | Name of the |
-> IO ([(SrcSpan, Component)], [(String, FilePath)], [Identifier]) |
Generate a hierarchical netlist out of a set of global binders with
topEntity
at the top.
:: HashMap TmName (Type, SrcSpan, Term) | Global binders |
-> PrimMap BlackBoxTemplate | Primitive Definitions |
-> HashMap TyConName TyCon | TyCon cache |
-> (HashMap TyConName TyCon -> Type -> Maybe (Either String HWType)) | Hardcode Type -> HWType translator |
-> String | Name of the module containing the |
-> [(String, FilePath)] | Set of collected data-files |
-> Int | IntWordInteger bit-width |
-> (Identifier -> Identifier) | valid identifiers |
-> [Identifier] | Seen components |
-> NetlistMonad a | Action to run |
-> IO (a, NetlistState) |
Run a NetlistMonad action in a given environment
genNames :: (Identifier -> Identifier) -> String -> [Identifier] -> HashMap TmName Identifier -> [TmName] -> ([Identifier], HashMap TmName Identifier) Source
:: TmName | Name of the function |
-> Maybe Int | Starting value of the unique counter |
-> NetlistMonad (SrcSpan, Component) |
Generate a component for a given function (caching)
:: TmName | Name of the function |
-> Term | Corresponding term |
-> Maybe Int | Starting value of the unique counter |
-> NetlistMonad (SrcSpan, Component) |
Generate a component for a given function
genComponentName :: [Identifier] -> (Identifier -> Identifier) -> String -> TmName -> Identifier Source
:: Id | LHS of the let-binder |
-> Term | RHS of the let-binder |
-> NetlistMonad [Declaration] |
Generate a list of Declarations for a let-binder
:: Id | LHS of the let-binder |
-> TmName | Name of the applied function |
-> [Term] | Function arguments |
-> NetlistMonad [Declaration] |
Generate a list of Declarations for a let-binder where the RHS is a function application
toSimpleVar :: Id -> (Expr, Type) -> NetlistMonad (Expr, [Declaration]) Source
:: Bool | Treat BlackBox expression as declaration |
-> Either Identifier Id | Id to assign the result to |
-> Type | Type of the LHS of the let-binder |
-> Term | Term to convert to an expression |
-> NetlistMonad (Expr, [Declaration]) | Returned expression and a list of generate BlackBox declarations |
Generate an expression for a term occurring on the RHS of a let-binder
:: HWType | HWType of the LHS of the let-binder |
-> Either Identifier Id | Id to assign the result to |
-> DataCon | Applied DataCon |
-> [Term] | DataCon Arguments |
-> NetlistMonad (Expr, [Declaration]) | Returned expression and a list of generate BlackBox declarations |
Generate an expression for a DataCon application occurring on the RHS of a let-binder