aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/rfnoc/radio_ctrl_impl.cpp
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2018-03-26 11:52:50 -0700
committerMartin Braun <martin.braun@ettus.com>2018-03-27 16:19:30 -0700
commit632dc63810dae60e89f0e6f1d3149a05733c6116 (patch)
tree66a4366be570c958919c60e816cc21dc995e52c3 /host/lib/rfnoc/radio_ctrl_impl.cpp
parentfdd96ef20e0745d732208f430f19a5483ba31d53 (diff)
downloaduhd-632dc63810dae60e89f0e6f1d3149a05733c6116.tar.gz
uhd-632dc63810dae60e89f0e6f1d3149a05733c6116.tar.bz2
uhd-632dc63810dae60e89f0e6f1d3149a05733c6116.zip
rfnoc radio: Improve warning for too many samples requested
When doing a NUM_SAMPS_AND_DONE stream command, there is a limit to the number of samples that can be requested (as of now, there's 28 bits for this counter). When the number was exceeded, the previous error message was not helpful. Note that the DDC block will multiply the number of requested samples by the decimation rate. This means the number of samples requested from the radio is higher than the number of samples requested by the application.
Diffstat (limited to 'host/lib/rfnoc/radio_ctrl_impl.cpp')
-rw-r--r--host/lib/rfnoc/radio_ctrl_impl.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/host/lib/rfnoc/radio_ctrl_impl.cpp b/host/lib/rfnoc/radio_ctrl_impl.cpp
index a151b2690..643a6e745 100644
--- a/host/lib/rfnoc/radio_ctrl_impl.cpp
+++ b/host/lib/rfnoc/radio_ctrl_impl.cpp
@@ -360,7 +360,17 @@ void radio_ctrl_impl::issue_stream_cmd(
"channel. Skipping.";
return;
}
- UHD_ASSERT_THROW(stream_cmd.num_samps <= 0x0fffffff);
+ constexpr size_t max_num_samps = 0x0fffffff;
+ if (stream_cmd.num_samps > max_num_samps) {
+ UHD_LOG_ERROR("RFNOC RADIO",
+ "Requesting too many samples in a single burst! "
+ "Requested " + std::to_string(stream_cmd.num_samps) + ", maximum "
+ "is " + std::to_string(max_num_samps) + ".");
+ UHD_LOG_INFO("RFNOC RADIO",
+ "Note that a decimation block will increase the number of samples "
+ "per burst. Your application may have requested fewer samples.");
+ throw uhd::value_error("Requested too many samples in a single burst.");
+ }
_continuous_streaming[chan] =
(stream_cmd.stream_mode == stream_cmd_t::STREAM_MODE_START_CONTINUOUS);