From da1aeaeccc3e1790d6c4fc5573c3aa713d3487fb Mon Sep 17 00:00:00 2001 From: Steven Koo Date: Thu, 27 Aug 2020 13:13:35 -0500 Subject: 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 --- host/lib/utils/graph_utils.cpp | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) (limited to 'host/lib/utils') 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); } } -- cgit v1.2.3