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] Use stream ID and Master or Slave information for each interface tile from metadata #8743

Merged
merged 2 commits into from
Feb 7, 2025
Merged
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
21 changes: 11 additions & 10 deletions src/runtime_src/xdp/profile/plugin/aie_trace/client/aie_trace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -678,27 +678,28 @@ namespace xdp {
}
else if (type == module_type::shim) {
// Interface tiles (e.g., GMIO)
bool isMaster = ((portnum >= 2) || (metricSet.find("input") == std::string::npos));
auto slaveOrMaster = isMaster ? XAIE_STRMSW_MASTER : XAIE_STRMSW_SLAVE;
uint8_t streamPortId = isMaster ? ((channelNum == 0) ? 2 : 3)
: ((channelNum == 0) ? 3 : 7);
// NOTE: skip configuration of extra ports for tile if stream_ids are not available.
if (portnum >= tile.stream_ids.size())
continue;

auto slaveOrMaster = (tile.is_master_vec.at(portnum) == 0) ? XAIE_STRMSW_SLAVE : XAIE_STRMSW_MASTER;
uint8_t streamPortId = static_cast<uint8_t>(tile.stream_ids.at(portnum));
std::string typeName = (tile.is_master_vec.at(portnum) == 0) ? "slave" : "master";

std::string typeName = isMaster ? "master" : "slave";
std::string msg = "Configuring interface tile stream switch to monitor "
+ typeName + " port with stream ID of " + std::to_string(streamPortId);
xrt_core::message::send(severity_level::debug, "XRT", msg);

//switchPortRsc->setPortToSelect(slaveOrMaster, SOUTH, streamPortId);
XAie_EventSelectStrmPort(&aieDevInst, loc, portnum, slaveOrMaster, SOUTH, streamPortId);

// Record for runtime config file
config.port_trace_ids[portnum] = channelNum;
config.port_trace_is_master[portnum] = isMaster;
config.port_trace_is_master[portnum] = (tile.is_master_vec.at(portnum) != 0);

if (isMaster)
config.s2mm_channels[channelNum] = channelNum;
if (tile.is_master_vec.at(portnum) == 0)
config.mm2s_channels[channelNum] = channel; // Slave or Input Port
else
config.mm2s_channels[channelNum] = channelNum;
config.s2mm_channels[channelNum] = channel; // Master or Output Port
}
else {
// Memory tiles
Expand Down
Loading