aboutsummaryrefslogtreecommitdiffstats
path: root/host/include
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2016-10-19 09:38:25 -0700
committerMartin Braun <martin.braun@ettus.com>2016-10-19 09:38:25 -0700
commitf386a2805b1cda04eef8c2ba1a3c680edf28c2a6 (patch)
treeb7cd00691bf68ce2c7b3bda9d9c1dc67a3bd522d /host/include
parentd172b44f157a1429de69599cf0a06aa61fa7a274 (diff)
parentad5b10677c91494f87c363e9096b7a2e61e414f6 (diff)
downloaduhd-f386a2805b1cda04eef8c2ba1a3c680edf28c2a6.tar.gz
uhd-f386a2805b1cda04eef8c2ba1a3c680edf28c2a6.tar.bz2
uhd-f386a2805b1cda04eef8c2ba1a3c680edf28c2a6.zip
Merge branch 'maint'
Diffstat (limited to 'host/include')
-rw-r--r--host/include/uhd/rfnoc/node_ctrl_base.hpp28
-rw-r--r--host/include/uhd/rfnoc/node_ctrl_base.ipp7
-rw-r--r--host/include/uhd/rfnoc/sink_node_ctrl.hpp9
-rw-r--r--host/include/uhd/rfnoc/source_node_ctrl.hpp9
4 files changed, 29 insertions, 24 deletions
diff --git a/host/include/uhd/rfnoc/node_ctrl_base.hpp b/host/include/uhd/rfnoc/node_ctrl_base.hpp
index 071de803c..bf799d2c2 100644
--- a/host/include/uhd/rfnoc/node_ctrl_base.hpp
+++ b/host/include/uhd/rfnoc/node_ctrl_base.hpp
@@ -119,17 +119,17 @@ public:
* Search only goes downstream.
*/
template <typename T>
- UHD_INLINE std::vector< boost::shared_ptr<T> > find_downstream_node()
+ UHD_INLINE std::vector< boost::shared_ptr<T> > find_downstream_node(bool active_only = false)
{
- return _find_child_node<T, true>();
+ return _find_child_node<T, true>(active_only);
}
/*! Same as find_downstream_node(), but only search upstream.
*/
template <typename T>
- UHD_INLINE std::vector< boost::shared_ptr<T> > find_upstream_node()
+ UHD_INLINE std::vector< boost::shared_ptr<T> > find_upstream_node(bool active_only = false)
{
- return _find_child_node<T, false>();
+ return _find_child_node<T, false>(active_only);
}
/*! Checks if downstream nodes share a common, unique property.
@@ -186,6 +186,24 @@ protected:
//! List of downstream nodes
node_map_t _downstream_nodes;
+ /*! For every output port, store rx streamer activity.
+ *
+ * If _rx_streamer_active[0] == true, this means that an active rx
+ * streamer is operating on port 0. If it is false, or if the entry
+ * does not exist, there is no streamer.
+ * Values are toggled by set_rx_streamer().
+ */
+ std::map<size_t, bool> _rx_streamer_active;
+
+ /*! For every input port, store tx streamer activity.
+ *
+ * If _tx_streamer_active[0] == true, this means that an active tx
+ * streamer is operating on port 0. If it is false, or if the entry
+ * does not exist, there is no streamer.
+ * Values are toggled by set_tx_streamer().
+ */
+ std::map<size_t, bool> _tx_streamer_active;
+
/***********************************************************************
* Connections
**********************************************************************/
@@ -221,7 +239,7 @@ private:
* \param downstream Set to true if search goes downstream, false for upstream.
*/
template <typename T, bool downstream>
- std::vector< boost::shared_ptr<T> > _find_child_node();
+ std::vector< boost::shared_ptr<T> > _find_child_node(bool active_only = false);
/*! Implements the search algorithm for find_downstream_unique_property() and
* find_upstream_unique_property().
diff --git a/host/include/uhd/rfnoc/node_ctrl_base.ipp b/host/include/uhd/rfnoc/node_ctrl_base.ipp
index 136354cd2..4ab25c597 100644
--- a/host/include/uhd/rfnoc/node_ctrl_base.ipp
+++ b/host/include/uhd/rfnoc/node_ctrl_base.ipp
@@ -29,7 +29,7 @@ namespace uhd {
namespace rfnoc {
template <typename T, bool downstream>
- std::vector< boost::shared_ptr<T> > node_ctrl_base::_find_child_node()
+ std::vector< boost::shared_ptr<T> > node_ctrl_base::_find_child_node(bool active_only)
{
typedef boost::shared_ptr<T> T_sptr;
static const size_t MAX_ITER = 20;
@@ -57,6 +57,11 @@ namespace uhd {
it != all_next_nodes.end();
++it
) {
+ size_t our_port = it->first;
+ if (active_only
+ and not (downstream ? _tx_streamer_active[our_port] : _tx_streamer_active[our_port] )) {
+ continue;
+ }
sptr one_next_node = it->second.lock();
if (not one_next_node or explored.count(one_next_node)) {
continue;
diff --git a/host/include/uhd/rfnoc/sink_node_ctrl.hpp b/host/include/uhd/rfnoc/sink_node_ctrl.hpp
index 5142a269e..90d617bb7 100644
--- a/host/include/uhd/rfnoc/sink_node_ctrl.hpp
+++ b/host/include/uhd/rfnoc/sink_node_ctrl.hpp
@@ -75,15 +75,6 @@ public:
protected:
- /*! For every input port, store tx streamer activity.
- *
- * If _tx_streamer_active[0] == true, this means that an active tx
- * streamer is operating on port 0. If it is false, or if the entry
- * does not exist, there is no streamer.
- * Values are toggled by set_tx_streamer().
- */
- std::map<size_t, bool> _tx_streamer_active;
-
/*! Ask for a port number to connect an upstream block to.
*
* Typically, this will be overridden for custom behaviour.
diff --git a/host/include/uhd/rfnoc/source_node_ctrl.hpp b/host/include/uhd/rfnoc/source_node_ctrl.hpp
index a351f6c8e..cacbcbb47 100644
--- a/host/include/uhd/rfnoc/source_node_ctrl.hpp
+++ b/host/include/uhd/rfnoc/source_node_ctrl.hpp
@@ -83,15 +83,6 @@ public:
protected:
- /*! For every output port, store rx streamer activity.
- *
- * If _rx_streamer_active[0] == true, this means that an active rx
- * streamer is operating on port 0. If it is false, or if the entry
- * does not exist, there is no streamer.
- * Values are toggled by set_rx_streamer().
- */
- std::map<size_t, bool> _rx_streamer_active;
-
/*! Ask for a port number to connect a downstream block to.
*
* See sink_node_ctrl::_request_input_port(). This is the same