From 5a00f4d7864c6258f0d070b4753569413c7cfc4f Mon Sep 17 00:00:00 2001 From: michael-west Date: Fri, 12 Jun 2020 10:13:35 -0700 Subject: 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 --- host/include/uhd/rfnoc_graph.hpp | 40 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) (limited to 'host/include') 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 * -- cgit v1.2.3