aboutsummaryrefslogtreecommitdiffstats
path: root/host
diff options
context:
space:
mode:
authorMichael West <michael.west@ettus.com>2020-03-23 16:52:32 -0700
committerAaron Rossetto <aaron.rossetto@ni.com>2020-04-30 15:14:28 -0500
commit022cfa3d80ddac3589ff01ff36a231760190a418 (patch)
treeeee49aadbeafe17149c72aa11f254b6c34302336 /host
parent8d5bcddd0d90074a140c9b8ffa88c63a1a58a057 (diff)
downloaduhd-022cfa3d80ddac3589ff01ff36a231760190a418.tar.gz
uhd-022cfa3d80ddac3589ff01ff36a231760190a418.tar.bz2
uhd-022cfa3d80ddac3589ff01ff36a231760190a418.zip
devtest: Add support for TwinRX to x3x0
Adding necessary code to examine number of TX and RX channels and adjust test cases accordingly. Signed-off-by: Michael West <michael.west@ettus.com>
Diffstat (limited to 'host')
-rwxr-xr-xhost/tests/devtest/devtest_x3x0.py144
1 files changed, 92 insertions, 52 deletions
diff --git a/host/tests/devtest/devtest_x3x0.py b/host/tests/devtest/devtest_x3x0.py
index d7390f8f2..ce522206c 100755
--- a/host/tests/devtest/devtest_x3x0.py
+++ b/host/tests/devtest/devtest_x3x0.py
@@ -10,63 +10,103 @@ Run device tests for the X3x0 series.
# pylint: disable=wrong-import-position
# pylint: disable=unused-import
+
+import os
+from usrp_probe import get_num_chans
+num_chans = get_num_chans(os.getenv('_UHD_TEST_ARGS_STR', ""))
+tx_chans = num_chans['tx']
+rx_chans = num_chans['rx']
+
from benchmark_rate_test import uhd_benchmark_rate_test
-uhd_benchmark_rate_test.tests = {
- 'mimo_slow': {
- 'duration': 1,
- 'direction': 'tx,rx',
- 'chan': '0,1',
- 'rate': 1e6,
- 'acceptable-underruns': 500,
- 'tx_buffer': (0.1*1e6)+32e6*8*1/32, # 32 MB DRAM for each channel (32 bit OTW format),
- 'rx_buffer': 0.1*1e6,
- },
- 'mimo_fast': {
- 'duration': 1,
- 'direction': 'tx,rx',
- 'chan': '0,1',
- 'rate': 12.5e6,
- 'acceptable-underruns': 500,
- 'tx_buffer': (0.1*12.5e6)+32e6*8*1/32, # 32 MB DRAM for each channel (32 bit OTW format),
- 'rx_buffer': 0.1*12.5e6,
- },
- 'siso_chan0_slow': {
- 'duration': 1,
- 'direction': 'tx,rx',
- 'chan': '0',
- 'rate': 1e6,
- 'acceptable-underruns': 10,
- 'tx_buffer': (0.1*1e6)+32e6*8*1/32, # 32 MB DRAM for each channel (32 bit OTW format),
- 'rx_buffer': 0.1*1e6,
- },
- 'siso_chan1_slow': {
- 'duration': 1,
- 'direction': 'tx,rx',
- 'chan': '1',
- 'rate': 1e6,
- 'acceptable-underruns': 10,
- 'tx_buffer': (0.1*1e6)+32e6*8*1/32, # 32 MB DRAM for each channel (32 bit OTW format),
- 'rx_buffer': 0.1*1e6,
- },
-}
+uhd_benchmark_rate_test.tests = {}
+for (rate, speed) in [(1e6, 'slow'), (12.5e6, 'fast')]:
+ for chan in range(tx_chans):
+ uhd_benchmark_rate_test.tests.update({
+ 'tx_chan{}_{}'.format(chan, speed): {
+ 'duration': 1,
+ 'direction': 'tx',
+ 'chan': str(chan),
+ 'rate': rate,
+ 'acceptable-underruns': 10,
+ 'tx_buffer': (0.1*1e6)+32e6*8*1/32, # 32 MB DRAM for each channel (32 bit OTW format),
+ }
+ })
+ for chan in range(rx_chans):
+ uhd_benchmark_rate_test.tests.update({
+ 'rx_chan{}_{}'.format(chan, speed): {
+ 'duration': 1,
+ 'direction': 'rx',
+ 'chan': str(chan),
+ 'rate': rate,
+ 'rx_buffer': 0.1*1e6,
+ }
+ })
+ if tx_chans > 0:
+ all_chans_str = ",".join([str(chan) for chan in range(tx_chans)])
+ uhd_benchmark_rate_test.tests.update({
+ 'all_tx_chans_{}'.format(speed): {
+ 'duration': 1,
+ 'direction': 'tx',
+ 'chan': all_chans_str,
+ 'rate': rate,
+ 'acceptable-underruns': 10,
+ 'tx_buffer': (0.1*1e6)+32e6*8*1/32, # 32 MB DRAM for each channel (32 bit OTW format),
+ }
+ })
+ if rx_chans > 0:
+ all_chans_str = ",".join([str(chan) for chan in range(rx_chans)])
+ uhd_benchmark_rate_test.tests.update({
+ 'all_rx_chans_{}'.format(speed): {
+ 'duration': 1,
+ 'direction': 'rx',
+ 'chan': all_chans_str,
+ 'rate': rate,
+ 'rx_buffer': 0.1*1e6,
+ }
+ })
+ if tx_chans == rx_chans:
+ for chan in range(tx_chans):
+ uhd_benchmark_rate_test.tests.update({
+ 'siso_chan{}_{}'.format(chan, speed): {
+ 'duration': 1,
+ 'direction': 'tx,rx',
+ 'chan': str(chan),
+ 'rate': rate,
+ 'acceptable-underruns': 10,
+ 'tx_buffer': (0.1*1e6)+32e6*8*1/32, # 32 MB DRAM for each channel (32 bit OTW format),
+ 'rx_buffer': 0.1*1e6,
+ }
+ })
+ all_chans_str = ",".join([str(chan) for chan in range(tx_chans)])
+ uhd_benchmark_rate_test.tests.update({
+ 'mimo_{}'.format(speed): {
+ 'duration': 1,
+ 'direction': 'tx,rx',
+ 'chan': all_chans_str,
+ 'rate': rate,
+ 'acceptable-underruns': 500,
+ 'tx_buffer': (0.1*1e6)+32e6*8*1/32, # 32 MB DRAM for each channel (32 bit OTW format),
+ 'rx_buffer': 0.1*1e6,
+ }
+ })
-from tx_waveforms_test import uhd_tx_waveforms_test
-uhd_tx_waveforms_test.tests = {
- 'chan0': {
- 'chan': '0',
- },
- 'chan1': {
- 'chan': '0',
- },
- 'both_chans': {
- 'chan': '0,1',
- },
-}
+if (tx_chans > 0):
+ from tx_waveforms_test import uhd_tx_waveforms_test
+ uhd_tx_waveforms_test.tests = {}
+ all_chans = []
+ for i in range(tx_chans):
+ all_chans.append(str(i))
+ test_name = 'chan{}'.format(i)
+ uhd_tx_waveforms_test.tests.update({test_name : {'chan': i}})
+ if (tx_chans > 1):
+ uhd_tx_waveforms_test.tests.update({'all_chans': {'chan': ",".join(all_chans)}})
+ from tx_bursts_test import uhd_tx_bursts_test
-from rx_samples_to_file_test import rx_samples_to_file_test
-from tx_bursts_test import uhd_tx_bursts_test
+if (rx_chans > 0):
+ from rx_samples_to_file_test import rx_samples_to_file_test
from test_pps_test import uhd_test_pps_test
from gpio_test import gpio_test
from bitbang_test import bitbang_test
from list_sensors_test import list_sensors_test
from test_messages_test import test_messages_test
+