USRP Hardware Driver and Device Manual  Version: 4.11.0.0-0-g0d7ed3b1
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 <optional>
15 #include <vector>
16 
17 
18 namespace uhd { namespace rfnoc {
19 
21 using block_port_def = std::tuple<std::string, std::optional<size_t>>;
22 
23 // TODO: Get rid of magic strings
27 static const std::vector<block_port_def> TERMINATOR_BLOCKS{
28  block_port_def{NODE_ID_SEP, std::nullopt},
29  block_port_def{"Radio", std::nullopt},
30  block_port_def{"NullSrcSink", 0}};
31 
47 std::vector<graph_edge_t> UHD_API get_block_chain(const rfnoc_graph::sptr graph,
48  const block_id_t start_block,
49  const size_t port,
50  const bool source_chain);
51 
52 
72 std::vector<graph_edge_t> UHD_API connect_through_blocks(rfnoc_graph::sptr graph,
73  const block_id_t src_blk,
74  const size_t src_port,
75  const block_id_t dst_blk,
76  const size_t dst_port,
77  const bool skip_property_propagation = false);
78 
79 }} // namespace uhd::rfnoc
Definition: block_id.hpp:40
std::shared_ptr< rfnoc_graph > sptr
Definition: rfnoc_graph.hpp:40
#define UHD_API
Definition: config.h:87
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)
std::tuple< std::string, std::optional< size_t > > block_port_def
Tuple that stores a block ID, as well as an optional port number.
Definition: graph_utils.hpp:21
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)
Definition: build_info.hpp:12