Skip to content

Share BD size/stride verification between AIE and AIEX dialects (#2566)#3109

Draft
hunhoffe wants to merge 1 commit into
Xilinx:mainfrom
hunhoffe:ehunhoff/issue-2566-dma-layout-checks
Draft

Share BD size/stride verification between AIE and AIEX dialects (#2566)#3109
hunhoffe wants to merge 1 commit into
Xilinx:mainfrom
hunhoffe:ehunhoff/issue-2566-dma-layout-checks

Conversation

@hunhoffe
Copy link
Copy Markdown
Collaborator

Closes #2566.

AIEX::verifyStridesWraps already had a careful granularity-based check for BD sizes and strides — this PR pulls the size/stride/granularity portion into a shared helper AIE::verifyBDSizesStrides so aie.dma_bd's verifier can use the same logic. Two follow-on behavior changes fall out:

  • aie.dma_bd now accepts inner-dim strides > 1 on sub-32b types when stride × elemWidth is a multiple of the address granularity (e.g. memref<128xi16>, [<size=32, stride=2>] — 2 × 16b = 32b, perfectly word-aligned). The previous blanket check rejected these even though hardware can encode them.
  • aie.dma_bd now rejects sub-word innermost contiguous runs (e.g. memref<128xi8>, [<size=3, stride=4>, <size=2, stride=1>] — innermost run = 2 bytes). The AIEX path already caught these; the AIE path didn't.

The elemWidth > granularity constraint added in #2435 (innermost stride must be 1 for bfp / wide types) is preserved in the shared helper, matching the silent strides[0] = 0 behavior in getHardwareStridesWraps.

…linx#2566)

Factors the size/stride/granularity portion of AIEX::verifyStridesWraps
into a shared helper AIE::verifyBDSizesStrides, called from both
DMABDOp::verify and the AIEX BD-emitting paths. This (1) lets
DMABDOp accept inner-dim strides > 1 on sub-32b types when
stride*elemWidth is a granularity multiple (previously rejected
outright), and (2) makes DMABDOp reject sub-word innermost
contiguous runs (previously silently accepted). The bfp/>32b
inner-stride==1 constraint from Xilinx#2435 is preserved in the shared
helper.

Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing and Wrong Data Layout Transformation Checks

1 participant