USRP Hardware Driver and USRP Manual  Version: 4.7.0.0
UHD and USRP Manual
graph_utils.hpp
Go to the documentation of this file.
1 //
2 // Copyright 2019 Ettus Research, a National Instruments Branch
3 //
4 // SPDX-License-Identifier: GPL-3.0-or-later
5 //
6 
7 #pragma once
8 
9 #include <uhd/config.hpp>
10 #include <uhd/rfnoc/block_id.hpp>
11 #include <uhd/rfnoc/defaults.hpp>
12 #include <uhd/rfnoc/graph_edge.hpp>
13 #include <uhd/rfnoc_graph.hpp>
14 #include <boost/none.hpp>
15 #include <boost/optional.hpp>
16 #include <vector>
17 
18 
19 namespace uhd { namespace rfnoc {
20 
22 using block_port_def = std::tuple<std::string, boost::optional<size_t>>;
23 
24 // TODO: Get rid of magic strings
28 static const std::vector<block_port_def> TERMINATOR_BLOCKS{
29  block_port_def{NODE_ID_SEP, boost::none},
30  block_port_def{"Radio", boost::none},
31  block_port_def{"NullSrcSink", 0}};
32 
48 std::vector<graph_edge_t> UHD_API get_block_chain(const rfnoc_graph::sptr graph,
49  const block_id_t start_block,
50  const size_t port,
51  const bool source_chain);
52 
53 
73 std::vector<graph_edge_t> UHD_API connect_through_blocks(rfnoc_graph::sptr graph,
74  const block_id_t src_blk,
75  const size_t src_port,
76  const block_id_t dst_blk,
77  const size_t dst_port,
78  const bool skip_property_propagation = false);
79 
80 }} // namespace uhd::rfnoc
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 bool skip_property_propagation=false)
Definition: block_id.hpp:39
std::shared_ptr< rfnoc_graph > sptr
Definition: rfnoc_graph.hpp:39
Definition: build_info.hpp:12
std::tuple< std::string, boost::optional< size_t > > block_port_def
Tuple that stores a block ID, as well as an optional port number.
Definition: graph_utils.hpp:22
#define UHD_API
Definition: config.h:87
std::vector< graph_edge_t > UHD_API get_block_chain(const rfnoc_graph::sptr graph, const block_id_t start_block, const size_t port, const bool source_chain)