diff options
author | Martin Braun <martin.braun@ettus.com> | 2019-08-20 10:00:47 -0700 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2019-11-26 12:16:25 -0800 |
commit | 7d69dcdcc318ccdf87038b732acbf2bf7c087b60 (patch) | |
tree | 8179f2f4a14be591d7c856f77f13687b45f9a454 /host/lib/include | |
parent | 1ac6e6f56100a7e8186481ab0715937759f52737 (diff) | |
download | uhd-7d69dcdcc318ccdf87038b732acbf2bf7c087b60.tar.gz uhd-7d69dcdcc318ccdf87038b732acbf2bf7c087b60.tar.bz2 uhd-7d69dcdcc318ccdf87038b732acbf2bf7c087b60.zip |
Remove proto-RFNoC files
This commit removes all files and parts of files that are used by
proto-RFNoC only.
uhd: Fix include CMakeLists.txt, add missing files
Diffstat (limited to 'host/lib/include')
-rw-r--r-- | host/lib/include/uhdlib/rfnoc/async_msg_handler.hpp | 85 | ||||
-rw-r--r-- | host/lib/include/uhdlib/rfnoc/ctrl_iface.hpp | 77 | ||||
-rw-r--r-- | host/lib/include/uhdlib/rfnoc/graph_impl.hpp | 87 | ||||
-rw-r--r-- | host/lib/include/uhdlib/rfnoc/legacy_compat.hpp | 49 | ||||
-rw-r--r-- | host/lib/include/uhdlib/rfnoc/radio_ctrl_impl.hpp | 249 | ||||
-rw-r--r-- | host/lib/include/uhdlib/rfnoc/rx_stream_terminator.hpp | 78 | ||||
-rw-r--r-- | host/lib/include/uhdlib/rfnoc/tx_stream_terminator.hpp | 79 | ||||
-rw-r--r-- | host/lib/include/uhdlib/rfnoc/utils.hpp | 66 | ||||
-rw-r--r-- | host/lib/include/uhdlib/rfnoc/wb_iface_adapter.hpp | 57 | ||||
-rw-r--r-- | host/lib/include/uhdlib/rfnoc/xports.hpp | 35 |
10 files changed, 0 insertions, 862 deletions
diff --git a/host/lib/include/uhdlib/rfnoc/async_msg_handler.hpp b/host/lib/include/uhdlib/rfnoc/async_msg_handler.hpp deleted file mode 100644 index cd1aed37d..000000000 --- a/host/lib/include/uhdlib/rfnoc/async_msg_handler.hpp +++ /dev/null @@ -1,85 +0,0 @@ -// -// Copyright 2016 Ettus Research LLC -// Copyright 2018 Ettus Research, a National Instruments Company -// -// SPDX-License-Identifier: GPL-3.0-or-later -// - -#ifndef INCLUDED_LIBUHD_RFNOC_AYNC_MSG_HANDLER_HPP -#define INCLUDED_LIBUHD_RFNOC_AYNC_MSG_HANDLER_HPP - -#include <uhd/rfnoc/graph.hpp> -#include <uhd/transport/zero_copy.hpp> -#include <uhd/types/sid.hpp> -#include <uhd/types/endianness.hpp> -#include <uhdlib/rfnoc/async_msg.hpp> -#include <uhd/utils/noncopyable.hpp> -#include <functional> - -namespace uhd { namespace rfnoc { - -/*! Async message handler for a uhd::rfnoc::graph - * - */ -class async_msg_handler : uhd::noncopyable -{ -public: - typedef boost::shared_ptr<async_msg_handler> sptr; - typedef std::function<void(const async_msg_t&)> async_handler_type; - - /*! - * \param recv A transport on which async messages are received - * \param send A transport on which to send response messages - * \param sid The source part of this is taken as the local address of the - * transports. The remote part is ignored. - */ - static sptr make( - uhd::transport::zero_copy_if::sptr recv, - uhd::transport::zero_copy_if::sptr send, - uhd::sid_t sid, - uhd::endianness_t endianness - ); - - /*! Register an event handler. - * - * When any message is received with the given event code, - * \p handler is called with the async message data as an argument. - * - * Note that \p handler is called if a message includes a certain event - * code, but it does not have to be exclusive. Example: If there are two - * event handlers registered, one for EVENT_CODE_OVERRUN and one for - * EVENT_CODE_BAD_PACKET, and a message includes both those event codes, - * then both event handlers are called. - * - * Multiple handlers per event code may be registered. The order they are - * called in is non-deterministic. - * - * \returns The number of event handlers registered for this event code. - * Should never return anything less than 1. - */ - virtual int register_event_handler( - const async_msg_t::event_code_t event_code, - async_handler_type handler - ) = 0; - - /*! Post async messages into this message handler. - * - * This is the entry point for all async messages. When a message - * is posted here, the following actions take place: - * - If applicable, an event handler is called with \p metadata as the - * argument - * - Some messages print error codes (e.g. O, U, L, S) - */ - virtual void post_async_msg( - const async_msg_t &metadata - ) = 0; - - /*! Return the 16-bit address of this async message - */ - virtual uint32_t get_local_addr() const = 0; -}; - - -}}; /* namespace uhd::rfnoc */ - -#endif /* INCLUDED_LIBUHD_RFNOC_AYNC_MSG_HANDLER_HPP */ diff --git a/host/lib/include/uhdlib/rfnoc/ctrl_iface.hpp b/host/lib/include/uhdlib/rfnoc/ctrl_iface.hpp deleted file mode 100644 index 29b2e73c0..000000000 --- a/host/lib/include/uhdlib/rfnoc/ctrl_iface.hpp +++ /dev/null @@ -1,77 +0,0 @@ -// -// Copyright 2012-2016 Ettus Research LLC -// Copyright 2018 Ettus Research, a National Instruments Company -// -// SPDX-License-Identifier: GPL-3.0-or-later -// - -#ifndef INCLUDED_LIBUHD_RFNOC_CTRL_IFACE_HPP -#define INCLUDED_LIBUHD_RFNOC_CTRL_IFACE_HPP - -#include "xports.hpp" -#include <boost/shared_ptr.hpp> -#include <string> - -namespace uhd { namespace rfnoc { - -/*! - * Provide read/write access to registers on an RFNoC block via Noc-Shell. - */ -class ctrl_iface -{ -public: - typedef boost::shared_ptr<ctrl_iface> sptr; - virtual ~ctrl_iface(void) {} - - /*! Make a new control object - * - * \param xports Bidirectional transport object to the RFNoC block port. - * \param name Optional name for better identification in error messages. - */ - static sptr make( - const both_xports_t &xports, - const std::string &name="0" - ); - - /*! Send a command packet. - * - * \param addr Register address. This is the value that gets put into the - * command packet, its interpretation is defined on the FPGA. - * \param data Register value to write. - * \param readback If true, assume the command packet is for a readback, - * and wait for a response packet to return. The return - * value will then be the 64-bit payload of that response - * packet. If false, the return value is the payload of - * any outstanding ACK packet. - * \param timestamp Optional timestamp. The command packet will include this - * timestamp. Depending on the block configuration, this - * can trigger timed commands. - * A value of zero indicates that no timestamp will be - * applied. It is not possible to request anything to - * happen at time zero. - * - * \throws uhd::io_error if the response is malformed; uhd::runtime_error if - * no packet could be sent. - */ - virtual uint64_t send_cmd_pkt( - const size_t addr, - const size_t data, - const bool readback=false, - const uint64_t timestamp=0 - ) = 0; - - /*! Set the depth of the command FIFO size - * - * Note: This is not safe to call during operations. Call this during - * initialization. - * - * \param num_lines The number of lines of depth in the command FIFO. The - * function will calculate the number of packets that will - * fit into the command FIFO. - */ - virtual void set_cmd_fifo_size(const size_t num_lines) = 0; -}; - -}} /* namespace uhd::rfnoc */ - -#endif /* INCLUDED_LIBUHD_RFNOC_CTRL_IFACE_HPP */ diff --git a/host/lib/include/uhdlib/rfnoc/graph_impl.hpp b/host/lib/include/uhdlib/rfnoc/graph_impl.hpp deleted file mode 100644 index 4147acedf..000000000 --- a/host/lib/include/uhdlib/rfnoc/graph_impl.hpp +++ /dev/null @@ -1,87 +0,0 @@ -// -// Copyright 2016 Ettus Research LLC -// Copyright 2018 Ettus Research, a National Instruments Company -// -// SPDX-License-Identifier: GPL-3.0-or-later -// - -#ifndef INCLUDED_LIBUHD_RFNOC_GRAPH_IMPL_HPP -#define INCLUDED_LIBUHD_RFNOC_GRAPH_IMPL_HPP - -#include "async_msg_handler.hpp" -#include <uhd/device3.hpp> -#include <uhd/rfnoc/graph.hpp> - -namespace uhd { namespace rfnoc { - -class graph_impl : public graph -{ -public: - /************************************************************************ - * Structors - ***********************************************************************/ - /*! - * \param name An optional name to describe this graph - * \param device_ptr Weak pointer to the originating device3 - * \param msg_handler Pointer to the async message handler - */ - graph_impl(const std::string& name, - boost::weak_ptr<uhd::device3> device_ptr, - async_msg_handler::sptr msg_handler); - virtual ~graph_impl() {} - - /************************************************************************ - * Connection API - ***********************************************************************/ - void connect(const block_id_t& src_block, - size_t src_block_port, - const block_id_t& dst_block, - size_t dst_block_port, - const size_t pkt_size = 0); - - void connect(const block_id_t& src_block, const block_id_t& dst_block); - - void connect_src(const block_id_t& src_block, - const size_t src_block_port, - const uhd::sid_t dst_sid, - const size_t buf_size_dst_bytes, - const size_t pkt_size_); - - void connect_sink(const block_id_t& sink_block, - const size_t dst_block_port, - const size_t bytes_per_ack); - - /************************************************************************ - * Utilities - ***********************************************************************/ - std::string get_name() const - { - return _name; - } - - -private: - void handle_overruns(const async_msg_t& async_msg); - - //! Maps 16-bit addresses to block IDs - std::map<uint32_t, block_id_t> _block_id_map; - - //! For any given block, look up the MIMO group - std::map<uint32_t, size_t> _mimo_group_map; - - //! For any MIMO group, store the list of blocks in that group - std::map<size_t, std::set<block_id_t>> _mimo_groups; - - //! Optional: A string to describe this graph - const std::string _name; - - //! Reference to the generating device object - const boost::weak_ptr<uhd::device3> _device_ptr; - - //! Reference to the async message handler - async_msg_handler::sptr _msg_handler; -}; - -}} /* namespace uhd::rfnoc */ - -#endif /* INCLUDED_LIBUHD_RFNOC_GRAPH_IMPL_HPP */ diff --git a/host/lib/include/uhdlib/rfnoc/legacy_compat.hpp b/host/lib/include/uhdlib/rfnoc/legacy_compat.hpp deleted file mode 100644 index 185b89f82..000000000 --- a/host/lib/include/uhdlib/rfnoc/legacy_compat.hpp +++ /dev/null @@ -1,49 +0,0 @@ -// -// Copyright 2016 Ettus Research LLC -// Copyright 2018 Ettus Research, a National Instruments Company -// -// SPDX-License-Identifier: GPL-3.0-or-later -// - -#ifndef INCLUDED_RFNOC_LEGACY_COMPAT_HPP -#define INCLUDED_RFNOC_LEGACY_COMPAT_HPP - -#include <uhd/device3.hpp> -#include <uhd/stream.hpp> - -namespace uhd { namespace rfnoc { - - /*! Legacy compatibility layer class. - */ - class legacy_compat - { - public: - typedef boost::shared_ptr<legacy_compat> sptr; - - virtual uhd::fs_path rx_dsp_root(const size_t mboard_idx, const size_t chan) = 0; - - virtual uhd::fs_path tx_dsp_root(const size_t mboard_idx, const size_t chan) = 0; - - virtual uhd::fs_path rx_fe_root(const size_t mboard_idx, const size_t chan) = 0; - - virtual uhd::fs_path tx_fe_root(const size_t mboard_idx, const size_t chan) = 0; - - virtual void issue_stream_cmd(const uhd::stream_cmd_t &stream_cmd, size_t mboard, size_t chan) = 0; - - virtual uhd::rx_streamer::sptr get_rx_stream(const uhd::stream_args_t &args) = 0; - - virtual uhd::tx_streamer::sptr get_tx_stream(const uhd::stream_args_t &args) = 0; - - virtual void set_rx_rate(const double rate, const size_t chan) = 0; - - virtual void set_tx_rate(const double rate, const size_t chan) = 0; - - static sptr make( - uhd::device3::sptr device, - const uhd::device_addr_t &args - ); - }; - -}} /* namespace uhd::rfnoc */ - -#endif /* INCLUDED_RFNOC_LEGACY_COMPAT_HPP */ diff --git a/host/lib/include/uhdlib/rfnoc/radio_ctrl_impl.hpp b/host/lib/include/uhdlib/rfnoc/radio_ctrl_impl.hpp deleted file mode 100644 index af4168d8b..000000000 --- a/host/lib/include/uhdlib/rfnoc/radio_ctrl_impl.hpp +++ /dev/null @@ -1,249 +0,0 @@ -// -// Copyright 2014-2016 Ettus Research LLC -// Copyright 2018 Ettus Research, a National Instruments Company -// -// SPDX-License-Identifier: GPL-3.0-or-later -// - -#ifndef INCLUDED_LIBUHD_RFNOC_RADIO_CTRL_IMPL_HPP -#define INCLUDED_LIBUHD_RFNOC_RADIO_CTRL_IMPL_HPP - -#include <uhd/rfnoc/radio_ctrl.hpp> -#include <uhd/types/direction.hpp> -#include <uhdlib/usrp/cores/rx_vita_core_3000.hpp> -#include <uhdlib/usrp/cores/tx_vita_core_3000.hpp> -#include <uhdlib/usrp/cores/time_core_3000.hpp> -#include <uhdlib/usrp/cores/gpio_atr_3000.hpp> -#include <boost/thread.hpp> -#include <mutex> - -//! Shorthand for radio block constructor -#define UHD_RFNOC_RADIO_BLOCK_CONSTRUCTOR_DECL(CLASS_NAME) \ - CLASS_NAME##_impl(const make_args_t &make_args); - -#define UHD_RFNOC_RADIO_BLOCK_CONSTRUCTOR(CLASS_NAME) \ - CLASS_NAME##_impl::CLASS_NAME##_impl( \ - const make_args_t &make_args \ - ) : block_ctrl_base(make_args), radio_ctrl_impl() - -namespace uhd { - namespace rfnoc { - -/*! \brief Provide access to a radio. - * - */ -class radio_ctrl_impl : public radio_ctrl -{ -public: - /************************************************************************ - * Structors - ***********************************************************************/ - radio_ctrl_impl(); - virtual ~radio_ctrl_impl() {}; - - /************************************************************************ - * Public Radio API calls - ***********************************************************************/ - virtual double set_rate(double rate); - virtual void set_tx_antenna(const std::string &ant, const size_t chan); - virtual void set_rx_antenna(const std::string &ant, const size_t chan); - virtual double set_tx_frequency(const double freq, const size_t chan); - virtual double set_rx_frequency(const double freq, const size_t chan); - virtual double set_tx_gain(const double gain, const size_t chan); - virtual double set_rx_gain(const double gain, const size_t chan); - virtual double set_tx_bandwidth(const double bandwidth, const size_t chan); - virtual double set_rx_bandwidth(const double bandwidth, const size_t chan); - - virtual double get_rate() const; - virtual std::string get_tx_antenna(const size_t chan) /* const */; - virtual std::string get_rx_antenna(const size_t chan) /* const */; - virtual double get_tx_frequency(const size_t) /* const */; - virtual double get_rx_frequency(const size_t) /* const */; - virtual double get_tx_gain(const size_t) /* const */; - virtual double get_rx_gain(const size_t) /* const */; - virtual double get_tx_bandwidth(const size_t) /* const */; - virtual double get_rx_bandwidth(const size_t) /* const */; - - virtual std::vector<std::string> get_rx_lo_names(const size_t chan); - virtual std::vector<std::string> get_rx_lo_sources(const std::string &name, const size_t chan); - virtual freq_range_t get_rx_lo_freq_range(const std::string &name, const size_t chan); - - virtual void set_rx_lo_source(const std::string &src, const std::string &name, const size_t chan); - virtual const std::string get_rx_lo_source(const std::string &name, const size_t chan); - - virtual void set_rx_lo_export_enabled(bool enabled, const std::string &name, const size_t chan); - virtual bool get_rx_lo_export_enabled(const std::string &name, const size_t chan); - - virtual double set_rx_lo_freq(const double freq, const std::string &name, const size_t chan); - virtual double get_rx_lo_freq(const std::string &name, const size_t chan); - - virtual std::vector<std::string> get_tx_lo_names(const size_t chan); - virtual std::vector<std::string> get_tx_lo_sources(const std::string &name, const size_t chan); - virtual freq_range_t get_tx_lo_freq_range(const std::string &name, const size_t chan); - - virtual void set_tx_lo_source(const std::string &src, const std::string &name, const size_t chan); - virtual const std::string get_tx_lo_source(const std::string &name, const size_t chan); - - virtual void set_tx_lo_export_enabled(const bool enabled, const std::string &name, const size_t chan); - virtual bool get_tx_lo_export_enabled(const std::string &name, const size_t chan); - - virtual double set_tx_lo_freq(const double freq, const std::string &name, const size_t chan); - virtual double get_tx_lo_freq(const std::string &name, const size_t chan); - - void set_time_now(const time_spec_t &time_spec); - void set_time_next_pps(const time_spec_t &time_spec); - void set_time_sync(const uhd::time_spec_t &time); - time_spec_t get_time_now(); - time_spec_t get_time_last_pps(); - virtual void set_time_source(const std::string &source); - virtual std::string get_time_source(); - virtual std::vector<std::string> get_time_sources(); - virtual void set_clock_source(const std::string &source); - virtual std::string get_clock_source(); - virtual std::vector<std::string> get_clock_sources(); - - virtual std::vector<std::string> get_gpio_banks() const; - virtual void set_gpio_attr( - const std::string &bank, - const std::string &attr, - const uint32_t value, - const uint32_t mask - ); - virtual uint32_t get_gpio_attr(const std::string &bank, const std::string &attr); - void enable_rx_timestamps(const bool, const size_t); - - /*********************************************************************** - * Block control API calls - **********************************************************************/ - void set_rx_streamer(bool active, const size_t port); - void set_tx_streamer(bool active, const size_t port); - - void issue_stream_cmd(const uhd::stream_cmd_t &stream_cmd, const size_t port); - - virtual double get_input_samp_rate(size_t /* port */) { return get_rate(); } - virtual double get_output_samp_rate(size_t /* port */) { return get_rate(); } - double _get_tick_rate() { return get_rate(); } - - std::vector<size_t> get_active_rx_ports(); - bool in_continuous_streaming_mode(const size_t chan) { return _continuous_streaming.at(chan); } - void rx_ctrl_clear_cmds(const size_t port) { sr_write(regs::RX_CTRL_CLEAR_CMDS, 0, port); } - -protected: // TODO see what's protected and what's private - void _register_loopback_self_test(size_t chan); - - /*********************************************************************** - * Registers - **********************************************************************/ - struct regs { - static inline uint32_t sr_addr(const uint32_t offset) { return offset * 4; } - static inline uint32_t rb_addr(const uint32_t offset) { return offset * 8; } - - static const uint32_t BASE = 128; - - // defined in radio_core_regs.vh - static const uint32_t TIME = 128; // time hi - 128, time lo - 129, ctrl - 130 - static const uint32_t CLEAR_CMDS = 131; // Any write to this reg clears the command FIFO - static const uint32_t LOOPBACK = 132; - static const uint32_t TEST = 133; - static const uint32_t CODEC_IDLE = 134; - static const uint32_t TX_CTRL_ERROR_POLICY = 144; - static const uint32_t RX_CTRL_CMD = 152; - static const uint32_t RX_CTRL_TIME_HI = 153; - static const uint32_t RX_CTRL_TIME_LO = 154; - static const uint32_t RX_CTRL_HALT = 155; - static const uint32_t RX_CTRL_MAXLEN = 156; - static const uint32_t RX_CTRL_CLEAR_CMDS = 157; - static const uint32_t RX_CTRL_OUTPUT_FORMAT= 158; - static const uint32_t MISC_OUTS = 160; - static const uint32_t DACSYNC = 161; - static const uint32_t SPI = 168; - static const uint32_t LEDS = 176; - static const uint32_t FP_GPIO = 184; - static const uint32_t GPIO = 192; - // NOTE: Upper 32 registers (224-255) are reserved for the output settings bus for use with - // device specific front end control - - // frontend control: needs rethinking TODO - //static const uint32_t TX_FRONT = BASE + 96; - //static const uint32_t RX_FRONT = BASE + 112; - //static const uint32_t READBACK = BASE + 127; - - static const uint32_t RB_TIME_NOW = 0; - static const uint32_t RB_TIME_PPS = 1; - static const uint32_t RB_TEST = 2; - static const uint32_t RB_CODEC_READBACK = 3; - static const uint32_t RB_RADIO_NUM = 4; - static const uint32_t RB_MISC_IO = 16; - static const uint32_t RB_SPI = 17; - static const uint32_t RB_LEDS = 18; - static const uint32_t RB_DB_GPIO = 19; - static const uint32_t RB_FP_GPIO = 20; - }; - - /*********************************************************************** - * Block control API calls - **********************************************************************/ - void _update_spp(int spp); - - inline size_t _get_num_radios() const { - return std::max(_num_rx_channels, _num_tx_channels); - } - - inline timed_wb_iface::sptr _get_ctrl(size_t radio_num) const { - return _perifs.at(radio_num).ctrl; - } - - inline bool _is_streamer_active(uhd::direction_t dir, const size_t chan) const { - switch (dir) { - case uhd::TX_DIRECTION: - return _tx_streamer_active.count(chan) ? _tx_streamer_active.at(chan) : false; - case uhd::RX_DIRECTION: - return _rx_streamer_active.count(chan) ? _rx_streamer_active.at(chan) : false; - case uhd::DX_DIRECTION: - return (_tx_streamer_active.count(chan) and _rx_streamer_active.count(chan)) ? - _rx_streamer_active.at(chan) and _tx_streamer_active.at(chan) : false; - default: - return false; - } - } - - virtual bool check_radio_config() { return true; }; - - //! There is always only one time core per radio - time_core_3000::sptr _time64; - - std::mutex _mutex; - - size_t _num_tx_channels; - size_t _num_rx_channels; - std::vector<bool> _continuous_streaming; - -private: - /************************************************************************ - * Peripherals - ***********************************************************************/ - //! Stores pointers to all streaming-related radio cores - struct radio_perifs_t - { - timed_wb_iface::sptr ctrl; - }; - std::map<size_t, radio_perifs_t> _perifs; - - - - // Cached values - double _tick_rate; - std::map<size_t, std::string> _tx_antenna; - std::map<size_t, std::string> _rx_antenna; - std::map<size_t, double> _tx_freq; - std::map<size_t, double> _rx_freq; - std::map<size_t, double> _tx_gain; - std::map<size_t, double> _rx_gain; - std::map<size_t, double> _tx_bandwidth; - std::map<size_t, double> _rx_bandwidth; - -}; /* class radio_ctrl_impl */ - -}} /* namespace uhd::rfnoc */ - -#endif /* INCLUDED_LIBUHD_RFNOC_RADIO_CTRL_IMPL_HPP */ diff --git a/host/lib/include/uhdlib/rfnoc/rx_stream_terminator.hpp b/host/lib/include/uhdlib/rfnoc/rx_stream_terminator.hpp deleted file mode 100644 index 2ac65bb25..000000000 --- a/host/lib/include/uhdlib/rfnoc/rx_stream_terminator.hpp +++ /dev/null @@ -1,78 +0,0 @@ -// -// Copyright 2014 Ettus Research LLC -// Copyright 2018 Ettus Research, a National Instruments Company -// -// SPDX-License-Identifier: GPL-3.0-or-later -// - -#ifndef INCLUDED_LIBUHD_RFNOC_TERMINATOR_RECV_HPP -#define INCLUDED_LIBUHD_RFNOC_TERMINATOR_RECV_HPP - -#include <uhd/rfnoc/sink_node_ctrl.hpp> -#include <uhd/rfnoc/rate_node_ctrl.hpp> -#include <uhd/rfnoc/tick_node_ctrl.hpp> -#include <uhd/rfnoc/scalar_node_ctrl.hpp> -#include <uhd/rfnoc/terminator_node_ctrl.hpp> -#include <uhd/rfnoc/block_ctrl_base.hpp> // For the block macros -#include <mutex> - -namespace uhd { - namespace rfnoc { - -/*! \brief Terminator node for Rx streamers. - * - * This node is only used by rx_streamers. It terminates the flow graph - * inside the streamer and does not have a counterpart on the FPGA. - */ -class rx_stream_terminator : - public sink_node_ctrl, - public rate_node_ctrl, - public tick_node_ctrl, - public scalar_node_ctrl, - public terminator_node_ctrl -{ -public: - UHD_RFNOC_BLOCK_OBJECT(rx_stream_terminator) - - static sptr make() - { - return sptr(new rx_stream_terminator); - } - - // If this is called, then by a send terminator at the other end - // of a flow graph. - double get_input_samp_rate(size_t) { return _samp_rate; }; - - // Same for the scaling factor - double get_input_scale_factor(size_t) { return scalar_node_ctrl::SCALE_UNDEFINED; }; - - std::string unique_id() const; - - void set_rx_streamer(bool active, const size_t port); - - void set_tx_streamer(bool active, const size_t port); - - virtual ~rx_stream_terminator(); - - void handle_overrun(boost::weak_ptr<uhd::rx_streamer>, const size_t); - -protected: - rx_stream_terminator(); - - virtual double _get_tick_rate() { return _tick_rate; }; - -private: - //! Every terminator has a unique index - const size_t _term_index; - static size_t _count; - - double _samp_rate; - double _tick_rate; - - std::mutex _overrun_handler_mutex; - -}; /* class rx_stream_terminator */ - -}} /* namespace uhd::rfnoc */ - -#endif /* INCLUDED_LIBUHD_RFNOC_TERMINATOR_RECV_HPP */ diff --git a/host/lib/include/uhdlib/rfnoc/tx_stream_terminator.hpp b/host/lib/include/uhdlib/rfnoc/tx_stream_terminator.hpp deleted file mode 100644 index e4d509dc5..000000000 --- a/host/lib/include/uhdlib/rfnoc/tx_stream_terminator.hpp +++ /dev/null @@ -1,79 +0,0 @@ -// -// Copyright 2014 Ettus Research LLC -// Copyright 2018 Ettus Research, a National Instruments Company -// -// SPDX-License-Identifier: GPL-3.0-or-later -// - -#ifndef INCLUDED_LIBUHD_RFNOC_TERMINATOR_SEND_HPP -#define INCLUDED_LIBUHD_RFNOC_TERMINATOR_SEND_HPP - -#include <uhd/rfnoc/source_node_ctrl.hpp> -#include <uhd/rfnoc/rate_node_ctrl.hpp> -#include <uhd/rfnoc/tick_node_ctrl.hpp> -#include <uhd/rfnoc/scalar_node_ctrl.hpp> -#include <uhd/rfnoc/terminator_node_ctrl.hpp> -#include <uhd/rfnoc/block_ctrl_base.hpp> // For the block macros -#include <uhd/utils/log.hpp> - -namespace uhd { - namespace rfnoc { - -/*! \brief Terminator node for Tx streamers. - * - * This node is only used by tx_streamers. It terminates the flow graph - * inside the streamer and does not have a counterpart on the FPGA. - */ -class tx_stream_terminator : - public source_node_ctrl, - public rate_node_ctrl, - public tick_node_ctrl, - public scalar_node_ctrl, - public terminator_node_ctrl -{ -public: - UHD_RFNOC_BLOCK_OBJECT(tx_stream_terminator) - - static sptr make() - { - return sptr(new tx_stream_terminator); - } - - void issue_stream_cmd(const uhd::stream_cmd_t &, const size_t) - { - UHD_RFNOC_BLOCK_TRACE() << "tx_stream_terminator::issue_stream_cmd()" ; - } - - // If this is called, then by a send terminator at the other end - // of a flow graph. - double get_output_samp_rate(size_t) { return _samp_rate; }; - - // Same for the scaling factor - double get_output_scale_factor(size_t) { return scalar_node_ctrl::SCALE_UNDEFINED; }; - - std::string unique_id() const; - - void set_rx_streamer(bool active, const size_t port); - - void set_tx_streamer(bool active, const size_t port); - - virtual ~tx_stream_terminator(); - -protected: - tx_stream_terminator(); - - virtual double _get_tick_rate() { return _tick_rate; }; - -private: - //! Every terminator has a unique index - const size_t _term_index; - static size_t _count; - - double _samp_rate; - double _tick_rate; - -}; /* class tx_stream_terminator */ - -}} /* namespace uhd::rfnoc */ - -#endif /* INCLUDED_LIBUHD_RFNOC_TERMINATOR_SEND_HPP */ diff --git a/host/lib/include/uhdlib/rfnoc/utils.hpp b/host/lib/include/uhdlib/rfnoc/utils.hpp deleted file mode 100644 index 7c3c1bb5f..000000000 --- a/host/lib/include/uhdlib/rfnoc/utils.hpp +++ /dev/null @@ -1,66 +0,0 @@ -// -// Copyright 2014 Ettus Research LLC -// Copyright 2018 Ettus Research, a National Instruments Company -// -// SPDX-License-Identifier: GPL-3.0-or-later -// - -#ifndef INCLUDED_LIBUHD_RFNOC_UTILS_HPP -#define INCLUDED_LIBUHD_RFNOC_UTILS_HPP - -#include <uhd/rfnoc/node_ctrl_base.hpp> -#include <boost/lexical_cast.hpp> -#include <set> - -namespace uhd { namespace rfnoc { namespace utils { - - /*! If \p suggested_port equals ANY_PORT, return the first available - * port number on \p nodes. Otherwise, return \p suggested_port. - * - * If \p allowed_ports is given, another condition is that the port - * number must be listed in here. - * If \p allowed_ports is not specified or empty, the assumption is - * that all ports are valid. - * - * On failure, ANY_PORT is returned. - */ - static size_t node_map_find_first_free( - node_ctrl_base::node_map_t nodes, - const size_t suggested_port, - const std::set<size_t> allowed_ports=std::set<size_t>() - ) { - size_t port = suggested_port; - if (port == ANY_PORT) { - if (allowed_ports.empty()) { - port = 0; - while (nodes.count(port) and (port != ANY_PORT)) { - port++; - } - } else { - for(const size_t allowed_port: allowed_ports) { - if (not nodes.count(port)) { - return allowed_port; - } - return ANY_PORT; - } - } - } else { - if (not (allowed_ports.empty() or allowed_ports.count(port))) { - return ANY_PORT; - } - } - return port; - } - - template <typename T> - static std::set<T> str_list_to_set(const std::vector<std::string> &list) { - std::set<T> return_set; - for(const std::string &S: list) { - return_set.insert(boost::lexical_cast<T>(S)); - } - return return_set; - } - -}}}; /* namespace uhd::rfnoc::utils */ - -#endif /* INCLUDED_LIBUHD_RFNOC_UTILS_HPP */ diff --git a/host/lib/include/uhdlib/rfnoc/wb_iface_adapter.hpp b/host/lib/include/uhdlib/rfnoc/wb_iface_adapter.hpp deleted file mode 100644 index 1ed8cf69b..000000000 --- a/host/lib/include/uhdlib/rfnoc/wb_iface_adapter.hpp +++ /dev/null @@ -1,57 +0,0 @@ -// -// Copyright 2016 Ettus Research LLC -// Copyright 2018 Ettus Research, a National Instruments Company -// -// SPDX-License-Identifier: GPL-3.0-or-later -// - -#ifndef INCLUDED_RFNOC_WB_IFACE_ADAPTER_HPP -#define INCLUDED_RFNOC_WB_IFACE_ADAPTER_HPP - -#include <uhd/config.hpp> -#include "ctrl_iface.hpp" -#include <uhd/types/wb_iface.hpp> -#include <boost/function.hpp> - -namespace uhd { - namespace rfnoc { - -/*! wb_iface control into RFNoC block registers. - * - * This is specifically for mimicking a wb_iface that talks to an RFNoC block. - * It assumes an underlying ctrl_iface is talking to an RFNoC block. - */ -class UHD_API wb_iface_adapter : public uhd::timed_wb_iface -{ -public: - typedef boost::function<double()> gettickrate_type; - typedef boost::function<uhd::time_spec_t()> gettime_type; - typedef boost::function<void(const uhd::time_spec_t &)> settime_type; - - wb_iface_adapter( - ctrl_iface::sptr iface, - const gettickrate_type &, - const settime_type &, - const gettime_type & - ); - - virtual ~wb_iface_adapter(void) {} - - void poke32(const wb_addr_type addr, const uint32_t data); - uint32_t peek32(const wb_addr_type addr); - uint64_t peek64(const wb_addr_type addr); - time_spec_t get_time() { return gettime_functor(); } - void set_time(const uhd::time_spec_t& t) { settime_functor(t); } - -private: - ctrl_iface::sptr _iface; - const gettickrate_type gettickrate_functor; - const settime_type settime_functor; - const gettime_type gettime_functor; - - inline uint64_t get_timestamp() { return gettime_functor().to_ticks(gettickrate_functor()); } -}; - -}} // namespace uhd::rfnoc - -#endif /* INCLUDED_RFNOC_WB_IFACE_ADAPTER_HPP */ diff --git a/host/lib/include/uhdlib/rfnoc/xports.hpp b/host/lib/include/uhdlib/rfnoc/xports.hpp deleted file mode 100644 index 6b30fe5b1..000000000 --- a/host/lib/include/uhdlib/rfnoc/xports.hpp +++ /dev/null @@ -1,35 +0,0 @@ -// -// Copyright 2016 Ettus Research LLC -// Copyright 2018 Ettus Research, a National Instruments Company -// -// SPDX-License-Identifier: GPL-3.0-or-later -// - -#ifndef INCLUDED_LIBUHD_XPORTS_HPP -#define INCLUDED_LIBUHD_XPORTS_HPP - -#include <uhd/types/sid.hpp> -#include <uhd/types/endianness.hpp> -#include <uhd/transport/zero_copy.hpp> - -namespace uhd { - - /*! Holds all necessary items for a bidirectional link - */ - struct both_xports_t - { - both_xports_t(): recv_buff_size(0), send_buff_size(0), lossless(false) - {} - uhd::transport::zero_copy_if::sptr recv; - uhd::transport::zero_copy_if::sptr send; - size_t recv_buff_size; - size_t send_buff_size; - uhd::sid_t send_sid; - uhd::sid_t recv_sid; - uhd::endianness_t endianness; - bool lossless; - }; - -}; - -#endif /* INCLUDED_LIBUHD_XPORTS_HPP */ |