From b54ecc05270a76c90967a9d9065f4cc925d1a574 Mon Sep 17 00:00:00 2001 From: Paul Schumacher Date: Thu, 16 Jan 2025 17:19:17 +0000 Subject: [PATCH 1/6] added new setting to supported list Signed-off-by: Paul Schumacher --- .../xdp/profile/plugin/aie_profile/aie_profile_metadata.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/runtime_src/xdp/profile/plugin/aie_profile/aie_profile_metadata.cpp b/src/runtime_src/xdp/profile/plugin/aie_profile/aie_profile_metadata.cpp index 760b2c4469..27bd5bc233 100644 --- a/src/runtime_src/xdp/profile/plugin/aie_profile/aie_profile_metadata.cpp +++ b/src/runtime_src/xdp/profile/plugin/aie_profile/aie_profile_metadata.cpp @@ -121,7 +121,8 @@ namespace xdp { "graph_based_memory_tile_metrics", "graph_based_interface_tile_metrics", "tile_based_aie_metrics", "tile_based_aie_memory_metrics", "tile_based_memory_tile_metrics", "tile_based_interface_tile_metrics", - "interval_us", "interface_tile_latency", "start_type", "start_iteration"}; + "interval_us", "interface_tile_latency", "start_type", "start_iteration", + "tile_based_microcontroller_metrics"}; const std::map deprecatedSettings { {"aie_profile_core_metrics", "AIE_profile_settings.graph_based_aie_metrics or tile_based_aie_metrics"}, {"aie_profile_memory_metrics", "AIE_profile_settings.graph_based_aie_memory_metrics or tile_based_aie_memory_metrics"}, From ad002bc7df490cdd3b6b9fcf1f0ac702abd13cf2 Mon Sep 17 00:00:00 2001 From: Paul Schumacher Date: Thu, 16 Jan 2025 19:04:44 +0000 Subject: [PATCH 2/6] using 16-bit API Signed-off-by: Paul Schumacher --- .../plugin/aie_profile/util/aie_profile_util.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/runtime_src/xdp/profile/plugin/aie_profile/util/aie_profile_util.cpp b/src/runtime_src/xdp/profile/plugin/aie_profile/util/aie_profile_util.cpp index d68b5fffc7..f30715ceab 100644 --- a/src/runtime_src/xdp/profile/plugin/aie_profile/util/aie_profile_util.cpp +++ b/src/runtime_src/xdp/profile/plugin/aie_profile/util/aie_profile_util.cpp @@ -635,18 +635,14 @@ namespace xdp::aie::profile { return std::make_pair(eventId, eventId); } -#ifdef XDP_CLIENT_BUILD uint16_t tmpStart; uint16_t tmpEnd; +#ifdef XDP_CLIENT_BUILD XAie_EventLogicalToPhysicalConv(aieDevInst, tileLoc, xaieModType, startEvent, &tmpStart); XAie_EventLogicalToPhysicalConv(aieDevInst, tileLoc, xaieModType, endEvent, &tmpEnd); #else - uint8_t tmpStart; - uint8_t tmpEnd; - //XAie_EventLogicalToPhysicalConv_16(aieDevInst, tileLoc, xaieModType, startEvent, &tmpStart); - //XAie_EventLogicalToPhysicalConv_16(aieDevInst, tileLoc, xaieModType, endEvent, &tmpEnd); - XAie_EventLogicalToPhysicalConv(aieDevInst, tileLoc, xaieModType, startEvent, &tmpStart); - XAie_EventLogicalToPhysicalConv(aieDevInst, tileLoc, xaieModType, endEvent, &tmpEnd); + XAie_EventLogicalToPhysicalConv_16(aieDevInst, tileLoc, xaieModType, startEvent, &tmpStart); + XAie_EventLogicalToPhysicalConv_16(aieDevInst, tileLoc, xaieModType, endEvent, &tmpEnd); #endif uint16_t phyStartEvent = tmpStart + getCounterBase(xdpModType); uint16_t phyEndEvent = tmpEnd + getCounterBase(xdpModType); From bfce4f1b8829665b80d4fdb3257efb47ad48d333 Mon Sep 17 00:00:00 2001 From: Paul Schumacher Date: Mon, 20 Jan 2025 16:49:11 +0000 Subject: [PATCH 3/6] fixed metric set search plus some cleanup Signed-off-by: Paul Schumacher --- .../plugin/aie_profile/aie_profile_metadata.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/runtime_src/xdp/profile/plugin/aie_profile/aie_profile_metadata.cpp b/src/runtime_src/xdp/profile/plugin/aie_profile/aie_profile_metadata.cpp index 27bd5bc233..fc9afba688 100644 --- a/src/runtime_src/xdp/profile/plugin/aie_profile/aie_profile_metadata.cpp +++ b/src/runtime_src/xdp/profile/plugin/aie_profile/aie_profile_metadata.cpp @@ -1,5 +1,5 @@ /** - * Copyright (C) 2022-2023 Advanced Micro Devices, Inc. - All rights reserved + * Copyright (C) 2022-2025 Advanced Micro Devices, Inc. - All rights reserved * * Licensed under the Apache License, Version 2.0 (the "License"). You may * not use this file except in compliance with the License. A copy of the @@ -1045,6 +1045,7 @@ namespace xdp { auto defaultSet = defaultSets[moduleIdx]; bool showWarning = true; std::vector offTiles; + auto metricVec = metricStrings.at(module_type::shim); for (auto& tileMetric : configMetrics[moduleIdx]) { // Save list of "off" tiles @@ -1054,8 +1055,6 @@ namespace xdp { } // Ensure requested metric set is supported (if not, use default) - auto metricVec = metricStrings.at(module_type::shim); - if (std::find(metricVec.begin(), metricVec.end(), tileMetric.second) == metricVec.end()) { if (showWarning) { std::string msg = "Unable to find interface_tile metric set " + tileMetric.second @@ -1088,7 +1087,7 @@ namespace xdp { auto allValidPorts = metadataReader->getValidPorts(); // STEP 1 : Parse per-graph or per-kernel settings - // NOTE: graph settings not yet + // NOTE: graph settings not supported yet // STEP 2 : Parse per-tile settings: all, bounding box, and/or single tiles @@ -1187,6 +1186,7 @@ namespace xdp { auto defaultSet = defaultSets[moduleIdx]; bool showWarning = true; std::vector offTiles; + auto metricVec = metricStrings.at(module_type::uc); for (auto& tileMetric : configMetrics[moduleIdx]) { // Save list of "off" tiles @@ -1196,8 +1196,6 @@ namespace xdp { } // Ensure requested metric set is supported (if not, use default) - auto metricVec = metricStrings.at(module_type::shim); - if (std::find(metricVec.begin(), metricVec.end(), tileMetric.second) == metricVec.end()) { if (showWarning) { std::string msg = "Unable to find microcontroller metric set " + tileMetric.second From c4fd7a55a3ec2cc038b5bcaa65d6f778001d9a92 Mon Sep 17 00:00:00 2001 From: Paul Schumacher Date: Mon, 20 Jan 2025 17:39:41 +0000 Subject: [PATCH 4/6] MDM sampling, uC test set, and moved functions Signed-off-by: Paul Schumacher --- .../aie_profile/util/aie_profile_config.cpp | 83 ------------------ .../aie_profile/util/aie_profile_config.h | 22 ----- .../aie_profile/util/aie_profile_util.cpp | 87 ++++++++++++++++++- .../aie_profile/util/aie_profile_util.h | 20 +++++ 4 files changed, 106 insertions(+), 106 deletions(-) diff --git a/src/runtime_src/xdp/profile/plugin/aie_profile/util/aie_profile_config.cpp b/src/runtime_src/xdp/profile/plugin/aie_profile/util/aie_profile_config.cpp index 2d45dc21c1..200a7d4b35 100644 --- a/src/runtime_src/xdp/profile/plugin/aie_profile/util/aie_profile_config.cpp +++ b/src/runtime_src/xdp/profile/plugin/aie_profile/util/aie_profile_config.cpp @@ -607,87 +607,4 @@ namespace xdp::aie::profile { bcChannelEvent = channelEvent; } - - - - - /**************************************************************************** - * Configure counters in Microblaze Debug Module (MDM) - * TODO: convert to using XAie_Events once support is available from driver - ***************************************************************************/ - void configMDMCounters(XAie_DevInst* aieDevInst, uint8_t col, uint8_t row, - const std::vector events) - { - auto tileOffset = XAie_GetTileAddr(aieDevInst, row, col); - - // Use MDM protocol to program counters - // 1. Reset to first counter - XAie_Write32(aieDevInst, tileOffset + UC_MDM_PCCMDR, 1 << UC_MDM_PCCMDR_RESET_BIT); - - // 2. Write events for all counters - for (auto event : events) - XAie_Write32(aieDevInst, tileOffset + UC_MDM_PCCTRLR, event); - - // 3. Clear and start counters - XAie_Write32(aieDevInst, tileOffset + UC_MDM_PCCMDR, 1 << UC_MDM_PCCMDR_CLEAR_BIT); - XAie_Write32(aieDevInst, tileOffset + UC_MDM_PCCMDR, 1 << UC_MDM_PCCMDR_START_BIT); - } - - /**************************************************************************** - * Read counters in Microblaze Debug Module (MDM) - ***************************************************************************/ - void readMDMCounters(XAie_DevInst* aieDevInst, uint8_t col, uint8_t row, - std::vector& values) - { - auto tileOffset = XAie_GetTileAddr(aieDevInst, row, col); - - // Use MDM protocol to program counters - // 1. Reset to first counter - XAie_Write32(aieDevInst, tileOffset + UC_MDM_PCCMDR, 1 << UC_MDM_PCCMDR_RESET_BIT); - - // 2. Read status of all counters - std::vector overflows; - uint32_t numCounters = UC_NUM_EVENT_COUNTERS + UC_NUM_LATENCY_COUNTERS; - for (uint32_t c=0; c < numCounters; ++c) { - uint32_t val; - XAie_Read32(aieDevInst, tileOffset + UC_MDM_PCSR, &val); - bool overflow = (((val >> UC_MDM_PCSR_OVERFLOW_BIT) & 0x1) == 1); - overflows.push_back(overflow); - - if ((val >> UC_MDM_PCSR_FULL_BIT) & 0x1) { - std::cout << "Full bit of tile " << col << "," << row << " microcontroller counter " - << c << " is high" << std::endl; - } - } - - // 3. Read values of event counters - for (uint32_t c=0; c < UC_NUM_EVENT_COUNTERS; ++c) { - uint32_t val; - XAie_Read32(aieDevInst, tileOffset + UC_MDM_PCDRR, &val); - uint64_t val2 = (overflows.at(c)) ? (val + OVERFLOW_32BIT) : val; - values.push_back(val2); - } - - // 4. Read four values from latency counter - // Read 1 - The number of times the event occurred - // Read 2 - The sum of each event latency - // Read 3 - The sum of each event latency squared - // Read 4 - 31:16 Minimum measured latency, 16 bits - // 15:0 Maximum measured latency, 16 bits - std::vector latencyValues; - for (uint32_t c=0; c < UC_MDM_PCDRR_LATENCY_READS; ++c) { - uint32_t val; - XAie_Read32(aieDevInst, tileOffset + UC_MDM_PCDRR, &val); - uint64_t val2 = (overflows.at(UC_NUM_EVENT_COUNTERS)) ? (val + OVERFLOW_32BIT) : val; - latencyValues.push_back(val2); - } - - // 5. Calculate average latency - // NOTE: for now, only report average (we also have min and max; see above) - uint32_t numValues = latencyValues.at(0); - uint32_t totalLatency = latencyValues.at(1); - uint64_t avgLatency = (numValues == 0) ? 0 : (totalLatency / numValues); - values.push_back(avgLatency); - } - } // namespace xdp diff --git a/src/runtime_src/xdp/profile/plugin/aie_profile/util/aie_profile_config.h b/src/runtime_src/xdp/profile/plugin/aie_profile/util/aie_profile_config.h index d3b3be7ed9..10c7b946bd 100644 --- a/src/runtime_src/xdp/profile/plugin/aie_profile/util/aie_profile_config.h +++ b/src/runtime_src/xdp/profile/plugin/aie_profile/util/aie_profile_config.h @@ -223,28 +223,6 @@ namespace xdp::aie::profile { const XAie_Events bcEvent, XAie_Events& bcChannelEvent, std::vector>& bcResourcesBytesTx); - - - /** - * @brief Configure counters in Microblaze Debug Module (MDM) - * @param aieDevInst AIE device instance - * @param col tile column - * @param row tile row - * @param events vector of events to use in counters - */ - void configMDMCounters(XAie_DevInst* aieDevInst, uint8_t col, uint8_t row, - const std::vector events); - - /** - * @brief Read counters in Microblaze Debug Module (MDM) - * @param aieDevInst AIE device instance - * @param col tile column - * @param row tile row - * @param values vector of values from counters - */ - void readMDMCounters(XAie_DevInst* aieDevInst, uint8_t col, uint8_t row, - std::vector& values); - } // namespace xdp::aie::profile #endif diff --git a/src/runtime_src/xdp/profile/plugin/aie_profile/util/aie_profile_util.cpp b/src/runtime_src/xdp/profile/plugin/aie_profile/util/aie_profile_util.cpp index f30715ceab..b5aa310c68 100644 --- a/src/runtime_src/xdp/profile/plugin/aie_profile/util/aie_profile_util.cpp +++ b/src/runtime_src/xdp/profile/plugin/aie_profile/util/aie_profile_util.cpp @@ -288,7 +288,8 @@ namespace xdp::aie::profile { eventSets = { {"execution", {16, 17, 18, 19, 20, 62}}, {"interrupt_stalls", {23, 24, 25, 26, 27, 57}}, - {"mmu_activity", {43, 48, 49, 50, 53, 61}} + {"mmu_activity", {43, 48, 49, 50, 53, 61}}, + {"test", { 0, 0, 0, 0, 0, 0}} }; return eventSets; @@ -692,4 +693,88 @@ namespace xdp::aie::profile { return total_beats; } + /**************************************************************************** + * Configure counters in Microblaze Debug Module (MDM) + * TODO: convert to using XAie_Events once support is available from driver + ***************************************************************************/ + void configMDMCounters(XAie_DevInst* aieDevInst, uint8_t col, uint8_t row, + const std::vector events) + { + auto tileOffset = XAie_GetTileAddr(aieDevInst, row, col); + + // Use MDM protocol to configure counters + // 1. Reset to first counter + XAie_Write32(aieDevInst, tileOffset + UC_MDM_PCCMDR, 1 << UC_MDM_PCCMDR_RESET_BIT); + + // 2. Write events for all counters + for (auto event : events) + XAie_Write32(aieDevInst, tileOffset + UC_MDM_PCCTRLR, event); + + // 3. Clear and start counters + XAie_Write32(aieDevInst, tileOffset + UC_MDM_PCCMDR, 1 << UC_MDM_PCCMDR_CLEAR_BIT); + XAie_Write32(aieDevInst, tileOffset + UC_MDM_PCCMDR, 1 << UC_MDM_PCCMDR_START_BIT); + } + + /**************************************************************************** + * Read counters in Microblaze Debug Module (MDM) + ***************************************************************************/ + void readMDMCounters(XAie_DevInst* aieDevInst, uint8_t col, uint8_t row, + std::vector& values) + { + auto tileOffset = XAie_GetTileAddr(aieDevInst, row, col); + + // Use MDM protocol to read counters + // 1. Sample and stop counters + XAie_Write32(aieDevInst, tileOffset + UC_MDM_PCCMDR, 1 << UC_MDM_PCCMDR_SAMPLE_BIT); + // NOTE: Do counters need to be stopped before reading? If so, uncomment line below. + //XAie_Write32(aieDevInst, tileOffset + UC_MDM_PCCMDR, 1 << UC_MDM_PCCMDR_STOP_BIT); + + // 2. Reset to first counter + XAie_Write32(aieDevInst, tileOffset + UC_MDM_PCCMDR, 1 << UC_MDM_PCCMDR_RESET_BIT); + + // 3. Read status of all counters + std::vector overflows; + uint32_t numCounters = UC_NUM_EVENT_COUNTERS + UC_NUM_LATENCY_COUNTERS; + for (uint32_t c=0; c < numCounters; ++c) { + uint32_t val; + XAie_Read32(aieDevInst, tileOffset + UC_MDM_PCSR, &val); + bool overflow = (((val >> UC_MDM_PCSR_OVERFLOW_BIT) & 0x1) == 1); + overflows.push_back(overflow); + + if ((val >> UC_MDM_PCSR_FULL_BIT) & 0x1) { + std::cout << "Full bit of tile " << col << "," << row << " microcontroller counter " + << c << " is high" << std::endl; + } + } + + // 4. Read values of event counters + for (uint32_t c=0; c < UC_NUM_EVENT_COUNTERS; ++c) { + uint32_t val; + XAie_Read32(aieDevInst, tileOffset + UC_MDM_PCDRR, &val); + uint64_t val2 = (overflows.at(c)) ? (val + OVERFLOW_32BIT) : val; + values.push_back(val2); + } + + // 5. Read four values from latency counter + // Read 1 - The number of times the event occurred + // Read 2 - The sum of each event latency + // Read 3 - The sum of each event latency squared + // Read 4 - 31:16 Minimum measured latency, 16 bits + // 15:0 Maximum measured latency, 16 bits + std::vector latencyValues; + for (uint32_t c=0; c < UC_MDM_PCDRR_LATENCY_READS; ++c) { + uint32_t val; + XAie_Read32(aieDevInst, tileOffset + UC_MDM_PCDRR, &val); + uint64_t val2 = (overflows.at(UC_NUM_EVENT_COUNTERS)) ? (val + OVERFLOW_32BIT) : val; + latencyValues.push_back(val2); + } + + // 6. Calculate average latency + // NOTE: for now, only report average (we also have min and max; see above) + uint32_t numValues = latencyValues.at(0); + uint32_t totalLatency = latencyValues.at(1); + uint64_t avgLatency = (numValues == 0) ? 0 : (totalLatency / numValues); + values.push_back(avgLatency); + } + } // namespace xdp::aie diff --git a/src/runtime_src/xdp/profile/plugin/aie_profile/util/aie_profile_util.h b/src/runtime_src/xdp/profile/plugin/aie_profile/util/aie_profile_util.h index f017bdea6e..dba34d426e 100644 --- a/src/runtime_src/xdp/profile/plugin/aie_profile/util/aie_profile_util.h +++ b/src/runtime_src/xdp/profile/plugin/aie_profile/util/aie_profile_util.h @@ -225,6 +225,26 @@ namespace xdp::aie::profile { uint32_t convertToBeats(const std::string& metricSet, uint32_t bytes, uint8_t hwGen); + /** + * @brief Configure counters in Microblaze Debug Module (MDM) + * @param aieDevInst AIE device instance + * @param col tile column + * @param row tile row + * @param events vector of events to use in counters + */ + void configMDMCounters(XAie_DevInst* aieDevInst, uint8_t col, uint8_t row, + const std::vector events); + + /** + * @brief Read counters in Microblaze Debug Module (MDM) + * @param aieDevInst AIE device instance + * @param col tile column + * @param row tile row + * @param values vector of values from counters + */ + void readMDMCounters(XAie_DevInst* aieDevInst, uint8_t col, uint8_t row, + std::vector& values); + } // namespace xdp::aie::profile #endif From c88f0dcce7148aa88d3fd51c2139640ed7d6a380 Mon Sep 17 00:00:00 2001 From: Paul Schumacher Date: Mon, 20 Jan 2025 18:05:11 +0000 Subject: [PATCH 5/6] more MDM bug fixes Signed-off-by: Paul Schumacher --- .../xdp/profile/plugin/aie_profile/aie_profile_defs.h | 1 + .../xdp/profile/plugin/aie_profile/util/aie_profile_util.h | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/runtime_src/xdp/profile/plugin/aie_profile/aie_profile_defs.h b/src/runtime_src/xdp/profile/plugin/aie_profile/aie_profile_defs.h index 738ea6b056..886bb42121 100644 --- a/src/runtime_src/xdp/profile/plugin/aie_profile/aie_profile_defs.h +++ b/src/runtime_src/xdp/profile/plugin/aie_profile/aie_profile_defs.h @@ -20,6 +20,7 @@ constexpr uint16_t BASE_MEMORY_COUNTER = 1000; constexpr uint16_t BASE_SHIM_COUNTER = 2000; constexpr uint16_t BASE_MEM_TILE_COUNTER = 3000; +constexpr uint16_t BASE_UC_MDM_COUNTER = 4000; constexpr uint32_t PAYLOAD_IS_CHANNEL_SHIFT = 7; constexpr uint32_t PAYLOAD_IS_MASTER_SHIFT = 8; diff --git a/src/runtime_src/xdp/profile/plugin/aie_profile/util/aie_profile_util.h b/src/runtime_src/xdp/profile/plugin/aie_profile/util/aie_profile_util.h index dba34d426e..440846858e 100644 --- a/src/runtime_src/xdp/profile/plugin/aie_profile/util/aie_profile_util.h +++ b/src/runtime_src/xdp/profile/plugin/aie_profile/util/aie_profile_util.h @@ -37,7 +37,8 @@ namespace xdp::aie::profile { {module_type::core, static_cast(0)}, {module_type::dma, BASE_MEMORY_COUNTER}, {module_type::shim, BASE_SHIM_COUNTER}, - {module_type::mem_tile, BASE_MEM_TILE_COUNTER} + {module_type::mem_tile, BASE_MEM_TILE_COUNTER}, + {module_type::uc, BASE_UC_MDM_COUNTER} }; const std::vector falModuleTypes = { @@ -45,7 +46,7 @@ namespace xdp::aie::profile { XAIE_MEM_MOD, XAIE_PL_MOD, XAIE_MEM_MOD, - XAIE_PL_MOD // TODO: if needed, replace with module type for uCs + XAIE_PL_MOD // TODO: replace if/when there is an uC module type }; enum adfAPI { From 6aa405438d86d75c4b819f70f7b2ab3357dc9499 Mon Sep 17 00:00:00 2001 From: Paul Schumacher Date: Tue, 21 Jan 2025 21:38:42 +0000 Subject: [PATCH 6/6] only build AIE plugins for versal devices Signed-off-by: Paul Schumacher --- .../xdp/profile/plugin/aie_profile/CMakeLists.txt | 9 ++++----- .../xdp/profile/plugin/aie_trace/CMakeLists.txt | 8 ++++---- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/runtime_src/xdp/profile/plugin/aie_profile/CMakeLists.txt b/src/runtime_src/xdp/profile/plugin/aie_profile/CMakeLists.txt index dab1b2c249..8ee75a4af3 100644 --- a/src/runtime_src/xdp/profile/plugin/aie_profile/CMakeLists.txt +++ b/src/runtime_src/xdp/profile/plugin/aie_profile/CMakeLists.txt @@ -1,5 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -# Copyright (C) 2022 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (C) 2022-2025 Advanced Micro Devices, Inc. All rights reserved. # # ==================================================================== @@ -7,7 +7,7 @@ # on both Edge, x86, client and ve2 platforms that support AIE. # ==================================================================== -if(XDP_VE2_BUILD_CMAKE STREQUAL "yes") +if (XDP_VE2_BUILD_CMAKE STREQUAL "yes") set(IMPL_DIR "${PROFILE_DIR}/plugin/aie_profile/ve2") elseif (XDP_CLIENT_BUILD_CMAKE STREQUAL "yes") set(IMPL_DIR "${PROFILE_DIR}/plugin/aie_profile/client") @@ -38,7 +38,7 @@ file(GLOB AIE_DRIVER_COMMON_UTIL_FILES "${PROFILE_DIR}/device/common/*.cpp" ) -if(XDP_VE2_BUILD_CMAKE STREQUAL "yes") +if (XDP_VE2_BUILD_CMAKE STREQUAL "yes") add_library(xdp_aie_profile_plugin MODULE ${AIE_PROFILE_PLUGIN_FILES} ${AIE_PROFILE_UTIL_FILES} ${AIE_PROFILE_CONFIG_FILES}) add_dependencies(xdp_aie_profile_plugin xdp_core xrt_coreutil) target_link_libraries(xdp_aie_profile_plugin PRIVATE xdp_core xrt_coreutil xaiengine) @@ -62,8 +62,7 @@ elseif (XDP_CLIENT_BUILD_CMAKE STREQUAL "yes") LIBRARY DESTINATION ${XDP_PLUGIN_INSTALL_DIR} ) - -elseif (${XRT_NATIVE_BUILD} STREQUAL "yes") +elseif (DEFINED XRT_AIE_BUILD AND ${XRT_NATIVE_BUILD} STREQUAL "yes") add_library(xdp_aie_profile_plugin MODULE ${AIE_PROFILE_PLUGIN_FILES}) add_dependencies(xdp_aie_profile_plugin xdp_core xrt_coreutil) target_link_libraries(xdp_aie_profile_plugin PRIVATE xdp_core xrt_coreutil) diff --git a/src/runtime_src/xdp/profile/plugin/aie_trace/CMakeLists.txt b/src/runtime_src/xdp/profile/plugin/aie_trace/CMakeLists.txt index 76bbdf5082..d0d2bcb7d2 100644 --- a/src/runtime_src/xdp/profile/plugin/aie_trace/CMakeLists.txt +++ b/src/runtime_src/xdp/profile/plugin/aie_trace/CMakeLists.txt @@ -1,5 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -# Copyright (C) 2022 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (C) 2022-2025 Advanced Micro Devices, Inc. All rights reserved. # # ==================================================================== @@ -7,7 +7,7 @@ # Edge-Versal systems, client and ve2 but not Edge-aarch64. It also has a dependency # on the hardware shim # ==================================================================== -if(XDP_VE2_BUILD_CMAKE STREQUAL "yes") +if (XDP_VE2_BUILD_CMAKE STREQUAL "yes") set(IMPL_DIR "${PROFILE_DIR}/plugin/aie_trace/ve2") set(OFFLOAD_DIR "${PROFILE_DIR}/device/aie_trace/ve2") set(DEVICE_DIR "${PROFILE_DIR}/device/hal_device") @@ -50,7 +50,7 @@ file(GLOB AIE_DRIVER_COMMON_UTIL_FILES "${PROFILE_DIR}/device/common/*.cpp" ) -if(XDP_VE2_BUILD_CMAKE STREQUAL "yes") +if (XDP_VE2_BUILD_CMAKE STREQUAL "yes") add_library(xdp_aie_trace_plugin MODULE ${AIE_TRACE_PLUGIN_FILES} ${AIE_TRACE_UTIL_FILES} ${AIE_TRACE_CONFIG_FILES}) add_dependencies(xdp_aie_trace_plugin xdp_core xrt_coreutil) target_link_libraries(xdp_aie_trace_plugin PRIVATE xdp_core xrt_coreutil xaiengine) @@ -74,7 +74,7 @@ elseif (XDP_CLIENT_BUILD_CMAKE STREQUAL "yes") LIBRARY DESTINATION ${XDP_PLUGIN_INSTALL_DIR} ) -elseif (${XRT_NATIVE_BUILD} STREQUAL "yes") +elseif (DEFINED XRT_AIE_BUILD AND ${XRT_NATIVE_BUILD} STREQUAL "yes") add_library(xdp_aie_trace_plugin MODULE ${AIE_TRACE_PLUGIN_FILES}) add_dependencies(xdp_aie_trace_plugin xdp_core xrt_coreutil) target_link_libraries(xdp_aie_trace_plugin PRIVATE xdp_core xrt_coreutil)