Skip to content

Commit 2042b2e

Browse files
hunhoffeclaude
andcommitted
Fix dma_op.py BD dimensions; restore stale doc comment
test/python/dma_op.py used innermost size=1 on i16, a sub-word contiguous run that the new shared verifier (correctly) rejects. Make the innermost dim (2,1) so the BD is realizable. Also move the BDDimLayoutAttr doc comment back above isContiguousBDTransfer; it got separated when verifyBDSizesStrides was inserted in between. Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>
1 parent 62d3ae4 commit 2042b2e

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

lib/Dialect/AIE/IR/AIEDialect.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2196,9 +2196,6 @@ void DMABDOp::print(::mlir::OpAsmPrinter &printer) {
21962196
printer.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
21972197
}
21982198

2199-
// A BDDimLayoutAttr array (outermost-first) describes a contiguous row-major
2200-
// scan when the innermost stride is 1 and each outer stride equals the product
2201-
// of all inner sizes. Used by both DMABDOp verification and canonicalization.
22022199
mlir::LogicalResult xilinx::AIE::verifyBDSizesStrides(
22032200
mlir::Operation *forOp, unsigned elemWidthBits,
22042201
uint32_t addressGranularityBits, llvm::ArrayRef<int64_t> inputSizes,
@@ -2267,6 +2264,9 @@ mlir::LogicalResult xilinx::AIE::verifyBDSizesStrides(
22672264
return success();
22682265
}
22692266

2267+
// A BDDimLayoutAttr array (outermost-first) describes a contiguous row-major
2268+
// scan when the innermost stride is 1 and each outer stride equals the product
2269+
// of all inner sizes. Used by both DMABDOp verification and canonicalization.
22702270
bool xilinx::AIE::isContiguousBDTransfer(llvm::ArrayRef<BDDimLayoutAttr> dims) {
22712271
if (dims.empty())
22722272
return true; // no ND layout = trivially contiguous

test/python/dma_op.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
# %memtile_dma_0_1 = aie.memtile_dma(%tile_0_1) {
3838
# %0 = aie.dma(MM2S, 0) [{
3939
# aie.use_lock(%lock_0_1_0, AcquireGreaterEqual)
40-
# aie.dma_bd(%mem_A : memref<2x1xi16>, 0, 2, [<size = 1, stride = 1>, <size = 1, stride = 1>, <size = 1, stride = 1>, <size = 1, stride = 1>])
40+
# aie.dma_bd(%mem_A : memref<2x1xi16>, 0, 2, [<size = 1, stride = 1>, <size = 1, stride = 1>, <size = 1, stride = 1>, <size = 2, stride = 1>])
4141
# aie.use_lock(%lock_0_1, Release)
4242
# }]
4343
# aie.end
@@ -75,7 +75,7 @@ def dma_in_A_to_compute():
7575
(1, 1),
7676
(1, 1),
7777
(1, 1),
78-
(1, 1),
78+
(2, 1),
7979
],
8080
)
8181
use_lock(prod_lock_mem_A, LockAction.Release)

0 commit comments

Comments
 (0)