@@ -229,7 +229,13 @@ namespace xdp {
229229 {
230230 auto col = tile.col ;
231231 auto row = tile.row ;
232- auto loc = XAie_TileLoc (col, row);
232+ // Get the column for XAIE APIs
233+ // For LOAD_XCLBIN_STYLE: use absolute column (includes partition shift from metadata)
234+ // For REGISTER_XCLBIN_STYLE (hw_context): XAIE APIs expect relative columns, so subtract partition shift
235+ auto partitionShift = metadata->getPartitionOverlayStartCols ().front ();
236+ auto xaieCol = (db->getStaticInfo ().getAppStyle () == xdp::AppStyle::LOAD_XCLBIN_STYLE)
237+ ? col : (col - partitionShift);
238+ auto loc = XAie_TileLoc (xaieCol, row);
233239 std::string moduleName = (mod == XAIE_CORE_MOD) ? " aie"
234240 : ((mod == XAIE_MEM_MOD) ? " aie_memory"
235241 : " interface_tile" );
@@ -443,7 +449,13 @@ namespace xdp {
443449
444450 // Generate user_event_1 for byte count metric set after configuration
445451 if ((metricSet == METRIC_BYTE_COUNT) && (i == 1 ) && !graphItrBroadcastConfigDone) {
446- XAie_LocType tileloc = XAie_TileLoc (tile.col , tile.row );
452+ // Get the column for XAIE APIs
453+ // For LOAD_XCLBIN_STYLE: use absolute column (includes partition shift from metadata)
454+ // For REGISTER_XCLBIN_STYLE (hw_context): XAIE APIs expect relative columns, so subtract partition shift
455+ auto partitionShift = metadata->getPartitionOverlayStartCols ().front ();
456+ auto xaieCol = (db->getStaticInfo ().getAppStyle () == xdp::AppStyle::LOAD_XCLBIN_STYLE)
457+ ? tile.col : (tile.col - partitionShift);
458+ XAie_LocType tileloc = XAie_TileLoc (xaieCol, tile.row );
447459 // Note: For BYTE_COUNT metric, user_event_1 is used twice as eventA & eventB to
448460 // to transition the FSM from Idle->State0->State1.
449461 // eventC = Port Running and eventD = stop event (counter event).
@@ -547,7 +559,13 @@ namespace xdp {
547559 uint32_t counterValue;
548560 if (perfCounters.empty ()) {
549561 // Compiler-defined counters
550- XAie_LocType tileLocation = XAie_TileLoc (aie->column , aie->row );
562+ // Get the column for XAIE APIs
563+ // For LOAD_XCLBIN_STYLE: use absolute column (includes partition shift from metadata)
564+ // For REGISTER_XCLBIN_STYLE (hw_context): XAIE APIs expect relative columns, so subtract partition shift
565+ auto partitionShift = metadata->getPartitionOverlayStartCols ().front ();
566+ auto xaieCol = (db->getStaticInfo ().getAppStyle () == xdp::AppStyle::LOAD_XCLBIN_STYLE)
567+ ? tile.col : (tile.col - partitionShift);
568+ XAie_LocType tileLocation = XAie_TileLoc (xaieCol, aie->row );
551569 XAie_PerfCounterGet (aieDevInst, tileLocation, XAIE_CORE_MOD, aie->counterNumber , &counterValue);
552570 }
553571 else {
@@ -601,7 +619,13 @@ namespace xdp {
601619 auto falModuleType = (moduleType == module_type::core) ? XAIE_CORE_MOD
602620 : ((moduleType == module_type::shim) ? XAIE_PL_MOD
603621 : XAIE_MEM_MOD);
604- XAie_LocType tileLocation = XAie_TileLoc (aie->column , aie->row );
622+ // Get the column for XAIE APIs
623+ // For LOAD_XCLBIN_STYLE: use absolute column (includes partition shift from metadata)
624+ // For REGISTER_XCLBIN_STYLE (hw_context): XAIE APIs expect relative columns, so subtract partition shift
625+ auto partitionShift = metadata->getPartitionOverlayStartCols ().front ();
626+ auto xaieCol = (db->getStaticInfo ().getAppStyle () == xdp::AppStyle::LOAD_XCLBIN_STYLE)
627+ ? tile.col : (tile.col - partitionShift);
628+ XAie_LocType tileLocation = XAie_TileLoc (xaieCol, aie->row );
605629 XAie_ReadTimer (aieDevInst, tileLocation, falModuleType, &timerValue);
606630 }
607631 values.push_back (timerValue);
0 commit comments