diff options
Diffstat (limited to 'host')
-rw-r--r-- | host/include/uhd/rfnoc/radio_control.hpp | 23 | ||||
-rw-r--r-- | host/include/uhd/types/stream_cmd.hpp | 4 | ||||
-rw-r--r-- | host/lib/include/uhdlib/rfnoc/radio_control_impl.hpp | 1 | ||||
-rw-r--r-- | host/lib/rfnoc/radio_control_impl.cpp | 5 | ||||
-rw-r--r-- | host/lib/rfnoc/radio_control_python.hpp | 1 |
5 files changed, 34 insertions, 0 deletions
diff --git a/host/include/uhd/rfnoc/radio_control.hpp b/host/include/uhd/rfnoc/radio_control.hpp index 097529147..06f889a8a 100644 --- a/host/include/uhd/rfnoc/radio_control.hpp +++ b/host/include/uhd/rfnoc/radio_control.hpp @@ -48,6 +48,20 @@ public: //! Return a list of valid rates virtual uhd::meta_range_t get_rate_range() const = 0; + //! Return the samples per clock (SPC) value of this radio + // + // Some radios may operate on multiple samples per clock cycle, usually in + // order to handle large bandwidths without requiring very fast FPGA clock + // rates. + // + // When the SPC value is greater than one, certain API calls may behave + // slightly differently. This is most relevant for issue_stream_cmd(). Other + // commands may round their execution time to the next integer multiple of + // SPC as well. + // + // Ultimately, the exact impact of SPC is device-dependent. + virtual size_t get_spc() const = 0; + /************************************************************************** * RF-Related API Calls *************************************************************************/ @@ -227,6 +241,15 @@ public: *************************************************************************/ /*! Issue stream command: Instruct the RX part of the radio to send samples * + * When the radio is running at multiple samples per clock cycle, there are + * some restrictions in place: + * - When requesting a burst of length N, N must be an integer multiple of + * SPC. If it's not, the radio will round up to the next integer multiple. + * - When requesting a start time, the start time may be rounded down such + * that the first sample has a tick count value that is an integer multiple + * of SPC. That means the sample at the requested time will always be + * produced, but it might not be the first sample to be returned. + * * \param stream_cmd The actual stream command to execute * \param port The port for which the stream command is meant */ diff --git a/host/include/uhd/types/stream_cmd.hpp b/host/include/uhd/types/stream_cmd.hpp index bc7a21186..84872bd13 100644 --- a/host/include/uhd/types/stream_cmd.hpp +++ b/host/include/uhd/types/stream_cmd.hpp @@ -31,6 +31,10 @@ namespace uhd { * The stream now parameter controls when the stream begins. * When true, the device will begin streaming ASAP. When false, * the device will begin streaming at a time specified by time_spec. + * + * Note: When a radio runs at multiple samples per clock cycle, it may not be + * possible to request samples at any given time, and \p num_samps might have to + * be an integer multiple of SPC. */ struct UHD_API stream_cmd_t { diff --git a/host/lib/include/uhdlib/rfnoc/radio_control_impl.hpp b/host/lib/include/uhdlib/rfnoc/radio_control_impl.hpp index 7d9ce6ec2..0ff0e9b12 100644 --- a/host/lib/include/uhdlib/rfnoc/radio_control_impl.hpp +++ b/host/lib/include/uhdlib/rfnoc/radio_control_impl.hpp @@ -56,6 +56,7 @@ public: double set_rate(const double rate) override; double get_rate() const override; meta_range_t get_rate_range() const override; + size_t get_spc() const override; /************************************************************************** * RF-specific API calls diff --git a/host/lib/rfnoc/radio_control_impl.cpp b/host/lib/rfnoc/radio_control_impl.cpp index 709bbd87d..0a3eda277 100644 --- a/host/lib/rfnoc/radio_control_impl.cpp +++ b/host/lib/rfnoc/radio_control_impl.cpp @@ -289,6 +289,11 @@ uhd::meta_range_t radio_control_impl::get_rate_range() const return result; } +size_t radio_control_impl::get_spc() const +{ + return _spc; +} + /**************************************************************************** * RF API ***************************************************************************/ diff --git a/host/lib/rfnoc/radio_control_python.hpp b/host/lib/rfnoc/radio_control_python.hpp index 2f76209f2..3fb6371da 100644 --- a/host/lib/rfnoc/radio_control_python.hpp +++ b/host/lib/rfnoc/radio_control_python.hpp @@ -21,6 +21,7 @@ void export_radio_control(py::module& m) .def("set_rate", &radio_control::set_rate) .def("get_rate", &radio_control::get_rate) .def("get_rate_range", &radio_control::get_rate_range) + .def("get_spc", &radio_control::get_spc) .def("get_tx_antenna", &radio_control::get_tx_antenna) .def("get_tx_antennas", &radio_control::get_tx_antennas) .def("set_tx_antenna", &radio_control::set_tx_antenna) |