AIESW-44785: Fix AIE Halt elf generation - #118
Merged
Merged
Conversation
Signed-off-by: snigupta <snigupta@amd.com>
jvillarre
approved these changes
Sep 11, 2026
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 alignsaie_haltwith the handling already present in the AIE profile and AIE trace VE2 plugins. This is a fix for https://jira.xilinx.com/browse/AIESW-44785Problem
AIEHaltVE2Impl::generateHaltControlCode()assembled the ELF successfully but failed at submission:Two causes:
meta_config.num_columnsfrom 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, andxrt::hw_context::add_config()rejects any ELF whose partition size differs from the context's.VE2Transaction::m_fullElfFlowdefaults totrueandaie_haltnever set it, so the halt path always submitted viaadd_config(), even on an xclbin-based context where the ELF must be wrapped in anxrt::module.The halt loop also used the absolute
start_colfromaie_partition_info, but full-ELF control code addresses tiles relative to the partition.Fix
hw_context_int::get_partition_size()and use it forXAie_Config, so the generated ELF's partition matches the context.start_colforced to 0) in full-ELF flow.tranxHandler->setElfFlow()with the value fromhw_context_int::get_elf_flow()beforeinitializeTransaction(), so submission usesadd_configfor full ELF andxrt::modulefor 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.