-
Notifications
You must be signed in to change notification settings - Fork 93
Adding further aie4 shim test support #895
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR extends AIE4 support in the shim test suite by introducing a new debug buffer type (XRT_BO_USE_UC_DEBUG) and broadening test coverage from AIE2-specific to general AIE platform support. The changes enable debug buffer operations to work correctly on AIE4 devices while maintaining backward compatibility with AIE2.
- Introduced XRT_BO_USE_UC_DEBUG buffer type for AIE4 debug operations
- Extended test coverage from AIE2-only to all AIE platforms for several test cases
- Updated buffer creation logic to conditionally use appropriate debug flags based on device type
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| test/shim_test/shim_test.cpp | Conditionally selects debug buffer flags based on AIE4 detection and broadens test filters from AIE2-specific to general AIE support |
| src/shim/buffer.cpp | Adds mapping for new XRT_BO_USE_UC_DEBUG buffer type to firmware debug buffer type |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| case XRT_BO_USE_UC_DEBUG: | ||
| return AMDXDNA_FW_BUF_DEBUG; |
Copilot
AI
Dec 3, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new XRT_BO_USE_UC_DEBUG case returns the same firmware buffer type as XRT_BO_USE_DEBUG. Add a comment explaining why both buffer use types map to the same firmware type, or if they should have different behaviors.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is reasonable. @hlaccabu can you add some comments here?
xdavidz
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With this, can we get a pass when run "shim_test" without any index number?
Signed-off-by: Hayden Laccabue <[email protected]>
Signed-off-by: Hayden Laccabue <[email protected]>
Signed-off-by: Hayden Laccabue <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 9 out of 9 changed files in this pull request and generated 7 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| auto dev = sdev.get(); | ||
| auto boflags = XRT_BO_FLAGS_CACHEABLE; | ||
| auto ext_boflags = XRT_BO_USE_DEBUG << 4; | ||
| auto ext_boflags = dev_filter_is_aie4(id, dev) ? (XRT_BO_USE_UC_DEBUG << 4) : (XRT_BO_USE_DEBUG << 4); |
Copilot
AI
Jan 6, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The variable name ext_boflags is ambiguous. Consider renaming to extended_bo_flags for clarity.
| for (auto& cmd : cmdlist_bos) { | ||
| for (size_t i = 0; i < cmdlist_bos.size(); i++) { | ||
| auto& cmd = cmdlist_bos[i]; | ||
|
|
Copilot
AI
Jan 6, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Empty line within conditional logic reduces readability. Consider removing this blank line between the comment and the conditional check.
| if (bo_set_ptr && i < bo_set_ptr->size()) { | ||
| std::atomic_thread_fence(std::memory_order_acquire); | ||
| } | ||
|
|
Copilot
AI
Jan 6, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unnecessary blank line after memory fence. Consider removing for consistency.
| if (completed >= total_cmd_submission) | ||
| break; | ||
| std::get<1>(cmd)->state = ERT_CMD_STATE_NEW; | ||
|
|
Copilot
AI
Jan 6, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unnecessary blank line before conditional. Consider removing for consistency.
| std::get<1>(cmd)->state = ERT_CMD_STATE_NEW; | ||
| if (!bo_set_ptr) | ||
| std::get<1>(cmd)->state = ERT_CMD_STATE_NEW; | ||
|
|
Copilot
AI
Jan 6, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unnecessary blank line after state assignment. Consider removing for consistency.
| (*bo_set_ptr)[wait_idx]->restore_cmd_header(); | ||
| else | ||
| std::get<1>(cmdlist_bos[wait_idx])->state = ERT_CMD_STATE_NEW; | ||
|
|
Copilot
AI
Jan 6, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unnecessary blank line after conditional restore logic. Consider removing for consistency.
| auto is_full_elf = (get_kernel_type(dev, xclbin_name) == KERNEL_TYPE_TXN_FULL_ELF_PREEMPT); | ||
| auto kernel_type = get_kernel_type(dev, xclbin_name); | ||
| auto is_full_elf = (kernel_type == KERNEL_TYPE_TXN_FULL_ELF_PREEMPT || | ||
| kernel_type == KERNEL_TYPE_TXN_FULL_ELF); |
Copilot
AI
Jan 6, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inconsistent indentation: line 39 uses tabs while the codebase appears to use spaces. Ensure consistent whitespace usage.
| kernel_type == KERNEL_TYPE_TXN_FULL_ELF); | |
| kernel_type == KERNEL_TYPE_TXN_FULL_ELF); |
No description provided.