diff --git a/src/runtime_src/xdp/profile/plugin/aie_profile/edge/aie_profile.cpp b/src/runtime_src/xdp/profile/plugin/aie_profile/edge/aie_profile.cpp index b547e81892..903c996791 100644 --- a/src/runtime_src/xdp/profile/plugin/aie_profile/edge/aie_profile.cpp +++ b/src/runtime_src/xdp/profile/plugin/aie_profile/edge/aie_profile.cpp @@ -623,6 +623,10 @@ namespace xdp { // Generate user_event_1 for byte count metric set after configuration if ((metricSet == METRIC_BYTE_COUNT) && (i == 1) && !graphItrBroadcastConfigDone) { XAie_LocType tileloc = XAie_TileLoc(tile.col, tile.row); + //Note: For BYTE_COUNT metric, user_event_1 is used twice as eventA & eventB to + // to transition the FSM from Idle->State0->State1. + // eventC = Port Running and eventD = stop event (counter event). + XAie_EventGenerate(aieDevInst, tileloc, mod, XAIE_EVENT_USER_EVENT_1_PL); XAie_EventGenerate(aieDevInst, tileloc, mod, XAIE_EVENT_USER_EVENT_1_PL); } @@ -901,7 +905,7 @@ namespace xdp { // Set up the combo event with FSM type using 4 events state machine XAie_Events eventA = (resetEvent != XAIE_EVENT_NONE_CORE) ? resetEvent : XAIE_EVENT_USER_EVENT_1_PL; - XAie_Events eventB = startEvent; + XAie_Events eventB = XAIE_EVENT_USER_EVENT_1_PL; XAie_Events eventC = startEvent; XAie_Events eventD = endEvent; @@ -1061,6 +1065,9 @@ namespace xdp { XAie_Events counterEvent; pc->getCounterEvent(mod, counterEvent); + if (pc->start() != XAIE_OK) + return false; + // performance counter event to use it later for broadcasting retCounterEvent = counterEvent; return true; diff --git a/src/runtime_src/xdp/profile/plugin/aie_profile/util/aie_profile_util.cpp b/src/runtime_src/xdp/profile/plugin/aie_profile/util/aie_profile_util.cpp index e0bd7d5665..c07a5c742d 100644 --- a/src/runtime_src/xdp/profile/plugin/aie_profile/util/aie_profile_util.cpp +++ b/src/runtime_src/xdp/profile/plugin/aie_profile/util/aie_profile_util.cpp @@ -521,11 +521,7 @@ namespace xdp::aie::profile { uint32_t streamWidth = aie::getStreamWidth(hw_gen); uint32_t total_beats = static_cast(std::ceil(1.0 * bytes / streamWidth)); - // Note: As per run experiments on board, combo 3 FSM checks stop event in - // every 4 clock cycles. We make sure stop event is in sync with FSM oddity - // by rounding up total beats to nearest multiple of 4. - uint32_t max_beats = 4 * ((total_beats + 3) / 4); - return max_beats; + return total_beats; } } // namespace xdp::aie