Skip to content

Commit

Permalink
Correct use of streamIds for tiles (#8743)
Browse files Browse the repository at this point in the history
  • Loading branch information
vipangul authored Feb 7, 2025
1 parent a1e39e6 commit f02de26
Showing 1 changed file with 11 additions and 10 deletions.
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

0 comments on commit f02de26

Please sign in to comment.