clash-lib-1.4.0: Clash: a functional hardware description language - As a library
Copyright(C) 2012-2016 University of Twente
2016 Myrtle Software Ltd
2017 Google Inc.
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

-> BindingMap

Global Binders

-> (CustomReprs -> TyConMap -> Type -> State HWMap (Maybe (Either String FilteredHWType)))

Hardcoded Type -> HWType translator

-> CustomReprs 
-> TyConMap

TyCon cache

-> IntMap TyConName

Tuple TyCon cache

-> Evaluator

Hardcoded evaluator for partial evaluation

-> CompiledPrimMap

Primitive Definitions

-> VarEnv Bool

Map telling whether a components is part of a recursive group

-> [Id]

topEntities

-> NormalizeSession a

NormalizeSession to run

-> a 

Run a NormalizeSession in a given environment

checkNonRecursive Source #

Arguments

:: BindingMap

List of normalized binders

-> BindingMap 

Check whether the normalized bindings are non-recursive. Errors when one of the components is recursive.

cleanupGraph :: Id -> BindingMap -> NormalizeSession BindingMap Source #

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

  • Inlining functions that simply "wrap" another function

data CallTree Source #

A tree of identifiers and their bindings, with branches containing additional bindings which are used. See Clash.Driver.Types.Binding.

Constructors

CLeaf (Id, Binding Term) 
CBranch (Id, Binding Term) [CallTree] 

mkCallTree Source #

Arguments

:: [Id]

Visited

-> BindingMap

Global binders

-> Id

Root of the call graph

-> Maybe CallTree