diff --git a/src/shim/device.cpp b/src/shim/device.cpp index d557fcb2..375f0e66 100644 --- a/src/shim/device.cpp +++ b/src/shim/device.cpp @@ -370,7 +370,7 @@ struct partition_info struct context_health_info { - static ert_ctx_health_data + static xrt_core::query::context_health_info::smi_context_health fill_health_entry(const amdxdna_drm_hwctx_entry& entry) { ert_ctx_health_data new_entry{}; @@ -380,7 +380,12 @@ struct context_health_info { new_entry.fatal_error_exception_type = entry.fatal_error_exception_type; new_entry.fatal_error_exception_pc = entry.fatal_error_exception_pc; new_entry.fatal_error_app_module = entry.fatal_error_app_module; - return new_entry; + + xrt_core::query::context_health_info::smi_context_health val{}; + val.ctx_id = entry.context_id; + val.pid = entry.pid; + val.health_data = new_entry; + return val; } using result_type = std::any; @@ -589,15 +594,25 @@ struct event_trace } static result_type - get(const xrt_core::device* device, key_type key) + get(const xrt_core::device* device, key_type key, const std::any& any) { switch (key) { - case key_type::event_trace_data: - { - // static query::firmware_debug_buffer log_buffer; - // TODO : implement IOCTL to get event_trace data - // return log_buffer; + case key_type::event_trace_data: + { + // static query::firmware_debug_buffer log_buffer; + // TODO : implement IOCTL to get event_trace data + // return log_buffer; + } + default: + throw xrt_core::error("Unsupported event_trace query key"); } + // TODO : Implement IOCTL to get event_trace configuration + } + + static result_type + get(const xrt_core::device* device, key_type key) + { + switch (key) { case key_type::event_trace_version: { // query::event_trace_version::result_type version; @@ -633,15 +648,26 @@ struct firmware_log } static result_type - get(const xrt_core::device* device, key_type key) + get(const xrt_core::device* device, key_type key, const std::any& any) { switch (key) { - case key_type::firmware_log_data: - { - // static query::firmware_debug_buffer log_buffer; - // TODO : implement IOCTL to get firmware log data - // return log_buffer; + case key_type::firmware_log_data: + { + // static query::firmware_debug_buffer log_buffer; + // TODO : implement IOCTL to get firmware_log data + // return log_buffer; + } + default: + throw xrt_core::error("Unsupported firmware_log query key"); } + // TODO : Implement IOCTL to get firmware_log configuration + } + + static result_type + get(const xrt_core::device* device, key_type key) + { + switch (key) { + case key_type::firmware_log_version: { // query::firmware_log_version::result_type version; @@ -664,6 +690,39 @@ struct firmware_log } }; +struct archive_path +{ + using result_type = query::archive_path::result_type; + + static result_type + get(const xrt_core::device* device, key_type key) + { + const auto& pcie_id = xrt_core::device_query(device); + xrt_core::smi::smi_hardware_config smi_hrdw; + auto hardware_type = smi_hrdw.get_hardware_type(pcie_id); + + switch (key) { + case key_type::archive_path: + { + switch (hardware_type) + { + case xrt_core::smi::smi_hardware_config::hardware_type::stxA0: + case xrt_core::smi::smi_hardware_config::hardware_type::stxB0: + case xrt_core::smi::smi_hardware_config::hardware_type::stxH: + case xrt_core::smi::smi_hardware_config::hardware_type::krk1: + return std::string(get_shim_data_dir() + "bins/xrt_smi_strx.a"); + case xrt_core::smi::smi_hardware_config::hardware_type::phx: + return std::string(get_shim_data_dir() + "bins/xrt_smi_phx.a"); + default: + throw xrt_core::error("Unsupported hardware type"); + } + } + default: + throw xrt_core::error("Unsupported archive_path query key"); + } + } +}; + struct frame_boundary_preemption { using result_type = query::frame_boundary_preemption::result_type; @@ -1596,14 +1655,15 @@ initialize_query_table() emplace_func0_getput(); emplace_func0_getput(); - emplace_func0_request(); + emplace_func1_request(); emplace_func0_request(); emplace_func0_request(); emplace_func0_getput(); - emplace_func0_request(); + emplace_func1_request(); emplace_func0_request(); emplace_func0_request(); emplace_func0_getput(); + emplace_func0_request(); emplace_func0_request(); emplace_func0_request(); emplace_func0_request(); diff --git a/src/shim/smi_xdna.cpp b/src/shim/smi_xdna.cpp index 610458ae..ad9782e5 100644 --- a/src/shim/smi_xdna.cpp +++ b/src/shim/smi_xdna.cpp @@ -73,6 +73,8 @@ config_gen_xdna::create_examine_subcommand() {"preemption", "Preemption telemetry data for the device", "hidden"}, {"clocks", "Clock frequency information", "hidden"}, {"context-health", "Log to console context health information", "hidden"}, + {"event-trace", "Event trace report", "hidden"}, + {"firmware-log", "Firmware Log report", "hidden"} }; std::map> examine_suboptions; diff --git a/tools/info.json b/tools/info.json index f6220f68..6eff9f0a 100644 --- a/tools/info.json +++ b/tools/info.json @@ -1,7 +1,7 @@ { "copyright": "Copyright (C) 2023-2025 Advanced Micro Devices, Inc. All rights reserved.", "xrt" : { - "version": "202520.2.20.132", + "version": "202520.2.20.144", "os_rel": ["22.04", "24.04"] }, "firmwares": [ diff --git a/xrt b/xrt index 4a8cf2da..2876a7cd 160000 --- a/xrt +++ b/xrt @@ -1 +1 @@ -Subproject commit 4a8cf2da4b8de433956e07b4138c180af47aab7e +Subproject commit 2876a7cda97235f7217f9a8ba09c42dbba574951