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
32 changes: 27 additions & 5 deletions profile/plugin/aie_profile/aie_profile_metadata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -619,6 +619,9 @@ namespace xdp {

// Pass 2 : process only range of tiles metric setting
for (size_t i = 0; i < metricsSettings.size(); ++i) {
//Do not re-parse Pass 1 "all:..."
if (isAll[i])
continue;
if ((metrics[i].size() != 3) && (metrics[i].size() != 4))
continue;

Expand Down Expand Up @@ -921,7 +924,7 @@ namespace xdp {
}
catch (...) {
std::stringstream msg;
msg << "Channel specifications in graph_based_interface_metrics "
msg << "Channel specifications in graph_based_interface_tile_metrics "
<< "are not valid and hence ignored.";
xrt_core::message::send(severity_level::warning, "XRT", msg.str());
}
Expand Down Expand Up @@ -1074,18 +1077,20 @@ namespace xdp {
for (size_t i = 0; i < metricsSettings.size(); ++i) {
if ((metrics[i][0].compare("all") == 0) || (metrics[i].size() < 3))
continue;
if (!isSupported(metrics[i][1], true))
continue;

uint8_t maxCol = 0;
try {
maxCol = aie::convertStringToUint8(metrics[i][1]);
}
catch (std::invalid_argument const&) {
// maxColumn is not an integer i.e either 1st style or wrong format, skip for now
// Not a range specification (e.g. single-tile format such as
// <col>:<metric>:<channel>); let later passes handle it.
continue;
}

if (!isSupported(metrics[i][2], true))
continue;

uint8_t minCol = 0;
try {
minCol = aie::convertStringToUint8(metrics[i][0]);
Expand Down Expand Up @@ -1139,8 +1144,21 @@ namespace xdp {
// Pass 3 : process only single tile metric setting
// <singleColumn>:<metric>[:<channel0>[:<channel1>]]
for (size_t i = 0; i < metricsSettings.size(); ++i) {
bool isRangeSpecification = false;
if (metrics[i].size() >= 3) {
try {
(void)aie::convertStringToUint8(metrics[i][0]);
(void)aie::convertStringToUint8(metrics[i][1]);
isRangeSpecification = true;
}
catch (std::invalid_argument const&) {
isRangeSpecification = false;
}
}

// Skip range specification, invalid format, or already processed
if ((metrics[i].size() == 4) || (metrics[i].size() < 2) || (metrics[i][0].compare("all") == 0))
if (isRangeSpecification || (metrics[i].size() == 4) || (metrics[i].size() < 2)
|| (metrics[i][0].compare("all") == 0))
continue;
if (!isSupported(metrics[i][1], true))
continue;
Expand All @@ -1149,6 +1167,10 @@ namespace xdp {

try {
col = aie::convertStringToUint8(metrics[i][1]);
xrt_core::message::send(severity_level::warning, "XRT",
"tile_based_interface_tile_metrics: invalid format. Ignored: "
+ metricsSettings[i]);
continue;
Comment thread
predutta marked this conversation as resolved.
}
catch (std::invalid_argument const&) {
// max column is not a number, so the expected single column specification. Handle this here
Expand Down
5 changes: 4 additions & 1 deletion profile/plugin/aie_profile/edge/aie_profile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,10 @@ namespace xdp {
if (!runtimeCounters) {
// No runtime counters means there were no valid metrics configured for profiling this design. There is nothing to profile, so return early.
xrt_core::message::send(severity_level::warning, "XRT",
"No valid metric setting found for this design. Please specify valid tile_based_[aie|aie_memory|interface_tile]_metrics under \"AIE_profile_settings\" section in your xrt.ini if you want to configure this design.");
"No valid metric setting found for this design. Please specify valid "
"graph_based_[aie|aie_memory|memory_tile|interface_tile]_metrics and/or "
"tile_based_[aie|aie_memory|memory_tile|interface_tile|microcontroller]_metrics "
"under \"AIE_profile_settings\" section in your xrt.ini if you want to configure this design.");
return;
}
}
Expand Down
5 changes: 4 additions & 1 deletion profile/plugin/aie_profile/ve2/aie_profile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,10 @@ namespace xdp {

if (counters.empty()) {
xrt_core::message::send(severity_level::warning, "XRT",
"AIE Profile Counters were not found for this design. Please specify tile_based_[aie|aie_memory|interface_tile]_metrics under \"AIE_profile_settings\" section in your xrt.ini.");
"AIE Profile Counters were not found for this design. Please specify "
"graph_based_[aie|aie_memory|memory_tile|interface_tile]_metrics and/or "
"tile_based_[aie|aie_memory|memory_tile|interface_tile|microcontroller]_metrics "
"under \"AIE_profile_settings\" section in your xrt.ini.");
(db->getStaticInfo()).setIsAIECounterRead(deviceID,true);
return;
}
Expand Down
20 changes: 16 additions & 4 deletions profile/plugin/aie_trace/aie_trace_metadata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ namespace xdp {
&& (std::find(allValidEntries.begin(), allValidEntries.end(), graphMetrics[i][1]) == allValidEntries.end())) {
std::stringstream msg;
msg << "Could not find " << entryType << " " << graphMetrics[i][1]
<< " as specified in graph_based_" << tileName << "_metrics setting."
<< " as specified in graph_based_" << tileName << "_tile_metrics setting."
<< " The following " << entryType << "s are valid : ";
if (!allValidEntries.empty()) {
msg << allValidEntries[0];
Expand Down Expand Up @@ -460,7 +460,7 @@ namespace xdp {
&& (std::find(allValidEntries.begin(), allValidEntries.end(), graphMetrics[i][1]) == allValidEntries.end())) {
std::stringstream msg;
msg << "Could not find " << entryType << " " << graphMetrics[i][1]
<< " as specified in graph_based_" << tileName << "_metrics setting."
<< " as specified in graph_based_" << tileName << "_tile_metrics setting."
<< " The following " << entryType << "s are valid : ";
if (!allValidEntries.empty()) {
msg << allValidEntries[0];
Expand Down Expand Up @@ -788,7 +788,7 @@ namespace xdp {
}
} catch (...) {
std::stringstream msg;
msg << "Channel specifications in graph_based_interface_metrics "
msg << "Channel specifications in graph_based_interface_tile_metrics "
<< "are not valid and hence ignored.";
xrt_core::message::send(severity_level::warning, "XRT", msg.str());
}
Expand Down Expand Up @@ -888,12 +888,20 @@ namespace xdp {
if ((processed.find(i) != processed.end()) || (metrics[i].size() < 3))
continue;

// Only entries with a numeric second token are range specifications.
// Valid single-tile settings with channels (for example,
// <col>:<metric>:<channel>) also have 3+ tokens and are handled in Pass 3.
if (!aie::isDigitString(metrics[i][1]))
continue;

uint8_t maxCol = 0;
try {
maxCol = aie::convertStringToUint8(metrics[i][1]);
}
catch (std::invalid_argument const&) {
// Max column is not an integer, so either first style or wrong format. Skip for now.
xrt_core::message::send(severity_level::warning, "XRT",
"tile_based_interface_tile_metrics: invalid range line. Ignored: "
+ metricsSettings[i]);
continue;
}

Expand Down Expand Up @@ -952,6 +960,10 @@ namespace xdp {
uint8_t col = 0;
try {
col = aie::convertStringToUint8(metrics[i][1]);
xrt_core::message::send(severity_level::warning, "XRT",
"tile_based_interface_tile_metrics: invalid format. Ignored: "
+ metricsSettings[i]);
continue;
}
catch (std::invalid_argument const&) {
// Max column is not an integer, so expected single column specification. Handle this here.
Expand Down
Loading