MLIR-AIE 1.4.5.dev
AIERoutingDiagnostics.h
Go to the documentation of this file.
1//===- AIERoutingDiagnostics.h ----------------------------------*- C++ -*-===//
2//
3// Copyright (C) 2026 Advanced Micro Devices, Inc.
4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
5//
6//===----------------------------------------------------------------------===//
7//
8// How the router names ports and flows in its diagnostics.
9//
10//===----------------------------------------------------------------------===//
11
12#ifndef AIE_DIALECT_AIE_TRANSFORMS_AIEROUTINGDIAGNOSTICS_H
13#define AIE_DIALECT_AIE_TRANSFORMS_AIEROUTINGDIAGNOSTICS_H
14
16
17#include "llvm/ADT/ArrayRef.h"
18
19#include <string>
20
21namespace xilinx::AIE {
22
23/// Names a port the way diagnostics do, e.g. "DMA:1".
24std::string describePort(Port port);
25
26/// Names a tile port the way diagnostics do, e.g. "(0, 2) DMA:1".
27std::string describeTilePort(TileID tile, Port port);
28
29/// Lists `names` as "A, B and C", the first `shown` of them followed by
30/// "N more" if there are more.
31std::string joinNames(llvm::ArrayRef<std::string> names, size_t shown = 4);
32
33/// Says that the packet flows from `sources` keep the route they take alone,
34/// as a control-packet reload of a design they are prioritized in asks.
35std::string describePrioritized(llvm::ArrayRef<std::string> sources);
36
37} // namespace xilinx::AIE
38
39#endif // AIE_DIALECT_AIE_TRANSFORMS_AIEROUTINGDIAGNOSTICS_H
std::string joinNames(llvm::ArrayRef< std::string > names, size_t shown=4)
Lists names as "A, B and C", the first shown of them followed by "N more" if there are more.
std::string describePrioritized(llvm::ArrayRef< std::string > sources)
Says that the packet flows from sources keep the route they take alone, as a control-packet reload of...
struct TileID { friend std::ostream &operator<<(std::ostream &os, const TileID &s) { os<< "TileID("<< s.col<< ", "<< s.row<< ")"; return os; } friend std::string to_string(const TileID &s) { std::ostringstream ss; ss<< s; return ss.str(); } friend llvm::raw_ostream &operator<<(llvm::raw_ostream &os, const TileID &s) { os<< to_string(s); return os; } inline bool operator<(const TileID &rhs) const { return std::tie(col, row)< std::tie(rhs.col, rhs.row); } bool operator==(const TileID &rhs) const { return std::tie(col, row)==std::tie(rhs.col, rhs.row); } bool operator!=(const TileID &rhs) const { return !(*this==rhs);} int col, row;} TileID
std::string describeTilePort(TileID tile, Port port)
Names a tile port the way diagnostics do, e.g. "(0, 2) DMA:1".
struct Port { WireBundle bundle; int channel; bool operator==(const Port &rhs) const { return std::tie(bundle, channel)==std::tie(rhs.bundle, rhs.channel); } bool operator!=(const Port &rhs) const { return !(*this==rhs);} bool operator<(const Port &rhs) const { return std::tie(bundle, channel)< std::tie(rhs.bundle, rhs.channel); } friend std::ostream &operator<<(std::ostream &os, const Port &port) { os<< "("; os<< stringifyWireBundle(port.bundle).str(); os<< ": "<< std::to_string(port.channel)<< ")"; return os; } friend llvm::raw_ostream &operator<<(llvm::raw_ostream &os, const Port &port) { os<< to_string(port); return os; } } Port
Definition AIEDialect.h:265
std::string describePort(Port port)
Names a port the way diagnostics do, e.g. "DMA:1".