From 53775ee7eaf6ba33c661a91f47fe313541ee70e1 Mon Sep 17 00:00:00 2001 From: pgschuey Date: Wed, 18 Sep 2024 16:20:15 -0600 Subject: [PATCH] [XDP] Multiple CRs - fixed PLIO verification and refined all_stalls_s2mm metric set (#8429) --- .../filetypes/aie_control_config_filetype.cpp | 23 +++++++++---------- .../filetypes/aie_control_config_filetype.h | 2 +- .../filetypes/base_filetype_impl.h | 2 +- .../plugin/aie_trace/util/aie_trace_util.cpp | 23 ++++++++----------- 4 files changed, 23 insertions(+), 27 deletions(-) diff --git a/src/runtime_src/xdp/profile/database/static_info/filetypes/aie_control_config_filetype.cpp b/src/runtime_src/xdp/profile/database/static_info/filetypes/aie_control_config_filetype.cpp index 922299b020a..5239dacaccc 100644 --- a/src/runtime_src/xdp/profile/database/static_info/filetypes/aie_control_config_filetype.cpp +++ b/src/runtime_src/xdp/profile/database/static_info/filetypes/aie_control_config_filetype.cpp @@ -213,7 +213,7 @@ std::vector AIEControlConfigFiletype::getInterfaceTiles(const std::string& graphName, const std::string& portName, const std::string& metricStr, - int16_t channelId, + int16_t specifiedId, bool useColumn, uint8_t minCol, uint8_t maxCol) const @@ -225,6 +225,7 @@ AIEControlConfigFiletype::getInterfaceTiles(const std::string& graphName, for (auto& io : ios) { auto isMaster = io.second.slaveOrMaster; auto streamId = io.second.streamId; + auto channelNum = io.second.channelNum; auto shimCol = io.second.shimColumn; auto logicalName = io.second.logicalName; auto name = io.second.name; @@ -251,7 +252,7 @@ AIEControlConfigFiletype::getInterfaceTiles(const std::string& graphName, || (!isMaster && (metricStr.find("input") == std::string::npos) && (metricStr.find("mm2s") == std::string::npos))) { - // Process this tile for below profile API specific metrics + // Catch metric sets that don't follow above naming convention if ((metricStr != "packets") && (metricStr != "interface_tile_latency") && (metricStr != "start_to_bytes_transferred")) @@ -261,14 +262,12 @@ AIEControlConfigFiletype::getInterfaceTiles(const std::string& graphName, // Make sure column is within specified range (if specified) if (useColumn && !((minCol <= shimCol) && (shimCol <= maxCol))) continue; - // Make sure channel number is same as specified (GMIO only) - if ((type == io_type::GMIO) && (channelId >= 0) && (channelId != io.second.channelNum)) { - std::stringstream msg; - msg << "Specified channel ID " << +channelId << "doesn't match for interface column " - << +shimCol <<" and stream ID " << +streamId; - xrt_core::message::send(severity_level::info, "XRT", msg.str()); + + // Make sure stream/channel number is as specified + // NOTE: For GMIO, we use DMA channel number; for PLIO, we use the SOUTH location + uint8_t idToCheck = (type == io_type::GMIO) ? channelNum : streamId; + if ((specifiedId >= 0) && (specifiedId != idToCheck)) continue; - } tile_type tile = {0}; tile.col = shimCol; @@ -281,9 +280,9 @@ AIEControlConfigFiletype::getInterfaceTiles(const std::string& graphName, tiles.emplace_back(std::move(tile)); } - if (tiles.empty() && (channelId >= 0)) { - std::string msg = "No tiles used channel ID " + std::to_string(channelId) - + ". Please specify a valid channel ID."; + if (tiles.empty() && (specifiedId >= 0)) { + std::string msg = "No tiles used specified ID " + std::to_string(specifiedId) + + ". Please specify a valid ID."; xrt_core::message::send(severity_level::warning, "XRT", msg); } diff --git a/src/runtime_src/xdp/profile/database/static_info/filetypes/aie_control_config_filetype.h b/src/runtime_src/xdp/profile/database/static_info/filetypes/aie_control_config_filetype.h index f3f59a9026f..15d385c0544 100644 --- a/src/runtime_src/xdp/profile/database/static_info/filetypes/aie_control_config_filetype.h +++ b/src/runtime_src/xdp/profile/database/static_info/filetypes/aie_control_config_filetype.h @@ -71,7 +71,7 @@ class AIEControlConfigFiletype : public xdp::aie::BaseFiletypeImpl { getInterfaceTiles(const std::string& graphName, const std::string& portName = "all", const std::string& metricStr = "channels", - int16_t channelId = -1, + int16_t specifiedId = -1, bool useColumn = false, uint8_t minCol = 0, uint8_t maxCol = 0) const override; diff --git a/src/runtime_src/xdp/profile/database/static_info/filetypes/base_filetype_impl.h b/src/runtime_src/xdp/profile/database/static_info/filetypes/base_filetype_impl.h index c739e1f00a2..bf7fe118ec9 100644 --- a/src/runtime_src/xdp/profile/database/static_info/filetypes/base_filetype_impl.h +++ b/src/runtime_src/xdp/profile/database/static_info/filetypes/base_filetype_impl.h @@ -65,7 +65,7 @@ class BaseFiletypeImpl { getInterfaceTiles(const std::string& graphName, const std::string& portName = "all", const std::string& metricStr = "channels", - int16_t channelId = -1, + int16_t specifiedId = -1, bool useColumn = false, uint8_t minCol = 0, uint8_t maxCol = 0) const = 0; diff --git a/src/runtime_src/xdp/profile/plugin/aie_trace/util/aie_trace_util.cpp b/src/runtime_src/xdp/profile/plugin/aie_trace/util/aie_trace_util.cpp index cc6409c6706..6c6c994ad61 100755 --- a/src/runtime_src/xdp/profile/plugin/aie_trace/util/aie_trace_util.cpp +++ b/src/runtime_src/xdp/profile/plugin/aie_trace/util/aie_trace_util.cpp @@ -101,6 +101,11 @@ namespace xdp::aie::trace { {XAIE_EVENT_INSTR_CALL_CORE, XAIE_EVENT_INSTR_RETURN_CORE, XAIE_EVENT_PORT_RUNNING_0_CORE, XAIE_EVENT_PORT_RUNNING_1_CORE, XAIE_EVENT_PORT_RUNNING_2_CORE, XAIE_EVENT_PORT_RUNNING_3_CORE}}, + {"all_stalls_s2mm", + {XAIE_EVENT_INSTR_CALL_CORE, XAIE_EVENT_INSTR_RETURN_CORE, + XAIE_EVENT_MEMORY_STALL_CORE, XAIE_EVENT_STREAM_STALL_CORE, + XAIE_EVENT_LOCK_STALL_CORE, XAIE_EVENT_PORT_RUNNING_0_CORE, + XAIE_EVENT_PORT_RUNNING_1_CORE}}, {"all_stalls_dma", {XAIE_EVENT_INSTR_CALL_CORE, XAIE_EVENT_INSTR_RETURN_CORE, XAIE_EVENT_GROUP_CORE_STALL_CORE, XAIE_EVENT_PORT_RUNNING_0_CORE, @@ -113,19 +118,11 @@ namespace xdp::aie::trace { }; // Generation-specific sets - // * AIE1 only supports seven trace events (need one for counter) - // * Sets w/ DMA stall/backpressure events not supported on AIE1 - if (hwGen == 1) { - eventSets["all_stalls_s2mm"] = - {XAIE_EVENT_INSTR_CALL_CORE, XAIE_EVENT_INSTR_RETURN_CORE, - XAIE_EVENT_GROUP_CORE_STALL_CORE, XAIE_EVENT_PORT_RUNNING_0_CORE, - XAIE_EVENT_PORT_RUNNING_1_CORE}; - } else { - eventSets["all_stalls_s2mm"] = - {XAIE_EVENT_INSTR_CALL_CORE, XAIE_EVENT_INSTR_RETURN_CORE, - XAIE_EVENT_MEMORY_STALL_CORE, XAIE_EVENT_STREAM_STALL_CORE, - XAIE_EVENT_CASCADE_STALL_CORE, XAIE_EVENT_LOCK_STALL_CORE, - XAIE_EVENT_PORT_RUNNING_0_CORE, XAIE_EVENT_PORT_RUNNING_1_CORE}; + // * AIE2+ supports all eight trace events (AIE1 requires one for counter) + // * Sets w/ DMA stall/backpressure events not supported on AIE1 + if (hwGen > 1) { + eventSets["all_stalls_s2mm"].push_back(XAIE_EVENT_CASCADE_STALL_CORE); + eventSets["s2mm_channels_stalls"] = {XAIE_EVENT_DMA_S2MM_0_START_TASK_MEM, XAIE_EVENT_DMA_S2MM_0_FINISHED_BD_MEM, XAIE_EVENT_DMA_S2MM_0_FINISHED_TASK_MEM, XAIE_EVENT_DMA_S2MM_0_STALLED_LOCK_MEM,