Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 31 additions & 1 deletion profile/plugin/aie_halt/ve2/aie_halt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,32 @@ namespace xdp {
return false;
}

// Full-ELF add_config() rejects an ELF whose partition column count differs
// from the hw_context's, so use the actual partition width instead of
// metadata num_columns (halted tiles are partition-relative). The xclbin
// flow does not enforce this and keeps num_columns.
bool isFullELFFlow = false;
size_t partitionSize = 0;
uint8_t numColumns = meta_config.num_columns;
try {
isFullELFFlow = xrt_core::hw_context_int::get_elf_flow(hwContext);
if (isFullELFFlow) {
partitionSize = xrt_core::hw_context_int::get_partition_size(hwContext);
if (partitionSize > 0)
numColumns = static_cast<uint8_t>(partitionSize);
}
} catch (const std::exception& e) {
xrt_core::message::send(severity_level::warning, "XRT",
std::string("Failed to query ELF flow for AIE halt, assuming xclbin flow: ") + e.what());
}

XAie_Config cfg {
meta_config.hw_gen,
meta_config.base_address,
meta_config.column_shift,
meta_config.row_shift,
meta_config.num_rows,
meta_config.num_columns,
numColumns,
meta_config.shim_row,
meta_config.mem_row_start,
meta_config.mem_num_rows,
Expand All @@ -126,11 +145,22 @@ namespace xdp {
break;
}

// Full-ELF control code addresses tiles relative to the partition, so the
// absolute start column reported by the driver does not apply.
if (isFullELFFlow && partitionSize > 0) {
startCol = 0;
numCols = numColumns;
}

std::stringstream msg;
msg << "Set AIE Core breakpoint at Lock Acquire Req Instr, Start col "
<< startCol << ", Num col " << numCols;
xrt_core::message::send(severity_level::info, "XRT", msg.str());

// Submit through the path matching the hw_context: add_config for full ELF,
// xrt::module for xclbin.
tranxHandler->setElfFlow(isFullELFFlow);

// Record driver calls into the control code ASM.
if (!tranxHandler->initializeTransaction(&aieDevInst, "AieHalt")) {
xrt_core::message::send(severity_level::warning, "XRT", "AIE Halt transaction initialization failed.");
Expand Down
Loading