Skip to content
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
5 changes: 3 additions & 2 deletions profile/device/aie_trace/aie_trace_offload.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -415,8 +415,9 @@ uint64_t AIETraceOffload::syncAndLog(uint64_t index)
bd.offloadDone = true;
}

// Log nBytes of trace
traceLogger->addAIETraceData(index, hostBuf, nBytes, mEnCircularBuf);
// Log nBytes of trace. Always copy: syncTraceBuf() unmaps the BO before returning.
traceLogger->addAIETraceData(index, hostBuf, nBytes, true);

return nBytes;
}

Expand Down
9 changes: 6 additions & 3 deletions profile/plugin/aie_trace/aie_trace_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -264,15 +264,18 @@ void AieTracePluginUnified::updateAIEDevice(void *handle, bool hw_context_flow)
// uint64_t aieTraceBufSizePLIO = aieTraceBufSize;
// uint64_t aieTraceBufSizeGMIO = aieTraceBufSize;
if (isPLIO && !configuredOnePlioPartition) {
#if defined(XDP_VE2_BUILD) && defined(XDP_VE2_ZOCL_BUILD) // PLIO flow for VE2 ZOCL build only
#if defined(XDP_CLIENT_BUILD) || (defined(XDP_VE2_BUILD) && !defined(XDP_VE2_ZOCL_BUILD))
// PLIO not supported on client/XDNA builds
#else
XAie_DevInst* devInst = static_cast<XAie_DevInst*>(AIEData.implementation->setAieDeviceInst(handle, deviceID));
if(!devInst) {
xrt_core::message::send(severity_level::warning, "XRT",
"Unable to get AIE device instance. AIE event trace will not be available.");
return;
}
AIEData.offloadManager->configureAndInitPLIO(handle, deviceIntf, aieTraceBufSize,
AIEData.metadata->getNumStreamsPLIO(), devInst);
if (!AIEData.offloadManager->configureAndInitPLIO(handle, deviceIntf, aieTraceBufSize,
AIEData.metadata->getNumStreamsPLIO(), devInst))
return;
#endif
configuredOnePlioPartition = true;
}
Expand Down
12 changes: 12 additions & 0 deletions profile/plugin/aie_trace/edge/aie_trace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,15 @@ namespace xdp {
if(!metadata->getRuntimeMetrics())
return;

if (!aieDevice) {
setAieDeviceInst(metadata->getHandle(), metadata->getDeviceID());
if (!aieDevice) {
xrt_core::message::send(severity_level::warning, "XRT",
"Unable to get AIE device. AIE event trace will not be available.");
return;
}
}

// Set metrics for counters and trace events
if (!setMetricsSettings(metadata->getDeviceID(), metadata->getHandle())) {
std::string msg("Unable to configure AIE trace control and events. No trace will be generated.");
Expand Down Expand Up @@ -996,6 +1005,9 @@ namespace xdp {
if (!(db->getStaticInfo().isDeviceReady(index)))
return;

if (!aieDevInst)
return;

// Only read first timer and assume common time domain across all tiles
static auto tileMetrics = metadata->getConfigMetrics();
if (tileMetrics.empty())
Expand Down
Loading