aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Amsel <lars.amsel@ni.com>2024-03-19 17:37:02 +0100
committerjoergho <48011876+joergho@users.noreply.github.com>2024-03-20 08:50:31 +0100
commit1e8953f70e3824892f0b7d734fe16fe82fcbc5b2 (patch)
tree2f23a9bc2374ef7217d2a9492a774078083ff1d2
parentubx: Fix width of gain register (diff)
downloaduhd-1e8953f70e3824892f0b7d734fe16fe82fcbc5b2.tar.xz
uhd-1e8953f70e3824892f0b7d734fe16fe82fcbc5b2.zip
host: Add edge style to dot output of graph
To better align with the string representation of an edge this adds styling to the edges. Static connections are displayed as double lined arrows (==> in string representation), dynamic connections are plain arrows (--> in string representation). Furthermore the streamer connections are displayed as dashed lines and all egdes get a label describing their type (static, dynamic, RX stream, TX stream).
-rw-r--r--host/lib/rfnoc/graph.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/host/lib/rfnoc/graph.cpp b/host/lib/rfnoc/graph.cpp
index 12a179f44..b84ceee3e 100644
--- a/host/lib/rfnoc/graph.cpp
+++ b/host/lib/rfnoc/graph.cpp
@@ -332,11 +332,21 @@ std::string graph_t::to_dot()
}
result += "\n";
+ static const std::map<uhd::rfnoc::graph_edge_t::edge_t, std::string> edge_format_map =
+ {{uhd::rfnoc::graph_edge_t::edge_t::DYNAMIC, "label=\"dynamic\""},
+ {uhd::rfnoc::graph_edge_t::edge_t::STATIC,
+ "color=\"black:white:black\",label=\"static\",weight=10"},
+ {uhd::rfnoc::graph_edge_t::edge_t::RX_STREAM,
+ "style=\"dashed\",label=\"RX stream\""},
+ {uhd::rfnoc::graph_edge_t::edge_t::TX_STREAM,
+ "style=\"dashed\",label=\"TX stream\""}};
+
// add current connections
for (const auto& elem : enumerate_edges()) {
result +=
- str(boost::format(" \"%s_out\":\"out_%d\" -> \"%s_in\":\"in_%d\"\n")
- % elem.src_blockid % elem.src_port % elem.dst_blockid % elem.dst_port);
+ str(boost::format(" \"%s_out\":\"out_%d\" -> \"%s_in\":\"in_%d\" [%s]\n")
+ % elem.src_blockid % elem.src_port % elem.dst_blockid % elem.dst_port
+ % edge_format_map.at(elem.edge));
}
result += "}\n";
return result;