diff options
author | Steven Koo <steven.koo@ni.com> | 2020-08-27 13:13:35 -0500 |
---|---|---|
committer | Aaron Rossetto <aaron.rossetto@ni.com> | 2020-08-28 12:28:08 -0500 |
commit | da1aeaeccc3e1790d6c4fc5573c3aa713d3487fb (patch) | |
tree | 8eb9d4c278586f9e65e3868bf654f30dc62c7394 /host | |
parent | 03e1b13d3d84ceed82ebf7bc1cc1d27e49f07d4d (diff) | |
download | uhd-da1aeaeccc3e1790d6c4fc5573c3aa713d3487fb.tar.gz uhd-da1aeaeccc3e1790d6c4fc5573c3aa713d3487fb.tar.bz2 uhd-da1aeaeccc3e1790d6c4fc5573c3aa713d3487fb.zip |
rfnoc: enable SEPs with connect_through_blocks
Calling on connect with SEPs in the path is not supported. This change
enables connect_through_blocks to find SEPs in the connection chain
and link the src and dest blocks directly.
Signed-off-by: Steven Koo <steven.koo@ni.com>
Diffstat (limited to 'host')
-rw-r--r-- | host/lib/utils/graph_utils.cpp | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/host/lib/utils/graph_utils.cpp b/host/lib/utils/graph_utils.cpp index d6e82f546..d3288440c 100644 --- a/host/lib/utils/graph_utils.cpp +++ b/host/lib/utils/graph_utils.cpp @@ -124,9 +124,31 @@ void connect_through_blocks(rfnoc_graph::sptr graph, "GRAPH_UTILS", "Found destination chain for " + dst_blk.to_string()); } - // Finally, make all of the connections in our chain + // Finally, make all of the connections in our chain. + // If we have SEPs in the chain, find them and directly + // call connect on the src and dst blocks since calling + // connect on SEPs is invalid + std::string src_to_sep_id; + size_t src_to_sep_port; + std::string sep_to_dst_id; + size_t sep_to_dst_port; + bool has_sep_connection = false; + for (auto edge : block_chain) { - graph->connect(edge.src_blockid, edge.src_port, edge.dst_blockid, edge.dst_port); + if(uhd::rfnoc::block_id_t(edge.dst_blockid).match(uhd::rfnoc::NODE_ID_SEP)) { + has_sep_connection = true; + src_to_sep_id = edge.src_blockid; + src_to_sep_port = edge.src_port; + } else if(uhd::rfnoc::block_id_t(edge.src_blockid).match(uhd::rfnoc::NODE_ID_SEP)) { + has_sep_connection = true; + sep_to_dst_id = edge.dst_blockid; + sep_to_dst_port = edge.dst_port; + } else{ + graph->connect(edge.src_blockid, edge.src_port, edge.dst_blockid, edge.dst_port); + } + } + if(has_sep_connection) { + graph->connect(src_to_sep_id, src_to_sep_port, sep_to_dst_id, sep_to_dst_port); } } |