diff options
author | Lars Amsel <lars.amsel@ni.com> | 2021-12-03 13:02:09 +0100 |
---|---|---|
committer | Aaron Rossetto <aaron.rossetto@ni.com> | 2022-01-10 14:56:35 -0600 |
commit | 3e5e4eb06c0ea6337464cbda0648a75bf76cca17 (patch) | |
tree | a39eb76a91b19ba5f38aacafd844e869bc459319 /host/lib/include/uhdlib/transport | |
parent | 0e7553cd1a8758a8488afc2efaff7295b351e7fe (diff) | |
download | uhd-3e5e4eb06c0ea6337464cbda0648a75bf76cca17.tar.gz uhd-3e5e4eb06c0ea6337464cbda0648a75bf76cca17.tar.bz2 uhd-3e5e4eb06c0ea6337464cbda0648a75bf76cca17.zip |
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.
Diffstat (limited to 'host/lib/include/uhdlib/transport')
-rw-r--r-- | host/lib/include/uhdlib/transport/rx_streamer_impl.hpp | 6 | ||||
-rw-r--r-- | host/lib/include/uhdlib/transport/tx_streamer_impl.hpp | 6 |
2 files changed, 12 insertions, 0 deletions
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 { |