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
28 changes: 11 additions & 17 deletions profile/plugin/aie_status/aie_status_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -433,13 +433,9 @@ namespace xdp {
}
}

uint64_t AIEStatusPlugin::getDeviceIDFromHandle(void* handle, bool hw_context_flow)
uint64_t AIEStatusPlugin::getDeviceIDFromHandle(void* handle)
{
if (hw_context_flow)
return db->addDevice("ve2_device");
else
// only xcl device handle
return db->addDevice(util::getDebugIpLayoutPath(handle)); // Get the unique device Id
return (db->getStaticInfo()).getDeviceContextUniqueId(handle);
}

/****************************************************************************
Expand All @@ -455,21 +451,23 @@ namespace xdp {
if (!handle)
return;

if (!((db->getStaticInfo()).continueXDPConfig(hw_context_flow)))
return;

auto mXrtCoreDevice = util::convertToCoreDevice(handle, hw_context_flow);
auto deviceID = getDeviceIDFromHandle(handle, hw_context_flow);
auto deviceID = getDeviceIDFromHandle(handle);

// Update the static database with information from xclbin
{
#ifdef XDP_VE2_BUILD
if ((db->getStaticInfo()).getAppStyle() == xdp::AppStyle::REGISTER_XCLBIN_STYLE)
// TODO: should we use updateDeviceFromCoreDeviceHwCtxFlow or updateDeviceFromCoreDevice
(db->getStaticInfo()).updateDeviceFromCoreDevice(deviceID, mXrtCoreDevice);
#else
(db->getStaticInfo()).updateDeviceFromCoreDeviceHwCtxFlow(deviceID, mXrtCoreDevice, handle, hw_context_flow);
else
(db->getStaticInfo()).updateDeviceFromHandle(deviceID, nullptr, handle);
#endif
}

// Grab AIE metadata
metadataReader = (db->getStaticInfo()).getAIEmetadataReader();
metadataReader = (db->getStaticInfo()).getAIEmetadataReader(deviceID);
if (!metadataReader)
return;
auto hwGen = metadataReader->getHardwareGeneration();
Expand All @@ -478,11 +476,7 @@ namespace xdp {
getTilesForStatus(handle);

// Open the writer for this device
#ifdef XDP_VE2_BUILD
std::string devicename = util::getDeviceName(handle,true);
#else
std::string devicename = util::getDeviceName(handle);
#endif
std::string devicename = util::getDeviceName(handle, hw_context_flow);

std::string currentTime = "0000_00_00_0000";
auto time = std::chrono::system_clock::to_time_t(std::chrono::system_clock::now());
Expand Down
2 changes: 1 addition & 1 deletion profile/plugin/aie_status/aie_status_plugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ namespace xdp {
void getTilesForStatus(void* handle);
void endPoll();
std::string getCoreStatusString(uint32_t status);
uint64_t getDeviceIDFromHandle(void* handle, bool hw_context_flow);
uint64_t getDeviceIDFromHandle(void* handle);

// Threads used by this plugin
void pollDeadlock(uint64_t index, void* handle);
Expand Down
Loading