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

Safe HaskellNone
LanguageHaskell2010

CLaSH.Netlist

Description

Create Netlists out of normalized CoreHW Terms

Synopsis

Documentation

genNetlist Source

Arguments

:: Maybe VHDLState

State for the VHDLM Monad

-> Maybe Int

Starting number of the component counter

-> HashMap TmName (Type, Term)

Global binders

-> PrimMap

Primitive definitions

-> HashMap TyConName TyCon

TyCon cache

-> (HashMap TyConName TyCon -> Type -> Maybe (Either String HWType))

Hardcoded Type -> HWType translator

-> Maybe Int

Symbol count

-> TmName

Name of the topEntity

-> IO ([Component], VHDLState, Int) 

Generate a hierarchical netlist out of a set of global binders with topEntity at the top.

runNetlistMonad Source

Arguments

:: Maybe VHDLState

State for the VHDLM Monad

-> Maybe Int

Starting number of the component counter

-> HashMap TmName (Type, Term)

Global binders

-> PrimMap

Primitive Definitions

-> HashMap TyConName TyCon

TyCon cache

-> (HashMap TyConName TyCon -> Type -> Maybe (Either String HWType))

Hardcode Type -> HWType translator

-> NetlistMonad a

Action to run

-> IO (a, NetlistState) 

Run a NetlistMonad action in a given environment

genComponent Source

Arguments

:: TmName

Name of the function

-> Maybe Int

Starting value of the unique counter

-> NetlistMonad Component 

Generate a component for a given function (caching)

genComponentT Source

Arguments

:: TmName

Name of the function

-> Term

Corresponding term

-> Maybe Int

Starting value of the unique counter

-> NetlistMonad Component 

Generate a component for a given function

mkDeclarations Source

Arguments

:: Id

LHS of the let-binder

-> Term

RHS of the let-binder

-> NetlistMonad [Declaration] 

Generate a list of Declarations for a let-binder

mkFunApp Source

Arguments

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

mkExpr Source

Arguments

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

mkDcApplication Source

Arguments

:: HWType

HWType of the LHS of the let-binder

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