aboutsummaryrefslogtreecommitdiffstats
path: root/host/examples/python/benchmark_rate.py
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2019-11-12 14:26:10 -0800
committerMartin Braun <martin.braun@ettus.com>2019-11-26 12:21:33 -0800
commit113b3262d3ac2995b5141180be70a0790fa553ed (patch)
treeee41a6b526de1343d48a6fd6a0d095ed33502817 /host/examples/python/benchmark_rate.py
parent59fae330b0345c4a587862322b16379e563e673b (diff)
downloaduhd-113b3262d3ac2995b5141180be70a0790fa553ed.tar.gz
uhd-113b3262d3ac2995b5141180be70a0790fa553ed.tar.bz2
uhd-113b3262d3ac2995b5141180be70a0790fa553ed.zip
examples: benchmark_rate.py: Add ?x_stream_args args
This allows adding stream args to the Python version of benchmark_rate in the same way as for the C++ version, e.g.: python3 ./benchmark_rate.py \ --args addr=192.168.40.2,num_poll_offload_threads=4 \ --rx_stream_args \ recv_offload=1,num_recv_frames=32,recv_offload_wait_mode=poll \ --tx_stream_args \ send_offload=1,num_send_frames=32,send_offload_wait_mode=poll \ [... other arguments ...]
Diffstat (limited to 'host/examples/python/benchmark_rate.py')
-rwxr-xr-xhost/examples/python/benchmark_rate.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/host/examples/python/benchmark_rate.py b/host/examples/python/benchmark_rate.py
index 67b9c1e02..6f3191e07 100755
--- a/host/examples/python/benchmark_rate.py
+++ b/host/examples/python/benchmark_rate.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
#
# Copyright 2018 Ettus Research, a National Instruments Company
+# Copyright 2019 Ettus Research, a National Instruments Brand
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
@@ -48,6 +49,10 @@ def parse_args():
help="specify the host/cpu sample mode for RX")
parser.add_argument("--tx_cpu", type=str, default="fc32",
help="specify the host/cpu sample mode for TX")
+ parser.add_argument("--rx_stream_args",
+ help="stream args for RX streamer", default="")
+ parser.add_argument("--tx_stream_args", help="stream args for TX streamer",
+ default="")
parser.add_argument("--ref", type=str,
help="clock reference (internal, external, mimo, gpsdo)")
parser.add_argument("--pps", type=str, help="PPS source (internal, external, mimo, gpsdo)")
@@ -86,7 +91,7 @@ def setup_ref(usrp, ref, num_mboards):
if ref == "mimo":
if num_mboards != 2:
logger.error("ref = \"mimo\" implies 2 motherboards; "
- "your system has %d boards", num_mboards)
+ "your system has %d boards", num_mboards)
return False
usrp.set_clock_source("mimo", 1)
else:
@@ -114,7 +119,7 @@ def setup_pps(usrp, pps, num_mboards):
if pps == "mimo":
if num_mboards != 2:
logger.error("ref = \"mimo\" implies 2 motherboards; "
- "your system has %d boards", num_mboards)
+ "your system has %d boards", num_mboards)
return False
# make mboard 1 a slave over the MIMO Cable
usrp.set_time_source("mimo", 1)
@@ -419,6 +424,7 @@ def main():
usrp.set_rx_rate(args.rx_rate)
st_args = uhd.usrp.StreamArgs(args.rx_cpu, args.rx_otw)
st_args.channels = rx_channels
+ st_args.args = uhd.types.DeviceAddr(args.rx_stream_args)
rx_streamer = usrp.get_rx_stream(st_args)
rx_thread = threading.Thread(target=benchmark_rx_rate,
args=(usrp, rx_streamer, args.random, quit_event,
@@ -437,6 +443,7 @@ def main():
usrp.set_tx_rate(args.tx_rate)
st_args = uhd.usrp.StreamArgs(args.tx_cpu, args.tx_otw)
st_args.channels = tx_channels
+ st_args.args = uhd.types.DeviceAddr(args.tx_stream_args)
tx_streamer = usrp.get_tx_stream(st_args)
tx_thread = threading.Thread(target=benchmark_tx_rate,
args=(usrp, tx_streamer, args.random, quit_event,