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

Copyright (C) 2012-2016 University of Twente BSD2 (see the file LICENSE) Christiaan Baaij None Haskell2010

Clash.Normalize.Util

Description

Utility functions used by the normalisation transformations

Synopsis

# Documentation

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

Arguments

 :: TmOccName Function we want to inline -> TmOccName Function in which we want to perform the inlining -> NormalizeMonad ()

Specialize under the Normalization Monad

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

Determine if a term is closed

Determine if a term represents a constant

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.

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

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

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)