diff options
author | Alex Williams <alex.williams@ni.com> | 2019-06-19 17:40:46 -0700 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2019-11-26 11:49:29 -0800 |
commit | 52c38e3c22d7c83943c0e1fc0bc69a967d6fe25c (patch) | |
tree | 1fec490bc9297c21b43805f942cf8982b7c98260 /host/include | |
parent | 50f8e9f35f776016ec8df7edad570d9d8084afdb (diff) | |
download | uhd-52c38e3c22d7c83943c0e1fc0bc69a967d6fe25c.tar.gz uhd-52c38e3c22d7c83943c0e1fc0bc69a967d6fe25c.tar.bz2 uhd-52c38e3c22d7c83943c0e1fc0bc69a967d6fe25c.zip |
rfnoc: Enable users to query connections in the graph
Implement uhd::rfnoc::rfnoc_graph::enumerate_*_connections()
Diffstat (limited to 'host/include')
-rw-r--r-- | host/include/uhd/rfnoc_graph.hpp | 30 |
1 files changed, 19 insertions, 11 deletions
diff --git a/host/include/uhd/rfnoc_graph.hpp b/host/include/uhd/rfnoc_graph.hpp index 6a75a8668..c13939ac9 100644 --- a/host/include/uhd/rfnoc_graph.hpp +++ b/host/include/uhd/rfnoc_graph.hpp @@ -8,12 +8,12 @@ #define INCLUDED_LIBUHD_RFNOCDEV_GRAPH_HPP #include <uhd/config.hpp> -#include <uhd/stream.hpp> -#include <uhd/utils/noncopyable.hpp> -#include <uhd/rfnoc/graph_edge.hpp> #include <uhd/rfnoc/block_id.hpp> +#include <uhd/rfnoc/graph_edge.hpp> #include <uhd/rfnoc/noc_block_base.hpp> +#include <uhd/stream.hpp> #include <uhd/types/device_addr.hpp> +#include <uhd/utils/noncopyable.hpp> #include <boost/units/detail/utility.hpp> // for demangle #include <memory> #include <vector> @@ -39,8 +39,10 @@ public: virtual ~rfnoc_graph() {} - //! Stuct to store information about which blocks are actually stored at a given port on the crossbar - struct block_xbar_info { + //! Stuct to store information about which blocks are actually stored at a given port + //! on the crossbar + struct block_xbar_info + { size_t xbar_port; noc_block_base::noc_id_t noc_id; size_t inst_num; @@ -75,7 +77,8 @@ public: * \endcode * \note this access is not thread safe if performed during block enumeration */ - virtual std::vector<block_id_t> find_blocks(const std::string& block_id_hint) const = 0; + virtual std::vector<block_id_t> find_blocks( + const std::string& block_id_hint) const = 0; /*! Type-cast version of find_blocks(). */ @@ -139,8 +142,7 @@ public: template <typename T> std::shared_ptr<T> get_block(const block_id_t& block_id) const { - std::shared_ptr<T> blk = - std::dynamic_pointer_cast<T>(get_block(block_id)); + std::shared_ptr<T> blk = std::dynamic_pointer_cast<T>(get_block(block_id)); if (blk) { return blk; } else { @@ -204,11 +206,17 @@ public: uhd::rx_streamer& streamer, size_t strm_port) = 0; - /*! Enumerate all the connections in the graph + /*! Enumerate all the possible static connections in the graph + * + * \return A vector containing all the static edges in the graph. + */ + virtual std::vector<graph_edge_t> enumerate_static_connections() const = 0; + + /*! Enumerate all the active connections in the graph * - * \return A vector containing all the edges in the graph. + * \return A vector containing all the active edges in the graph. */ - std::vector<graph_edge_t> enumerate_connections(); + virtual std::vector<graph_edge_t> enumerate_active_connections() = 0; /*! Commit graph and run initial checks * |