Skip to content

Commit

Permalink
Sort packet flows based on channel id, too
Browse files Browse the repository at this point in the history
  • Loading branch information
erwei-xilinx committed Sep 18, 2024
1 parent b5d4181 commit bd0ed52
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/Dialect/AIE/Transforms/AIEPathFinder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -354,13 +354,18 @@ void Pathfinder::sortFlows(const int maxCol, const int maxRow) {
normalFlows.push_back(f);
}
std::sort(priorityFlows.begin(), priorityFlows.end(),
[maxCol](const auto &lhs, const auto &rhs) {
[maxCol, maxRow](const auto &lhs, const auto &rhs) {
int lhsUniqueID = lhs.src.coords.col;
lhsUniqueID += lhs.src.coords.row * maxCol;
lhsUniqueID += maxRow * maxCol;
lhsUniqueID += getWireBundleAsInt(lhs.src.port.bundle);
lhsUniqueID += AIE::getMaxEnumValForWireBundle();
lhsUniqueID += lhs.src.port.channel;
int rhsUniqueID = rhs.src.coords.col;
rhsUniqueID += rhs.src.coords.row * maxCol;
rhsUniqueID += maxRow * maxCol;
rhsUniqueID += getWireBundleAsInt(rhs.src.port.bundle);
rhsUniqueID += rhs.src.port.channel;
return lhsUniqueID < rhsUniqueID;
});
flows = priorityFlows;
Expand Down

0 comments on commit bd0ed52

Please sign in to comment.