From 9b11d868f15bab169d84b854804c9c872989ea54 Mon Sep 17 00:00:00 2001 From: Jason Villarreal Date: Fri, 29 May 2026 15:44:17 -0700 Subject: [PATCH] Removing the system compiler and noc plugins Signed-off-by: Jason Villarreal --- README.md | 1 - profile/plugin/CMakeLists.txt | 2 - profile/plugin/noc/CMakeLists.txt | 26 --- profile/plugin/noc/noc_cb.cpp | 26 --- profile/plugin/noc/noc_plugin.cpp | 148 ------------------ profile/plugin/noc/noc_plugin.h | 48 ------ profile/plugin/system_compiler/CMakeLists.txt | 23 --- .../system_compiler/system_compiler_cb.cpp | 26 --- .../system_compiler_plugin.cpp | 39 ----- .../system_compiler/system_compiler_plugin.h | 33 ---- profile/plugin/vp_base/info.h | 10 +- 11 files changed, 4 insertions(+), 378 deletions(-) delete mode 100644 profile/plugin/noc/CMakeLists.txt delete mode 100644 profile/plugin/noc/noc_cb.cpp delete mode 100755 profile/plugin/noc/noc_plugin.cpp delete mode 100755 profile/plugin/noc/noc_plugin.h delete mode 100644 profile/plugin/system_compiler/CMakeLists.txt delete mode 100644 profile/plugin/system_compiler/system_compiler_cb.cpp delete mode 100644 profile/plugin/system_compiler/system_compiler_plugin.cpp delete mode 100644 profile/plugin/system_compiler/system_compiler_plugin.h diff --git a/README.md b/README.md index 0014e828..de40d3b1 100644 --- a/README.md +++ b/README.md @@ -82,7 +82,6 @@ Plugins: * opencl : OpenCL trace of host code. Available on Edge, Alveo, hardware emulation * pl_deadlock: Detect and interpret PL deadlock. Available on Edge, Alveo * power: Available on Alveo -* system_compiler : No feature * user : Called from user host code. Available on Edge, Alveo, Client, hardware emulation. * vart : No feature * vp_base : No feature diff --git a/profile/plugin/CMakeLists.txt b/profile/plugin/CMakeLists.txt index 829c4f00..16133e4d 100644 --- a/profile/plugin/CMakeLists.txt +++ b/profile/plugin/CMakeLists.txt @@ -52,9 +52,7 @@ add_subdirectory(aie_status) add_subdirectory(aie_profile) add_subdirectory(aie_trace) add_subdirectory(device_offload/hw_emu) -add_subdirectory(noc) add_subdirectory(power) -add_subdirectory(system_compiler) add_subdirectory(vart) else() diff --git a/profile/plugin/noc/CMakeLists.txt b/profile/plugin/noc/CMakeLists.txt deleted file mode 100644 index d555e32a..00000000 --- a/profile/plugin/noc/CMakeLists.txt +++ /dev/null @@ -1,26 +0,0 @@ -# SPDX-License-Identifier: Apache-2.0 -# Copyright (C) 2022 Advanced Micro Devices, Inc. All rights reserved. -# - -# ==================================================================== -# This builds the NoC plugin, which is currently unused and not -# completely implemented, but included for future expansion. -# ==================================================================== - -file(GLOB NOC_PLUGIN_FILES - "${PROFILE_DIR}/plugin/noc/*.h" - "${PROFILE_DIR}/plugin/noc/*.cpp" - "${PROFILE_DIR}/writer/noc/*.h" - "${PROFILE_DIR}/writer/noc/*.cpp" -) - -add_library(xdp_noc_plugin SHARED ${NOC_PLUGIN_FILES}) -add_dependencies(xdp_noc_plugin xdp_core xrt_core) -target_link_libraries(xdp_noc_plugin PRIVATE xdp_core xrt_core) - -set_target_properties(xdp_noc_plugin PROPERTIES VERSION ${XRT_VERSION_STRING} SOVERSION ${XRT_SOVERSION}) - -install (TARGETS xdp_noc_plugin - RUNTIME DESTINATION ${XDP_PLUGIN_INSTALL_DIR} COMPONENT ${XRT_COMPONENT} - LIBRARY DESTINATION ${XDP_PLUGIN_INSTALL_DIR} COMPONENT ${XRT_COMPONENT} ${XRT_NAMELINK_SKIP} -) diff --git a/profile/plugin/noc/noc_cb.cpp b/profile/plugin/noc/noc_cb.cpp deleted file mode 100644 index d511c1f3..00000000 --- a/profile/plugin/noc/noc_cb.cpp +++ /dev/null @@ -1,26 +0,0 @@ -/** - * Copyright (C) 2020 Xilinx, Inc - * - * 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 - * License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - */ - -#include "xdp/profile/plugin/noc/noc_plugin.h" - -namespace xdp { - - // The NOC profiling plugin doesn't have any callbacks. Instead, it - // only has a single static instance of the plugin object. - - static NOCProfilingPlugin nocPluginInstance; - -} // end namespace xdp diff --git a/profile/plugin/noc/noc_plugin.cpp b/profile/plugin/noc/noc_plugin.cpp deleted file mode 100755 index 1cae6386..00000000 --- a/profile/plugin/noc/noc_plugin.cpp +++ /dev/null @@ -1,148 +0,0 @@ -/** - * Copyright (C) 2020-2021 Xilinx, Inc - * 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 - * License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - */ - -#define XDP_PLUGIN_SOURCE - -#include "core/common/system.h" -#include "core/common/time.h" -#include "core/common/config_reader.h" -#include "core/include/xrt/experimental/xrt-next.h" -#include "core/include/xrt/xrt_device.h" - -#include "xdp/profile/database/static_info/aie_constructs.h" -#include "xdp/profile/plugin/noc/noc_plugin.h" -#include "xdp/profile/writer/noc/noc_writer.h" -#include "xdp/profile/plugin/vp_base/info.h" -#include "xdp/profile/device/utility.h" - -#include - -namespace xdp { - - NOCProfilingPlugin::NOCProfilingPlugin() - : XDPPlugin(), mKeepPolling(true) - { - db->registerPlugin(this); - db->registerInfo(info::noc); - - uint32_t numDevices = xrt_core::get_total_devices(true).second; - uint32_t index = 0; - while (index < numDevices) { - try { - auto xrtDevice = std::make_unique(index); - auto ownedHandle = xrtDevice->get_handle()->get_device_handle(); - // Determine the name of the device - std::string deviceName = util::getDeviceName(ownedHandle); - mDevices.push_back(deviceName); - - std::string outputFile = "noc_profile_" + deviceName + ".csv"; - VPWriter* writer = new NOCProfilingWriter(outputFile.c_str(), - deviceName.c_str(), - index) ; - writers.push_back(writer); - db->addOpenedFile(writer->getcurrentFileName(), "NOC_PROFILE") ; - } catch (const std::runtime_error &) { - break; - } - ++index; - } - - // Get polling interval (in msec) - mPollingInterval = xrt_core::config::get_noc_profile_interval_ms(); - - // Start the NOC profiling thread - mPollingThread = std::thread(&NOCProfilingPlugin::pollNOCCounters, this); - } - - NOCProfilingPlugin::~NOCProfilingPlugin() - { - // Stop the polling thread - mKeepPolling = false; - mPollingThread.join(); - - if (VPDatabase::alive()) { - for (auto w : writers) { - w->write(false); - } - - db->unregisterPlugin(this); - } - } - - void NOCProfilingPlugin::pollNOCCounters() - { - /* - uint64_t pollnum = 0; - - while (mKeepPolling) { - // Get timestamp in milliseconds - double timestamp = xrt_core::time_ns() / 1.0e6; - uint64_t index = 0; - - // Iterate over all devices - for (auto device : mDevices) { - XclbinInfo* currentXclbin = db->getStaticInfo().getCurrentlyLoadedXclbin(index); - // Iterate over all NOC NMUs - auto numNOC = db->getStaticInfo().getNumNOC(index, currentXclbin); - for (uint64_t n=0; n < numNOC; n++) { - auto noc = db->getStaticInfo().getNOC(index, currentXclbin, n); - - // Name = ----- - std::vector result; - boost::split(result, noc->name, boost::is_any_of("-")); - std::string cellName = (result.size() > 1) ? result[1] : "N/A"; - - // TODO: replace dummy data with counter values - std::vector values; - - // Read - uint64_t readByteCount = pollnum * 128; - uint64_t readBurstCount = pollnum * 10; - uint64_t readTotalLatency = pollnum * 1000; - uint64_t readMinLatency = 42; - uint64_t readMaxLatency = 100; - values.push_back(readByteCount); - values.push_back(readBurstCount); - values.push_back(readTotalLatency); - values.push_back(readMinLatency); - values.push_back(readMaxLatency); - - // Write - uint64_t writeByteCount = pollnum * 234; - uint64_t writeBurstCount = pollnum * 21; - uint64_t writeTotalLatency = pollnum * 1234; - uint64_t writeMinLatency = 24; - uint64_t writeMaxLatency = 123; - values.push_back(writeByteCount); - values.push_back(writeBurstCount); - values.push_back(writeTotalLatency); - values.push_back(writeMinLatency); - values.push_back(writeMaxLatency); - - // Add sample to dynamic database - // db->getDynamicInfo().addNOCSample(index, timestamp, cellName, values); - ++index; - } - } - - std::this_thread::sleep_for(std::chrono::milliseconds(mPollingInterval)); - ++pollnum; - } - */ - } - -} // end namespace xdp diff --git a/profile/plugin/noc/noc_plugin.h b/profile/plugin/noc/noc_plugin.h deleted file mode 100755 index f1ba4ca7..00000000 --- a/profile/plugin/noc/noc_plugin.h +++ /dev/null @@ -1,48 +0,0 @@ -/** - * Copyright (C) 2020 Xilinx, Inc - * - * 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 - * License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - */ - -#ifndef XDP_NOC_PLUGIN_DOT_H -#define XDP_NOC_PLUGIN_DOT_H - -#include -#include -#include - -#include "xdp/profile/plugin/vp_base/vp_base_plugin.h" -#include "xdp/config.h" - -namespace xdp { - - class NOCProfilingPlugin : public XDPPlugin - { - public: - NOCProfilingPlugin(); - ~NOCProfilingPlugin(); - - private: - void pollNOCCounters(); - - private: - // NOC profiling uses its own thread - bool mKeepPolling; - unsigned int mPollingInterval; - std::thread mPollingThread; - std::vector mDevices; - }; - -} // end namespace xdp - -#endif diff --git a/profile/plugin/system_compiler/CMakeLists.txt b/profile/plugin/system_compiler/CMakeLists.txt deleted file mode 100644 index 520364b9..00000000 --- a/profile/plugin/system_compiler/CMakeLists.txt +++ /dev/null @@ -1,23 +0,0 @@ -# SPDX-License-Identifier: Apache-2.0 -# Copyright (C) 2022 Advanced Micro Devices, Inc. All rights reserved. -# - -# ==================================================================== -# This builds the System Compiler plugin. -# ==================================================================== - -file(GLOB SYSTEM_COMPILER_PLUGIN_FILES - "${PROFILE_DIR}/plugin/system_compiler/*.h" - "${PROFILE_DIR}/plugin/system_compiler/*.cpp" -) - -add_library(xdp_system_compiler_plugin SHARED ${SYSTEM_COMPILER_PLUGIN_FILES}) -add_dependencies(xdp_system_compiler_plugin xdp_core) -target_link_libraries(xdp_system_compiler_plugin PRIVATE xdp_core) - -set_target_properties(xdp_system_compiler_plugin PROPERTIES VERSION ${XRT_VERSION_STRING} SOVERSION ${XRT_SOVERSION}) - -install (TARGETS xdp_system_compiler_plugin - RUNTIME DESTINATION ${XDP_PLUGIN_INSTALL_DIR} COMPONENT ${XRT_COMPONENT} - LIBRARY DESTINATION ${XDP_PLUGIN_INSTALL_DIR} COMPONENT ${XRT_COMPONENT} ${XRT_NAMELINK_SKIP} -) diff --git a/profile/plugin/system_compiler/system_compiler_cb.cpp b/profile/plugin/system_compiler/system_compiler_cb.cpp deleted file mode 100644 index 49a9539d..00000000 --- a/profile/plugin/system_compiler/system_compiler_cb.cpp +++ /dev/null @@ -1,26 +0,0 @@ -/** - * Copyright (C) 2021 Xilinx, Inc - * - * 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 - * License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - */ - -#include "xdp/profile/plugin/system_compiler/system_compiler_plugin.h" - -namespace xdp { - - // The System Compiler plugin currently doesn't have any callbacks. - // Instead, it only has a single static instance of the plugin object. - - static SystemCompilerPlugin systemCompilerPluginInstance ; - -} // end namespace xdp diff --git a/profile/plugin/system_compiler/system_compiler_plugin.cpp b/profile/plugin/system_compiler/system_compiler_plugin.cpp deleted file mode 100644 index 4c407357..00000000 --- a/profile/plugin/system_compiler/system_compiler_plugin.cpp +++ /dev/null @@ -1,39 +0,0 @@ -/** - * Copyright (C) 2021 Xilinx, Inc - * Copyright (C) 2023-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 - * License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - */ - -#define XDP_PLUGIN_SOURCE - -#include "xdp/profile/plugin/system_compiler/system_compiler_plugin.h" -#include "xdp/profile/plugin/vp_base/info.h" - -namespace xdp { - - SystemCompilerPlugin::SystemCompilerPlugin() : XDPPlugin() - { - db->registerPlugin(this); - db->registerInfo(info::system_compiler); - - db->addOpenedFile("sc_host_summary.csv", "PROFILE_SUMMARY"); - db->addOpenedFile("sc_trace.csv", "VP_TRACE"); - } - - SystemCompilerPlugin::~SystemCompilerPlugin() - { - } - - -} // end namespace xdp diff --git a/profile/plugin/system_compiler/system_compiler_plugin.h b/profile/plugin/system_compiler/system_compiler_plugin.h deleted file mode 100644 index 861af9d3..00000000 --- a/profile/plugin/system_compiler/system_compiler_plugin.h +++ /dev/null @@ -1,33 +0,0 @@ -/** - * Copyright (C) 2021 Xilinx, Inc - * - * 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 - * License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - */ - -#ifndef SYSTEM_COMPILER_PLUGIN_DOT_H -#define SYSTEM_COMPILER_PLUGIN_DOT_H - -#include "xdp/profile/plugin/vp_base/vp_base_plugin.h" - -namespace xdp { - - class SystemCompilerPlugin : public XDPPlugin - { - public: - SystemCompilerPlugin() ; - ~SystemCompilerPlugin() ; - } ; - -} // end namespace xdp - -#endif diff --git a/profile/plugin/vp_base/info.h b/profile/plugin/vp_base/info.h index d5693b76..7e3fc342 100644 --- a/profile/plugin/vp_base/info.h +++ b/profile/plugin/vp_base/info.h @@ -1,6 +1,6 @@ /** * Copyright (C) 2016-2021 Xilinx, Inc - * Copyright (C) 2022-2024 Advanced Micro Devices, Inc. - All rights reserved + * Copyright (C) 2022-2026 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 @@ -20,8 +20,7 @@ #include -namespace xdp { -namespace info { +namespace xdp::info { const uint64_t aie_profile = 0x00001 ; const uint64_t aie_trace = 0x00002 ; @@ -33,7 +32,7 @@ namespace info { const uint64_t opencl_counters = 0x00080 ; const uint64_t opencl_trace = 0x00100 ; const uint64_t power = 0x00200 ; - const uint64_t system_compiler = 0x00400 ; + // Removed functionality: 0x00400 is currently unused const uint64_t user = 0x00800 ; const uint64_t vart = 0x01000 ; const uint64_t aie_status = 0x02000 ; @@ -43,7 +42,6 @@ namespace info { const uint64_t aie_debug = 0x20000 ; const uint64_t aie_dtrace = 0x40000 ; -} // end namespace info -} // end namespace xdp ; +} // end namespace xdp::info #endif