Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[XDP] Adjustments to Byte count metric #8615

Merged
merged 4 commits into from
Nov 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -521,11 +521,7 @@ namespace xdp::aie::profile {
uint32_t streamWidth = aie::getStreamWidth(hw_gen);
uint32_t total_beats = static_cast<uint32_t>(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
Loading