-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[LowerToAIE] Add support for DMA chains (#1000)
Adds support for lowering `amdaie.npu.circular_dma_cpy_nd` to a chain of `aie.dma_bd` operations. This is needed becaused low-level DMA BD configurations currently don't support a zero stride. For example: ``` amdaie.npu.circular_dma_cpy_nd %some_connection([] [] [], [0, 0, 0] [2, 32, 32] [0, 64, 1]) ``` contains an outer dimension with zero stride, which describes a repetition, and if this is not the common repetition count of all connections operating on a logical objectFifo, this is lowered to a chain of `dma_bd` operations to implement the zero stride: ``` ^bb3: // 2 preds: ^bb2, ^bb4 aie.use_lock(%lock_0_1_0, AcquireGreaterEqual, 1) aie.dma_bd(%buffer_0_1 : memref<4096xi32, 1 : i32>) {dimensions = #aie<bd_dim_layout_array[<size = 32, stride = 64>, <size = 32, stride = 1>]>, len = 1024 : i32} aie.next_bd ^bb4 ^bb4: // pred: ^bb3 aie.dma_bd(%buffer_0_1 : memref<4096xi32, 1 : i32>) {dimensions = #aie<bd_dim_layout_array[<size = 32, stride = 64>, <size = 32, stride = 1>]>, len = 1024 : i32} aie.use_lock(%lock_0_1, Release, 1) aie.next_bd ^bb3 ``` Note how the first block contains a lock acquire operation, but no lock release operation as it needs to hand off to the second block before releasing a lock to create the DMA chain.
- Loading branch information
Showing
3 changed files
with
320 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.