Skip to content

Commit

Permalink
[XDP] Multiple CRs - fixed PLIO verification and refined all_stalls_s…
Browse files Browse the repository at this point in the history
…2mm metric set (#8429)
  • Loading branch information
pgschuey authored Sep 18, 2024
1 parent fb9dfad commit 53775ee
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ std::vector<tile_type>
AIEControlConfigFiletype::getInterfaceTiles(const std::string& graphName,
const std::string& portName,
const std::string& metricStr,
int16_t channelId,
int16_t specifiedId,
bool useColumn,
uint8_t minCol,
uint8_t maxCol) const
Expand All @@ -225,6 +225,7 @@ AIEControlConfigFiletype::getInterfaceTiles(const std::string& graphName,
for (auto& io : ios) {
auto isMaster = io.second.slaveOrMaster;
auto streamId = io.second.streamId;
auto channelNum = io.second.channelNum;
auto shimCol = io.second.shimColumn;
auto logicalName = io.second.logicalName;
auto name = io.second.name;
Expand All @@ -251,7 +252,7 @@ AIEControlConfigFiletype::getInterfaceTiles(const std::string& graphName,
|| (!isMaster && (metricStr.find("input") == std::string::npos)
&& (metricStr.find("mm2s") == std::string::npos)))
{
// Process this tile for below profile API specific metrics
// Catch metric sets that don't follow above naming convention
if ((metricStr != "packets") &&
(metricStr != "interface_tile_latency") &&
(metricStr != "start_to_bytes_transferred"))
Expand All @@ -261,14 +262,12 @@ AIEControlConfigFiletype::getInterfaceTiles(const std::string& graphName,
// Make sure column is within specified range (if specified)
if (useColumn && !((minCol <= shimCol) && (shimCol <= maxCol)))
continue;
// Make sure channel number is same as specified (GMIO only)
if ((type == io_type::GMIO) && (channelId >= 0) && (channelId != io.second.channelNum)) {
std::stringstream msg;
msg << "Specified channel ID " << +channelId << "doesn't match for interface column "
<< +shimCol <<" and stream ID " << +streamId;
xrt_core::message::send(severity_level::info, "XRT", msg.str());

// Make sure stream/channel number is as specified
// NOTE: For GMIO, we use DMA channel number; for PLIO, we use the SOUTH location
uint8_t idToCheck = (type == io_type::GMIO) ? channelNum : streamId;
if ((specifiedId >= 0) && (specifiedId != idToCheck))
continue;
}

tile_type tile = {0};
tile.col = shimCol;
Expand All @@ -281,9 +280,9 @@ AIEControlConfigFiletype::getInterfaceTiles(const std::string& graphName,
tiles.emplace_back(std::move(tile));
}

if (tiles.empty() && (channelId >= 0)) {
std::string msg = "No tiles used channel ID " + std::to_string(channelId)
+ ". Please specify a valid channel ID.";
if (tiles.empty() && (specifiedId >= 0)) {
std::string msg = "No tiles used specified ID " + std::to_string(specifiedId)
+ ". Please specify a valid ID.";
xrt_core::message::send(severity_level::warning, "XRT", msg);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class AIEControlConfigFiletype : public xdp::aie::BaseFiletypeImpl {
getInterfaceTiles(const std::string& graphName,
const std::string& portName = "all",
const std::string& metricStr = "channels",
int16_t channelId = -1,
int16_t specifiedId = -1,
bool useColumn = false,
uint8_t minCol = 0,
uint8_t maxCol = 0) const override;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class BaseFiletypeImpl {
getInterfaceTiles(const std::string& graphName,
const std::string& portName = "all",
const std::string& metricStr = "channels",
int16_t channelId = -1,
int16_t specifiedId = -1,
bool useColumn = false,
uint8_t minCol = 0,
uint8_t maxCol = 0) const = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,11 @@ namespace xdp::aie::trace {
{XAIE_EVENT_INSTR_CALL_CORE, XAIE_EVENT_INSTR_RETURN_CORE,
XAIE_EVENT_PORT_RUNNING_0_CORE, XAIE_EVENT_PORT_RUNNING_1_CORE,
XAIE_EVENT_PORT_RUNNING_2_CORE, XAIE_EVENT_PORT_RUNNING_3_CORE}},
{"all_stalls_s2mm",
{XAIE_EVENT_INSTR_CALL_CORE, XAIE_EVENT_INSTR_RETURN_CORE,
XAIE_EVENT_MEMORY_STALL_CORE, XAIE_EVENT_STREAM_STALL_CORE,
XAIE_EVENT_LOCK_STALL_CORE, XAIE_EVENT_PORT_RUNNING_0_CORE,
XAIE_EVENT_PORT_RUNNING_1_CORE}},
{"all_stalls_dma",
{XAIE_EVENT_INSTR_CALL_CORE, XAIE_EVENT_INSTR_RETURN_CORE,
XAIE_EVENT_GROUP_CORE_STALL_CORE, XAIE_EVENT_PORT_RUNNING_0_CORE,
Expand All @@ -113,19 +118,11 @@ namespace xdp::aie::trace {
};

// Generation-specific sets
// * AIE1 only supports seven trace events (need one for counter)
// * Sets w/ DMA stall/backpressure events not supported on AIE1
if (hwGen == 1) {
eventSets["all_stalls_s2mm"] =
{XAIE_EVENT_INSTR_CALL_CORE, XAIE_EVENT_INSTR_RETURN_CORE,
XAIE_EVENT_GROUP_CORE_STALL_CORE, XAIE_EVENT_PORT_RUNNING_0_CORE,
XAIE_EVENT_PORT_RUNNING_1_CORE};
} else {
eventSets["all_stalls_s2mm"] =
{XAIE_EVENT_INSTR_CALL_CORE, XAIE_EVENT_INSTR_RETURN_CORE,
XAIE_EVENT_MEMORY_STALL_CORE, XAIE_EVENT_STREAM_STALL_CORE,
XAIE_EVENT_CASCADE_STALL_CORE, XAIE_EVENT_LOCK_STALL_CORE,
XAIE_EVENT_PORT_RUNNING_0_CORE, XAIE_EVENT_PORT_RUNNING_1_CORE};
// * AIE2+ supports all eight trace events (AIE1 requires one for counter)
// * Sets w/ DMA stall/backpressure events not supported on AIE1
if (hwGen > 1) {
eventSets["all_stalls_s2mm"].push_back(XAIE_EVENT_CASCADE_STALL_CORE);

eventSets["s2mm_channels_stalls"] =
{XAIE_EVENT_DMA_S2MM_0_START_TASK_MEM, XAIE_EVENT_DMA_S2MM_0_FINISHED_BD_MEM,
XAIE_EVENT_DMA_S2MM_0_FINISHED_TASK_MEM, XAIE_EVENT_DMA_S2MM_0_STALLED_LOCK_MEM,
Expand Down

0 comments on commit 53775ee

Please sign in to comment.