clash-lib-1.5.0: Clash: a functional hardware description language - As a library
Copyright(C) 2012-2016 University of Twente
2016 Myrtle Software Ltd
2017 Google Inc.
2021-2022 QBayLogic B.V.
LicenseBSD2 (see the file LICENSE)
MaintainerQBayLogic B.V. <devops@qbaylogic.com>
Safe HaskellNone
LanguageHaskell2010

Clash.Normalize

Description

Turn CoreHW terms into normalized CoreHW Terms

Synopsis

Documentation

runNormalization Source #

Arguments

:: ClashEnv 
-> Supply

UniqueSupply

-> BindingMap

Global Binders

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

Hardcoded Type -> HWType translator

-> Evaluator

Hardcoded evaluator for partial evaluation

-> Evaluator

Hardcoded evaluator for WHNF (old evaluator)

-> VarEnv Bool

Map telling whether a components is part of a recursive group

-> [Id]

topEntities

-> NormalizeSession a

NormalizeSession to run

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