aboutsummaryrefslogtreecommitdiffstats
path: root/host
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2020-05-04 06:51:53 -0700
committerAaron Rossetto <aaron.rossetto@ni.com>2020-05-05 14:42:29 -0500
commit4e775027871a7676bb49076cf56638aef2529bfe (patch)
tree6a71af7132142967f32638e30974ec8c7816b368 /host
parente31b16a07c7f03bc244e63aecc5cad41a6339799 (diff)
downloaduhd-4e775027871a7676bb49076cf56638aef2529bfe.tar.gz
uhd-4e775027871a7676bb49076cf56638aef2529bfe.tar.bz2
uhd-4e775027871a7676bb49076cf56638aef2529bfe.zip
cores: Fix rx_vita_core_3000 assertion error in issue_stream_cmd()
The current code had an assertion UHD_ASSERT_THROW(stream_cmd.num_samps <= 0x0fffffff); which would check that num_samps in a stream command don't exceed the counter depth in the FPGA. However, this is only relevant if the stream command is not "continuous" or "stop". num_samps could be unitialized, and randomly have a value larger than the maximum, and the assertion could trigger even though the value in num_samps is irrelevant. The new assertion checks for the correct case, and has a more verbose error message.
Diffstat (limited to 'host')
-rw-r--r--host/lib/usrp/cores/rx_vita_core_3000.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/host/lib/usrp/cores/rx_vita_core_3000.cpp b/host/lib/usrp/cores/rx_vita_core_3000.cpp
index 8a20e637b..4b09f75fd 100644
--- a/host/lib/usrp/cores/rx_vita_core_3000.cpp
+++ b/host/lib/usrp/cores/rx_vita_core_3000.cpp
@@ -82,9 +82,13 @@ struct rx_vita_core_3000_impl : rx_vita_core_3000
// not setup yet!";
return;
}
- UHD_ASSERT_THROW(stream_cmd.num_samps <= 0x0fffffff);
- _continuous_streaming = stream_cmd.stream_mode
- == stream_cmd_t::STREAM_MODE_START_CONTINUOUS;
+ if ((stream_cmd.stream_mode == stream_cmd_t::STREAM_MODE_NUM_SAMPS_AND_DONE
+ || stream_cmd.stream_mode == stream_cmd_t::STREAM_MODE_NUM_SAMPS_AND_MORE)
+ && stream_cmd.num_samps > 0x0fffffff) {
+ throw uhd::assertion_error(
+ "Invalid stream command: num_samps exceeds maximum value! "
+ "(Note: Chain multiple commands to request larger bursts)");
+ }
// setup the mode to instruction flags
typedef std::tuple<bool, bool, bool, bool> inst_t;