clash-lib-0.99.1: 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.Util

Description

Utility functions used by the normalisation transformations

Synopsis

Documentation

alreadyInlined Source #

Arguments

:: TmOccName

Function we want to inline

-> TmOccName

Function in which we want to perform the inlining

-> NormalizeMonad (Maybe Int) 

Determine if a function is already inlined in the context of the NetlistMonad

addNewInline Source #

Arguments

:: TmOccName

Function we want to inline

-> TmOccName

Function in which we want to perform the inlining

-> NormalizeMonad () 

specializeNorm :: NormRewrite Source #

Specialize under the Normalization Monad

isClosed :: Fresh m => HashMap TyConOccName TyCon -> Term -> m Bool Source #

Determine if a term is closed

isConstant :: Term -> Bool Source #

Determine if a term represents a constant

isRecursiveBndr :: TmOccName -> NormalizeSession Bool Source #

Assert whether a name is a reference to a recursive binder.

type CallGraph = HashMap TmOccName (HashMap TmOccName Word) Source #

A call graph counts the number of occurrences that a functions g is used in f.

callGraph :: BindingMap -> TmOccName -> CallGraph Source #

Create a call graph for a set of global binders, given a root

classifyFunction :: Term -> TermClassification Source #

Give a "performance/size" classification of a function in normal form.

isCheapFunction :: Term -> Bool Source #

Determine whether a function adds a lot of hardware or not.

It is considered expensive when it has 2 or more of the following components:

  • functions
  • primitives
  • selections (multiplexers)