ddc-core-flow-0.4.1.1: Disciplined Disciple Compiler data flow compiler.

Safe HaskellNone

DDC.Core.Flow.Procedure

Description

A Procedure is an abstract imperative loop nest. The loops are represented as a separated loop anatomy, to make it easy to incrementally build them from a data flow graph expressed as a Process.

Synopsis

Documentation

data Procedure Source

An imperative procedure made up of some loops.

data Context Source

Constructors

ContextRate

A top-level context associated with a rate that is a parameter of the process. This context isn't created by the process itself.

Fields

contextRate :: Type Name
 
ContextSelect

A nested context created by a mkSel1# function.

ContextSegment

A nested context created by a mkSegd# function.

Instances

data StmtStart Source

Statements that can appear at the start of a loop. These initialise accumulators.

Constructors

StartStmt

Evaluate a pure expression

StartVecNew

Allocate a new vector.

StartAcc

Inititlise a new accumulator.

Instances

data StmtBody Source

Statements that appear in the body of a loop.

Constructors

BodyStmt

Evaluate a pure expression.

Fields

bodyResultBind :: Bind Name

Bind for the result

bodyExpression :: Exp () Name

Expression to evaluate

BodyVecWrite

Write to a vector.

Fields

bodyVecName :: Name

Name of the vector.

bodyVecWriteElemType :: Type Name

Type of the element.

bodyVecWriteIx :: Exp () Name

Expression for the index to write to.

bodyVecWriteVal :: Exp () Name

Expression for the value to write.

BodyAccRead

Read from an accumulator.

Fields

bodyAccName :: Name

Name of the accumulator.

Name of the accumulator.

bodyAccType :: Type Name

Type of the accumulator.

Type of the accumulator.

bodyAccNameBind :: Bind Name

Binder for the read value.

BodyAccWrite

Body of an accumulation operation. Writes to the accumulator.

Fields

bodyAccName :: Name

Name of the accumulator.

Name of the accumulator.

bodyAccType :: Type Name

Type of the accumulator.

Type of the accumulator.

bodyAccExp :: Exp () Name

Expression to update the accumulator.

Instances

data StmtEnd Source

Statements that appear after a loop to cleanup.

Constructors

EndStmt

Generic ending statements.

Fields

endBind :: Bind Name
 
endExp :: Exp () Name
 
EndAcc

Read the result of an accumulator.

EndVecTrunc

Destructively truncate a vector to its final size.

Instances