aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/include/uhdlib/rfnoc/rfnoc_tx_streamer.hpp
diff options
context:
space:
mode:
authorCiro Nishiguchi <ciro.nishiguchi@ni.com>2019-05-23 20:38:07 -0500
committerMartin Braun <martin.braun@ettus.com>2019-11-26 11:49:29 -0800
commit75a090543b8fb8e7c875387eee6d3fe7227e4450 (patch)
tree2904b48607cc07158aa6b068ada35ab56c4da516 /host/lib/include/uhdlib/rfnoc/rfnoc_tx_streamer.hpp
parentd8e9705bc6c34b8d015b56a76955ee2f15426bd8 (diff)
downloaduhd-75a090543b8fb8e7c875387eee6d3fe7227e4450.tar.gz
uhd-75a090543b8fb8e7c875387eee6d3fe7227e4450.tar.bz2
uhd-75a090543b8fb8e7c875387eee6d3fe7227e4450.zip
rfnoc: add rx and tx transports, and amend rfnoc_graph
transports: Transports build on I/O service and implements flow control and sequence number checking. The rx streamer subclass extends the streamer implementation to connect it to the rfnoc graph. It receives configuration values from property propagation and configures the streamer accordingly. It also implements the issue_stream_cmd rx_streamer API method. Add implementation of rx streamer creation and method to connect it to an rfnoc block. rfnoc_graph: Cache more connection info, clarify contract Summary of changes: - rfnoc_graph stores more information about static connections at the beginning. Some search algorithms are replaced by simpler lookups. - The contract for connect() was clarified. It is required to call connect, even for static connections.
Diffstat (limited to 'host/lib/include/uhdlib/rfnoc/rfnoc_tx_streamer.hpp')
-rw-r--r--host/lib/include/uhdlib/rfnoc/rfnoc_tx_streamer.hpp90
1 files changed, 90 insertions, 0 deletions
diff --git a/host/lib/include/uhdlib/rfnoc/rfnoc_tx_streamer.hpp b/host/lib/include/uhdlib/rfnoc/rfnoc_tx_streamer.hpp
new file mode 100644
index 000000000..4acee45cc
--- /dev/null
+++ b/host/lib/include/uhdlib/rfnoc/rfnoc_tx_streamer.hpp
@@ -0,0 +1,90 @@
+//
+// Copyright 2019 Ettus Research, a National Instruments Brand
+//
+// SPDX-License-Identifier: GPL-3.0-or-later
+//
+
+#ifndef INCLUDED_LIBUHD_RFNOC_TX_STREAMER_HPP
+#define INCLUDED_LIBUHD_RFNOC_TX_STREAMER_HPP
+
+#include <uhd/rfnoc/node.hpp>
+#include <uhdlib/rfnoc/chdr_tx_data_xport.hpp>
+#include <uhdlib/transport/tx_streamer_impl.hpp>
+#include <string>
+
+namespace uhd { namespace rfnoc {
+
+/*!
+ * Extends the streamer_impl to be an rfnoc node so it can connect to the
+ * graph. Configures the streamer conversion and rate parameters with values
+ * received through property propagation.
+ */
+class rfnoc_tx_streamer : public node_t,
+ public transport::tx_streamer_impl<chdr_tx_data_xport>
+{
+public:
+ /*! Constructor
+ *
+ * \param num_ports The number of ports
+ * \param stream_args Arguments to aid the construction of the streamer
+ */
+ rfnoc_tx_streamer(const size_t num_chans, const uhd::stream_args_t stream_args);
+
+ /*! Returns a unique identifier string for this node. In every RFNoC graph,
+ * no two nodes cannot have the same ID. Returns a string in the form of
+ * "TxStreamer#0".
+ *
+ * \returns The unique ID as a string
+ */
+ std::string get_unique_id() const;
+
+ /*! Returns the number of input ports for this block.
+ *
+ * Always returns 0 for this block.
+ *
+ * \return noc_id The number of ports
+ */
+ size_t get_num_input_ports() const;
+
+ /*! Returns the number of output ports for this block.
+ *
+ * \return noc_id The number of ports
+ */
+ size_t get_num_output_ports() const;
+
+ /*! Returns stream args provided at creation
+ *
+ * \return stream args provided when streamer is created
+ */
+ const uhd::stream_args_t& get_stream_args() const;
+
+ /*! Check that all streamer ports are connected to blocks
+ *
+ * Overrides node_t to ensure there are no unconnected ports.
+ *
+ * \param connected_inputs A list of input ports that are connected
+ * \param connected_outputs A list of output ports that are connected
+ * \returns true if the block can deal with this configuration
+ */
+ bool check_topology(const std::vector<size_t>& connected_inputs,
+ const std::vector<size_t>& connected_outputs);
+
+private:
+ void _register_props(const size_t chan, const std::string& otw_format);
+
+ // Properties
+ std::vector<property_t<double>> _scaling_out;
+ std::vector<property_t<double>> _samp_rate_out;
+ std::vector<property_t<double>> _tick_rate_out;
+ std::vector<property_t<std::string>> _type_out;
+
+ // Streamer unique ID
+ const std::string _unique_id;
+
+ // Stream args provided at construction
+ const uhd::stream_args_t _stream_args;
+};
+
+}} // namespace uhd::rfnoc
+
+#endif /* INCLUDED_LIBUHD_RFNOC_TX_STREAMER_HPP */