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

Safe HaskellNone

CLaSH.Normalize

Description

Turn CoreHW terms into normalized CoreHW Terms

Synopsis

Documentation

runNormalizationSource

Arguments

:: DebugLevel

Level of debug messages to print

-> Supply

UniqueSupply

-> HashMap TmName (Type, Term)

Global Binders

-> (Type -> Maybe (Either String HWType))

Hardcoded Type -> HWType translator

-> NormalizeSession a

NormalizeSession to run

-> a 

Run a NormalizeSession in a given environment

normalize :: [TmName] -> NormalizeSession [(TmName, (Type, Term))]Source

Normalize a list of global binders

rewriteExprSource

Arguments

:: (String, NormRewrite)

Transformation to apply

-> (String, Term)

Term to transform

-> NormalizeSession Term 

Rewrite a term according to the provided transformation

cleanupGraphSource

Arguments

:: [TmName]

Names of the functions to clean up

-> [(TmName, (Type, Term))]

Global binders

-> NormalizeSession [(TmName, (Type, Term))] 

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

  • Inlining functions that simply "wrap" another function

checkNonRecursiveSource

Arguments

:: TmName
topEntity
-> [(TmName, (Type, Term))]

List of normalized binders

-> [(TmName, (Type, 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.