Skip to content

Commit

Permalink
Fix to handle input_ports_details and output_ports_details Interface …
Browse files Browse the repository at this point in the history
…tiles metric for PLIO designs (#8064)
  • Loading branch information
vipangul authored Apr 12, 2024
1 parent 0a06c6f commit baf8882
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,8 @@ namespace xdp::aie {
for (auto& info : infoVector) {
auto startCol = static_cast<uint8_t>(info.start_col);
xrt_core::message::send(severity_level::info, "XRT",
"Partition shift of " + std::to_string(startCol) + " was found.");
"Partition shift of " + std::to_string(startCol) +
" was found, number of columns: " + std::to_string(info.num_cols));
startCols.push_back(startCol);
}
}
Expand Down
1 change: 1 addition & 0 deletions src/runtime_src/xdp/profile/device/tracedefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ Please increase trace_buffer_size and trace_buffer_offload_interval together or
#define AIE_TRACE_BUF_ALLOC_FAIL "Allocation of buffer for AIE trace failed. AIE trace will not be available."
#define AIE_TS2MM_WARN_MSG_BUF_FULL "AIE Trace Buffer is full. Device trace could be incomplete."
#define AIE_TS2MM_WARN_MSG_CIRC_BUF_OVERWRITE "Circular buffer overwrite was detected in device trace. AIE trace could be incomplete."
#define AIE_TRACE_TILES_UNAVAILABLE "No valid tiles found for the provided configuration and design. So, AIE event trace will not be available."

#define AIE_TRACE_BUF_REUSE_WARN "AIE reuse_buffer may cause overrun. \
Recommended settings: \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -903,6 +903,7 @@ namespace xdp {

// Set default, check validity, and remove "off" tiles
bool showWarning = true;
bool showWarningGMIOMetric = true;
std::vector<tile_type> offTiles;
auto defaultSet = defaultSets[module_type::shim];
auto metricVec = metricSets[module_type::shim];
Expand All @@ -917,6 +918,23 @@ namespace xdp {
continue;
}

// Check for PLIO tiles and it's compatible metric settings
if ((tileMetric.first.subtype == 0) && isGMIOMetric(tileMetric.second)) {
if (showWarningGMIOMetric) {
std::string msg = "Configured interface_tile metric set " + tileMetric.second
+ " is only applicable for GMIO type tiles.";
xrt_core::message::send(severity_level::warning, "XRT", msg);
showWarningGMIOMetric = false;
}

std::stringstream msg;
msg << "Configured interface_tile metric set metric set " << tileMetric.second;
msg << " skipped for tile (" << +tileMetric.first.col << ", " << +tileMetric.first.row << ").";
xrt_core::message::send(severity_level::warning, "XRT", msg.str());
offTiles.push_back(tileMetric.first);
continue;
}

// Ensure requested metric set is supported (if not, use default)
if (std::find(metricVec.begin(), metricVec.end(), tileMetric.second) == metricVec.end()) {
if (showWarning) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,11 @@ class AieTraceMetadata {
hwContext = std::move(c);
}

bool isGMIOMetric(const std::string& metric) const {
return gmioMetricSets.find(metric) != gmioMetricSets.end();
}
bool configMetricsEmpty() const { return configMetrics.empty(); }

private:
bool useDelay = false;
bool useUserControl = false;
Expand Down Expand Up @@ -157,11 +162,15 @@ class AieTraceMetadata {
"input_ports_details", "output_ports_details",
"mm2s_ports", "s2mm_ports",
"mm2s_ports_stalls", "s2mm_ports_stalls",
"mms2_ports_details", "s2mm_ports_details",
"mm2s_ports_details", "s2mm_ports_details",
"input_output_ports", "mm2s_s2mm_ports",
"input_output_ports_stalls", "mm2s_s2mm_ports_stalls"} }
};

std::set<std::string> gmioMetricSets {
"input_ports_details", "output_ports_details",
"mm2s_ports_details", "s2mm_ports_details" };

void* handle;
xrt::hw_context hwContext;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,12 @@ void AieTracePluginUnified::updateAIEDevice(void *handle) {

// Metadata depends on static information from the database
AIEData.metadata = std::make_shared<AieTraceMetadata>(deviceID, handle);
if (AIEData.metadata->configMetricsEmpty()) {
AIEData.valid = false;
xrt_core::message::send(severity_level::warning, "XRT",
AIE_TRACE_TILES_UNAVAILABLE);
return;
}

#ifdef XDP_CLIENT_BUILD
AIEData.metadata->setHwContext(context);
Expand Down

0 comments on commit baf8882

Please sign in to comment.