From 3e5e4eb06c0ea6337464cbda0648a75bf76cca17 Mon Sep 17 00:00:00 2001 From: Lars Amsel Date: Fri, 3 Dec 2021 13:02:09 +0100 Subject: rfnoc: Add atomic item size property for RFNoC blocks An RFNoC block (like the radio) might require a minimal number of items in each clock cycle, e.g. the radio has to process SPC (samples per cycle). Because data in RFNoC is transmitted and processed in packets, we have to make sure the items inside these packets are a multiple of the items processed in each cycle. This commit adds an atomic item size properties which is set by the radio and adapted by the streamers. The streamers adapt the SPP property of the radio block controller depending on the MTU value. This might lead to an SPP value which does not align with the SPC value of the radio block, hence we add a property resolver for the atomic item size. --- host/lib/include/uhdlib/transport/rx_streamer_impl.hpp | 6 ++++++ host/lib/include/uhdlib/transport/tx_streamer_impl.hpp | 6 ++++++ 2 files changed, 12 insertions(+) (limited to 'host/lib/include/uhdlib/transport') diff --git a/host/lib/include/uhdlib/transport/rx_streamer_impl.hpp b/host/lib/include/uhdlib/transport/rx_streamer_impl.hpp index 1b25b308b..03cd3824a 100644 --- a/host/lib/include/uhdlib/transport/rx_streamer_impl.hpp +++ b/host/lib/include/uhdlib/transport/rx_streamer_impl.hpp @@ -208,6 +208,12 @@ protected: _converters[chan]->set_scalar(scale_factor); } + //! set maximum number of sample (per packet) + void set_max_num_samps(const size_t value) + { + _spp = value; + } + //! Returns the maximum payload size size_t get_mtu() const { diff --git a/host/lib/include/uhdlib/transport/tx_streamer_impl.hpp b/host/lib/include/uhdlib/transport/tx_streamer_impl.hpp index 6b34c1c10..38f16671a 100644 --- a/host/lib/include/uhdlib/transport/tx_streamer_impl.hpp +++ b/host/lib/include/uhdlib/transport/tx_streamer_impl.hpp @@ -329,6 +329,12 @@ protected: return _zero_copy_streamer.get_tick_rate(); } + //! set maximum number of sample (per packet) + void set_max_num_samps(const size_t value) + { + _spp = value; + } + //! Returns the maximum payload size size_t get_mtu() const { -- cgit v1.2.3