Skip to content

AIESW-44785: Fix AIE Halt elf generation - #118

Merged
jvillarre merged 2 commits into
Xilinx:masterfrom
snigdha-gupta:aie_halt_elf_fix
Sep 11, 2026
Merged

jvillarre merged 2 commits into
Xilinx:masterfrom
snigdha-gupta:aie_halt_elf_fix

Conversation

@snigdha-gupta

@snigdha-gupta snigdha-gupta commented Sep 10, 2026

Copy link
Copy Markdown
Collaborator

Summary

AIE Halt failed to register its generated control-code ELF with the hardware context in full-ELF flow, silently falling back to the prebuilt aieHaltNx4x4.elf. The generated ELF was built for the wrong partition width. This PR aligns aie_halt with the handling already present in the AIE profile and AIE trace VE2 plugins. This is a fix for https://jira.xilinx.com/browse/AIESW-44785

Problem

AIEHaltVE2Impl::generateHaltControlCode() assembled the ELF successfully but failed at submission:

[XRT] DEBUG: Elf Object Created
[XRT] WARNING: Failed to register AieHalt.elf with HW Context: can not add config to ctx with different configuration
[XRT] WARNING: Failed to generate/submit AIE Halt control code.
[XRT] DEBUG: Could not generate AIE Halt control code. Falling back to prebuilt control code ELF.

Two causes:

  1. The AIE driver was initialized with meta_config.num_columns from the xclbin AIE metadata, which is the full array width, not the width of the partition owned by the hardware context. That column count ends up in the assembled ELF's partition note, and xrt::hw_context::add_config() rejects any ELF whose partition size differs from the context's.
  2. VE2Transaction::m_fullElfFlow defaults to true and aie_halt never set it, so the halt path always submitted via add_config(), even on an xclbin-based context where the ELF must be wrapped in an xrt::module.

The halt loop also used the absolute start_col from aie_partition_info, but full-ELF control code addresses tiles relative to the partition.

Fix

  • In full-ELF flow, take the column count from hw_context_int::get_partition_size() and use it for XAie_Config, so the generated ELF's partition matches the context.
  • Program the halt registers over partition-relative columns (start_col forced to 0) in full-ELF flow.
  • Call tranxHandler->setElfFlow() with the value from hw_context_int::get_elf_flow() before initializeTransaction(), so submission uses add_config for full ELF and xrt::module for xclbin.

Both column changes are gated on full-ELF flow, so the xclbin path is unchanged. If get_elf_flow() throws (context not yet fully configured) or the partition size query returns 0, the code warns and keeps the previous metadata-based behavior.

snigdha-gupta and others added 2 commits September 9, 2026 17:17
@snigdha-gupta snigdha-gupta changed the title Fix AIE Halt full-ELF generation Fix AIE Halt elf generation Sep 10, 2026
@snigdha-gupta snigdha-gupta changed the title Fix AIE Halt elf generation AIESW-44785: Fix AIE Halt elf generation Sep 11, 2026
@jvillarre
jvillarre merged commit cbd23e4 into Xilinx:master Sep 11, 2026
4 checks passed
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.

2 participants