# CIRCT

Circuit IR Compilers and Tools

# 'staticlogic' Dialect

## Operation definition ¶

### staticlogic.pipeline (::circt::staticlogic::PipelineOp) ¶

pipeline operation

The “staticlogic.pipeline” operation represents a statically scheduled pipeline stucture which contains several MLIR blocks. Each MLIR block is corresponding to a pipeline stage.

Interfaces: NoSideEffect (MemoryEffectOpInterface)

Effects: MemoryEffects::Effect{}

#### Operands: ¶

OperandDescription
«unnamed»any type

#### Results: ¶

ResultDescription
«unnamed»any type

### staticlogic.pipeline.register (::circt::staticlogic::PipelineRegisterOp) ¶

StaticLogic dialect pipeline register.

Syntax:

operation ::= staticlogic.pipeline.register $operands (: qualified(type($operands))^)? attr-dict


The staticlogic.pipeline.register terminates a pipeline stage and “registers” the values specified as operands. These values become the results of the stage.

Traits: HasParent<PipelineWhileOp, PipelineStageOp>, Terminator

#### Operands: ¶

OperandDescription
operandsany type

### staticlogic.pipeline.stage (::circt::staticlogic::PipelineStageOp) ¶

StaticLogic dialect pipeline stage.

Syntax:

operation ::= staticlogic.pipeline.stage start = $start (when$when^)? $body (: qualified(type($results))^)? attr-dict


This operation has a single-block region which dictates the operations that may occur concurrently.

It has a start attribute, which indicates the start cycle for this stage.

It may have an optional when predicate, which supports conditional execution for each stage. This is in addition to the condition region that controls the execution of the whole pipeline. A stage with a when predicate should only execute when the predicate is true : i1, and push a bubble through the pipeline otherwise.

It has a staticlogic.register terminator, which passes the concurrently computed values forward to the next stage.

Any stage may access iter_args. If a stage accesses an iter_arg after the stage in which it is defined, it is up to lowering passes to preserve this value until the last stage that needs it.

Other than iter_args, stages may only access SSA values dominating the pipeline or SSA values computed by a previous stage. This ensures the stages capture the coarse-grained schedule of the pipeline and how values feed forward and backward.

Traits: HasParent

#### Attributes: ¶

AttributeMLIR TypeDescription
start::mlir::IntegerAttr64-bit signed integer attribute

#### Operands: ¶

OperandDescription
when1-bit signless integer

#### Results: ¶

ResultDescription
resultsany type

### staticlogic.pipeline.terminator (::circt::staticlogic::PipelineTerminatorOp) ¶

StaticLogic dialect pipeline terminator.

Syntax:

operation ::= staticlogic.pipeline.terminator iter_args ( $iter_args ) , results ($results ) :
functional-type($iter_args,$results) attr-dict


The staticlogic.pipeline.terminator operation represents the terminator of a staticlogic.pipeline.while.

The results section accepts a variadic list of values which become the pipeline’s return values. These must be results of a stage, and their types must match the pipeline’s return types. The results need not be defined in the final stage, and it is up to lowering passes to preserve these values until the final stage is complete.

The iter_args section accepts a variadic list of values which become the next iteration’s iter_args. These may be the results of any stage, and their types must match the pipeline’s iter_args types.

Traits: AttrSizedOperandSegments, HasParent, Terminator

#### Operands: ¶

OperandDescription
iter_argsany type
resultsany type

### staticlogic.pipeline.while (::circt::staticlogic::PipelineWhileOp) ¶

StaticLogic dialect pipeline while-loop.

The staticlogic.pipeline.while operation represents a statically scheduled pipeline stucture that executes while a condition is true. For more details, see: https://llvm.discourse.group/t/rfc-representing-pipelined-loops/4171.

A pipeline captures the result of scheduling, and is not generally safe to transform, besides lowering to hardware dialects. For more discussion about relaxing this, see: https://github.com/llvm/circt/issues/2204.

This is the top-level operation representing a high-level pipeline. It is not isolated from above, but could be if this is helpful. A pipeline contains two regions: condition and stages.

The pipeline may accept an optional iter_args, similar to the SCF dialect, for representing loop-carried values like induction variables or reductions. When the pipeline starts execution, the registers indicated as iter_args by staticlogic.pipeline.terminator should be initialized to the initial values specified in the iter_args section here. The iter_args relate to the initiation interval of the loop. The maximum distance in stages between where an iter_arg is used and where that iter_arg is registered must be less than the loop’s initiation interval. For example, with II=1, each iter_arg must be used and registered in the same stage.

The single-block condition region dictates the condition under which the pipeline should execute. It has a staticlogic.register terminator, and the pipeline initiates new iterations while the registered value is true : i1. It may access SSA values dominating the pipeline, as well as iter_args, which are block arguments. The body of the block may only contain “combinational” operations, which are currently defined to be simple arithmetic, comparisons, and selects from the Standard dialect.

The single-block stages region wraps staticlogic.pipeline.stage operations. It has a staticlogic.pipeline.terminator terminator, which can both return results from the pipeline and register iter_args. Stages may access SSA values dominating the pipeline, as well as iter_args, which are block arguments.

#### Attributes: ¶

AttributeMLIR TypeDescription
II::mlir::IntegerAttr64-bit signless integer attribute
tripCount::mlir::IntegerAttr64-bit signless integer attribute

#### Operands: ¶

OperandDescription
iterArgsany type

#### Results: ¶

ResultDescription
resultsany type

### staticlogic.return (::circt::staticlogic::ReturnOp) ¶

StaticLogic dialect return.

The “staticlogic.return” operation represents a terminator of a statically scheduled module, which is similar to a standard return operation.

Traits: Terminator

#### Operands: ¶

OperandDescription
operandsany type