# 'emithls' Dialect
The `emithls` dialect groups together a set of types, operations and
transformations that are useful to represent a High-Level Synthese
style C++ code.
These abstractions works as a.
[TOC]
## Operations
### `emithls.arith.add` (emithls::ArithAddOp)
Syntax:
```
operation ::= `emithls.arith.add` $lhs `,` $rhs attr-dict `:` type($result)
```
Traits: `AlwaysSpeculatableImplTrait`, `SameOperandsAndResultType`
Interfaces: `ConditionallySpeculatable`, `InferTypeOpInterface`, `NoMemoryEffect (MemoryEffectOpInterface)`
Effects: `MemoryEffects::Effect{}`
#### Operands:
| Operand | Description |
| :-----: | ----------- |
| `lhs` | any non-token type |
| `rhs` | any non-token type |
#### Results:
| Result | Description |
| :----: | ----------- |
| `result` | any non-token type |
### `emithls.arith.and` (emithls::ArithAndOp)
Syntax:
```
operation ::= `emithls.arith.and` $lhs `,` $rhs attr-dict `:` type($result)
```
Traits: `AlwaysSpeculatableImplTrait`, `SameOperandsAndResultType`
Interfaces: `ConditionallySpeculatable`, `InferTypeOpInterface`, `NoMemoryEffect (MemoryEffectOpInterface)`
Effects: `MemoryEffects::Effect{}`
#### Operands:
| Operand | Description |
| :-----: | ----------- |
| `lhs` | any non-token type |
| `rhs` | any non-token type |
#### Results:
| Result | Description |
| :----: | ----------- |
| `result` | any non-token type |
### `emithls.arith.cast` (emithls::ArithCastOp)
_Arithmetic type cast operation._
Syntax:
```
operation ::= `emithls.arith.cast` $from attr-dict `:` type($from) `to` type($to)
```
Traits: `AlwaysSpeculatableImplTrait`, `SameOperandsAndResultShape`
Interfaces: `ConditionallySpeculatable`, `NoMemoryEffect (MemoryEffectOpInterface)`
Effects: `MemoryEffects::Effect{}`
#### Operands:
| Operand | Description |
| :-----: | ----------- |
| `from` | any non-token type |
#### Results:
| Result | Description |
| :----: | ----------- |
| `to` | any non-token type |
### `emithls.arith.cmp` (emithls::ArithCmpOp)
_Arithmetic comparison with predicate._
Syntax:
```
operation ::= `emithls.arith.cmp` $predicate `,` $lhs `,` $rhs attr-dict `:` type($lhs)
```
Traits: `AlwaysSpeculatableImplTrait`, `SameTypeOperands`
Interfaces: `ConditionallySpeculatable`, `InferTypeOpInterface`, `NoMemoryEffect (MemoryEffectOpInterface)`
Effects: `MemoryEffects::Effect{}`
#### Attributes:
| Attribute | MLIR Type | Description |
predicate | ::mlir::emithls::CmpPredicateAttr | predicate for comparison operation |
#### Operands:
| Operand | Description |
| :-----: | ----------- |
| `lhs` | any non-token type |
| `rhs` | any non-token type |
#### Results:
| Result | Description |
| :----: | ----------- |
| `result` | 1-bit signless integer |
### `emithls.arith.data_range` (emithls::ArithDataRangeOp)
Traits: `AlwaysSpeculatableImplTrait`
Interfaces: `ConditionallySpeculatable`, `NoMemoryEffect (MemoryEffectOpInterface)`
Effects: `MemoryEffects::Effect{}`
#### Operands:
| Operand | Description |
| :-----: | ----------- |
| `data` | any non-token type |
| `high_bit` | index |
| `low_bit` | index |
#### Results:
| Result | Description |
| :----: | ----------- |
| `result` | any non-token type |
### `emithls.arith.div` (emithls::ArithDivOp)
Syntax:
```
operation ::= `emithls.arith.div` $lhs `,` $rhs attr-dict `:` type($result)
```
Traits: `AlwaysSpeculatableImplTrait`, `SameOperandsAndResultType`
Interfaces: `ConditionallySpeculatable`, `InferTypeOpInterface`, `NoMemoryEffect (MemoryEffectOpInterface)`
Effects: `MemoryEffects::Effect{}`
#### Operands:
| Operand | Description |
| :-----: | ----------- |
| `lhs` | any non-token type |
| `rhs` | any non-token type |
#### Results:
| Result | Description |
| :----: | ----------- |
| `result` | any non-token type |
### `emithls.arith.fused` (emithls::ArithFusedOp)
_Defines C/C++ style fused assignment._
Syntax:
```
operation ::= `emithls.arith.fused` $op_code `,` $acc `,` $val attr-dict `:` type($acc)
```
Traits: `SameTypeOperands`
Interfaces: `MemoryEffectsOpInterface`
#### Attributes:
| Attribute | MLIR Type | Description |
op_code | ::mlir::emithls::FusedOperatorAttr | fused operator such as `+=` |
#### Operands:
| Operand | Description |
| :-----: | ----------- |
| `acc` | any non-token type |
| `val` | any non-token type |
### `emithls.arith.logical_and` (emithls::ArithLogicalAndOp)
Syntax:
```
operation ::= `emithls.arith.logical_and` $values attr-dict `:` type($result)
```
Traits: `AlwaysSpeculatableImplTrait`, `SameOperandsAndResultType`
Interfaces: `ConditionallySpeculatable`, `NoMemoryEffect (MemoryEffectOpInterface)`
Effects: `MemoryEffects::Effect{}`
#### Operands:
| Operand | Description |
| :-----: | ----------- |
| `values` | variadic of 1-bit signless integer |
#### Results:
| Result | Description |
| :----: | ----------- |
| `result` | 1-bit signless integer |
### `emithls.arith.logical_or` (emithls::ArithLogicalOrOp)
Syntax:
```
operation ::= `emithls.arith.logical_or` $values attr-dict `:` type($result)
```
Traits: `AlwaysSpeculatableImplTrait`, `SameOperandsAndResultType`
Interfaces: `ConditionallySpeculatable`, `NoMemoryEffect (MemoryEffectOpInterface)`
Effects: `MemoryEffects::Effect{}`
#### Operands:
| Operand | Description |
| :-----: | ----------- |
| `values` | variadic of 1-bit signless integer |
#### Results:
| Result | Description |
| :----: | ----------- |
| `result` | 1-bit signless integer |
### `emithls.arith.max` (emithls::ArithMaxOp)
Syntax:
```
operation ::= `emithls.arith.max` $lhs `,` $rhs attr-dict `:` type($result)
```
Traits: `AlwaysSpeculatableImplTrait`, `SameOperandsAndResultType`
Interfaces: `ConditionallySpeculatable`, `InferTypeOpInterface`, `NoMemoryEffect (MemoryEffectOpInterface)`
Effects: `MemoryEffects::Effect{}`
#### Operands:
| Operand | Description |
| :-----: | ----------- |
| `lhs` | any non-token type |
| `rhs` | any non-token type |
#### Results:
| Result | Description |
| :----: | ----------- |
| `result` | any non-token type |
### `emithls.arith.min` (emithls::ArithMinOp)
Syntax:
```
operation ::= `emithls.arith.min` $lhs `,` $rhs attr-dict `:` type($result)
```
Traits: `AlwaysSpeculatableImplTrait`, `SameOperandsAndResultType`
Interfaces: `ConditionallySpeculatable`, `InferTypeOpInterface`, `NoMemoryEffect (MemoryEffectOpInterface)`
Effects: `MemoryEffects::Effect{}`
#### Operands:
| Operand | Description |
| :-----: | ----------- |
| `lhs` | any non-token type |
| `rhs` | any non-token type |
#### Results:
| Result | Description |
| :----: | ----------- |
| `result` | any non-token type |
### `emithls.arith.mul` (emithls::ArithMulOp)
Syntax:
```
operation ::= `emithls.arith.mul` $lhs `,` $rhs attr-dict `:` type($result)
```
Traits: `AlwaysSpeculatableImplTrait`, `SameOperandsAndResultType`
Interfaces: `ConditionallySpeculatable`, `InferTypeOpInterface`, `NoMemoryEffect (MemoryEffectOpInterface)`
Effects: `MemoryEffects::Effect{}`
#### Operands:
| Operand | Description |
| :-----: | ----------- |
| `lhs` | any non-token type |
| `rhs` | any non-token type |
#### Results:
| Result | Description |
| :----: | ----------- |
| `result` | any non-token type |
### `emithls.arith.or` (emithls::ArithOrOp)
Syntax:
```
operation ::= `emithls.arith.or` $lhs `,` $rhs attr-dict `:` type($result)
```
Traits: `AlwaysSpeculatableImplTrait`, `SameOperandsAndResultType`
Interfaces: `ConditionallySpeculatable`, `InferTypeOpInterface`, `NoMemoryEffect (MemoryEffectOpInterface)`
Effects: `MemoryEffects::Effect{}`
#### Operands:
| Operand | Description |
| :-----: | ----------- |
| `lhs` | any non-token type |
| `rhs` | any non-token type |
#### Results:
| Result | Description |
| :----: | ----------- |
| `result` | any non-token type |
### `emithls.arith.rem` (emithls::ArithRemOp)
Syntax:
```
operation ::= `emithls.arith.rem` $lhs `,` $rhs attr-dict `:` type($result)
```
Traits: `AlwaysSpeculatableImplTrait`, `SameOperandsAndResultType`
Interfaces: `ConditionallySpeculatable`, `InferTypeOpInterface`, `NoMemoryEffect (MemoryEffectOpInterface)`
Effects: `MemoryEffects::Effect{}`
#### Operands:
| Operand | Description |
| :-----: | ----------- |
| `lhs` | any non-token type |
| `rhs` | any non-token type |
#### Results:
| Result | Description |
| :----: | ----------- |
| `result` | any non-token type |
### `emithls.arith.select` (emithls::ArithSelectOp)
Syntax:
```
operation ::= `emithls.arith.select` $condition `,` $true_value `,` $false_value attr-dict `:` type($result)
```
Traits: `AlwaysSpeculatableImplTrait`
Interfaces: `ConditionallySpeculatable`, `InferTypeOpInterface`, `NoMemoryEffect (MemoryEffectOpInterface)`
Effects: `MemoryEffects::Effect{}`
#### Operands:
| Operand | Description |
| :-----: | ----------- |
| `condition` | 1-bit signless integer |
| `true_value` | any non-token type |
| `false_value` | any non-token type |
#### Results:
| Result | Description |
| :----: | ----------- |
| `result` | any non-token type |
### `emithls.arith.shl` (emithls::ArithShlOp)
Syntax:
```
operation ::= `emithls.arith.shl` $lhs `,` $rhs attr-dict `:` type($result)
```
Traits: `AlwaysSpeculatableImplTrait`, `SameOperandsAndResultType`
Interfaces: `ConditionallySpeculatable`, `InferTypeOpInterface`, `NoMemoryEffect (MemoryEffectOpInterface)`
Effects: `MemoryEffects::Effect{}`
#### Operands:
| Operand | Description |
| :-----: | ----------- |
| `lhs` | any non-token type |
| `rhs` | any non-token type |
#### Results:
| Result | Description |
| :----: | ----------- |
| `result` | any non-token type |
### `emithls.arith.shr` (emithls::ArithShrOp)
Syntax:
```
operation ::= `emithls.arith.shr` $lhs `,` $rhs attr-dict `:` type($result)
```
Traits: `AlwaysSpeculatableImplTrait`, `SameOperandsAndResultType`
Interfaces: `ConditionallySpeculatable`, `InferTypeOpInterface`, `NoMemoryEffect (MemoryEffectOpInterface)`
Effects: `MemoryEffects::Effect{}`
#### Operands:
| Operand | Description |
| :-----: | ----------- |
| `lhs` | any non-token type |
| `rhs` | any non-token type |
#### Results:
| Result | Description |
| :----: | ----------- |
| `result` | any non-token type |
### `emithls.arith.sub` (emithls::ArithSubOp)
Syntax:
```
operation ::= `emithls.arith.sub` $lhs `,` $rhs attr-dict `:` type($result)
```
Traits: `AlwaysSpeculatableImplTrait`, `SameOperandsAndResultType`
Interfaces: `ConditionallySpeculatable`, `InferTypeOpInterface`, `NoMemoryEffect (MemoryEffectOpInterface)`
Effects: `MemoryEffects::Effect{}`
#### Operands:
| Operand | Description |
| :-----: | ----------- |
| `lhs` | any non-token type |
| `rhs` | any non-token type |
#### Results:
| Result | Description |
| :----: | ----------- |
| `result` | any non-token type |
### `emithls.array.ptr_read` (emithls::ArrayPointerReadOp)
_Reads a value from an pointer_
Syntax:
```
operation ::= `emithls.array.ptr_read` $pointer `[` $indices `]` attr-dict `:` qualified(type($pointer)) `->` type($result)
```
Interfaces: `InferTypeOpInterface`, `MemoryEffectsOpInterface`
#### Operands:
| Operand | Description |
| :-----: | ----------- |
| `pointer` | Pointer type in HLS C++ |
| `indices` | variadic of index |
#### Results:
| Result | Description |
| :----: | ----------- |
| `result` | any non-token type |
### `emithls.array.ptr_write` (emithls::ArrayPointerWriteOp)
_Writes a value into an array_
Syntax:
```
operation ::= `emithls.array.ptr_write` $value `,` $pointer `[` $indices `]` attr-dict `:` type($value) `->` qualified(type($pointer))
```
Interfaces: `MemoryEffectsOpInterface`
#### Operands:
| Operand | Description |
| :-----: | ----------- |
| `value` | any non-token type |
| `pointer` | Pointer type in HLS C++ |
| `indices` | variadic of index |
### `emithls.array.read` (emithls::ArrayReadOp)
_Reads a value from an array_
Syntax:
```
operation ::= `emithls.array.read` $array `[` $indices `]` attr-dict `:` qualified(type($array)) `->` type($result)
```
Interfaces: `InferTypeOpInterface`, `MemoryEffectsOpInterface`
#### Operands:
| Operand | Description |
| :-----: | ----------- |
| `array` | Array type in C++ |
| `indices` | variadic of index |
#### Results:
| Result | Description |
| :----: | ----------- |
| `result` | any non-token type |
### `emithls.array.write` (emithls::ArrayWriteOp)
_Writes a value into an array_
Syntax:
```
operation ::= `emithls.array.write` $value `,` $array `[` $indices `]` attr-dict `:` type($value) `->` qualified(type($array))
```
Interfaces: `MemoryEffectsOpInterface`
#### Operands:
| Operand | Description |
| :-----: | ----------- |
| `value` | any non-token type |
| `array` | Array type in C++ |
| `indices` | variadic of index |
### `emithls.call` (emithls::CallOp)
_Defines a function call._
Syntax:
```
operation ::= `emithls.call` $callee `(` $operands `)` attr-dict `:` functional-type($operands, results)
```
Interfaces: `ArgAndResultAttrsOpInterface`, `CallOpInterface`
#### Attributes:
| Attribute | MLIR Type | Description |
callee | ::mlir::FlatSymbolRefAttr | flat symbol reference attribute |
arg_attrs | ::mlir::ArrayAttr | Array of dictionary attributes |
res_attrs | ::mlir::ArrayAttr | Array of dictionary attributes |
#### Operands:
| Operand | Description |
| :-----: | ----------- |
| `operands` | variadic of any non-token type |
#### Results:
| Result | Description |
| :----: | ----------- |
| «unnamed» | variadic of any non-token type |
### `emithls.expr` (emithls::ExpressionOp)
_Represents a combined C/C++ expression._
Syntax:
```
operation ::= `emithls.expr` attr-dict `:` type($result) $body
```
The `expression` operation defines a set of operations that together
form a C/C++ style complex expression, such as:
`int var = (a + b) * c;`.
This operation returns one value with a scalar type, which is yielded
from the region using `YieldOp`.
Nested expressions are also allowed.
Example:
```
// Assume %lhs, %rhs, %cst are i32 values
%expr = emithls.expr : i32 {
%0 = arith.addi %lhs, %cst : i32
%1 = arith.muli %0, %rhs : i32
emithls.yield %1 : i32
}
```
Traits: `NoRegionArguments`, `SingleBlockImplicitTerminator`, `SingleBlock`
Interfaces: `OpAsmOpInterface`
#### Results:
| Result | Description |
| :----: | ----------- |
| `result` | any non-token type |
### `emithls.for` (emithls::ForOp)
_Defines a C/C++ for loop._
The `for` operation defines a counted loop with compile-time constant
lower bound, upper bound, and step, mapping to a C/C++ `for` loop.
The loop body receives the current induction variable as a block
argument and iterates from `lowerBound` to `upperBound` (exclusive)
in increments of `step`.
Example:
```
emithls.for %idx0 = 0 to 10 step 1 {
ops using %idx0 ...
}
```
Traits: `NoTerminator`, `RecursiveMemoryEffects`
Interfaces: `OpAsmOpInterface`
#### Attributes:
| Attribute | MLIR Type | Description |
lowerBound | ::mlir::IntegerAttr | index attribute |
upperBound | ::mlir::IntegerAttr | index attribute |
step | ::mlir::IntegerAttr | index attribute |
### `emithls.func` (emithls::FuncOp)
_Defines a C/C++ function with a void return type._
The `func` operation defines a C/C++ function with a void return type,
serving as the node and top-level function unit for HLS code generation.
The function is identified by its symbol name and is isolated from
above, meaning it cannot reference values defined outside its scope.
Function arguments are accessible via the entry block of the body region.
Example:
```
emithls.func @my_func(%arg0: type, %arg1: type, ...) {
ops...
}
```
Traits: `AutomaticAllocationScope`, `IsolatedFromAbove`, `NoTerminator`
Interfaces: `ArgAndResultAttrsOpInterface`, `CallableOpInterface`, `FunctionOpInterface`, `Symbol`
#### Attributes:
| Attribute | MLIR Type | Description |
sym_name | ::mlir::StringAttr | string attribute |
function_type | ::mlir::TypeAttr | type attribute of function type |
arg_attrs | ::mlir::ArrayAttr | Array of dictionary attributes |
res_attrs | ::mlir::ArrayAttr | Array of dictionary attributes |
### `emithls.helper.accumulate` (emithls::HelperAccumulateOp)
_Helper to mark the accumulate axis in the computation._
Traits: `HasParent`
#### Attributes:
| Attribute | MLIR Type | Description |
op_code | ::mlir::emithls::FusedOperatorAttr | fused operator such as `+=` |
#### Operands:
| Operand | Description |
| :-----: | ----------- |
| `accu_ref` | memref or emithls.array type |
| `value` | any non-token type |
| `indices` | variadic of index |
### `emithls.helper.linebuf` (emithls::HelperLineBufferOp)
_Helper to store information of line buffer construction_
Traits: `HasParent`
Interfaces: `OpAsmOpInterface`
#### Attributes:
| Attribute | MLIR Type | Description |
num_chan | ::mlir::ArrayAttr | 32-bit integer array attribute |
num_line | ::mlir::IntegerAttr | 32-bit signless integer attribute |
#### Operands:
| Operand | Description |
| :-----: | ----------- |
| `token_ref` | memref or emithls.array type |
| `index` | index |
#### Results:
| Result | Description |
| :----: | ----------- |
| `buf_ref` | memref or emithls.array type |
### `emithls.helper.window` (emithls::HelperWindowOp)
_Helper to construct a compute windows from line buffer._
Traits: `HasParent`
Interfaces: `OpAsmOpInterface`
#### Operands:
| Operand | Description |
| :-----: | ----------- |
| `buf_ref` | memref or emithls.array type |
| `indices` | variadic of index |
#### Results:
| Result | Description |
| :----: | ----------- |
| `win_ref` | memref or emithls.array type |
### `emithls.if` (emithls::IfOp)
_Defines a C/C style if-statement._
The `if` operation conditionally executes one of two regions based on
an `i1` condition value, mapping to a C/C++ `if`/`else` statement.
The `then` region is always executed when the condition is true.
The optional `else` region is executed when the condition is false;
if absent, no action is taken on the false path.
Example:
```
emithls.if %cond {
ops ...
} else {
ops ...
}
```
Traits: `NoRegionArguments`, `NoTerminator`, `RecursiveMemoryEffects`
#### Operands:
| Operand | Description |
| :-----: | ----------- |
| `condition` | 1-bit signless integer |
### `emithls.include` (emithls::IncludeOp)
_C/C++ include statement_
The `include` operation abstracts the C/C++ include syntax.
However, this operation does not check the existence of the
header file.
This operation is created automatically by a transformation pass
inside this dialect.
Traits: `HasParent`
#### Attributes:
| Attribute | MLIR Type | Description |
header | ::mlir::StringAttr | string attribute |
### `emithls.pragma.array_partition` (emithls::PragmaArrayPartitionOp)
_#pragma HLS ARRAY_PARTITION variable= type= factor= dim=_
Interfaces: `EmitHLS_PragmaInterface`
#### Attributes:
| Attribute | MLIR Type | Description |
part_type | ::mlir::emithls::ArrayPartitionTypeAttr | #pragma HLS array_partition type=? |
part_factor | ::mlir::IntegerAttr | 32-bit signless integer attribute |
part_dim | ::mlir::IntegerAttr | 32-bit signless integer attribute |
#### Operands:
| Operand | Description |
| :-----: | ----------- |
| `variable` | Array type in C++ |
### `emithls.pragma.bind_storage` (emithls::PragmaBindStorageOp)
_#pragma HLS BIND_STORAGE variable= type= impl=_
Interfaces: `EmitHLS_PragmaInterface`
#### Attributes:
| Attribute | MLIR Type | Description |
storage_type | ::mlir::emithls::BindStorageTypeAttr | #pragma HLS bind_storage type=? |
storage_impl | ::mlir::emithls::BindStorageImplAttr | #pragma HLS bind_storage impl=? |
#### Operands:
| Operand | Description |
| :-----: | ----------- |
| `variable` | Array type in C++ or Stream type in HLS C++ |
### `emithls.pragma.dataflow` (emithls::PragmaDataflowOp)
_#pragma HLS DATAFLOW_
Syntax:
```
operation ::= `emithls.pragma.dataflow` $body attr-dict
```
Traits: `NoTerminator`
Interfaces: `EmitHLS_PragmaInterface`
### `emithls.pragma.inline` (emithls::PragmaInlineOp)
_#pragma HLS INLINE off_
Interfaces: `EmitHLS_PragmaInterface`
#### Attributes:
| Attribute | MLIR Type | Description |
off | ::mlir::UnitAttr | unit attribute |
### `emithls.pragma.pipeline` (emithls::PragmaPipelineOp)
_#pragma HLS PIPELINE II=_
Interfaces: `EmitHLS_PragmaInterface`
#### Attributes:
| Attribute | MLIR Type | Description |
interval | ::mlir::IntegerAttr | 32-bit signless integer attribute |
style | ::mlir::emithls::PipelineStyleAttr | ##pragma HLS HLS pipeline style=? |
### `emithls.pragma.stream` (emithls::PragmaStreamOp)
_#pragma HLS STREAM type=fifo depth=_
Interfaces: `EmitHLS_PragmaInterface`
#### Attributes:
| Attribute | MLIR Type | Description |
depth | ::mlir::IntegerAttr | 32-bit signless integer attribute |
#### Operands:
| Operand | Description |
| :-----: | ----------- |
| `variable` | Stream type in HLS C++ or Array type in C++ |
### `emithls.pragma.unroll` (emithls::PragmaUnrollOp)
_#pragma HLS UNROLL factor=_
Traits: `HasParent`
Interfaces: `EmitHLS_PragmaInterface`
#### Attributes:
| Attribute | MLIR Type | Description |
factor | ::mlir::IntegerAttr | 32-bit signless integer attribute |
### `emithls.stream.read` (emithls::StreamReadOp)
_Reads data out from hls::stream._
Syntax:
```
operation ::= `emithls.stream.read` $stream (`[` $indices^ `]`)? attr-dict `:` qualified(type($stream)) `->` type($data)
```
Interfaces: `MemoryEffectsOpInterface`
#### Operands:
| Operand | Description |
| :-----: | ----------- |
| `stream` | Stream type in HLS C++ or Array type in C++ |
| `indices` | variadic of index |
#### Results:
| Result | Description |
| :----: | ----------- |
| `data` | any non-token type |
### `emithls.stream.write` (emithls::StreamWriteOp)
_Writes data into hls::stream._
Syntax:
```
operation ::= `emithls.stream.write` $data `to` $stream (`[` $indices^ `]`)? attr-dict `:` type($data) `->` qualified(type($stream))
```
Interfaces: `MemoryEffectsOpInterface`
#### Operands:
| Operand | Description |
| :-----: | ----------- |
| `data` | any non-token type |
| `stream` | Stream type in HLS C++ or Array type in C++ |
| `indices` | variadic of index |
### `emithls.top_interface` (emithls::PragmaTopInterfaceOp)
_#pragma HLS INTERFACE for the top function_
Syntax:
```
operation ::= `emithls.top_interface` attr-dict
```
Interfaces: `EmitHLS_PragmaInterface`
### `emithls.update` (emithls::UpdateOp)
_Defines a C/C++ style assignment._
The `update` operation performs a C/C++ style assignment to an
existing variable.
This operation also supports element-wise assignment for array
types using a list of `IndexType` indices.
```
emithls.update %var with %new_value : type <- type
emithls.update %var with %arr[%indices]
: type <- !emithls.array
emithls.update %arr[%indices] with %new_value
: !emithls.array <- type
emithls.update %arr0[%indices] with %arr1[%indices]
: !emithls.array <- !emithls.array
```
Traits: `AttrSizedOperandSegments`
Interfaces: `MemoryEffectsOpInterface`
#### Operands:
| Operand | Description |
| :-----: | ----------- |
| `variable` | any non-token type |
| `indices` | variadic of index |
| `new_value` | any non-token type |
| `new_value_indices` | variadic of index |
### `emithls.variable` (emithls::VariableOp)
_Defines a C/C++ style variable._
The `variable` operation defines a C/C++ variable, which is used to
simplify the translation from `emithls` dialect to HLS code.
MLIR adopts the Single Static Assignment form, which forbids multiple
assignments to the same variable.
To solve this, the `variable` operation and an `update` operation are
defined, such as:
```
%var = emithls.variable : type
emithls.update %var, %value : type
```
A `variable` can also be defined as a constant as in C/C++.
Interfaces: `OpAsmOpInterface`
#### Attributes:
| Attribute | MLIR Type | Description |
init_number | ::mlir::Attribute | any attribute |
is_const | ::mlir::UnitAttr | unit attribute |
#### Operands:
| Operand | Description |
| :-----: | ----------- |
| `init_value` | any non-token type |
#### Results:
| Result | Description |
| :----: | ----------- |
| `variable` | any non-token type |
### `emithls.yield` (emithls::YieldOp)
_Yields the result value of an expression._
Syntax:
```
operation ::= `emithls.yield` attr-dict $value `:` type($value)
```
The `yield` operation terminates an expression block with a value,
which becomes the result of the enclosing expression.
This operation mimics a combined expression in C/C++.
Traits: `AlwaysSpeculatableImplTrait`, `HasParent`, `Terminator`
Interfaces: `ConditionallySpeculatable`, `NoMemoryEffect (MemoryEffectOpInterface)`
Effects: `MemoryEffects::Effect{}`
#### Operands:
| Operand | Description |
| :-----: | ----------- |
| `value` | any non-token type |
## Types
### ArrayType
_Array type in C++_
The `array` type represents a C++ style array, which contains
a shaped amount of variables of one scalar type, such as:
`!emithls.array<2xi32>`, `!emithls.array<2x2xi32>`
#### Parameters:
| Parameter | C++ type | Description |
| :-------: | :-------: | ----------- |
| shape | `::llvm::ArrayRef` | |
| elementType | `Type` | |
### PointerType
_Pointer type in HLS C++_
Syntax:
```
!emithls.ptr<
Type # elementType
>
```
The `pointer` type represents a C++ pointer type, which points
to the address of a value, e.g. `!emithls.ptr`.
#### Parameters:
| Parameter | C++ type | Description |
| :-------: | :-------: | ----------- |
| elementType | `Type` | |
### StreamType
_Stream type in HLS C++_
Syntax:
```
!emithls.stream<
Type # elementType
>
```
The `stream` type represents a HLS C++ hls::stream type, which
constructs an FIFO stream with element type flowing in it,
e.g. `!emithls.stream`.
#### Parameters:
| Parameter | C++ type | Description |
| :-------: | :-------: | ----------- |
| elementType | `Type` | |
## Enums
### ArrayPartitionType
_#pragma HLS array_partition type=?_
#### Cases:
| Symbol | Value | String |
| :----: | :---: | ------ |
| cyclic | `0` | cyclic |
| block | `1` | block |
| complete | `2` | complete |
### BindStorageImpl
_#pragma HLS bind_storage impl=?_
#### Cases:
| Symbol | Value | String |
| :----: | :---: | ------ |
| bram | `0` | bram |
| lutram | `1` | lutram |
| srl | `2` | srl |
### BindStorageType
_#pragma HLS bind_storage type=?_
#### Cases:
| Symbol | Value | String |
| :----: | :---: | ------ |
| fifo | `0` | fifo |
| ram_1p | `1` | ram_1p |
| ram_2p | `2` | ram_2p |
| rom_1p | `3` | rom_1p |
| rom_2p | `4` | rom_2p |
### CmpPredicate
_Predicate for comparison operation_
#### Cases:
| Symbol | Value | String |
| :----: | :---: | ------ |
| eq | `0` | eq |
| ne | `1` | ne |
| lt | `2` | lt |
| le | `3` | le |
| gt | `4` | gt |
| ge | `5` | ge |
### FusedOperator
_Fused operator such as `+=`_
#### Cases:
| Symbol | Value | String |
| :----: | :---: | ------ |
| add | `0` | add |
| sub | `1` | sub |
| mul | `2` | mul |
### PipelineStyle
_##pragma HLS HLS pipeline style=?_
#### Cases:
| Symbol | Value | String |
| :----: | :---: | ------ |
| stp | `0` | stp |
| flp | `1` | flp |
| frp | `2` | frp |