diff options
author | Martin Braun <martin.braun@ettus.com> | 2022-02-18 11:34:30 +0100 |
---|---|---|
committer | Aaron Rossetto <aaron.rossetto@ni.com> | 2022-02-24 13:39:41 -0600 |
commit | 0f15704cb9daf963a1d146c4f5413bfafb12e4de (patch) | |
tree | 6799d3074f7ef5b057a6e8a3b60c62b35c3bcd3d | |
parent | 45f4bb65864181b3a5c11c07d6a7f7393e2a3334 (diff) | |
download | uhd-0f15704cb9daf963a1d146c4f5413bfafb12e4de.tar.gz uhd-0f15704cb9daf963a1d146c4f5413bfafb12e4de.tar.bz2 uhd-0f15704cb9daf963a1d146c4f5413bfafb12e4de.zip |
rfnoc: graph_utils: Add ability to declare back-edges
rfnoc::connect_through_blocks(), unlike rfnoc_graph::connect(), did not
have an argument to declare a back-edge. This patch remedies this
situation by adding a skip_property_propagation argument that works
exactly as with rfnoc_graph::connect().
-rw-r--r-- | host/include/uhd/utils/graph_utils.hpp | 7 | ||||
-rw-r--r-- | host/lib/utils/graph_utils.cpp | 10 |
2 files changed, 13 insertions, 4 deletions
diff --git a/host/include/uhd/utils/graph_utils.hpp b/host/include/uhd/utils/graph_utils.hpp index 6b264032c..29f488983 100644 --- a/host/include/uhd/utils/graph_utils.hpp +++ b/host/include/uhd/utils/graph_utils.hpp @@ -63,6 +63,10 @@ std::vector<graph_edge_t> UHD_API get_block_chain(const rfnoc_graph::sptr graph, * \param src_port Block port where the path starts * \param dst_blk Destination block's ID * \param dst_port Block port where the path ends + * \param skip_property_propagation Declare back-edge + * (see also uhd::rfnoc::rfnoc_graph::connect()) + * If true, it will declare only the first + * connection in this chain as a back-edge. * * \return The edge list representing the data path requested */ @@ -70,6 +74,7 @@ std::vector<graph_edge_t> UHD_API connect_through_blocks(rfnoc_graph::sptr graph const block_id_t src_blk, const size_t src_port, const block_id_t dst_blk, - const size_t dst_port); + const size_t dst_port, + const bool skip_property_propagation = false); }} // namespace uhd::rfnoc diff --git a/host/lib/utils/graph_utils.cpp b/host/lib/utils/graph_utils.cpp index 89df30e15..aeb71b091 100644 --- a/host/lib/utils/graph_utils.cpp +++ b/host/lib/utils/graph_utils.cpp @@ -87,7 +87,8 @@ std::vector<graph_edge_t> connect_through_blocks(rfnoc_graph::sptr graph, const block_id_t src_blk, const size_t src_port, const block_id_t dst_blk, - const size_t dst_port) + const size_t dst_port, + const bool skip_property_propagation) { // First, create a chain from the source block to a stream endpoint auto block_chain = get_block_chain(graph, src_blk, src_port, true); @@ -136,6 +137,7 @@ std::vector<graph_edge_t> connect_through_blocks(rfnoc_graph::sptr graph, std::string sep_to_dst_id; size_t sep_to_dst_port = 0; bool has_sep_to_dst_connection = false; + bool skip_pp = skip_property_propagation; for (auto edge : block_chain) { if (uhd::rfnoc::block_id_t(edge.dst_blockid).match(uhd::rfnoc::NODE_ID_SEP)) { @@ -149,11 +151,13 @@ std::vector<graph_edge_t> connect_through_blocks(rfnoc_graph::sptr graph, sep_to_dst_port = edge.dst_port; } else { graph->connect( - edge.src_blockid, edge.src_port, edge.dst_blockid, edge.dst_port); + edge.src_blockid, edge.src_port, edge.dst_blockid, edge.dst_port, skip_pp); + skip_pp = false; } } if (has_src_to_sep_connection && has_sep_to_dst_connection) { - graph->connect(src_to_sep_id, src_to_sep_port, sep_to_dst_id, sep_to_dst_port); + graph->connect( + src_to_sep_id, src_to_sep_port, sep_to_dst_id, sep_to_dst_port, skip_pp); } else if (has_src_to_sep_connection != has_sep_to_dst_connection) { const std::string err_msg = "Incomplete path. Only one SEP edge found."; UHD_LOG_TRACE("GRAPH_UTILS", err_msg); |