aboutsummaryrefslogtreecommitdiffstats
path: root/host/include
diff options
context:
space:
mode:
authormichael-west <michael.west@ettus.com>2020-06-12 10:13:35 -0700
committerAaron Rossetto <aaron.rossetto@ni.com>2020-08-04 15:41:07 -0500
commit5a00f4d7864c6258f0d070b4753569413c7cfc4f (patch)
tree51a0a4634a4f385b10297c5cf191d3cf26f53473 /host/include
parentd7c64eb4b13670dbc5728f994e70dca60616af63 (diff)
downloaduhd-5a00f4d7864c6258f0d070b4753569413c7cfc4f.tar.gz
uhd-5a00f4d7864c6258f0d070b4753569413c7cfc4f.tar.bz2
uhd-5a00f4d7864c6258f0d070b4753569413c7cfc4f.zip
RFNoC: Add disconnect methods to graph
- Added method to disconnect an edge - Added method to remove a node - Fixed algorithm to check edges during connect. Previous code was checking some edges twice and allowing duplicate edges to be created for existing edges. Signed-off-by: michael-west <michael.west@ettus.com>
Diffstat (limited to 'host/include')
-rw-r--r--host/include/uhd/rfnoc_graph.hpp40
1 files changed, 39 insertions, 1 deletions
diff --git a/host/include/uhd/rfnoc_graph.hpp b/host/include/uhd/rfnoc_graph.hpp
index b414cc852..fabee53c7 100644
--- a/host/include/uhd/rfnoc_graph.hpp
+++ b/host/include/uhd/rfnoc_graph.hpp
@@ -166,7 +166,7 @@ public:
const block_id_t& dst_blk,
size_t dst_port) = 0;
- /*! Connect a RFNOC block with block ID \p src_block to another with block ID \p
+ /*! Connect a RFNoC block with block ID \p src_block to another with block ID \p
* dst_block.
*
* Note you need to also call this on statically connected blocks if you
@@ -221,6 +221,44 @@ public:
size_t strm_port,
uhd::transport::adapter_id_t adapter_id = uhd::transport::NULL_ADAPTER_ID) = 0;
+ /*! Disconnect a RFNoC block with block ID \p src_blk from another with block ID
+ * \p dst_blk. This will logically disconnect the blocks, but the physical
+ * connection will not be changed until a new connection is made on the source
+ * port.
+ *
+ * \param src_blk The block ID of the source block to disconnect.
+ * \param src_port The port of the source block to disconnect.
+ * \param dst_blk The block ID of the destination block to disconnect from.
+ * \param dst_port The port of the destination block to disconnect from.
+ */
+ virtual void disconnect(const block_id_t& src_blk,
+ size_t src_port,
+ const block_id_t& dst_blk,
+ size_t dst_port) = 0;
+
+ /*! Disconnect a streamer with ID \p streamer_id. This will logically
+ * disconnect the streamer, but physical connection will not be changed.
+ * For RX streamers, the physical connection will be changed when a new
+ * connection is made to the upstream source port(s). For TX streamers,
+ * the physical connection will be changed when the TX streamer is
+ * destroyed or the port(s) are connected to another block.
+ *
+ * \param streamer_id The ID of the streamer to disconnect.
+ */
+ virtual void disconnect(const std::string& streamer_id) = 0;
+
+ /*! Disconnect port \p port of a streamer with ID \p streamer_id. This
+ * will logically disconnect the streamer, but physical connection will
+ * not be changed. For RX streamers, the physical connection will be
+ * changed when a new connection is made to the upstreame source port.
+ * For TX streamers, the physical connection will be changed when the TX
+ * streamer is destroyed or the port is connected to another block.
+ *
+ * \param streamer_id The ID of the streamer.
+ * \param port The port to disconnect.
+ */
+ virtual void disconnect(const std::string& streamer_id, size_t port) = 0;
+
/*! Enumerate all the possible host transport adapters that can be used to
* receive from the specified block
*