aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/rfnoc
diff options
context:
space:
mode:
authorWade Fife <wade.fife@ettus.com>2021-01-07 15:53:47 -0600
committerAaron Rossetto <aaron.rossetto@ni.com>2021-01-11 12:57:28 -0600
commit643dd4f9d103da89feaa600214f2dab9d3c64bdc (patch)
tree225d7797d88a4bea1373805fb7f4a01cc6aa78b8 /host/lib/rfnoc
parentea0ecfcaf78e8dc1094357d908313326fe1201dc (diff)
downloaduhd-643dd4f9d103da89feaa600214f2dab9d3c64bdc.tar.gz
uhd-643dd4f9d103da89feaa600214f2dab9d3c64bdc.tar.bz2
uhd-643dd4f9d103da89feaa600214f2dab9d3c64bdc.zip
rfnoc: Update radio to support multiple SPC
Diffstat (limited to 'host/lib/rfnoc')
-rw-r--r--host/lib/rfnoc/radio_control_impl.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/host/lib/rfnoc/radio_control_impl.cpp b/host/lib/rfnoc/radio_control_impl.cpp
index e20f5d4f6..f1a1bb69a 100644
--- a/host/lib/rfnoc/radio_control_impl.cpp
+++ b/host/lib/rfnoc/radio_control_impl.cpp
@@ -151,7 +151,7 @@ radio_control_impl::radio_control_impl(make_args_ptr make_args)
PROP_KEY_TYPE, IO_TYPE_SC16, {res_source_info::OUTPUT_EDGE, chan}));
register_property(&_spp_prop.back(), [this, chan, &spp = _spp_prop.back()]() {
- const uint32_t words_per_pkt = spp.get();
+ const uint32_t words_per_pkt = spp.get() / _spc;
RFNOC_LOG_TRACE(
"Setting words_per_pkt to " << words_per_pkt << " on chan " << chan);
_radio_reg_iface.poke32(
@@ -888,10 +888,16 @@ void radio_control_impl::issue_stream_cmd(
"zero samples");
return;
}
- // FIXME: The num words might be different from num_samps, check the
- // radio width
- const uint64_t num_words = stream_cmd.num_samps;
+ uint64_t num_words = stream_cmd.num_samps / _spc;
constexpr uint64_t max_num_words = 0x00FFFFFFFFFFFF; // 48 bits
+ if (stream_cmd.num_samps % _spc != 0) {
+ num_words++;
+ RFNOC_LOG_WARNING("The requested "
+ + std::to_string(stream_cmd.num_samps)
+ + " samples is not a multiple of the samples per cycle ("
+ + std::to_string(_spc) + "); returning "
+ + std::to_string(num_words * _spc) + " samples.");
+ }
if (num_words > max_num_words) {
RFNOC_LOG_ERROR("Requesting too many samples in a single burst! "
"Requested "