From 52c38e3c22d7c83943c0e1fc0bc69a967d6fe25c Mon Sep 17 00:00:00 2001 From: Alex Williams Date: Wed, 19 Jun 2019 17:40:46 -0700 Subject: rfnoc: Enable users to query connections in the graph Implement uhd::rfnoc::rfnoc_graph::enumerate_*_connections() --- host/include/uhd/rfnoc_graph.hpp | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) (limited to 'host/include') 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 -#include -#include -#include #include +#include #include +#include #include +#include #include // for demangle #include #include @@ -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 find_blocks(const std::string& block_id_hint) const = 0; + virtual std::vector find_blocks( + const std::string& block_id_hint) const = 0; /*! Type-cast version of find_blocks(). */ @@ -139,8 +142,7 @@ public: template std::shared_ptr get_block(const block_id_t& block_id) const { - std::shared_ptr blk = - std::dynamic_pointer_cast(get_block(block_id)); + std::shared_ptr blk = std::dynamic_pointer_cast(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 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 enumerate_connections(); + virtual std::vector enumerate_active_connections() = 0; /*! Commit graph and run initial checks * -- cgit v1.2.3