Skip to content

Commit

Permalink
[Client][Edge] Support interface tiles input ports details metric eve…
Browse files Browse the repository at this point in the history
…nts (#8179)
  • Loading branch information
vipangul authored May 22, 2024
1 parent 687eac7 commit e127007
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 0 deletions.
32 changes: 32 additions & 0 deletions src/runtime_src/xdp/profile/plugin/aie_trace/client/aie_trace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,7 @@ namespace xdp {

/****************************************************************************
* Get channel number based on event
* NOTE: This only covers AIE Tiles and Interface Tiles
***************************************************************************/
int8_t AieTrace_WinImpl::getChannelNumberFromEvent(XAie_Events event)
{
Expand All @@ -518,6 +519,18 @@ namespace xdp {
case XAIE_EVENT_DMA_MM2S_0_STALLED_LOCK_MEM:
case XAIE_EVENT_DMA_MM2S_0_STREAM_BACKPRESSURE_MEM:
case XAIE_EVENT_DMA_MM2S_0_MEMORY_STARVATION_MEM:
case XAIE_EVENT_DMA_S2MM_0_FINISHED_BD_PL:
case XAIE_EVENT_DMA_S2MM_0_START_TASK_PL:
case XAIE_EVENT_DMA_S2MM_0_FINISHED_TASK_PL:
case XAIE_EVENT_DMA_S2MM_0_STALLED_LOCK_PL:
case XAIE_EVENT_DMA_S2MM_0_STREAM_STARVATION_PL:
case XAIE_EVENT_DMA_S2MM_0_MEMORY_BACKPRESSURE_PL:
case XAIE_EVENT_DMA_MM2S_0_FINISHED_BD_PL:
case XAIE_EVENT_DMA_MM2S_0_START_TASK_PL:
case XAIE_EVENT_DMA_MM2S_0_FINISHED_TASK_PL:
case XAIE_EVENT_DMA_MM2S_0_STALLED_LOCK_PL:
case XAIE_EVENT_DMA_MM2S_0_STREAM_BACKPRESSURE_PL:
case XAIE_EVENT_DMA_MM2S_0_MEMORY_STARVATION_PL:
return 0;
case XAIE_EVENT_DMA_S2MM_1_START_TASK_MEM:
case XAIE_EVENT_DMA_S2MM_1_FINISHED_BD_MEM:
Expand All @@ -531,6 +544,18 @@ namespace xdp {
case XAIE_EVENT_DMA_MM2S_1_STALLED_LOCK_MEM:
case XAIE_EVENT_DMA_MM2S_1_STREAM_BACKPRESSURE_MEM:
case XAIE_EVENT_DMA_MM2S_1_MEMORY_STARVATION_MEM:
case XAIE_EVENT_DMA_S2MM_1_FINISHED_BD_PL:
case XAIE_EVENT_DMA_S2MM_1_START_TASK_PL:
case XAIE_EVENT_DMA_S2MM_1_FINISHED_TASK_PL:
case XAIE_EVENT_DMA_S2MM_1_STALLED_LOCK_PL:
case XAIE_EVENT_DMA_S2MM_1_STREAM_STARVATION_PL:
case XAIE_EVENT_DMA_S2MM_1_MEMORY_BACKPRESSURE_PL:
case XAIE_EVENT_DMA_MM2S_1_FINISHED_BD_PL:
case XAIE_EVENT_DMA_MM2S_1_START_TASK_PL:
case XAIE_EVENT_DMA_MM2S_1_FINISHED_TASK_PL:
case XAIE_EVENT_DMA_MM2S_1_STALLED_LOCK_PL:
case XAIE_EVENT_DMA_MM2S_1_STREAM_BACKPRESSURE_PL:
case XAIE_EVENT_DMA_MM2S_1_MEMORY_STARVATION_PL:
return 1;
default:
return -1;
Expand Down Expand Up @@ -1349,6 +1374,13 @@ namespace xdp {
if (XAie_TraceStopEvent(&aieDevInst, loc, mod, interfaceTileTraceEndEvent) != XAIE_OK)
break;
cfgTile->interface_tile_trace_config.packet_type = packetType;
auto channelNum = getChannelNumberFromEvent(interfaceEvents.at(0));
if (channelNum >= 0) {
if (aie::isInputSet(type, metricSet))
cfgTile->interface_tile_trace_config.mm2s_channels[channelNum] = channelNum;
else
cfgTile->interface_tile_trace_config.s2mm_channels[channelNum] = channelNum;
}
} // Interface tiles

if (xrt_core::config::get_verbosity() >= static_cast<uint32_t>(severity_level::debug)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -892,6 +892,13 @@ namespace xdp {
if (shimTrace->start() != XAIE_OK)
break;
cfgTile->interface_tile_trace_config.packet_type = packetType;
auto channelNum = aie::trace::getChannelNumberFromEvent(interfaceEvents.at(0));
if (channelNum >= 0) {
if (aie::isInputSet(type, metricSet))
cfgTile->interface_tile_trace_config.mm2s_channels[channelNum] = channelNum;
else
cfgTile->interface_tile_trace_config.s2mm_channels[channelNum] = channelNum;
}
} // interface tiles

if (aie::isDebugVerbosity()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,7 @@ namespace xdp::aie::trace {

/****************************************************************************
* Get channel number based on event
* NOTE: This only covers AIE Tiles and Interface Tiles
***************************************************************************/
int8_t getChannelNumberFromEvent(XAie_Events event)
{
Expand All @@ -470,6 +471,20 @@ namespace xdp::aie::trace {
case XAIE_EVENT_DMA_MM2S_0_STALLED_LOCK_MEM:
case XAIE_EVENT_DMA_MM2S_0_STREAM_BACKPRESSURE_MEM:
case XAIE_EVENT_DMA_MM2S_0_MEMORY_STARVATION_MEM:
case XAIE_EVENT_DMA_S2MM_0_START_BD_PL:
case XAIE_EVENT_DMA_S2MM_0_FINISHED_BD_PL:
case XAIE_EVENT_DMA_S2MM_0_START_TASK_PL:
case XAIE_EVENT_DMA_S2MM_0_FINISHED_TASK_PL:
case XAIE_EVENT_DMA_S2MM_0_STALLED_LOCK_PL:
case XAIE_EVENT_DMA_S2MM_0_STREAM_STARVATION_PL:
case XAIE_EVENT_DMA_S2MM_0_MEMORY_BACKPRESSURE_PL:
case XAIE_EVENT_DMA_MM2S_0_START_BD_PL:
case XAIE_EVENT_DMA_MM2S_0_FINISHED_BD_PL:
case XAIE_EVENT_DMA_MM2S_0_START_TASK_PL:
case XAIE_EVENT_DMA_MM2S_0_FINISHED_TASK_PL:
case XAIE_EVENT_DMA_MM2S_0_STALLED_LOCK_PL:
case XAIE_EVENT_DMA_MM2S_0_STREAM_BACKPRESSURE_PL:
case XAIE_EVENT_DMA_MM2S_0_MEMORY_STARVATION_PL:
return 0;
case XAIE_EVENT_DMA_S2MM_1_START_TASK_MEM:
case XAIE_EVENT_DMA_S2MM_1_FINISHED_BD_MEM:
Expand All @@ -483,6 +498,20 @@ namespace xdp::aie::trace {
case XAIE_EVENT_DMA_MM2S_1_STALLED_LOCK_MEM:
case XAIE_EVENT_DMA_MM2S_1_STREAM_BACKPRESSURE_MEM:
case XAIE_EVENT_DMA_MM2S_1_MEMORY_STARVATION_MEM:
case XAIE_EVENT_DMA_S2MM_1_START_BD_PL:
case XAIE_EVENT_DMA_S2MM_1_FINISHED_BD_PL:
case XAIE_EVENT_DMA_S2MM_1_START_TASK_PL:
case XAIE_EVENT_DMA_S2MM_1_FINISHED_TASK_PL:
case XAIE_EVENT_DMA_S2MM_1_STALLED_LOCK_PL:
case XAIE_EVENT_DMA_S2MM_1_STREAM_STARVATION_PL:
case XAIE_EVENT_DMA_S2MM_1_MEMORY_BACKPRESSURE_PL:
case XAIE_EVENT_DMA_MM2S_1_START_BD_PL:
case XAIE_EVENT_DMA_MM2S_1_FINISHED_BD_PL:
case XAIE_EVENT_DMA_MM2S_1_START_TASK_PL:
case XAIE_EVENT_DMA_MM2S_1_FINISHED_TASK_PL:
case XAIE_EVENT_DMA_MM2S_1_STALLED_LOCK_PL:
case XAIE_EVENT_DMA_MM2S_1_STREAM_BACKPRESSURE_PL:
case XAIE_EVENT_DMA_MM2S_1_MEMORY_STARVATION_PL:
return 1;
default:
return -1;
Expand Down

0 comments on commit e127007

Please sign in to comment.