diff --git a/src/runtime_src/xdp/profile/plugin/aie_trace/aie_trace_metadata.h b/src/runtime_src/xdp/profile/plugin/aie_trace/aie_trace_metadata.h index ac11d2a79cc..c63ced0a7e9 100644 --- a/src/runtime_src/xdp/profile/plugin/aie_trace/aie_trace_metadata.h +++ b/src/runtime_src/xdp/profile/plugin/aie_trace/aie_trace_metadata.h @@ -151,7 +151,8 @@ class AieTraceMetadata { "all_stalls", "all_dma", "all_stalls_dma", "all_stalls_s2mm", "all_stalls_mm2s", "s2mm_channels", "mm2s_channels", - "s2mm_channels_stalls", "mm2s_channels_stalls"} }, + "s2mm_channels_stalls", "mm2s_channels_stalls", + "execution"} }, { module_type::mem_tile, {"input_channels", "input_channels_stalls", "output_channels", "output_channels_stalls", "s2mm_channels", "s2mm_channels_stalls", diff --git a/src/runtime_src/xdp/profile/plugin/aie_trace/client/aie_trace.cpp b/src/runtime_src/xdp/profile/plugin/aie_trace/client/aie_trace.cpp index af3fb581f4f..9fb3e155a38 100644 --- a/src/runtime_src/xdp/profile/plugin/aie_trace/client/aie_trace.cpp +++ b/src/runtime_src/xdp/profile/plugin/aie_trace/client/aie_trace.cpp @@ -930,6 +930,23 @@ namespace xdp { cfgTile->active_core = tile.active_core; cfgTile->active_memory = tile.active_memory; + // Catch core execution trace + if ((type == module_type::core) && (metricSet == "execution")) { + // Set start/end events, use execution packets, and start trace module + XAie_TraceStopEvent(&aieDevInst, loc, XAIE_CORE_MOD, coreTraceEndEvent); + + // Driver requires at least one, non-zero trace event + XAie_TraceEvent(&aieDevInst, loc, XAIE_CORE_MOD, XAIE_EVENT_TRUE_CORE, 0); + + XAie_Packet pkt = {0, 0}; + XAie_TraceModeConfig(&aieDevInst, loc, XAIE_CORE_MOD, XAIE_TRACE_INST_EXEC); + XAie_TracePktConfig(&aieDevInst, loc, XAIE_CORE_MOD, pkt); + + XAie_TraceStartEvent(&aieDevInst, loc, XAIE_CORE_MOD, coreTraceStartEvent); + (db->getStaticInfo()).addAIECfgTile(deviceId, cfgTile); + continue; + } + // Get vector of pre-defined metrics for this set // NOTE: These are local copies to add tile-specific events EventVector coreEvents; diff --git a/src/runtime_src/xdp/profile/plugin/aie_trace/edge/aie_trace.cpp b/src/runtime_src/xdp/profile/plugin/aie_trace/edge/aie_trace.cpp index 20194ffc317..de7468fa166 100755 --- a/src/runtime_src/xdp/profile/plugin/aie_trace/edge/aie_trace.cpp +++ b/src/runtime_src/xdp/profile/plugin/aie_trace/edge/aie_trace.cpp @@ -327,7 +327,7 @@ namespace xdp { auto typeInt = static_cast(type); auto& xaieTile = aieDevice->tile(col, row); auto loc = XAie_TileLoc(col, row); - + if ((type == module_type::core) && !aie::trace::isDmaSet(metricSet)) { // If we're not looking at DMA events, then don't display the DMA // If core is not active (i.e., DMA-only tile), then ignore this tile @@ -341,6 +341,12 @@ namespace xdp { : ((type == module_type::shim) ? "interface" : "AIE"); tileName.append(" tile (" + std::to_string(col) + "," + std::to_string(row) + ")"); + if (aie::isInfoVerbosity()) { + std::stringstream infoMsg; + infoMsg << "Configuring " << tileName << " for trace using metric set " << metricSet; + xrt_core::message::send(severity_level::info, "XRT", infoMsg.str()); + } + xaiefal::XAieMod core; xaiefal::XAieMod memory; xaiefal::XAieMod shim; @@ -369,6 +375,28 @@ namespace xdp { cfgTile->active_core = tile.active_core; cfgTile->active_memory = tile.active_memory; + // Catch core execution trace + if ((type == module_type::core) && (metricSet == "execution")) { + // Set start/end events, use execution packets, and start trace module + auto coreTrace = core.traceControl(); + if (coreTrace->setCntrEvent(coreTraceStartEvent, coreTraceEndEvent) != XAIE_OK) + continue; + coreTrace->reserve(); + + // Driver requires at least one, non-zero trace event + uint8_t slot; + coreTrace->reserveTraceSlot(slot); + coreTrace->setTraceEvent(slot, XAIE_EVENT_TRUE_CORE); + + coreTrace->setMode(XAIE_TRACE_INST_EXEC); + XAie_Packet pkt = {0, 0}; + coreTrace->setPkt(pkt); + coreTrace->start(); + + (db->getStaticInfo()).addAIECfgTile(deviceId, cfgTile); + continue; + } + // Get vector of pre-defined metrics for this set // NOTE: these are local copies as we are adding tile/counter-specific events EventVector coreEvents; @@ -385,12 +413,6 @@ namespace xdp { interfaceEvents = interfaceTileEventSets[metricSet]; } - if (aie::isInfoVerbosity()) { - std::stringstream infoMsg; - infoMsg << "Configuring " << tileName << " for trace using metric set " << metricSet; - xrt_core::message::send(severity_level::info, "XRT", infoMsg.str()); - } - // Check Resource Availability if (!tileHasFreeRsc(aieDevice, loc, type, metricSet)) { xrt_core::message::send(severity_level::warning, "XRT",