clash-lib-0.6.21: 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.Normalize

Description

Turn CoreHW terms into normalized CoreHW Terms

Synopsis

Documentation

runNormalization Source #

Arguments

:: CLaSHOpts

Level of debug messages to print

-> Supply

UniqueSupply

-> HashMap TmName (Type, SrcSpan, Term)

Global Binders

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

Hardcoded Type -> HWType translator

-> HashMap TyConName TyCon

TyCon cache

-> IntMap TyConName

Tuple TyCon cache

-> (HashMap TyConName TyCon -> Bool -> Term -> Term)

Hardcoded evaluator (delta-reduction)

-> PrimMap BlackBoxTemplate

Primitive Definitions

-> HashMap TmName Bool

Map telling whether a components is part of a recursive group

-> NormalizeSession a

NormalizeSession to run

-> a 

Run a NormalizeSession in a given environment

rewriteExpr Source #

Arguments

:: (String, NormRewrite)

Transformation to apply

-> (String, Term)

Term to transform

-> NormalizeSession Term 

Rewrite a term according to the provided transformation

checkNonRecursive Source #

Arguments

:: TmName
topEntity
-> HashMap TmName (Type, SrcSpan, Term)

List of normalized binders

-> HashMap TmName (Type, SrcSpan, Term) 

Check if the call graph (second argument), starting at the topEnity (first argument) is non-recursive. Returns the list of normalized terms if call graph is indeed non-recursive, errors otherwise.

cleanupGraph :: TmName -> HashMap TmName (Type, SrcSpan, Term) -> NormalizeSession (HashMap TmName (Type, SrcSpan, Term)) Source #

Perform general "clean up" of the normalized (non-recursive) function hierarchy. This includes:

  • Inlining functions that simply "wrap" another function

mkCallTree Source #

Arguments

:: [TmName]

Visited

-> HashMap TmName (Type, SrcSpan, Term)

Global binders

-> TmName

Root of the call graph

-> CallTree