From 4ea8348fbc1039b437274e7b13ff32402f61a34b Mon Sep 17 00:00:00 2001 From: Manoj Takasi Date: Tue, 7 Jan 2025 22:44:02 +0530 Subject: [PATCH] Modified the aie-rt function APIs and updated the datatype of its parameter from u8 to u16 Signed-off-by: Manoj Takasi --- build/petalinux.build | 2 +- .../aie2_profile_config.cpp | 8 ++-- .../aie2_trace_config/aie2_trace_config.cpp | 42 ++++++++-------- .../aie_profile_config/aie_profile_config.cpp | 8 ++-- .../aie_trace_config/aie_trace_config.cpp | 38 +++++++-------- .../aie_trace_gmio/gmio_config_kernel.cpp | 6 +-- src/runtime_src/core/edge/user/aie/aie.cpp | 4 +- .../aie/common_layer/adf_aie_control_api.h | 22 ++++----- .../user/aie/common_layer/adf_api_config.h | 6 +-- .../user/aie/common_layer/adf_runtime_api.cpp | 36 +++++++------- .../device/aie_trace/aie_trace_offload.cpp | 6 +-- .../client/aie_trace_offload_client.cpp | 6 +-- .../aie_trace/ve2/aie_trace_offload_ve2.cpp | 6 +-- .../plugin/aie_profile/client/aie_profile.cpp | 4 +- .../plugin/aie_profile/edge/aie_profile.cpp | 8 ++-- .../plugin/aie_profile/ve2/aie_profile.cpp | 8 ++-- .../plugin/aie_trace/client/aie_trace.cpp | 24 +++++----- .../plugin/aie_trace/edge/aie_trace.cpp | 48 +++++++++---------- .../aie_trace/util/aie_trace_config.cpp | 4 +- .../plugin/aie_trace/ve2/aie_trace.cpp | 48 +++++++++---------- 20 files changed, 167 insertions(+), 167 deletions(-) diff --git a/build/petalinux.build b/build/petalinux.build index 4a2bf91e25..7919ea4534 100644 --- a/build/petalinux.build +++ b/build/petalinux.build @@ -1,3 +1,3 @@ # When updating Petalinux build please file a SH ticket to retain the build # https://jira.xilinx.com/secure/CreateIssue!default.jspa -PETALINUX=/proj/petalinux/2025.1/petalinux-v2025.1_12231101/tool/petalinux-v2025.1-final +PETALINUX=/proj/petalinux/2025.1/petalinux-v2025.1_01061007/tool/petalinux-v2025.1-final diff --git a/src/runtime_src/core/edge/ps_kernels/profiling/aie2_profile_config/aie2_profile_config.cpp b/src/runtime_src/core/edge/ps_kernels/profiling/aie2_profile_config/aie2_profile_config.cpp index 1285ff675f..84c79bda17 100644 --- a/src/runtime_src/core/edge/ps_kernels/profiling/aie2_profile_config/aie2_profile_config.cpp +++ b/src/runtime_src/core/edge/ps_kernels/profiling/aie2_profile_config/aie2_profile_config.cpp @@ -408,10 +408,10 @@ namespace { mPerfCounters.push_back(perfCounter); // Convert enums to physical event IDs for reporting purposes - uint8_t tmpStart; - uint8_t tmpEnd; - XAie_EventLogicalToPhysicalConv(aieDevInst, loc, mod, startEvent, &tmpStart); - XAie_EventLogicalToPhysicalConv(aieDevInst, loc, mod, endEvent, &tmpEnd); + uint16_t tmpStart; + uint16_t tmpEnd; + XAie_EventLogicalToPhysicalConv_16(aieDevInst, loc, mod, startEvent, &tmpStart); + XAie_EventLogicalToPhysicalConv_16(aieDevInst, loc, mod, endEvent, &tmpEnd); uint16_t phyStartEvent = tmpStart + config.mCounterBases[type]; uint16_t phyEndEvent = tmpEnd + config.mCounterBases[type]; diff --git a/src/runtime_src/core/edge/ps_kernels/profiling/aie2_trace_config/aie2_trace_config.cpp b/src/runtime_src/core/edge/ps_kernels/profiling/aie2_trace_config/aie2_trace_config.cpp index db0a2b4285..f656628933 100644 --- a/src/runtime_src/core/edge/ps_kernels/profiling/aie2_trace_config/aie2_trace_config.cpp +++ b/src/runtime_src/core/edge/ps_kernels/profiling/aie2_trace_config/aie2_trace_config.cpp @@ -391,13 +391,13 @@ namespace { numCoreCounters++; // Update config file - uint8_t phyEvent = 0; + uint16_t phyEvent = 0; auto& cfg = cfgTile.core_trace_config.pc[idx]; - XAie_EventLogicalToPhysicalConv(aieDevInst, loc, mod, config.coreCounterStartEvents[i], &phyEvent); + XAie_EventLogicalToPhysicalConv_16(aieDevInst, loc, mod, config.coreCounterStartEvents[i], &phyEvent); cfg.start_event = phyEvent; - XAie_EventLogicalToPhysicalConv(aieDevInst, loc, mod, config.coreCounterEndEvents[i], &phyEvent); + XAie_EventLogicalToPhysicalConv_16(aieDevInst, loc, mod, config.coreCounterEndEvents[i], &phyEvent); cfg.stop_event = phyEvent; - XAie_EventLogicalToPhysicalConv(aieDevInst, loc, mod, counterEvent, &phyEvent); + XAie_EventLogicalToPhysicalConv_16(aieDevInst, loc, mod, counterEvent, &phyEvent); cfg.reset_event = phyEvent; cfg.event_value = config.coreCounterEventValues[i]; } @@ -433,13 +433,13 @@ namespace { numMemoryCounters++; // Update config file - uint8_t phyEvent = 0; + uint16_t phyEvent = 0; auto& cfg = cfgTile.memory_trace_config.pc[idx]; - XAie_EventLogicalToPhysicalConv(aieDevInst, loc, mod, config.memoryCounterStartEvents[i], &phyEvent); + XAie_EventLogicalToPhysicalConv_16(aieDevInst, loc, mod, config.memoryCounterStartEvents[i], &phyEvent); cfg.start_event = phyEvent; - XAie_EventLogicalToPhysicalConv(aieDevInst, loc, mod, config.memoryCounterEndEvents[i], &phyEvent); + XAie_EventLogicalToPhysicalConv_16(aieDevInst, loc, mod, config.memoryCounterEndEvents[i], &phyEvent); cfg.stop_event = phyEvent; - XAie_EventLogicalToPhysicalConv(aieDevInst, loc, mod, counterEvent, &phyEvent); + XAie_EventLogicalToPhysicalConv_16(aieDevInst, loc, mod, counterEvent, &phyEvent); cfg.reset_event = phyEvent; cfg.event_value = config.memoryCounterEventValues[i]; } @@ -461,7 +461,7 @@ namespace { // if (type == xdp::module_type::core) { XAie_ModuleType mod = XAIE_CORE_MOD; - uint8_t phyEvent = 0; + uint16_t phyEvent = 0; auto coreTrace = core.traceControl(); // Delay cycles and user control are not compatible with each other @@ -495,13 +495,13 @@ namespace { numCoreTraceEvents++; // Update config file - XAie_EventLogicalToPhysicalConv(aieDevInst, loc, mod, coreEvents[i], &phyEvent); + XAie_EventLogicalToPhysicalConv_16(aieDevInst, loc, mod, coreEvents[i], &phyEvent); cfgTile.core_trace_config.traced_events[slot] = phyEvent; } // Update config file - XAie_EventLogicalToPhysicalConv(aieDevInst, loc, mod, config.coreTraceStartEvent, &phyEvent); + XAie_EventLogicalToPhysicalConv_16(aieDevInst, loc, mod, config.coreTraceStartEvent, &phyEvent); cfgTile.core_trace_config.start_event = phyEvent; - XAie_EventLogicalToPhysicalConv(aieDevInst, loc, mod, config.coreTraceEndEvent, &phyEvent); + XAie_EventLogicalToPhysicalConv_16(aieDevInst, loc, mod, config.coreTraceEndEvent, &phyEvent); cfgTile.core_trace_config.stop_event = phyEvent; coreEvents.clear(); @@ -589,8 +589,8 @@ namespace { XAie_ModuleType M; TraceE->getRscId(L, M, S); - uint8_t phyEvent = 0; - XAie_EventLogicalToPhysicalConv(aieDevInst, loc, XAIE_CORE_MOD, memoryCrossEvents[i], &phyEvent); + uint16_t phyEvent = 0; + XAie_EventLogicalToPhysicalConv_16(aieDevInst, loc, XAIE_CORE_MOD, memoryCrossEvents[i], &phyEvent); if (type == xdp::module_type::mem_tile) { cfgTile.memory_tile_trace_config.traced_events[S] = phyEvent; @@ -618,8 +618,8 @@ namespace { TraceE->getRscId(L, M, S); // Get Physical event - uint8_t phyEvent = 0; - XAie_EventLogicalToPhysicalConv(aieDevInst, loc, XAIE_MEM_MOD, memoryEvents[i], &phyEvent); + uint16_t phyEvent = 0; + XAie_EventLogicalToPhysicalConv_16(aieDevInst, loc, XAIE_MEM_MOD, memoryEvents[i], &phyEvent); // cfgTile.memory_trace_config.traced_events[S] = phyEvent; if (type == xdp::module_type::mem_tile) @@ -634,14 +634,14 @@ namespace { uint32_t bcBit = 0x1; auto bcId = memoryTrace->getStartBc(); coreToMemBcMask |= (bcBit << bcId); - uint8_t phyEvent = 0; + uint16_t phyEvent = 0; if (type == xdp::module_type::mem_tile) { - XAie_EventLogicalToPhysicalConv(aieDevInst, loc, XAIE_MEM_MOD, traceStartEvent, &phyEvent); + XAie_EventLogicalToPhysicalConv_16(aieDevInst, loc, XAIE_MEM_MOD, traceStartEvent, &phyEvent); cfgTile.memory_tile_trace_config.start_event = phyEvent; } else { - XAie_EventLogicalToPhysicalConv(aieDevInst, loc, XAIE_CORE_MOD, traceStartEvent, &phyEvent); + XAie_EventLogicalToPhysicalConv_16(aieDevInst, loc, XAIE_CORE_MOD, traceStartEvent, &phyEvent); cfgTile.memory_trace_config.start_event = bcIdToEvent(bcId); cfgTile.core_trace_config.internal_events_broadcast[bcId] = phyEvent; } @@ -650,10 +650,10 @@ namespace { bcId = memoryTrace->getStopBc(); coreToMemBcMask |= (bcBit << bcId); if (type == xdp::module_type::mem_tile) { - XAie_EventLogicalToPhysicalConv(aieDevInst, loc, XAIE_MEM_MOD, traceEndEvent, &phyEvent); + XAie_EventLogicalToPhysicalConv_16(aieDevInst, loc, XAIE_MEM_MOD, traceEndEvent, &phyEvent); cfgTile.memory_tile_trace_config.stop_event = bcIdToEvent(bcId); } else { - XAie_EventLogicalToPhysicalConv(aieDevInst, loc, XAIE_CORE_MOD, traceEndEvent, &phyEvent); + XAie_EventLogicalToPhysicalConv_16(aieDevInst, loc, XAIE_CORE_MOD, traceEndEvent, &phyEvent); cfgTile.memory_trace_config.stop_event = bcIdToEvent(bcId); cfgTile.core_trace_config.internal_events_broadcast[bcId] = phyEvent; diff --git a/src/runtime_src/core/edge/ps_kernels/profiling/aie_profile_config/aie_profile_config.cpp b/src/runtime_src/core/edge/ps_kernels/profiling/aie_profile_config/aie_profile_config.cpp index f1275ee0a4..4c4c4c427b 100644 --- a/src/runtime_src/core/edge/ps_kernels/profiling/aie_profile_config/aie_profile_config.cpp +++ b/src/runtime_src/core/edge/ps_kernels/profiling/aie_profile_config/aie_profile_config.cpp @@ -315,10 +315,10 @@ namespace { mPerfCounters.push_back(perfCounter); // Convert enums to physical event IDs for reporting purposes - uint8_t tmpStart; - uint8_t tmpEnd; - XAie_EventLogicalToPhysicalConv(aieDevInst, loc, mod, startEvent, &tmpStart); - XAie_EventLogicalToPhysicalConv(aieDevInst, loc, mod, endEvent, &tmpEnd); + uint16_t tmpStart; + uint16_t tmpEnd; + XAie_EventLogicalToPhysicalConv_16(aieDevInst, loc, mod, startEvent, &tmpStart); + XAie_EventLogicalToPhysicalConv_16(aieDevInst, loc, mod, endEvent, &tmpEnd); uint16_t phyStartEvent = tmpStart + config.mCounterBases[type]; uint16_t phyEndEvent = tmpEnd + config.mCounterBases[type]; diff --git a/src/runtime_src/core/edge/ps_kernels/profiling/aie_trace_config/aie_trace_config.cpp b/src/runtime_src/core/edge/ps_kernels/profiling/aie_trace_config/aie_trace_config.cpp index fbeef08a5e..8154fdb37b 100644 --- a/src/runtime_src/core/edge/ps_kernels/profiling/aie_trace_config/aie_trace_config.cpp +++ b/src/runtime_src/core/edge/ps_kernels/profiling/aie_trace_config/aie_trace_config.cpp @@ -343,13 +343,13 @@ namespace { numCoreCounters++; // Update config file - uint8_t phyEvent = 0; + uint16_t phyEvent = 0; auto& cfg = cfgTile.core_trace_config.pc[idx]; - XAie_EventLogicalToPhysicalConv(aieDevInst, loc, mod, config.coreCounterStartEvents[i], &phyEvent); + XAie_EventLogicalToPhysicalConv_16(aieDevInst, loc, mod, config.coreCounterStartEvents[i], &phyEvent); cfg.start_event = phyEvent; - XAie_EventLogicalToPhysicalConv(aieDevInst, loc, mod, config.coreCounterEndEvents[i], &phyEvent); + XAie_EventLogicalToPhysicalConv_16(aieDevInst, loc, mod, config.coreCounterEndEvents[i], &phyEvent); cfg.stop_event = phyEvent; - XAie_EventLogicalToPhysicalConv(aieDevInst, loc, mod, counterEvent, &phyEvent); + XAie_EventLogicalToPhysicalConv_16(aieDevInst, loc, mod, counterEvent, &phyEvent); cfg.reset_event = phyEvent; cfg.event_value = config.coreCounterEventValues[i]; } @@ -386,13 +386,13 @@ namespace { numMemoryCounters++; // Update config file - uint8_t phyEvent = 0; + uint16_t phyEvent = 0; auto& cfg = cfgTile.memory_trace_config.pc[idx]; - XAie_EventLogicalToPhysicalConv(aieDevInst, loc, mod, config.memoryCounterStartEvents[i], &phyEvent); + XAie_EventLogicalToPhysicalConv_16(aieDevInst, loc, mod, config.memoryCounterStartEvents[i], &phyEvent); cfg.start_event = phyEvent; - XAie_EventLogicalToPhysicalConv(aieDevInst, loc, mod, config.memoryCounterEndEvents[i], &phyEvent); + XAie_EventLogicalToPhysicalConv_16(aieDevInst, loc, mod, config.memoryCounterEndEvents[i], &phyEvent); cfg.stop_event = phyEvent; - XAie_EventLogicalToPhysicalConv(aieDevInst, loc, mod, counterEvent, &phyEvent); + XAie_EventLogicalToPhysicalConv_16(aieDevInst, loc, mod, counterEvent, &phyEvent); cfg.reset_event = phyEvent; cfg.event_value = config.memoryCounterEventValues[i]; } @@ -414,7 +414,7 @@ namespace { // { XAie_ModuleType mod = XAIE_CORE_MOD; - uint8_t phyEvent = 0; + uint16_t phyEvent = 0; auto coreTrace = core.traceControl(); // Delay cycles and user control are not compatible with each other @@ -449,13 +449,13 @@ namespace { numTraceEvents++; // Update config file - XAie_EventLogicalToPhysicalConv(aieDevInst, loc, mod, coreEvents[i], &phyEvent); + XAie_EventLogicalToPhysicalConv_16(aieDevInst, loc, mod, coreEvents[i], &phyEvent); cfgTile.core_trace_config.traced_events[slot] = phyEvent; } // Update config file - XAie_EventLogicalToPhysicalConv(aieDevInst, loc, mod, config.coreTraceStartEvent, &phyEvent); + XAie_EventLogicalToPhysicalConv_16(aieDevInst, loc, mod, config.coreTraceStartEvent, &phyEvent); cfgTile.core_trace_config.start_event = phyEvent; - XAie_EventLogicalToPhysicalConv(aieDevInst, loc, mod, config.coreTraceEndEvent, &phyEvent); + XAie_EventLogicalToPhysicalConv_16(aieDevInst, loc, mod, config.coreTraceEndEvent, &phyEvent); cfgTile.core_trace_config.stop_event = phyEvent; coreEvents.clear(); @@ -517,8 +517,8 @@ namespace { TraceE->getRscId(L, M, S); cfgTile.memory_trace_config.traced_events[S] = bcIdToEvent(bcId); auto mod = XAIE_CORE_MOD; - uint8_t phyEvent = 0; - XAie_EventLogicalToPhysicalConv(aieDevInst, loc, mod, memoryCrossEvents[i], &phyEvent); + uint16_t phyEvent = 0; + XAie_EventLogicalToPhysicalConv_16(aieDevInst, loc, mod, memoryCrossEvents[i], &phyEvent); cfgTile.core_trace_config.internal_events_broadcast[bcId] = phyEvent; } @@ -540,8 +540,8 @@ namespace { TraceE->getRscId(L, M, S); // Get Physical event auto mod = XAIE_MEM_MOD; - uint8_t phyEvent = 0; - XAie_EventLogicalToPhysicalConv(aieDevInst, loc, mod, memoryEvents[i], &phyEvent); + uint16_t phyEvent = 0; + XAie_EventLogicalToPhysicalConv_16(aieDevInst, loc, mod, memoryEvents[i], &phyEvent); cfgTile.memory_trace_config.traced_events[S] = phyEvent; } @@ -552,15 +552,15 @@ namespace { auto bcId = memoryTrace->getStartBc(); coreToMemBcMask |= (bcBit << bcId); auto mod = XAIE_CORE_MOD; - uint8_t phyEvent = 0; - XAie_EventLogicalToPhysicalConv(aieDevInst, loc, mod, config.coreTraceStartEvent, &phyEvent); + uint16_t phyEvent = 0; + XAie_EventLogicalToPhysicalConv_16(aieDevInst, loc, mod, config.coreTraceStartEvent, &phyEvent); cfgTile.memory_trace_config.start_event = bcIdToEvent(bcId); cfgTile.core_trace_config.internal_events_broadcast[bcId] = phyEvent; bcBit = 0x1; bcId = memoryTrace->getStopBc(); coreToMemBcMask |= (bcBit << bcId); - XAie_EventLogicalToPhysicalConv(aieDevInst, loc, mod, config.coreTraceEndEvent, &phyEvent); + XAie_EventLogicalToPhysicalConv_16(aieDevInst, loc, mod, config.coreTraceEndEvent, &phyEvent); cfgTile.memory_trace_config.stop_event = bcIdToEvent(bcId); cfgTile.core_trace_config.internal_events_broadcast[bcId] = phyEvent; } diff --git a/src/runtime_src/core/edge/ps_kernels/profiling/aie_trace_gmio/gmio_config_kernel.cpp b/src/runtime_src/core/edge/ps_kernels/profiling/aie_trace_gmio/gmio_config_kernel.cpp index d3359d0921..5bdfba2e28 100644 --- a/src/runtime_src/core/edge/ps_kernels/profiling/aie_trace_gmio/gmio_config_kernel.cpp +++ b/src/runtime_src/core/edge/ps_kernels/profiling/aie_trace_gmio/gmio_config_kernel.cpp @@ -92,12 +92,12 @@ namespace { XAie_DmaEnableBd(&(gmioDMAInsts[i].shimDmaInst)); // For trace, use bd# 0 for S2MM0, use bd# 4 for S2MM1 - int bdNum = channelNumber * 4; + uint16_t bdNum = channelNumber * 4; // Write to shim DMA BD AxiMM registers - XAie_DmaWriteBd(aieDevInst, &(gmioDMAInsts[i].shimDmaInst), gmioDMAInsts[i].gmioTileLoc, bdNum); + XAie_DmaWriteBd_16(aieDevInst, &(gmioDMAInsts[i].shimDmaInst), gmioDMAInsts[i].gmioTileLoc, bdNum); // Enqueue BD - XAie_DmaChannelPushBdToQueue(aieDevInst, gmioDMAInsts[i].gmioTileLoc, channelNumber, dir, bdNum); + XAie_DmaChannelPushBdToQueue_16(aieDevInst, gmioDMAInsts[i].gmioTileLoc, channelNumber, dir, bdNum); } return 0; diff --git a/src/runtime_src/core/edge/user/aie/aie.cpp b/src/runtime_src/core/edge/user/aie/aie.cpp index a6501e9ec2..9f0aa5f796 100755 --- a/src/runtime_src/core/edge/user/aie/aie.cpp +++ b/src/runtime_src/core/edge/user/aie/aie.cpp @@ -231,11 +231,11 @@ sync_external_buffer(std::vector& bos, adf::external_buffer_config& con int start_bd = -1; for (const auto& shim_bd_info : port_config.shim_bd_infos) { auto buf_idx = shim_bd_info.buf_idx; - dma_api_obj.updateBDAddressLin(&bds[buf_idx].mem_inst, port_config.shim_column, 0, static_cast(shim_bd_info.bd_id), shim_bd_info.offset * 4); + dma_api_obj.updateBDAddressLin(&bds[buf_idx].mem_inst, port_config.shim_column, 0, static_cast(shim_bd_info.bd_id), shim_bd_info.offset * 4); if (start_bd < 0) start_bd = shim_bd_info.bd_id; } - dma_api_obj.enqueueTask(1, port_config.shim_column, 0, port_config.direction, port_config.channel_number, port_config.task_repetition, port_config.enable_task_complete_token, static_cast(start_bd)); + dma_api_obj.enqueueTask(1, port_config.shim_column, 0, port_config.direction, port_config.channel_number, port_config.task_repetition, port_config.enable_task_complete_token, static_cast(start_bd)); } for (auto& bd :bds) { diff --git a/src/runtime_src/core/edge/user/aie/common_layer/adf_aie_control_api.h b/src/runtime_src/core/edge/user/aie/common_layer/adf_aie_control_api.h index 25ea5d912d..bc01b3ea21 100755 --- a/src/runtime_src/core/edge/user/aie/common_layer/adf_aie_control_api.h +++ b/src/runtime_src/core/edge/user/aie/common_layer/adf_aie_control_api.h @@ -89,15 +89,15 @@ class dma_api /// Lock acquire value (signed). acq_ge if less than 0. acq_eq if larger than or equal to 0. int8_t lock_acq_value = 0; /// Lock id to acquire - uint8_t lock_acq_id = 0; + uint16_t lock_acq_id = 0; /// Lock release value (signed). 0: do not release a lock. int8_t lock_rel_value = 0; /// Lock id to release - uint8_t lock_rel_id = 0; + uint16_t lock_rel_id = 0; /// Continue with next BD bool use_next_bd = false; /// Next BD ID - uint8_t next_bd = 0; + uint16_t next_bd = 0; /// AXI burst length. Shim tile only. In binary format 00: BLEN = 4 (64B), 01: BLEN = 8 (128B), 10: BLEN = 16 (256B), 11: Undefined uint8_t burst_length = 4; }; @@ -107,14 +107,14 @@ class dma_api /// @param column AIE array column /// @param row AIE array row relative to tileType /// @param dir 0 (XAie_DmaDirection::DMA_S2MM), 1 (XAie_DmaDirection::DMA_MM2S) - err_code configureBdWaitQueueEnqueueTask(int tileType, uint8_t column, uint8_t row, int dir, uint8_t channel, uint32_t repeatCount, bool enableTaskCompleteToken, std::vector bdIds, std::vector bdParams); + err_code configureBdWaitQueueEnqueueTask(int tileType, uint8_t column, uint8_t row, int dir, uint8_t channel, uint32_t repeatCount, bool enableTaskCompleteToken, std::vector bdIds, std::vector bdParams); - err_code configureBD(int tileType, uint8_t column, uint8_t row, uint8_t bdId, const dma_api::buffer_descriptor& bdParam); - err_code enqueueTask(int tileType, uint8_t column, uint8_t row, int dir, uint8_t channel, uint32_t repeatCount, bool enableTaskCompleteToken, uint8_t startBdId); + err_code configureBD(int tileType, uint8_t column, uint8_t row, uint16_t bdId, const dma_api::buffer_descriptor& bdParam); + err_code enqueueTask(int tileType, uint8_t column, uint8_t row, int dir, uint8_t channel, uint32_t repeatCount, bool enableTaskCompleteToken, uint16_t startBdId); err_code waitDMAChannelTaskQueue(int tileType, uint8_t column, uint8_t row, int dir, uint8_t channel); err_code waitDMAChannelDone(int tileType, uint8_t column, uint8_t row, int dir, uint8_t channel); - err_code updateBDAddress(int tileType, uint8_t column, uint8_t row, uint8_t bdId, uint64_t address); - err_code updateBDAddressLin(XAie_MemInst* memInst , uint8_t column, uint8_t row, uint8_t bdId, uint64_t offset); + err_code updateBDAddress(int tileType, uint8_t column, uint8_t row, uint16_t bdId, uint64_t address); + err_code updateBDAddressLin(XAie_MemInst* memInst , uint8_t column, uint8_t row, uint16_t bdId, uint64_t offset); std::shared_ptr get_config() { @@ -134,9 +134,9 @@ class lock_api /// @param tileType 0 (adf::tile_type::aie_tile), 1 (adf::tile_type::shim_tile), 2 (adf::tile_type::memory_tile) /// @param column AIE array column /// @param row AIE array row relative to tileType - err_code initializeLock(int tileType, uint8_t column, uint8_t row, unsigned short lockId, int8_t initVal); - err_code acquireLock(int tileType, uint8_t column, uint8_t row, unsigned short lockId, int8_t acqVal); - err_code releaseLock(int tileType, uint8_t column, uint8_t row, unsigned short lockId, int8_t relVal); + err_code initializeLock(int tileType, uint8_t column, uint8_t row, uint16_t lockId, int8_t initVal); + err_code acquireLock(int tileType, uint8_t column, uint8_t row, uint16_t lockId, int8_t acqVal); + err_code releaseLock(int tileType, uint8_t column, uint8_t row, uint16_t lockId, int8_t relVal); std::shared_ptr get_config() { return config; diff --git a/src/runtime_src/core/edge/user/aie/common_layer/adf_api_config.h b/src/runtime_src/core/edge/user/aie/common_layer/adf_api_config.h index 4eb3d86e9d..4005a9f1d8 100755 --- a/src/runtime_src/core/edge/user/aie/common_layer/adf_api_config.h +++ b/src/runtime_src/core/edge/user/aie/common_layer/adf_api_config.h @@ -78,15 +78,15 @@ struct rtp_config short selectorColumn; short selectorRow; size_t selectorAddr; - unsigned short selectorLockId; + uint16_t selectorLockId; short pingColumn; short pingRow; size_t pingAddr; - unsigned short pingLockId; + uint16_t pingLockId; short pongColumn; short pongRow; size_t pongAddr; - unsigned short pongLockId; + uint16_t pongLockId; bool blocking; }; diff --git a/src/runtime_src/core/edge/user/aie/common_layer/adf_runtime_api.cpp b/src/runtime_src/core/edge/user/aie/common_layer/adf_runtime_api.cpp index abaa7b9f55..a4a4ba6b35 100755 --- a/src/runtime_src/core/edge/user/aie/common_layer/adf_runtime_api.cpp +++ b/src/runtime_src/core/edge/user/aie/common_layer/adf_runtime_api.cpp @@ -678,13 +678,13 @@ err_code gmio_api::enqueueBD(XAie_MemInst *memInst, uint64_t offset, size_t size //move completed BDs from enqueuedBDs to availableBDs for (int i = 0; i < numBDCompleted; i++) { - size_t bdNumber = frontAndPop(enqueuedBDs); + uint16_t bdNumber = frontAndPop(enqueuedBDs); availableBDs.push(bdNumber); } } //get an available BD - size_t bdNumber = frontAndPop(availableBDs); + uint16_t bdNumber = frontAndPop(availableBDs); //set up BD driverStatus |= XAie_DmaSetAddrOffsetLen(&shimDmaInst, memInst, offset, (u32)size); @@ -697,10 +697,10 @@ err_code gmio_api::enqueueBD(XAie_MemInst *memInst, uint64_t offset, size_t size driverStatus |= XAie_DmaEnableBd(&shimDmaInst); //write BD - driverStatus |= XAie_DmaWriteBd(config->get_dev(), &shimDmaInst, gmioTileLoc, bdNumber); + driverStatus |= XAie_DmaWriteBd_16(config->get_dev(), &shimDmaInst, gmioTileLoc, bdNumber); //enqueue BD - driverStatus |= XAie_DmaChannelPushBdToQueue(config->get_dev(), gmioTileLoc, convertLogicalToPhysicalDMAChNum(pGMIOConfig->channelNum), (pGMIOConfig->type == gmio_config::gm2aie ? DMA_MM2S : DMA_S2MM), bdNumber); + driverStatus |= XAie_DmaChannelPushBdToQueue_16(config->get_dev(), gmioTileLoc, convertLogicalToPhysicalDMAChNum(pGMIOConfig->channelNum), (pGMIOConfig->type == gmio_config::gm2aie ? DMA_MM2S : DMA_S2MM), bdNumber); enqueuedBDs.push(bdNumber); /* Commenting out as this is increasing overhead of the performance */ @@ -750,7 +750,7 @@ static uint8_t relativeToAbsoluteRow(const std::shared_ptr confi return absoluteRow; } -err_code dma_api::configureBdWaitQueueEnqueueTask(int tileType, uint8_t column, uint8_t row, int dir, uint8_t channel, uint32_t repeatCount, bool enableTaskCompleteToken, std::vector bdIds, std::vector bdParams) +err_code dma_api::configureBdWaitQueueEnqueueTask(int tileType, uint8_t column, uint8_t row, int dir, uint8_t channel, uint32_t repeatCount, bool enableTaskCompleteToken, std::vector bdIds, std::vector bdParams) { int status = (int)err_code::ok; @@ -776,7 +776,7 @@ err_code dma_api::configureBdWaitQueueEnqueueTask(int tileType, uint8_t column, return (err_code)status; } -err_code dma_api::configureBD(int tileType, uint8_t column, uint8_t row, uint8_t bdId, const dma_api::buffer_descriptor& bdParam) +err_code dma_api::configureBD(int tileType, uint8_t column, uint8_t row, uint16_t bdId, const dma_api::buffer_descriptor& bdParam) { int driverStatus = XAIE_OK; //0 debugMsg(static_cast(std::stringstream() << "dma_api::configureBD" << std::endl).str()); @@ -820,7 +820,7 @@ err_code dma_api::configureBD(int tileType, uint8_t column, uint8_t row, uint8_t //iteration if (bdParam.iteration_stepsize > 0 || bdParam.iteration_wrap > 0 || bdParam.iteration_current > 0) - driverStatus |= XAie_DmaSetBdIteration(&dmaInst, bdParam.iteration_stepsize, bdParam.iteration_wrap, bdParam.iteration_current); + driverStatus |= XAie_DmaSetBdIteration_16(&dmaInst, bdParam.iteration_stepsize, bdParam.iteration_wrap, bdParam.iteration_current); debugMsg(static_cast(std::stringstream() << "iteration stepsize " << bdParam.iteration_stepsize << ", iteration wrap " << bdParam.iteration_wrap << ", iteration current " << (uint16_t)bdParam.iteration_current).str()); //enable compression @@ -843,7 +843,7 @@ err_code dma_api::configureBD(int tileType, uint8_t column, uint8_t row, uint8_t //next bd if (bdParam.use_next_bd) { - driverStatus |= XAie_DmaSetNextBd(&dmaInst, bdParam.next_bd, XAIE_ENABLE); + driverStatus |= XAie_DmaSetNextBd_16(&dmaInst, bdParam.next_bd, XAIE_ENABLE); debugMsg(static_cast(std::stringstream() << "next bd " << (uint16_t)bdParam.next_bd).str()); } @@ -851,7 +851,7 @@ err_code dma_api::configureBD(int tileType, uint8_t column, uint8_t row, uint8_t driverStatus |= XAie_DmaEnableBd(&dmaInst); //write bd - driverStatus |= XAie_DmaWriteBd(config->get_dev(), &dmaInst, tileLoc, bdId); + driverStatus |= XAie_DmaWriteBd_16(config->get_dev(), &dmaInst, tileLoc, bdId); debugMsg(static_cast(std::stringstream() << "XAie_DmaWriteBd " << (uint16_t)bdId << std::endl).str()); // Update status after using AIE driver @@ -861,13 +861,13 @@ err_code dma_api::configureBD(int tileType, uint8_t column, uint8_t row, uint8_t return err_code::ok; } -err_code dma_api::enqueueTask(int tileType, uint8_t column, uint8_t row, int dir, uint8_t channel, uint32_t repeatCount, bool enableTaskCompleteToken, uint8_t startBdId) +err_code dma_api::enqueueTask(int tileType, uint8_t column, uint8_t row, int dir, uint8_t channel, uint32_t repeatCount, bool enableTaskCompleteToken, uint16_t startBdId) { int driverStatus = XAIE_OK; //0 XAie_LocType tileLoc = XAie_TileLoc(column, relativeToAbsoluteRow(config, tileType, row)); //start queue - driverStatus |= XAie_DmaChannelSetStartQueue(config->get_dev(), tileLoc, channel, (XAie_DmaDirection)dir, startBdId, repeatCount, enableTaskCompleteToken); + driverStatus |= XAie_DmaChannelSetStartQueue_16(config->get_dev(), tileLoc, channel, (XAie_DmaDirection)dir, startBdId, repeatCount, enableTaskCompleteToken); debugMsg(static_cast(std::stringstream() << "XAie_DmaChannelSetStartQueue " << "col " << (uint16_t)tileLoc.Col << ", row " << (uint16_t)tileLoc.Row << ", channel " << (uint16_t)channel << ", dir " << dir << ", startBD " << (uint16_t)startBdId << ", repeat count " << repeatCount << ", enable task complete token " << enableTaskCompleteToken << std::endl).str()); @@ -915,12 +915,12 @@ err_code dma_api::waitDMAChannelDone(int tileType, uint8_t column, uint8_t row, return err_code::ok; } -err_code dma_api::updateBDAddressLin(XAie_MemInst* memInst , uint8_t column, uint8_t row, uint8_t bdId, uint64_t offset) +err_code dma_api::updateBDAddressLin(XAie_MemInst* memInst , uint8_t column, uint8_t row, uint16_t bdId, uint64_t offset) { int driverStatus = XAIE_OK; XAie_LocType tileLoc = XAie_TileLoc(column, relativeToAbsoluteRow(config, 1, row)); - driverStatus |= XAie_DmaUpdateBdAddrOff(memInst, tileLoc ,offset, bdId); + driverStatus |= XAie_DmaUpdateBdAddrOff_16(memInst, tileLoc ,offset, bdId); if (driverStatus != AieRC::XAIE_OK) return errorMsg(err_code::aie_driver_error, "ERROR: adf::dma_api::updateBDAddressLin: AIE driver error."); @@ -928,12 +928,12 @@ err_code dma_api::updateBDAddressLin(XAie_MemInst* memInst , uint8_t column, uin return err_code::ok; } -err_code dma_api::updateBDAddress(int tileType, uint8_t column, uint8_t row, uint8_t bdId, uint64_t address) +err_code dma_api::updateBDAddress(int tileType, uint8_t column, uint8_t row, uint16_t bdId, uint64_t address) { int driverStatus = XAIE_OK; //0 XAie_LocType tileLoc = XAie_TileLoc(column, relativeToAbsoluteRow(config, tileType, row)); - driverStatus |= XAie_DmaUpdateBdAddr(config->get_dev(), tileLoc, address, bdId); + driverStatus |= XAie_DmaUpdateBdAddr_16(config->get_dev(), tileLoc, address, bdId); debugMsg(static_cast(std::stringstream() << "XAie_DmaUpdateBdAddr " << "col " << (uint16_t)tileLoc.Col << ", row " << (uint16_t)tileLoc.Row << ", address " << std::hex << address << std::dec << ", bdId " << bdId << std::endl).str()); if (driverStatus != AieRC::XAIE_OK) @@ -943,7 +943,7 @@ err_code dma_api::updateBDAddress(int tileType, uint8_t column, uint8_t row, uin } /************************************ lock_api ************************************/ -err_code lock_api::initializeLock(int tileType, uint8_t column, uint8_t row, unsigned short lockId, int8_t initVal) +err_code lock_api::initializeLock(int tileType, uint8_t column, uint8_t row, uint16_t lockId, int8_t initVal) { XAie_LocType tileLoc = XAie_TileLoc(column, relativeToAbsoluteRow(config, tileType, row)); int driverStatus = XAie_LockSetValue(config->get_dev(), tileLoc, XAie_LockInit(lockId, initVal)); @@ -956,7 +956,7 @@ err_code lock_api::initializeLock(int tileType, uint8_t column, uint8_t row, uns return err_code::ok; } -err_code lock_api::acquireLock(int tileType, uint8_t column, uint8_t row, unsigned short lockId, int8_t acqVal) +err_code lock_api::acquireLock(int tileType, uint8_t column, uint8_t row, uint16_t lockId, int8_t acqVal) { XAie_LocType tileLoc = XAie_TileLoc(column, relativeToAbsoluteRow(config, tileType, row)); debugMsg(static_cast(std::stringstream() << "To call XAie_LockAcquire " << "col " << (uint16_t)tileLoc.Col << ", row " << (uint16_t)tileLoc.Row @@ -971,7 +971,7 @@ err_code lock_api::acquireLock(int tileType, uint8_t column, uint8_t row, unsign return err_code::ok; } -err_code lock_api::releaseLock(int tileType, uint8_t column, uint8_t row, unsigned short lockId, int8_t relVal) +err_code lock_api::releaseLock(int tileType, uint8_t column, uint8_t row, uint16_t lockId, int8_t relVal) { XAie_LocType tileLoc = XAie_TileLoc(column, relativeToAbsoluteRow(config, tileType, row)); int driverStatus = XAie_LockRelease(config->get_dev(), tileLoc, XAie_LockInit(lockId, relVal), LOCK_TIMEOUT); diff --git a/src/runtime_src/xdp/profile/device/aie_trace/aie_trace_offload.cpp b/src/runtime_src/xdp/profile/device/aie_trace/aie_trace_offload.cpp index 1500fd23ef..edc392951a 100644 --- a/src/runtime_src/xdp/profile/device/aie_trace/aie_trace_offload.cpp +++ b/src/runtime_src/xdp/profile/device/aie_trace/aie_trace_offload.cpp @@ -228,12 +228,12 @@ bool AIETraceOffload::initReadTrace() XAie_DmaEnableBd(&(gmioDMAInsts[i].shimDmaInst)); // For trace, use bd# 0 for S2MM0, use bd# 4 for S2MM1 - int bdNum = channelNumber * 4; + uint16_t bdNum = channelNumber * 4; // Write to shim DMA BD AxiMM registers - XAie_DmaWriteBd(devInst, &(gmioDMAInsts[i].shimDmaInst), gmioDMAInsts[i].gmioTileLoc, bdNum); + XAie_DmaWriteBd_16(devInst, &(gmioDMAInsts[i].shimDmaInst), gmioDMAInsts[i].gmioTileLoc, bdNum); // Enqueue BD - XAie_DmaChannelPushBdToQueue(devInst, gmioDMAInsts[i].gmioTileLoc, channelNumber, dir, bdNum); + XAie_DmaChannelPushBdToQueue_16(devInst, gmioDMAInsts[i].gmioTileLoc, channelNumber, dir, bdNum); #endif } diff --git a/src/runtime_src/xdp/profile/device/aie_trace/client/aie_trace_offload_client.cpp b/src/runtime_src/xdp/profile/device/aie_trace/client/aie_trace_offload_client.cpp index bf185532da..ddb2a19a7a 100644 --- a/src/runtime_src/xdp/profile/device/aie_trace/client/aie_trace_offload_client.cpp +++ b/src/runtime_src/xdp/profile/device/aie_trace/client/aie_trace_offload_client.cpp @@ -123,7 +123,7 @@ namespace xdp { XAie_DmaDesc DmaDesc; loc = XAie_TileLoc(traceGMIO->shimColumn, 0); uint8_t s2mm_ch_id = traceGMIO->channelNumber; - uint8_t s2mm_bd_id = 15; /* for now use last bd */ + uint16_t s2mm_bd_id = 15; /* for now use last bd */ // S2MM BD RC = XAie_DmaDescInit(&aieDevInst, &DmaDesc, loc); @@ -132,10 +132,10 @@ namespace xdp { static_cast(bufAllocSz)); RC = XAie_DmaEnableBd(&DmaDesc); RC = XAie_DmaSetAxi(&DmaDesc, 0U, 8U, 0U, 0U, 0U); - RC = XAie_DmaWriteBd(&aieDevInst, &DmaDesc, loc, s2mm_bd_id); + RC = XAie_DmaWriteBd_16(&aieDevInst, &DmaDesc, loc, s2mm_bd_id); // printf("Enabling channels....\n"); - RC = XAie_DmaChannelPushBdToQueue(&aieDevInst, loc, s2mm_ch_id, DMA_S2MM, + RC = XAie_DmaChannelPushBdToQueue_16(&aieDevInst, loc, s2mm_ch_id, DMA_S2MM, s2mm_bd_id); RC = XAie_DmaChannelEnable(&aieDevInst, loc, s2mm_ch_id, DMA_S2MM); diff --git a/src/runtime_src/xdp/profile/device/aie_trace/ve2/aie_trace_offload_ve2.cpp b/src/runtime_src/xdp/profile/device/aie_trace/ve2/aie_trace_offload_ve2.cpp index a270c0ecbd..635e8c2ff1 100644 --- a/src/runtime_src/xdp/profile/device/aie_trace/ve2/aie_trace_offload_ve2.cpp +++ b/src/runtime_src/xdp/profile/device/aie_trace/ve2/aie_trace_offload_ve2.cpp @@ -215,12 +215,12 @@ bool AIETraceOffload::initReadTrace() XAie_DmaEnableBd(&(gmioDMAInsts[i].shimDmaInst)); // For trace, use bd# 0 for S2MM0, use bd# 4 for S2MM1 - int bdNum = channelNumber * 4; + uint16_t bdNum = channelNumber * 4; // Write to shim DMA BD AxiMM registers - XAie_DmaWriteBd(devInst, &(gmioDMAInsts[i].shimDmaInst), gmioDMAInsts[i].gmioTileLoc, bdNum); + XAie_DmaWriteBd_16(devInst, &(gmioDMAInsts[i].shimDmaInst), gmioDMAInsts[i].gmioTileLoc, bdNum); // Enqueue BD - XAie_DmaChannelPushBdToQueue(devInst, gmioDMAInsts[i].gmioTileLoc, channelNumber, dir, bdNum); + XAie_DmaChannelPushBdToQueue_16(devInst, gmioDMAInsts[i].gmioTileLoc, channelNumber, dir, bdNum); } } bufferInitialized = true; diff --git a/src/runtime_src/xdp/profile/plugin/aie_profile/client/aie_profile.cpp b/src/runtime_src/xdp/profile/plugin/aie_profile/client/aie_profile.cpp index 5aa91282cd..80a6b6af6d 100644 --- a/src/runtime_src/xdp/profile/plugin/aie_profile/client/aie_profile.cpp +++ b/src/runtime_src/xdp/profile/plugin/aie_profile/client/aie_profile.cpp @@ -196,8 +196,8 @@ namespace xdp { // Convert enums to physical event IDs for reporting purposes uint16_t tmpStart; uint16_t tmpEnd; - XAie_EventLogicalToPhysicalConv(&aieDevInst, loc, mod, startEvent, &tmpStart); - XAie_EventLogicalToPhysicalConv(&aieDevInst, loc, mod, endEvent, &tmpEnd); + XAie_EventLogicalToPhysicalConv_16(&aieDevInst, loc, mod, startEvent, &tmpStart); + XAie_EventLogicalToPhysicalConv_16(&aieDevInst, loc, mod, endEvent, &tmpEnd); uint16_t phyStartEvent = tmpStart + aie::profile::getCounterBase(type); uint16_t phyEndEvent = tmpEnd + aie::profile::getCounterBase(type); // auto payload = getCounterPayload(tileMetric.first, type, col, row, 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 903c996791..b73954c959 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 @@ -1150,10 +1150,10 @@ namespace xdp { return std::make_pair(eventId, eventId); } - uint8_t tmpStart; - uint8_t tmpEnd; - XAie_EventLogicalToPhysicalConv(aieDevInst, tileLoc, xaieModType, startEvent, &tmpStart); - XAie_EventLogicalToPhysicalConv(aieDevInst, tileLoc, xaieModType, endEvent, &tmpEnd); + uint16_t tmpStart; + uint16_t tmpEnd; + XAie_EventLogicalToPhysicalConv_16(aieDevInst, tileLoc, xaieModType, startEvent, &tmpStart); + XAie_EventLogicalToPhysicalConv_16(aieDevInst, tileLoc, xaieModType, endEvent, &tmpEnd); uint16_t phyStartEvent = tmpStart + aie::profile::getCounterBase(xdpModType); uint16_t phyEndEvent = tmpEnd + aie::profile::getCounterBase(xdpModType); return std::make_pair(phyStartEvent, phyEndEvent); diff --git a/src/runtime_src/xdp/profile/plugin/aie_profile/ve2/aie_profile.cpp b/src/runtime_src/xdp/profile/plugin/aie_profile/ve2/aie_profile.cpp index 395c53786b..81240354fc 100644 --- a/src/runtime_src/xdp/profile/plugin/aie_profile/ve2/aie_profile.cpp +++ b/src/runtime_src/xdp/profile/plugin/aie_profile/ve2/aie_profile.cpp @@ -1150,10 +1150,10 @@ namespace xdp { return std::make_pair(eventId, eventId); } - uint8_t tmpStart; - uint8_t tmpEnd; - XAie_EventLogicalToPhysicalConv(aieDevInst, tileLoc, xaieModType, startEvent, &tmpStart); - XAie_EventLogicalToPhysicalConv(aieDevInst, tileLoc, xaieModType, endEvent, &tmpEnd); + uint16_t tmpStart; + uint16_t tmpEnd; + XAie_EventLogicalToPhysicalConv_16(aieDevInst, tileLoc, xaieModType, startEvent, &tmpStart); + XAie_EventLogicalToPhysicalConv_16(aieDevInst, tileLoc, xaieModType, endEvent, &tmpEnd); uint16_t phyStartEvent = tmpStart + aie::profile::getCounterBase(xdpModType); uint16_t phyEndEvent = tmpEnd + aie::profile::getCounterBase(xdpModType); return std::make_pair(phyStartEvent, phyEndEvent); 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 acaab76a53..beccca8334 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 @@ -904,7 +904,7 @@ namespace xdp { config.combo_event_control[i] = 2; for (size_t i=0; i < events.size(); ++i) { uint16_t phyEvent = 0; - XAie_EventLogicalToPhysicalConv(&aieDevInst, loc, mod, events.at(i), &phyEvent); + XAie_EventLogicalToPhysicalConv_16(&aieDevInst, loc, mod, events.at(i), &phyEvent); config.combo_event_input[i] = phyEvent; } @@ -1252,14 +1252,14 @@ namespace xdp { numCoreTraceEvents++; // Update config file - XAie_EventLogicalToPhysicalConv(&aieDevInst, loc, mod, coreEvents[i], &phyEvent); + XAie_EventLogicalToPhysicalConv_16(&aieDevInst, loc, mod, coreEvents[i], &phyEvent); cfgTile->core_trace_config.traced_events[slot] = phyEvent; } // Update config file - XAie_EventLogicalToPhysicalConv(&aieDevInst, loc, mod, coreTraceStartEvent, &phyEvent); + XAie_EventLogicalToPhysicalConv_16(&aieDevInst, loc, mod, coreTraceStartEvent, &phyEvent); cfgTile->core_trace_config.start_event = phyEvent; - XAie_EventLogicalToPhysicalConv(&aieDevInst, loc, mod, coreTraceEndEvent, &phyEvent); + XAie_EventLogicalToPhysicalConv_16(&aieDevInst, loc, mod, coreTraceEndEvent, &phyEvent); cfgTile->core_trace_config.stop_event = phyEvent; coreEvents.clear(); @@ -1319,10 +1319,10 @@ namespace xdp { uint16_t phyEvent = 0; if(!m_trace_start_broadcast) { - XAie_EventLogicalToPhysicalConv(&aieDevInst, loc, XAIE_CORE_MOD, traceStartEvent, &phyEvent); + XAie_EventLogicalToPhysicalConv_16(&aieDevInst, loc, XAIE_CORE_MOD, traceStartEvent, &phyEvent); cfgTile->core_trace_config.internal_events_broadcast[8] = phyEvent; } - XAie_EventLogicalToPhysicalConv(&aieDevInst, loc, XAIE_CORE_MOD, traceEndEvent, &phyEvent); + XAie_EventLogicalToPhysicalConv_16(&aieDevInst, loc, XAIE_CORE_MOD, traceEndEvent, &phyEvent); cfgTile->core_trace_config.internal_events_broadcast[9] = phyEvent; // Only enable Core -> MEM. Block everything else in both modules @@ -1355,8 +1355,8 @@ namespace xdp { { uint16_t phyEvent1 = 0; uint16_t phyEvent2 = 0; - XAie_EventLogicalToPhysicalConv(&aieDevInst, loc, mod, traceStartEvent, &phyEvent1); - XAie_EventLogicalToPhysicalConv(&aieDevInst, loc, mod, traceEndEvent, &phyEvent2); + XAie_EventLogicalToPhysicalConv_16(&aieDevInst, loc, mod, traceStartEvent, &phyEvent1); + XAie_EventLogicalToPhysicalConv_16(&aieDevInst, loc, mod, traceEndEvent, &phyEvent2); if (type == module_type::core) { cfgTile->memory_trace_config.start_event = phyEvent1; cfgTile->memory_trace_config.stop_event = phyEvent2; @@ -1438,7 +1438,7 @@ namespace xdp { // Update config file uint16_t phyEvent = 0; auto phyMod = isCoreEvent ? XAIE_CORE_MOD : XAIE_MEM_MOD; - XAie_EventLogicalToPhysicalConv(&aieDevInst, loc, phyMod, memoryEvents[i], &phyEvent); + XAie_EventLogicalToPhysicalConv_16(&aieDevInst, loc, phyMod, memoryEvents[i], &phyEvent); if (isCoreEvent) { cfgTile->core_trace_config.internal_events_broadcast[bcId] = phyEvent; @@ -1536,7 +1536,7 @@ namespace xdp { // TraceE->getRscId(L, M, S); // Get Physical event uint16_t phyEvent = 0; - XAie_EventLogicalToPhysicalConv(&aieDevInst, loc, XAIE_PL_MOD, event, &phyEvent); + XAie_EventLogicalToPhysicalConv_16(&aieDevInst, loc, XAIE_PL_MOD, event, &phyEvent); cfgTile->interface_tile_trace_config.traced_events[i] = phyEvent; } @@ -1545,10 +1545,10 @@ namespace xdp { // Add interface trace control events // Start uint16_t phyEvent = 0; - XAie_EventLogicalToPhysicalConv(&aieDevInst, loc, XAIE_PL_MOD, interfaceTileTraceStartEvent, &phyEvent); + XAie_EventLogicalToPhysicalConv_16(&aieDevInst, loc, XAIE_PL_MOD, interfaceTileTraceStartEvent, &phyEvent); cfgTile->interface_tile_trace_config.start_event = phyEvent; // Stop - XAie_EventLogicalToPhysicalConv(&aieDevInst, loc, XAIE_PL_MOD, interfaceTileTraceEndEvent, &phyEvent); + XAie_EventLogicalToPhysicalConv_16(&aieDevInst, loc, XAIE_PL_MOD, interfaceTileTraceEndEvent, &phyEvent); cfgTile->interface_tile_trace_config.stop_event = phyEvent; } 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 f748b80114..5d3028da2d 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 @@ -476,13 +476,13 @@ namespace xdp { numCoreCounters++; // Update config file - uint8_t phyEvent = 0; + uint16_t phyEvent = 0; auto& cfg = cfgTile->core_trace_config.pc[idx]; - XAie_EventLogicalToPhysicalConv(aieDevInst, loc, mod, coreCounterStartEvents[i], &phyEvent); + XAie_EventLogicalToPhysicalConv_16(aieDevInst, loc, mod, coreCounterStartEvents[i], &phyEvent); cfg.start_event = phyEvent; - XAie_EventLogicalToPhysicalConv(aieDevInst, loc, mod, coreCounterStartEvents[i], &phyEvent); + XAie_EventLogicalToPhysicalConv_16(aieDevInst, loc, mod, coreCounterStartEvents[i], &phyEvent); cfg.stop_event = phyEvent; - XAie_EventLogicalToPhysicalConv(aieDevInst, loc, mod, counterEvent, &phyEvent); + XAie_EventLogicalToPhysicalConv_16(aieDevInst, loc, mod, counterEvent, &phyEvent); cfg.reset_event = phyEvent; cfg.event_value = coreCounterEventValues[i]; } @@ -525,13 +525,13 @@ namespace xdp { numMemoryCounters++; // Update config file - uint8_t phyEvent = 0; + uint16_t phyEvent = 0; auto& cfg = cfgTile->memory_trace_config.pc[idx]; - XAie_EventLogicalToPhysicalConv(aieDevInst, loc, mod, memoryCounterStartEvents[i], &phyEvent); + XAie_EventLogicalToPhysicalConv_16(aieDevInst, loc, mod, memoryCounterStartEvents[i], &phyEvent); cfg.start_event = phyEvent; - XAie_EventLogicalToPhysicalConv(aieDevInst, loc, mod, memoryCounterEndEvents[i], &phyEvent); + XAie_EventLogicalToPhysicalConv_16(aieDevInst, loc, mod, memoryCounterEndEvents[i], &phyEvent); cfg.stop_event = phyEvent; - XAie_EventLogicalToPhysicalConv(aieDevInst, loc, mod, counterEvent, &phyEvent); + XAie_EventLogicalToPhysicalConv_16(aieDevInst, loc, mod, counterEvent, &phyEvent); cfg.reset_event = phyEvent; cfg.event_value = memoryCounterEventValues[i]; } @@ -563,7 +563,7 @@ namespace xdp { } XAie_ModuleType mod = XAIE_CORE_MOD; - uint8_t phyEvent = 0; + uint16_t phyEvent = 0; auto coreTrace = core.traceControl(); // Delay cycles and user control are not compatible with each other @@ -607,14 +607,14 @@ namespace xdp { numCoreTraceEvents++; // Update config file - XAie_EventLogicalToPhysicalConv(aieDevInst, loc, mod, coreEvents[i], &phyEvent); + XAie_EventLogicalToPhysicalConv_16(aieDevInst, loc, mod, coreEvents[i], &phyEvent); cfgTile->core_trace_config.traced_events[slot] = phyEvent; } // Update config file - XAie_EventLogicalToPhysicalConv(aieDevInst, loc, mod, coreTraceStartEvent, &phyEvent); + XAie_EventLogicalToPhysicalConv_16(aieDevInst, loc, mod, coreTraceStartEvent, &phyEvent); cfgTile->core_trace_config.start_event = phyEvent; - XAie_EventLogicalToPhysicalConv(aieDevInst, loc, mod, coreTraceEndEvent, &phyEvent); + XAie_EventLogicalToPhysicalConv_16(aieDevInst, loc, mod, coreTraceEndEvent, &phyEvent); cfgTile->core_trace_config.stop_event = phyEvent; // Record allocated trace events @@ -728,8 +728,8 @@ namespace xdp { TraceE->getRscId(L, M, S); // Get physical event - uint8_t phyEvent = 0; - XAie_EventLogicalToPhysicalConv(aieDevInst, loc, mod, memoryEvents[i], &phyEvent); + uint16_t phyEvent = 0; + XAie_EventLogicalToPhysicalConv_16(aieDevInst, loc, mod, memoryEvents[i], &phyEvent); if (isCoreEvent) { auto bcId = TraceE->getBc(); @@ -746,19 +746,19 @@ namespace xdp { // Add trace control events to config file { - uint8_t phyEvent = 0; + uint16_t phyEvent = 0; // Start if (aie::trace::isCoreModuleEvent(traceStartEvent)) { auto bcId = memoryTrace->getStartBc(); coreToMemBcMask |= (1 << bcId); - XAie_EventLogicalToPhysicalConv(aieDevInst, loc, XAIE_CORE_MOD, traceStartEvent, &phyEvent); + XAie_EventLogicalToPhysicalConv_16(aieDevInst, loc, XAIE_CORE_MOD, traceStartEvent, &phyEvent); cfgTile->core_trace_config.internal_events_broadcast[bcId] = phyEvent; cfgTile->memory_trace_config.start_event = aie::bcIdToEvent(bcId); } else { - XAie_EventLogicalToPhysicalConv(aieDevInst, loc, XAIE_MEM_MOD, traceStartEvent, &phyEvent); + XAie_EventLogicalToPhysicalConv_16(aieDevInst, loc, XAIE_MEM_MOD, traceStartEvent, &phyEvent); if (type == module_type::mem_tile) cfgTile->memory_tile_trace_config.start_event = phyEvent; else @@ -770,7 +770,7 @@ namespace xdp { auto bcId = memoryTrace->getStopBc(); coreToMemBcMask |= (1 << bcId); - XAie_EventLogicalToPhysicalConv(aieDevInst, loc, XAIE_CORE_MOD, traceEndEvent, &phyEvent); + XAie_EventLogicalToPhysicalConv_16(aieDevInst, loc, XAIE_CORE_MOD, traceEndEvent, &phyEvent); cfgTile->core_trace_config.internal_events_broadcast[bcId] = phyEvent; cfgTile->memory_trace_config.stop_event = aie::bcIdToEvent(bcId); @@ -781,7 +781,7 @@ namespace xdp { cfgTile->core_trace_config.broadcast_mask_west = coreToMemBcMask; } else { - XAie_EventLogicalToPhysicalConv(aieDevInst, loc, XAIE_MEM_MOD, traceEndEvent, &phyEvent); + XAie_EventLogicalToPhysicalConv_16(aieDevInst, loc, XAIE_MEM_MOD, traceEndEvent, &phyEvent); if (type == module_type::mem_tile) cfgTile->memory_tile_trace_config.stop_event = phyEvent; else @@ -868,8 +868,8 @@ namespace xdp { XAie_ModuleType M; TraceE->getRscId(L, M, S); // Get Physical event - uint8_t phyEvent = 0; - XAie_EventLogicalToPhysicalConv(aieDevInst, loc, XAIE_PL_MOD, event, &phyEvent); + uint16_t phyEvent = 0; + XAie_EventLogicalToPhysicalConv_16(aieDevInst, loc, XAIE_PL_MOD, event, &phyEvent); cfgTile->interface_tile_trace_config.traced_events[S] = phyEvent; } @@ -877,11 +877,11 @@ namespace xdp { { // Add interface trace control events // Start - uint8_t phyEvent = 0; - XAie_EventLogicalToPhysicalConv(aieDevInst, loc, XAIE_PL_MOD, interfaceTileTraceStartEvent, &phyEvent); + uint16_t phyEvent = 0; + XAie_EventLogicalToPhysicalConv_16(aieDevInst, loc, XAIE_PL_MOD, interfaceTileTraceStartEvent, &phyEvent); cfgTile->interface_tile_trace_config.start_event = phyEvent; // Stop - XAie_EventLogicalToPhysicalConv(aieDevInst, loc, XAIE_PL_MOD, interfaceTileTraceEndEvent, &phyEvent); + XAie_EventLogicalToPhysicalConv_16(aieDevInst, loc, XAIE_PL_MOD, interfaceTileTraceEndEvent, &phyEvent); cfgTile->interface_tile_trace_config.stop_event = phyEvent; } diff --git a/src/runtime_src/xdp/profile/plugin/aie_trace/util/aie_trace_config.cpp b/src/runtime_src/xdp/profile/plugin/aie_trace/util/aie_trace_config.cpp index 5dcd852d48..2ebe4f74f2 100755 --- a/src/runtime_src/xdp/profile/plugin/aie_trace/util/aie_trace_config.cpp +++ b/src/runtime_src/xdp/profile/plugin/aie_trace/util/aie_trace_config.cpp @@ -187,8 +187,8 @@ namespace xdp::aie::trace { for (int i=0; i < NUM_COMBO_EVENT_CONTROL; ++i) config.combo_event_control[i] = 2; for (int i=0; i < events.size(); ++i) { - uint8_t phyEvent = 0; - XAie_EventLogicalToPhysicalConv(aieDevInst, loc, mod, events.at(i), &phyEvent); + uint16_t phyEvent = 0; + XAie_EventLogicalToPhysicalConv_16(aieDevInst, loc, mod, events.at(i), &phyEvent); config.combo_event_input[i] = phyEvent; } diff --git a/src/runtime_src/xdp/profile/plugin/aie_trace/ve2/aie_trace.cpp b/src/runtime_src/xdp/profile/plugin/aie_trace/ve2/aie_trace.cpp index a4f1ec0578..f4a9972993 100755 --- a/src/runtime_src/xdp/profile/plugin/aie_trace/ve2/aie_trace.cpp +++ b/src/runtime_src/xdp/profile/plugin/aie_trace/ve2/aie_trace.cpp @@ -476,13 +476,13 @@ namespace xdp { numCoreCounters++; // Update config file - uint8_t phyEvent = 0; + uint16_t phyEvent = 0; auto& cfg = cfgTile->core_trace_config.pc[idx]; - XAie_EventLogicalToPhysicalConv(aieDevInst, loc, mod, coreCounterStartEvents[i], &phyEvent); + XAie_EventLogicalToPhysicalConv_16(aieDevInst, loc, mod, coreCounterStartEvents[i], &phyEvent); cfg.start_event = phyEvent; - XAie_EventLogicalToPhysicalConv(aieDevInst, loc, mod, coreCounterStartEvents[i], &phyEvent); + XAie_EventLogicalToPhysicalConv_16(aieDevInst, loc, mod, coreCounterStartEvents[i], &phyEvent); cfg.stop_event = phyEvent; - XAie_EventLogicalToPhysicalConv(aieDevInst, loc, mod, counterEvent, &phyEvent); + XAie_EventLogicalToPhysicalConv_16(aieDevInst, loc, mod, counterEvent, &phyEvent); cfg.reset_event = phyEvent; cfg.event_value = coreCounterEventValues[i]; } @@ -525,13 +525,13 @@ namespace xdp { numMemoryCounters++; // Update config file - uint8_t phyEvent = 0; + uint16_t phyEvent = 0; auto& cfg = cfgTile->memory_trace_config.pc[idx]; - XAie_EventLogicalToPhysicalConv(aieDevInst, loc, mod, memoryCounterStartEvents[i], &phyEvent); + XAie_EventLogicalToPhysicalConv_16(aieDevInst, loc, mod, memoryCounterStartEvents[i], &phyEvent); cfg.start_event = phyEvent; - XAie_EventLogicalToPhysicalConv(aieDevInst, loc, mod, memoryCounterEndEvents[i], &phyEvent); + XAie_EventLogicalToPhysicalConv_16(aieDevInst, loc, mod, memoryCounterEndEvents[i], &phyEvent); cfg.stop_event = phyEvent; - XAie_EventLogicalToPhysicalConv(aieDevInst, loc, mod, counterEvent, &phyEvent); + XAie_EventLogicalToPhysicalConv_16(aieDevInst, loc, mod, counterEvent, &phyEvent); cfg.reset_event = phyEvent; cfg.event_value = memoryCounterEventValues[i]; } @@ -563,7 +563,7 @@ namespace xdp { } XAie_ModuleType mod = XAIE_CORE_MOD; - uint8_t phyEvent = 0; + uint16_t phyEvent = 0; auto coreTrace = core.traceControl(); // Delay cycles and user control are not compatible with each other @@ -607,14 +607,14 @@ namespace xdp { numCoreTraceEvents++; // Update config file - XAie_EventLogicalToPhysicalConv(aieDevInst, loc, mod, coreEvents[i], &phyEvent); + XAie_EventLogicalToPhysicalConv_16(aieDevInst, loc, mod, coreEvents[i], &phyEvent); cfgTile->core_trace_config.traced_events[slot] = phyEvent; } // Update config file - XAie_EventLogicalToPhysicalConv(aieDevInst, loc, mod, coreTraceStartEvent, &phyEvent); + XAie_EventLogicalToPhysicalConv_16(aieDevInst, loc, mod, coreTraceStartEvent, &phyEvent); cfgTile->core_trace_config.start_event = phyEvent; - XAie_EventLogicalToPhysicalConv(aieDevInst, loc, mod, coreTraceEndEvent, &phyEvent); + XAie_EventLogicalToPhysicalConv_16(aieDevInst, loc, mod, coreTraceEndEvent, &phyEvent); cfgTile->core_trace_config.stop_event = phyEvent; // Record allocated trace events @@ -728,8 +728,8 @@ namespace xdp { TraceE->getRscId(L, M, S); // Get physical event - uint8_t phyEvent = 0; - XAie_EventLogicalToPhysicalConv(aieDevInst, loc, mod, memoryEvents[i], &phyEvent); + uint16_t phyEvent = 0; + XAie_EventLogicalToPhysicalConv_16(aieDevInst, loc, mod, memoryEvents[i], &phyEvent); if (isCoreEvent) { auto bcId = TraceE->getBc(); @@ -746,19 +746,19 @@ namespace xdp { // Add trace control events to config file { - uint8_t phyEvent = 0; + uint16_t phyEvent = 0; // Start if (aie::trace::isCoreModuleEvent(traceStartEvent)) { auto bcId = memoryTrace->getStartBc(); coreToMemBcMask |= (1 << bcId); - XAie_EventLogicalToPhysicalConv(aieDevInst, loc, XAIE_CORE_MOD, traceStartEvent, &phyEvent); + XAie_EventLogicalToPhysicalConv_16(aieDevInst, loc, XAIE_CORE_MOD, traceStartEvent, &phyEvent); cfgTile->core_trace_config.internal_events_broadcast[bcId] = phyEvent; cfgTile->memory_trace_config.start_event = aie::bcIdToEvent(bcId); } else { - XAie_EventLogicalToPhysicalConv(aieDevInst, loc, XAIE_MEM_MOD, traceStartEvent, &phyEvent); + XAie_EventLogicalToPhysicalConv_16(aieDevInst, loc, XAIE_MEM_MOD, traceStartEvent, &phyEvent); if (type == module_type::mem_tile) cfgTile->memory_tile_trace_config.start_event = phyEvent; else @@ -770,7 +770,7 @@ namespace xdp { auto bcId = memoryTrace->getStopBc(); coreToMemBcMask |= (1 << bcId); - XAie_EventLogicalToPhysicalConv(aieDevInst, loc, XAIE_CORE_MOD, traceEndEvent, &phyEvent); + XAie_EventLogicalToPhysicalConv_16(aieDevInst, loc, XAIE_CORE_MOD, traceEndEvent, &phyEvent); cfgTile->core_trace_config.internal_events_broadcast[bcId] = phyEvent; cfgTile->memory_trace_config.stop_event = aie::bcIdToEvent(bcId); @@ -781,7 +781,7 @@ namespace xdp { cfgTile->core_trace_config.broadcast_mask_west = coreToMemBcMask; } else { - XAie_EventLogicalToPhysicalConv(aieDevInst, loc, XAIE_MEM_MOD, traceEndEvent, &phyEvent); + XAie_EventLogicalToPhysicalConv_16(aieDevInst, loc, XAIE_MEM_MOD, traceEndEvent, &phyEvent); if (type == module_type::mem_tile) cfgTile->memory_tile_trace_config.stop_event = phyEvent; else @@ -868,8 +868,8 @@ namespace xdp { XAie_ModuleType M; TraceE->getRscId(L, M, S); // Get Physical event - uint8_t phyEvent = 0; - XAie_EventLogicalToPhysicalConv(aieDevInst, loc, XAIE_PL_MOD, event, &phyEvent); + uint16_t phyEvent = 0; + XAie_EventLogicalToPhysicalConv_16(aieDevInst, loc, XAIE_PL_MOD, event, &phyEvent); cfgTile->interface_tile_trace_config.traced_events[S] = phyEvent; } @@ -877,11 +877,11 @@ namespace xdp { { // Add interface trace control events // Start - uint8_t phyEvent = 0; - XAie_EventLogicalToPhysicalConv(aieDevInst, loc, XAIE_PL_MOD, interfaceTileTraceStartEvent, &phyEvent); + uint16_t phyEvent = 0; + XAie_EventLogicalToPhysicalConv_16(aieDevInst, loc, XAIE_PL_MOD, interfaceTileTraceStartEvent, &phyEvent); cfgTile->interface_tile_trace_config.start_event = phyEvent; // Stop - XAie_EventLogicalToPhysicalConv(aieDevInst, loc, XAIE_PL_MOD, interfaceTileTraceEndEvent, &phyEvent); + XAie_EventLogicalToPhysicalConv_16(aieDevInst, loc, XAIE_PL_MOD, interfaceTileTraceEndEvent, &phyEvent); cfgTile->interface_tile_trace_config.stop_event = phyEvent; }