mlir-aie icon indicating copy to clipboard operation
mlir-aie copied to clipboard

Canonicalizer merges multiple DMA blocks into one

Open dotkrnl opened this issue 1 year ago • 1 comments

When two DMA blocks are present, the canonicalizer may merge them into one, for example:

 ^bb5:  // 2 preds: ^bb4, ^bb5
    "AIE.useLock"(%4) {action = 0 : i32, value = 1 : i32} : (index) -> ()
    "AIE.dmaBdPacket"() {packet_id = 4 : i32, packet_type = 4 : i32} : () -> ()
    "AIE.dmaBd"(%32) {AB = 0 : i32, len = 1024 : i32, offset = 0 : i32} : (memref<1024xi32>) -> ()
    "AIE.useLock"(%4) {action = 1 : i32, value = 0 : i32} : (index) -> ()
    "AIE.useLock"(%3) {action = 0 : i32, value = 1 : i32} : (index) -> ()
    "AIE.dmaBdPacket"() {packet_id = 5 : i32, packet_type = 5 : i32} : () -> ()
    "AIE.dmaBd"(%33) {AB = 0 : i32, len = 1024 : i32, offset = 0 : i32} : (memref<1024xi32>) -> ()
    "AIE.useLock"(%3) {action = 1 : i32, value = 0 : i32} : (index) -> ()
    "cf.br"()[^bb5] : () -> ()

This triggers the error in #114 . AIETargetXAIE seems currently depend on blocks so simply reverting #114 does not solve the issue.

dotkrnl avatar Sep 08 '22 17:09 dotkrnl

I've hit this in the past. I think the solution is to introduce a custom terminator instead of using cf.br

fifield avatar Sep 16 '22 15:09 fifield

This should be fixed by https://github.com/Xilinx/mlir-aie/pull/247

fifield avatar Mar 06 '23 21:03 fifield