Skip to content

Conversation

@hlaccabu
Copy link
Contributor

@hlaccabu hlaccabu commented Dec 3, 2025

No description provided.

@hlaccabu hlaccabu requested a review from xdavidz December 3, 2025 21:22
Copilot AI review requested due to automatic review settings December 3, 2025 21:22
Copy link
Contributor

Copilot AI left a 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;
Copy link

Copilot AI Dec 3, 2025

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.

Copilot uses AI. Check for mistakes.
Copy link
Contributor

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?

Copy link
Contributor

@xdavidz xdavidz left a 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?

Copilot AI review requested due to automatic review settings January 6, 2026 00:33
Copy link
Contributor

Copilot AI left a 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);
Copy link

Copilot AI Jan 6, 2026

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.

Copilot uses AI. Check for mistakes.
for (auto& cmd : cmdlist_bos) {
for (size_t i = 0; i < cmdlist_bos.size(); i++) {
auto& cmd = cmdlist_bos[i];

Copy link

Copilot AI Jan 6, 2026

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.

Suggested change

Copilot uses AI. Check for mistakes.
if (bo_set_ptr && i < bo_set_ptr->size()) {
std::atomic_thread_fence(std::memory_order_acquire);
}

Copy link

Copilot AI Jan 6, 2026

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.

Suggested change

Copilot uses AI. Check for mistakes.
if (completed >= total_cmd_submission)
break;
std::get<1>(cmd)->state = ERT_CMD_STATE_NEW;

Copy link

Copilot AI Jan 6, 2026

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.

Suggested change

Copilot uses AI. Check for mistakes.
std::get<1>(cmd)->state = ERT_CMD_STATE_NEW;
if (!bo_set_ptr)
std::get<1>(cmd)->state = ERT_CMD_STATE_NEW;

Copy link

Copilot AI Jan 6, 2026

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.

Suggested change

Copilot uses AI. Check for mistakes.
(*bo_set_ptr)[wait_idx]->restore_cmd_header();
else
std::get<1>(cmdlist_bos[wait_idx])->state = ERT_CMD_STATE_NEW;

Copy link

Copilot AI Jan 6, 2026

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.

Suggested change

Copilot uses AI. Check for mistakes.
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);
Copy link

Copilot AI Jan 6, 2026

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.

Suggested change
kernel_type == KERNEL_TYPE_TXN_FULL_ELF);
kernel_type == KERNEL_TYPE_TXN_FULL_ELF);

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants