10#include "llvm/Support/FormatVariadic.h"
15 return llvm::formatv(
"{0}:{1}", stringifyWireBundle(port.bundle),
20 return llvm::formatv(
"({0}, {1}) {2}", tile.col, tile.row,
25 size_t more = names.size() > shown ? names.size() - shown : 0;
26 llvm::ArrayRef<std::string> listed = names.drop_back(more);
28 for (
auto [i, name] : llvm::enumerate(listed))
30 : i + 1 == listed.size() && !more ?
" and "
34 list +=
" and " + std::to_string(more) +
" more";
39 return "packet flows from " +
joinNames(sources) +
40 " are prioritized (priority_route) in a design a control-packet "
41 "reload configures (has_ctrl_pkt_overlay), so they keep the route "
42 "they take alone, as in @ctrl_pkt_overlay";
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
std::string describePort(Port port)
Names a port the way diagnostics do, e.g. "DMA:1".