‘aiex’ Dialect

This is a dialect for experimental work related to AIEngine processors. The expectation is that new ideas can be developed here before migration to the more mature AIE dialect.

[TOC]

Operations

aiex.bp_dest (::xilinx::AIEX::BPDestOp)

A destination port

Syntax:

operation ::= `aiex.bp_dest` `<` $tile `,` $bundle `:` $channel `>` attr-dict

An object representing the destination of a Broad Packet. This must exist within an [AIE.bp_id] operation. See [AIE.broadcast_packet] for an example.

Traits: HasParent<BPIDOp>

Attributes:

AttributeMLIR TypeDescription
bundlexilinx::AIE::WireBundleAttr
Bundle of wiresEnum cases: * Core (`Core`) * DMA (`DMA`) * FIFO (`FIFO`) * South (`South`) * West (`West`) * North (`North`) * East (`East`) * PLIO (`PLIO`) * NOC (`NOC`) * Trace (`Trace`)
channel::mlir::IntegerAttr32-bit signless integer attribute

Operands:

Operand Description
tile index

aiex.bp_id (::xilinx::AIEX::BPIDOp)

A set of packets that share the same ID

Syntax:

operation ::= `aiex.bp_id` `(` $ID `)` regions attr-dict

A set of destination packets that share the same source and ID. This must exist within an [AIE.broadcast_packet] operation. See [AIE.broadcast_packet]for an example.

Traits: SingleBlockImplicitTerminator<AIE::EndOp>, SingleBlock

Attributes:

AttributeMLIR TypeDescription
ID::mlir::IntegerAttr8-bit signless integer attribute

aiex.broadcast_packet (::xilinx::AIEX::BroadcastPacketOp)

Combination of broadcast and packet-switch

Syntax:

operation ::= `aiex.broadcast_packet` `(` $tile `,` $bundle `:` $channel `)` regions attr-dict

An abstraction of broadcast and packet-switched flow. During place and route, it will be replaced by packet-switched flow and further replaced by MasterSets and PacketRules inside switchboxes.

Example:

  %70 = AIE.tile(7, 0)
  %73 = AIE.tile(7, 3)
  %74 = AIE.tile(7, 4)
  %63 = AIE.tile(6, 3)
  %64 = AIE.tile(6, 4)
  AIE.broadcast_packet(%70, "DMA" : 0){
    AIE.bp_id(0x0){
      AIE.bp_dest<%73, "DMA" : 0>
      AIE.bp_dest<%63, "DMA" : 0>
    }
    AIE.bp_id(0x1){
      AIE.bp_dest<%74, "DMA" : 0>
      AIE.bp_dest<%64, "DMA" : 0>
    }
  }

Traits: SingleBlockImplicitTerminator<AIE::EndOp>, SingleBlock

Attributes:

AttributeMLIR TypeDescription
bundlexilinx::AIE::WireBundleAttr
Bundle of wiresEnum cases: * Core (`Core`) * DMA (`DMA`) * FIFO (`FIFO`) * South (`South`) * West (`West`) * North (`North`) * East (`East`) * PLIO (`PLIO`) * NOC (`NOC`) * Trace (`Trace`)
channel::mlir::IntegerAttr32-bit signless integer attribute

Operands:

Operand Description
tile index

aiex.connection (::xilinx::AIEX::ConnectionOp)

A logical circuit-switched connection between cores

Syntax:

operation ::= `aiex.connection` `(` $source `,` $sourceBundle `:` $sourceChannel `,` $dest `,` $destBundle `:` $destChannel `)` attr-dict

The “aie.connection” operation represents a circuit switched connection between two endpoints, usually “aie.core” operations. During routing, this is replaced by “aie.connect” operations which represent the programmed connections inside a switchbox, along with “aie.wire” operations which represent physical connections between switchboxes and other components. Note that while “aie.flow” operations can express partial routes between tiles, this is not possible with “aie.connection” operations.

Example: %22 = aie.tile(2, 2) %c22 = aie.core(%22) %11 = aie.tile(1, 1) %c11 = aie.core(%11) aie.flow(%c22, “Core” : 0, %c11, “Core” : 1)

Attributes:

AttributeMLIR TypeDescription
sourceBundlexilinx::AIE::WireBundleAttr
Bundle of wiresEnum cases: * Core (`Core`) * DMA (`DMA`) * FIFO (`FIFO`) * South (`South`) * West (`West`) * North (`North`) * East (`East`) * PLIO (`PLIO`) * NOC (`NOC`) * Trace (`Trace`)
sourceChannel::mlir::IntegerAttr32-bit signless integer attribute
destBundlexilinx::AIE::WireBundleAttr
Bundle of wiresEnum cases: * Core (`Core`) * DMA (`DMA`) * FIFO (`FIFO`) * South (`South`) * West (`West`) * North (`North`) * East (`East`) * PLIO (`PLIO`) * NOC (`NOC`) * Trace (`Trace`)
destChannel::mlir::IntegerAttr32-bit signless integer attribute

Operands:

Operand Description
source index
dest index

aiex.getTile (::xilinx::AIEX::GetTileOp)

Get a reference to an AIE tile

Syntax:

operation ::= `aiex.getTile` `(` $col `,` $row `)` attr-dict

Return a reference to an AIE tile, given the column and the row of the tile.

Operands:

Operand Description
col index
row index

Results:

Result Description
result index

aiex.herd (::xilinx::AIEX::HerdOp)

Declare a herd which is a bundle of core organized in a rectangular shape

Syntax:

operation ::= `aiex.herd` `[` $width `]` `[` $height `]` attr-dict

This operation creates a group of AIE tiles in 2D shape.

Example: %herd0 = AIE.herd[1][1] // a single AIE tile. location unknown %herd1 = AIE.herd[4][1] // a row of four-AIE tile

The operation can be used in replacement of a TileOp – in case we want to select a group of hardware entities (cores, mems, switchboxes) instead of individual entity, and we don’t want to specify their locations just yet. This can be useful if we want to generate parameterizable code (the column and row values are parameterized).

Example:

%herd = AIE.herd[2][2] // a herd of 2x2 AIE tiles

AIE.core(%herd) { // all the cores belong to this herd runs the same code }

Attributes:

AttributeMLIR TypeDescription
width::mlir::IntegerAttr32-bit signless integer attribute
height::mlir::IntegerAttr32-bit signless integer attribute

Results:

Result Description
«unnamed» index

aiex.ipu.dma_memcpy_nd (::xilinx::AIEX::IpuDmaMemcpyNdOp)

Half dma operator

Syntax:

operation ::= `aiex.ipu.dma_memcpy_nd` `(` $x `,` $y `,` $memref ``
              custom<DynamicIndexList>($offsets, $static_offsets) ``
              custom<DynamicIndexList>($sizes, $static_sizes) ``
              custom<DynamicIndexList>($strides, $static_strides) `)`
              attr-dict `:` type($memref)

An nd half dma operator.

Programs a DMA on coordinates (x, y) to access a memory memref with an access pattern specified by offsets, sizes and strides or static_offsets, static_sizes and static_strides. The operator references the target channel through the metadata symbol and specifies a descriptor id to be used, which will become the bd_id to be used when lowered further. The issue_token attribute specifies whether the execution of this operation should issue a token which can be received and read for synchronization purposes. This issue_token attribute is set to false by default for MM2S for backward compatibility and is always set to true for S2MM channels.

Traits: AttrSizedOperandSegments

Interfaces: MyOffsetSizeAndStrideOpInterface

Attributes:

AttributeMLIR TypeDescription
x::mlir::IntegerAttr64-bit signless integer attribute
y::mlir::IntegerAttr64-bit signless integer attribute
static_offsets::mlir::DenseI64ArrayAttri64 dense array attribute with exactly 4 elements
static_sizes::mlir::DenseI64ArrayAttri64 dense array attribute with exactly 4 elements
static_strides::mlir::DenseI64ArrayAttri64 dense array attribute with exactly 3 elements
metadata::mlir::FlatSymbolRefAttrflat symbol reference attribute
id::mlir::IntegerAttr64-bit signless integer attribute
issue_token::mlir::BoolAttrbool attribute

Operands:

Operand Description
memref memref of any type values
offsets variadic of 64-bit signless integer
sizes variadic of 64-bit signless integer
strides variadic of 64-bit signless integer

aiex.ipu.rtp_write (::xilinx::AIEX::IpuWriteRTPOp)

Rtp write operator

Syntax:

operation ::= `aiex.ipu.rtp_write` `(` $col `,` $row `,` $index `,` $value `)` attr-dict

rtp write operator

Attributes:

AttributeMLIR TypeDescription
buffer_sym_name::mlir::StringAttrstring attribute
col::mlir::IntegerAttr32-bit unsigned integer attribute
row::mlir::IntegerAttr32-bit unsigned integer attribute
index::mlir::IntegerAttr32-bit unsigned integer attribute
value::mlir::IntegerAttr32-bit signless integer attribute

aiex.ipu.shimtile_push_queue (::xilinx::AIEX::IpuShimTilePushQueueOp)

Bd queue push operator

Syntax:

operation ::= `aiex.ipu.shimtile_push_queue` attr-dict

bd queue push operator

Attributes:

AttributeMLIR TypeDescription
metadata::mlir::FlatSymbolRefAttrflat symbol reference attribute
issue_token::mlir::BoolAttrbool attribute
repeat_count::mlir::IntegerAttr32-bit signless integer attribute
bd_id::mlir::IntegerAttr32-bit signless integer attribute

aiex.ipu.sync (::xilinx::AIEX::IpuSyncOp)

Sync operator

Syntax:

operation ::= `aiex.ipu.sync` attr-dict

tct sync operator

Attributes:

AttributeMLIR TypeDescription
column::mlir::IntegerAttr32-bit signless integer attribute
row::mlir::IntegerAttr32-bit signless integer attribute
direction::mlir::IntegerAttr32-bit signless integer attribute
channel::mlir::IntegerAttr32-bit signless integer attribute
column_num::mlir::IntegerAttr32-bit signless integer attribute
row_num::mlir::IntegerAttr32-bit signless integer attribute

aiex.ipu.write32 (::xilinx::AIEX::IpuWrite32Op)

Write32 operator

Syntax:

operation ::= `aiex.ipu.write32` attr-dict

write32 operator

Attributes:

AttributeMLIR TypeDescription
column::mlir::IntegerAttr32-bit signless integer attribute
row::mlir::IntegerAttr32-bit signless integer attribute
address::mlir::IntegerAttr32-bit unsigned integer attribute
value::mlir::IntegerAttr32-bit unsigned integer attribute

aiex.ipu.writebd_shimtile (::xilinx::AIEX::IpuWriteBdExShimTileOp)

Dma operator

Syntax:

operation ::= `aiex.ipu.writebd_shimtile` attr-dict

writebd_shimtile operator

Attributes:

AttributeMLIR TypeDescription
column::mlir::IntegerAttr32-bit signless integer attribute
column_num::mlir::IntegerAttr32-bit signless integer attribute
ddr_id::mlir::IntegerAttr32-bit signless integer attribute
bd_id::mlir::IntegerAttr32-bit signless integer attribute
buffer_length::mlir::IntegerAttr32-bit signless integer attribute
buffer_offset::mlir::IntegerAttr32-bit signless integer attribute
enable_packet::mlir::IntegerAttr32-bit signless integer attribute
out_of_order_id::mlir::IntegerAttr32-bit signless integer attribute
packet_id::mlir::IntegerAttr32-bit signless integer attribute
packet_type::mlir::IntegerAttr32-bit signless integer attribute
d0_size::mlir::IntegerAttr32-bit signless integer attribute
d0_stride::mlir::IntegerAttr32-bit signless integer attribute
d1_size::mlir::IntegerAttr32-bit signless integer attribute
d1_stride::mlir::IntegerAttr32-bit signless integer attribute
d2_stride::mlir::IntegerAttr32-bit signless integer attribute
iteration_current::mlir::IntegerAttr32-bit signless integer attribute
iteration_size::mlir::IntegerAttr32-bit signless integer attribute
iteration_stride::mlir::IntegerAttr32-bit signless integer attribute
next_bd::mlir::IntegerAttr32-bit signless integer attribute
use_next_bd::mlir::IntegerAttr32-bit signless integer attribute
valid_bd::mlir::IntegerAttr32-bit signless integer attribute
lock_rel_val::mlir::IntegerAttr32-bit signless integer attribute
lock_rel_id::mlir::IntegerAttr32-bit signless integer attribute
lock_acq_enable::mlir::IntegerAttr32-bit signless integer attribute
lock_acq_val::mlir::IntegerAttr32-bit signless integer attribute
lock_acq_id::mlir::IntegerAttr32-bit signless integer attribute

aiex.iter (::xilinx::AIEX::IterOp)

An iter operation

Syntax:

operation ::= `aiex.iter` `(` $start `,` $end `,` $stride `)` attr-dict

This operation generates index values that can be used with the SelectOp to select a group of tiles from a herd.

Example: %iter0 = AIE.iter(0, 15, 1) // 0, 1, 2, … , 15 %iter1 = AIE.iter(2, 8, 2) // 2, 4, 6

Attributes:

AttributeMLIR TypeDescription
start::mlir::IntegerAttr32-bit signless integer attribute
end::mlir::IntegerAttr32-bit signless integer attribute
stride::mlir::IntegerAttr32-bit signless integer attribute

Results:

Result Description
«unnamed» index

aiex.memcpy (::xilinx::AIEX::MemcpyOp)

A memcpy op

Syntax:

operation ::= `aiex.memcpy` $tokenName `(` $acqValue `,` $relValue `)` `(`
              $srcTile `:` `<` $srcBuf `,` $srcOffset `,` $srcLen `>` `,`
              $dstTile `:` `<` $dstBuf `,` $dstOffset `,` $dstLen `>` `)`
              attr-dict `:` `(` type($srcBuf) `,` type($dstBuf) `)`

This operation defines a logical data transfer of a buffer from a source tile to another buffer from a destination tile.

This operation should be lowered to Mem ops with DMA setup and Flow ops for routing data from the source tile to the dest. tile.

Attributes:

AttributeMLIR TypeDescription
tokenName::mlir::FlatSymbolRefAttrflat symbol reference attribute
acqValue::mlir::IntegerAttr32-bit signless integer attribute
relValue::mlir::IntegerAttr32-bit signless integer attribute
srcOffset::mlir::IntegerAttr32-bit signless integer attribute
srcLen::mlir::IntegerAttr32-bit signless integer attribute
dstOffset::mlir::IntegerAttr32-bit signless integer attribute
dstLen::mlir::IntegerAttr32-bit signless integer attribute

Operands:

Operand Description
srcTile index
srcBuf memref of any type values
dstTile index
dstBuf memref of any type values

aiex.multi_dest (::xilinx::AIEX::MultiDestOp)

A destination port of multicast flow

Syntax:

operation ::= `aiex.multi_dest` `<` $tile `,` $bundle `:` $channel `>` attr-dict

An object representing the destination of a multicast flow. This must exist within an [aiex.multicast] operation. There can be multiple destinations within an aiex.multicast Op.

See [aiex.multicast]for an example.

Traits: HasParent<MulticastOp>

Attributes:

AttributeMLIR TypeDescription
bundlexilinx::AIE::WireBundleAttr
Bundle of wiresEnum cases: * Core (`Core`) * DMA (`DMA`) * FIFO (`FIFO`) * South (`South`) * West (`West`) * North (`North`) * East (`East`) * PLIO (`PLIO`) * NOC (`NOC`) * Trace (`Trace`)
channel::mlir::IntegerAttr32-bit signless integer attribute

Operands:

Operand Description
tile index

aiex.multicast (::xilinx::AIEX::MulticastOp)

An abstraction of multicast

Syntax:

operation ::= `aiex.multicast` `(` $tile `,` $bundle `:` $channel `)` regions attr-dict

An abstraction of broadcast. During place and route, it will be replaced by multiple flows.

Example:

  %70 = AIE.tile(7, 0)
  %73 = AIE.tile(7, 3)
  %74 = AIE.tile(7, 4)
  %63 = AIE.tile(6, 3)
  %64 = AIE.tile(6, 4)
  aiex.multicast(%70, "DMA" : 0){
    aiex.multi_dest<%73, "DMA" : 0>
    aiex.multi_dest<%74, "DMA" : 0>
    aiex.multi_dest<%63, "DMA" : 0>
    aiex.multi_dest<%64, "DMA" : 0>
  }

Traits: SingleBlockImplicitTerminator<AIE::EndOp>, SingleBlock

Attributes:

AttributeMLIR TypeDescription
bundlexilinx::AIE::WireBundleAttr
Bundle of wiresEnum cases: * Core (`Core`) * DMA (`DMA`) * FIFO (`FIFO`) * South (`South`) * West (`West`) * North (`North`) * East (`East`) * PLIO (`PLIO`) * NOC (`NOC`) * Trace (`Trace`)
channel::mlir::IntegerAttr32-bit signless integer attribute

Operands:

Operand Description
tile index

aiex.place (::xilinx::AIEX::PlaceOp)

A place operation that specifies the relative placement (XY) of one herd to another

Syntax:

operation ::= `aiex.place` `(` $sourceHerd `,` $destHerd `,` $distX `,` $distY `)` attr-dict

A place operation that specifies the relative placement (XY) of one herd to another.

Attributes:

AttributeMLIR TypeDescription
distX::mlir::IntegerAttr32-bit signless integer attribute
distY::mlir::IntegerAttr32-bit signless integer attribute

Operands:

Operand Description
sourceHerd index
destHerd index

aiex.route (::xilinx::AIEX::RouteOp)

A route operation that routes one herd to another

Syntax:

operation ::= `aiex.route` `(` `<` $sourceHerds `,` $sourceBundle `:` $sourceChannel `>` `,`
              `<` $destHerds   `,` $destBundle   `:` $destChannel   `>` `)` attr-dict

A route operation that routes one herd to another.

Attributes:

AttributeMLIR TypeDescription
sourceBundlexilinx::AIE::WireBundleAttr
Bundle of wiresEnum cases: * Core (`Core`) * DMA (`DMA`) * FIFO (`FIFO`) * South (`South`) * West (`West`) * North (`North`) * East (`East`) * PLIO (`PLIO`) * NOC (`NOC`) * Trace (`Trace`)
sourceChannel::mlir::IntegerAttr32-bit signless integer attribute
destBundlexilinx::AIE::WireBundleAttr
Bundle of wiresEnum cases: * Core (`Core`) * DMA (`DMA`) * FIFO (`FIFO`) * South (`South`) * West (`West`) * North (`North`) * East (`East`) * PLIO (`PLIO`) * NOC (`NOC`) * Trace (`Trace`)
destChannel::mlir::IntegerAttr32-bit signless integer attribute

Operands:

Operand Description
sourceHerds index
destHerds index

aiex.select (::xilinx::AIEX::SelectOp)

A select operation

Syntax:

operation ::= `aiex.select` `(` $startHerd `,` $iterX `,` $iterY `)` attr-dict

This operation selects a group of tiles based on the selected indices.

Example:

%herd = AIE.herd[4][4] // a herd of 4x4 tiles

%ix = AIE.iter(0, 4, 1) // 0, 1, 2, 3 %iy = AIE.iter(0, 1, 1) // 0

%sub_herd = AIE.select(%herd, %ix, %iy)

The SelectOp in the above example will select the tiles %herd[0][0], %herd[1][0], %herd[2][0], %herd[3][0] (the first column of the herd).

Operands:

Operand Description
startHerd index
iterX index
iterY index

Results:

Result Description
«unnamed» index

aiex.token (::xilinx::AIEX::TokenOp)

Declare a token (a logical lock)

Syntax:

operation ::= `aiex.token` `(` $value `)` attr-dict

This operation creates a logical lock. We use Symbol so that it can be referenced globally. Unlike phsical locks, logical locks are unlimited, and we can specify any integer value associated with a lock. The logical lock is used to manually specify the dependence of tasks, or core executions.

The operation can also be generated automatically if the Dependence Analysis can be leveraged.

Example: AIE.token(0) {sym_name = “token0”} // Declare token0 with initial value of 0

AIE.useToken @token0(“Acquire”, 0) // acquire token0 if its value is 0

AIE.useToken @token0(“Release”, 5) // release token0 and set its value to 5

Interfaces: Symbol

Attributes:

AttributeMLIR TypeDescription
value::mlir::IntegerAttr32-bit signless integer attribute

aiex.useToken (::xilinx::AIEX::UseTokenOp)

Acquire/release a logical lock

Syntax:

operation ::= `aiex.useToken` $tokenName `(` $action `,` $value `)` attr-dict

This operation uses token (logical lock). A logical lock can be acquired or released with a value. Similar to UseLockOp, this operation can be understood as “blocking” op.

Attributes:

AttributeMLIR TypeDescription
tokenName::mlir::FlatSymbolRefAttrflat symbol reference attribute
value::mlir::IntegerAttr32-bit signless integer attribute
actionxilinx::AIE::LockActionAttr
lock acquire/releaseEnum cases: * Acquire (`Acquire`) * AcquireGreaterEqual (`AcquireGreaterEqual`) * Release (`Release`)