Skip to content
Merged
Show file tree
Hide file tree
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
48 changes: 6 additions & 42 deletions profile/plugin/aie_dtrace/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,63 +1,27 @@
# SPDX-License-Identifier: Apache-2.0
# Copyright (C) 2025 Advanced Micro Devices, Inc. All rights reserved.
#
# Link this plugin with the same AIE profile *object sources* as
# xdp_aie_profile_plugin_xdna (see plugin/aie_profile/CMakeLists.txt, XDP_VE2_BUILD),
# except:
# - no aie_profile_plugin*, aie_profile_cb*, writer/aie_profile/*
# - no ve2/aie_profile* (replaced by aie_dtrace/ve2/*)
#
# If load fails with "undefined symbol" from AieProfileMetadata / parser / elf,
# add the missing .cpp here or in AIE_DTRACE_PROFILE_CORE_SOURCES below.
# ELF serialization for aiebu CT: ve2/elf_helper.cpp (same role as aie_profile/ve2/elf_helper.cpp).
# Copyright (C) 2026 Advanced Micro Devices, Inc. All rights reserved
#
# Standalone AIE dtrace plugin for VE2/XDNA. Handles bandwidth metric sets only;
# no dependency on aie_profile sources.

if (XDP_VE2_BUILD_CMAKE STREQUAL "yes")
set(XDP_PROFILE_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/../..")

file(GLOB AIE_DTRACE_PLUGIN_FILES
"${CMAKE_CURRENT_SOURCE_DIR}/*.h"
"${CMAKE_CURRENT_SOURCE_DIR}/*.cpp"
)
file(GLOB AIE_DTRACE_UTIL_FILES
"${CMAKE_CURRENT_SOURCE_DIR}/util/*.h"
"${CMAKE_CURRENT_SOURCE_DIR}/util/*.cpp"
set(AIE_DTRACE_UTIL_FILES
"${CMAKE_CURRENT_SOURCE_DIR}/util/aie_dtrace_util.h"
"${CMAKE_CURRENT_SOURCE_DIR}/util/aie_dtrace_util.cpp"
)
file(GLOB AIE_DTRACE_IMPL_FILES
"${CMAKE_CURRENT_SOURCE_DIR}/ve2/*.h"
"${CMAKE_CURRENT_SOURCE_DIR}/ve2/*.cpp"
)

# Explicit .cpp from aie_profile tree required by metadata + CT/ELF (not covered by util/config globs).
set(AIE_DTRACE_PROFILE_CORE_SOURCES
"${XDP_PROFILE_ROOT}/plugin/aie_profile/aie_profile_metadata.cpp"
"${XDP_PROFILE_ROOT}/plugin/aie_profile/aie_profile_metadata_json.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/ve2/elf_helper.cpp"
)

file(GLOB AIE_PROFILE_UTIL_FILES
"${XDP_PROFILE_ROOT}/plugin/aie_base/*"
"${XDP_PROFILE_ROOT}/plugin/aie_base/generations/*"
"${XDP_PROFILE_ROOT}/plugin/aie_profile/util/aie_profile_util.h"
"${XDP_PROFILE_ROOT}/plugin/aie_profile/util/aie_profile_util.cpp"
)
file(GLOB AIE_PROFILE_CONFIG_FILES
"${XDP_PROFILE_ROOT}/plugin/aie_profile/util/aie_profile_config.h"
"${XDP_PROFILE_ROOT}/plugin/aie_profile/util/aie_profile_config.cpp"
)
file(GLOB AIE_JSON_PARSER_FILES
"${XDP_PROFILE_ROOT}/database/parser/*.h"
"${XDP_PROFILE_ROOT}/database/parser/*.cpp"
)

add_library(xdp_aie_dtrace_plugin_xdna SHARED
${AIE_DTRACE_PLUGIN_FILES}
${AIE_DTRACE_IMPL_FILES}
${AIE_DTRACE_UTIL_FILES}
${AIE_DTRACE_PROFILE_CORE_SOURCES}
${AIE_PROFILE_UTIL_FILES}
${AIE_PROFILE_CONFIG_FILES}
${AIE_JSON_PARSER_FILES}
)
add_dependencies(xdp_aie_dtrace_plugin_xdna xdp_core xrt_coreutil)
target_link_libraries(xdp_aie_dtrace_plugin_xdna PRIVATE xdp_core xrt_coreutil aie_codegen aiebu_library_objects)
Expand Down
18 changes: 3 additions & 15 deletions profile/plugin/aie_dtrace/aie_dtrace_cb.cpp
Original file line number Diff line number Diff line change
@@ -1,18 +1,6 @@
/**
* Copyright (C) 2022-2023 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.
*/
// SPDX-License-Identifier: Apache-2.0
// Copyright (C) 2026 Advanced Micro Devices, Inc. All rights reserved

#define XDP_PLUGIN_SOURCE

#include "aie_dtrace_cb.h"
Expand Down
17 changes: 2 additions & 15 deletions profile/plugin/aie_dtrace/aie_dtrace_cb.h
Original file line number Diff line number Diff line change
@@ -1,18 +1,5 @@
/**
* 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.
*/
// SPDX-License-Identifier: Apache-2.0
// Copyright (C) 2026 Advanced Micro Devices, Inc. All rights reserved

#ifndef XDP_PLUGIN_AIE_DTRACE_CB_H
#define XDP_PLUGIN_AIE_DTRACE_CB_H
Expand Down
55 changes: 55 additions & 0 deletions profile/plugin/aie_dtrace/aie_dtrace_impl.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
// SPDX-License-Identifier: Apache-2.0
// Copyright (C) 2026 Advanced Micro Devices, Inc. All rights reserved

#ifndef AIE_DTRACE_IMPL_H
#define AIE_DTRACE_IMPL_H

#include <memory>
#include <string>

#include "xdp/profile/plugin/aie_dtrace/aie_dtrace_metadata.h"
#include "xdp/profile/plugin/vp_base/vp_base_plugin.h"

namespace xdp {

// AIE profile configurations can be done in different ways depending
// on the platform. For example, platforms like the VCK5000 or
// discovery platform, where the host code runs on the x86 and the AIE
// is not directly accessible, will require configuration be done via
// PS kernel.
class AieDtraceImpl
{

protected:
VPDatabase* db = nullptr;
std::shared_ptr<AieDtraceMetadata> metadata;
uint64_t deviceID;

public:
AieDtraceImpl(VPDatabase* database, std::shared_ptr<AieDtraceMetadata> metadata, uint64_t id)
: db(database),
metadata(metadata),
deviceID(id)
{}

AieDtraceImpl() = delete;
virtual ~AieDtraceImpl() {};

virtual void updateDevice() = 0;

virtual void startPoll(const uint64_t /*id*/) {}
virtual void continuePoll(const uint64_t /*id*/) {}
virtual void poll(const uint64_t /*id*/) {}
virtual void endPoll() {}
virtual void freeResources() {}

virtual void generateCTForRun(void* /*run_impl_ptr*/, void* /*hwctx*/, uint32_t /*run_uid*/,
const std::string& /*kernel_name*/,
void* /*elf_handle*/) {}

uint64_t getDeviceID() { return deviceID; }
};

} // namespace xdp

#endif
Loading
Loading