Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 2 additions & 0 deletions profile/plugin/aie_trace/client/aie_trace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -606,6 +606,8 @@ namespace xdp {
return false;
}

aie::trace::warnIfAieInterfaceTraceContendsWithStartToBytes(metadata);

Comment thread
predutta marked this conversation as resolved.
Outdated
// Get channel configurations (memory and interface tiles)
auto configChannel0 = metadata->getConfigChannel0();
auto configChannel1 = metadata->getConfigChannel1();
Expand Down
2 changes: 2 additions & 0 deletions profile/plugin/aie_trace/edge/aie_trace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,8 @@ namespace xdp {
return false;
}

aie::trace::warnIfAieInterfaceTraceContendsWithStartToBytes(metadata);

// Get channel configurations (memory and interface tiles)
auto configChannel0 = metadata->getConfigChannel0();
auto configChannel1 = metadata->getConfigChannel1();
Expand Down
46 changes: 46 additions & 0 deletions profile/plugin/aie_trace/util/aie_trace_util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include "xdp/profile/device/pl_device_intf.h"
#include "xdp/profile/device/tracedefs.h"

#include "core/common/config_reader.h"
#include "core/common/message.h"
#include "core/include/xrt/xrt_kernel.h"

Expand All @@ -20,6 +21,7 @@
#include <memory>
#include <regex>
#include <set>
#include <string>

// ***************************************************************
// Anonymous namespace for helper functions local to this file
Expand Down Expand Up @@ -778,4 +780,48 @@ namespace xdp::aie::trace {
}
}

static const char* const kStartToBytesMetric = "start_to_bytes_transferred";

static bool
aieProfileConfiguresStartToBytesOnInterfaceTiles()
{
if (!xrt_core::config::get_aie_profile())
return false;
const std::string g = boost::algorithm::trim_copy(
xrt_core::config::get_aie_profile_settings_graph_based_interface_tile_metrics());
const std::string t = boost::algorithm::trim_copy(
xrt_core::config::get_aie_profile_settings_tile_based_interface_tile_metrics());
return (g.find(kStartToBytesMetric) != std::string::npos)
|| (t.find(kStartToBytesMetric) != std::string::npos);
}

void
warnIfAieInterfaceTraceContendsWithStartToBytes(
const std::shared_ptr<AieTraceMetadata>& metadata)
{
static bool s_warned = false;
if (s_warned)
return;
if (!xrt_core::config::get_aie_trace())
Comment on lines +802 to +805
return;
if (!aieProfileConfiguresStartToBytesOnInterfaceTiles())
return;

bool traceHasInterfaceTile = false;
for (const auto& tileMetric : metadata->getConfigMetrics()) {
const auto& tile = tileMetric.first;
if (aie::getModuleType(tile.row, metadata->getRowOffset()) == module_type::shim) {
traceHasInterfaceTile = true;
break;
}
}
if (!traceHasInterfaceTile)
return;

s_warned = true;
std::string msg =
"AIE trace on interface (shim) tiles together with AIE profile start_to_bytes_transferred "
"on interface tiles can contend for the same PL user event; AIE trace data may be wrong.";
xrt_core::message::send(severity_level::warning, "XRT", msg);
}
} // namespace xdp::aie::trace
10 changes: 9 additions & 1 deletion profile/plugin/aie_trace/util/aie_trace_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,15 @@ namespace xdp::aie::trace {
void reset2ChannelBroadcastNetwork(XAie_DevInst* aieDevInst, std::shared_ptr<AieTraceMetadata> metadata,
uint8_t broadcastId1, uint8_t broadcastId2, uint8_t startCol,
uint8_t numCols, uint8_t numRows);


/**
* @brief If interface-tile AIE trace and AIE profile \c start_to_bytes_transferred
* (graph/tile interface-tile strings) are both in use, log a one-time warning.
* Call only after \c getIsValidMetrics() is true.
*/
void warnIfAieInterfaceTraceContendsWithStartToBytes(
const std::shared_ptr<AieTraceMetadata>& metadata);

} // namespace xdp::aie::trace

#endif
1 change: 1 addition & 0 deletions profile/plugin/aie_trace/ve2/aie_trace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,7 @@ namespace xdp {
return false;
}

aie::trace::warnIfAieInterfaceTraceContendsWithStartToBytes(metadata);
boost::property_tree::ptree aiePartitionPt = xdp::aie::getAIEPartitionInfo(handle);
// Currently, assuming only one Hw Context is alive at a time
// Column should be relative to the partition, hence startCol is 0.
Expand Down
Loading