aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormichael-west <michael.west@ettus.com>2019-01-30 18:31:56 -0800
committerAshish Chaudhari <ashish.chaudhari@ettus.com>2019-01-31 13:47:31 -0800
commit324c6d37da35f8e7bdb3b18d6d79d1d0e8252f41 (patch)
treedb38fc8833386658cdbea44e43bebda10239f659
parent13663f459d67fb3c0f289bbcbddc4534224381f5 (diff)
downloaduhd-324c6d37da35f8e7bdb3b18d6d79d1d0e8252f41.tar.gz
uhd-324c6d37da35f8e7bdb3b18d6d79d1d0e8252f41.tar.bz2
uhd-324c6d37da35f8e7bdb3b18d6d79d1d0e8252f41.zip
fixup! RFNoC: More graph traversal fixes
-rw-r--r--host/include/uhd/rfnoc/node_ctrl_base.hpp36
-rw-r--r--host/include/uhd/rfnoc/node_ctrl_base.ipp4
-rw-r--r--host/lib/rfnoc/block_ctrl_base.cpp4
-rw-r--r--host/lib/rfnoc/source_block_ctrl_base.cpp4
4 files changed, 14 insertions, 34 deletions
diff --git a/host/include/uhd/rfnoc/node_ctrl_base.hpp b/host/include/uhd/rfnoc/node_ctrl_base.hpp
index db552ff4c..2251baf2d 100644
--- a/host/include/uhd/rfnoc/node_ctrl_base.hpp
+++ b/host/include/uhd/rfnoc/node_ctrl_base.hpp
@@ -166,26 +166,6 @@ public:
get_property, null_value, exclude_nodes);
}
- UHD_INLINE size_t get_num_input_ports(void)
- {
- return _num_input_ports;
- }
-
- UHD_INLINE void set_num_input_ports(size_t num_ports)
- {
- _num_input_ports = num_ports;
- }
-
- UHD_INLINE size_t get_num_output_ports(void)
- {
- return _num_output_ports;
- }
-
- UHD_INLINE void set_num_output_ports(size_t num_ports)
- {
- _num_output_ports = num_ports;
- }
-
protected:
/***********************************************************************
* Structors
@@ -211,6 +191,14 @@ protected:
//! List of downstream nodes
node_map_t _downstream_nodes;
+ /*! Number of input ports
+ */
+ size_t _num_input_ports;
+
+ /*! Number of output ports
+ */
+ size_t _num_output_ports;
+
/*! For every output port, store rx streamer activity.
*
* If _rx_streamer_active[0] == true, this means that an active rx
@@ -283,14 +271,6 @@ private:
*/
std::map<size_t, size_t> _downstream_ports;
- /*! Stores the number of input ports.
- */
- size_t _num_input_ports;
-
- /*! Stores the number of output ports.
- */
- size_t _num_output_ports;
-
}; /* class node_ctrl_base */
}} /* namespace uhd::rfnoc */
diff --git a/host/include/uhd/rfnoc/node_ctrl_base.ipp b/host/include/uhd/rfnoc/node_ctrl_base.ipp
index 43a3cb162..0a9553b6d 100644
--- a/host/include/uhd/rfnoc/node_ctrl_base.ipp
+++ b/host/include/uhd/rfnoc/node_ctrl_base.ipp
@@ -85,8 +85,8 @@ namespace uhd {
// map each input port directly to the same output
// port. This limits the graph traversal to prevent
// finding nodes that are not part of this chain.
- if (one_next_node->get_num_input_ports() ==
- one_next_node->get_num_output_ports())
+ if (one_next_node->_num_input_ports ==
+ one_next_node->_num_output_ports)
{
next_port = (downstream ?
node->get_downstream_port(connected_port) :
diff --git a/host/lib/rfnoc/block_ctrl_base.cpp b/host/lib/rfnoc/block_ctrl_base.cpp
index 4137da9e3..ed8068b5b 100644
--- a/host/lib/rfnoc/block_ctrl_base.cpp
+++ b/host/lib/rfnoc/block_ctrl_base.cpp
@@ -125,8 +125,8 @@ block_ctrl_base::block_ctrl_base(const make_args_t& make_args)
/*** Init I/O port definitions ******************************************/
_init_port_defs("in", _block_def->get_input_ports());
_init_port_defs("out", _block_def->get_output_ports());
- set_num_input_ports(_block_def->get_input_ports().size());
- set_num_output_ports(_block_def->get_output_ports().size());
+ _num_input_ports = _block_def->get_input_ports().size();
+ _num_output_ports = _block_def->get_output_ports().size();
// FIXME this warning always fails until the input buffer code above is fixed
// if (_tree->list(_root_path / "ports/in").size() != n_valid_input_buffers) {
// UHD_LOGGER_WARNING(unique_id()) <<
diff --git a/host/lib/rfnoc/source_block_ctrl_base.cpp b/host/lib/rfnoc/source_block_ctrl_base.cpp
index c3c6faf1f..6c41fae14 100644
--- a/host/lib/rfnoc/source_block_ctrl_base.cpp
+++ b/host/lib/rfnoc/source_block_ctrl_base.cpp
@@ -31,10 +31,10 @@ void source_block_ctrl_base::issue_stream_cmd(
for (const node_ctrl_base::node_map_pair_t upstream_node : _upstream_nodes) {
// FIXME: Need proper mapping from input port to output port
// The code below assumes the input port and output port are the same
- // if the number of upstream and downstream connections are the same.
+ // if the number of upstream and downstream ports are the same.
// The stream command is limited to only that port to prevent issuing
// it on the wrong block and port.
- if (get_num_input_ports() == get_num_output_ports()
+ if (_num_input_ports == _num_output_ports
and upstream_node.first != chan) {
continue;
}