Add ADRV9025 to index #2517
79 fail, 1 282 skipped, 296 pass in 15m 21s
Annotations
Check warning on line 0 in test.test_adrv9025_p
github-actions / Test Results
test_adrv9025_attr[trx_lo-70000000-6000000000-1000-0-adi.adrv9025] (test.test_adrv9025_p) failed
results.xml [took 0s]
Raw output
AttributeError: trx_lo not defined in adi.adrv9025
test_attribute_single_value = <function attribute_single_value at 0x7f5e9d612b80>
iio_uri = 'ip:10.1.0.143', classname = 'adi.adrv9025', attr = 'trx_lo'
start = 70000000, stop = 6000000000, step = 1000, tol = 0
@pytest.mark.iio_hardware(hardware)
@pytest.mark.parametrize("classname", [(classname)])
@pytest.mark.parametrize(
"attr, start, stop, step, tol",
[
("tx_hardwaregain_chan0", -41.95, 0.0, 0.05, 0.05),
("tx_hardwaregain_chan1", -41.95, 0.0, 0.05, 0.05),
("trx_lo", 70000000, 6000000000, 1000, 0),
],
)
def test_adrv9025_attr(
test_attribute_single_value, iio_uri, classname, attr, start, stop, step, tol
):
> test_attribute_single_value(iio_uri, classname, attr, start, stop, step, tol)
test/test_adrv9025_p.py:363:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
test/attr_tests.py:69: in attribute_single_value
assert dev_interface(uri, classname, val, attr, tol)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
uri = 'ip:10.1.0.143', classname = 'adi.adrv9025', val = 2250255000
attr = 'trx_lo', tol = 0, sub_channel = None, sleep = 0, readonly = False
def dev_interface(
uri, classname, val, attr, tol, sub_channel=None, sleep=0, readonly=False
):
sdr = eval(classname + "(uri='" + uri + "')")
# Check hardware
if not hasattr(sdr, attr):
> raise AttributeError(attr + " not defined in " + classname)
E AttributeError: trx_lo not defined in adi.adrv9025
test/common.py:106: AttributeError
Check warning on line 0 in test.test_adrv9025_p
github-actions / Test Results
test_adrv9025_dds_loopback[param_set0-2000000-0.5--42-0-adi.adrv9025] (test.test_adrv9025_p) failed
results.xml [took 0s]
Raw output
assert (2000000 * 0.01) > 2000000.0
test_dds_loopback = <function dds_loopback at 0x7f5ea79e8af0>
iio_uri = 'ip:10.1.0.143', classname = 'adi.adrv9025'
param_set = {'calibrate': 1, 'calibrate_rx_qec_en': 1, 'calibrate_tx_qec_en': 1, 'gain_control_mode_chan0': 'manual', ...}
channel = 0, frequency = 2000000, scale = 0.5, peak_min = -42
@pytest.mark.iio_hardware(hardware)
@pytest.mark.parametrize("classname", [(classname)])
@pytest.mark.parametrize("channel", [0, 1])
@pytest.mark.parametrize(
"param_set, frequency, scale, peak_min",
[
(params["one_cw_tone_manual"], 2000000, 0.5, -42),
(params["one_cw_tone_manual"], 2000000, 0.12, -55),
(params["one_cw_tone_manual"], 2000000, 0.25, -48),
(params["one_cw_tone_slow_attack"], 1000000, 0.12, -44),
(params["one_cw_tone_slow_attack"], 2000000, 0.12, -44),
(params["one_cw_tone_slow_attack"], 500000, 0.12, -44),
(params["change_attenuation_5dB_manual"], 2000000, 0.25, -53),
(params["change_attenuation_10dB_manual"], 2000000, 0.25, -58),
(params["change_attenuation_0dB_slow_attack"], 1000000, 0.12, -35),
(params["change_attenuation_20dB_slow_attack"], 1000000, 0.12, -54),
(params["change_rf_gain_0dB_manual"], 2000000, 0.25, -59),
(params["change_rf_gain_20dB_manual"], 2000000, 0.25, -38),
],
)
def test_adrv9025_dds_loopback(
test_dds_loopback,
iio_uri,
classname,
param_set,
channel,
frequency,
scale,
peak_min,
):
> test_dds_loopback(
iio_uri, classname, param_set, channel, frequency, scale, peak_min
)
test/test_adrv9025_p.py:405:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
uri = 'ip:10.1.0.143', classname = 'adi.adrv9025'
param_set = {'calibrate': 1, 'calibrate_rx_qec_en': 1, 'calibrate_tx_qec_en': 1, 'gain_control_mode_chan0': 'manual', ...}
channel = 0, frequency = 2000000, scale = 0.5, peak_min = -42, use_obs = False
use_rx2 = False
def dds_loopback(
uri,
classname,
param_set,
channel,
frequency,
scale,
peak_min,
use_obs=False,
use_rx2=False,
):
"""dds_loopback: Test DDS loopback with connected loopback cables.
This test requires a devices with TX and RX onboard where the transmit
signal can be recovered. TX FPGA DDSs are used to generate a sinusoid
which is then estimated on the RX side. The receive tone must be within
1% of its expected frequency with a specified peak
parameters:
uri: type=string
URI of IIO context of target board/system
classname: type=string
Name of pyadi interface class which contain attribute
param_set: type=dict
Dictionary of attribute and values to be set before tone is
generated and received
channel: type=list
List of integers or list of list of integers of channels to
enable through tx_enabled_channels
frequency: type=integer
Frequency in Hz of transmitted tone
scale: type=float
Scale of DDS tone. Range [0,1]
peak_min: type=float
Minimum acceptable value of maximum peak in dBFS of received tone
"""
# See if we can tone using DMAs
sdr = eval(classname + "(uri='" + uri + "')")
# Set custom device parameters
for p in param_set.keys():
setattr(sdr, p, param_set[p])
# Set common buffer settings
sdr.tx_cyclic_buffer = True
N = 2 ** 14
if use_obs and use_rx2:
raise Exception("Both RX2 and OBS are selected. Select one at a time.")
if use_rx2:
sdr.rx2_enabled_channels = [channel]
sdr.rx2_buffer_size = N * 2 * len(sdr.rx2_enabled_channels)
elif use_obs:
sdr.obs.rx_enabled_channels = [0]
sdr.obs.rx_buffer_size = N * 2 * len(sdr.obs.rx_enabled_channels)
else:
sdr.rx_enabled_channels = [channel]
sdr.rx_buffer_size = N * 2 * len(sdr.rx_enabled_channels)
# Create a sinewave waveform
if hasattr(sdr, "sample_rate"):
RXFS = int(sdr.sample_rate)
else:
RXFS = int(sdr.orx_sample_rate) if use_obs else int(sdr.rx_sample_rate)
sdr.dds_single_tone(frequency, scale, channel)
# Pass through SDR
try:
for _ in range(10): # Wait
data = sdr.rx2() if use_rx2 else sdr.obs.rx() if use_obs else sdr.rx()
except Exception as e:
del sdr
raise Exception(e)
del sdr
tone_peaks, tone_freqs = spec.spec_est(data, fs=RXFS, ref=2 ** 15, plot=False)
indx = np.argmax(tone_peaks)
diff = np.abs(tone_freqs[indx] - frequency)
s = "Peak: " + str(tone_peaks[indx]) + "@" + str(tone_freqs[indx])
print(s)
if do_html_log:
pytest.data_log = {
"html": gen_line_plot_html(
tone_freqs,
tone_peaks,
"Frequency (Hz)",
"Amplitude (dBFS)",
"{} ({})".format(s, classname),
)
}
> assert (frequency * 0.01) > diff
E assert (2000000 * 0.01) > 2000000.0
test/dma_tests.py:340: AssertionError
Check warning on line 0 in test.test_adrv9025_p
github-actions / Test Results
test_adrv9025_dds_loopback[param_set0-2000000-0.5--42-1-adi.adrv9025] (test.test_adrv9025_p) failed
results.xml [took 0s]
Raw output
assert (2000000 * 0.01) > 2000000.0
test_dds_loopback = <function dds_loopback at 0x7f5ea79e8af0>
iio_uri = 'ip:10.1.0.143', classname = 'adi.adrv9025'
param_set = {'calibrate': 1, 'calibrate_rx_qec_en': 1, 'calibrate_tx_qec_en': 1, 'gain_control_mode_chan0': 'manual', ...}
channel = 1, frequency = 2000000, scale = 0.5, peak_min = -42
@pytest.mark.iio_hardware(hardware)
@pytest.mark.parametrize("classname", [(classname)])
@pytest.mark.parametrize("channel", [0, 1])
@pytest.mark.parametrize(
"param_set, frequency, scale, peak_min",
[
(params["one_cw_tone_manual"], 2000000, 0.5, -42),
(params["one_cw_tone_manual"], 2000000, 0.12, -55),
(params["one_cw_tone_manual"], 2000000, 0.25, -48),
(params["one_cw_tone_slow_attack"], 1000000, 0.12, -44),
(params["one_cw_tone_slow_attack"], 2000000, 0.12, -44),
(params["one_cw_tone_slow_attack"], 500000, 0.12, -44),
(params["change_attenuation_5dB_manual"], 2000000, 0.25, -53),
(params["change_attenuation_10dB_manual"], 2000000, 0.25, -58),
(params["change_attenuation_0dB_slow_attack"], 1000000, 0.12, -35),
(params["change_attenuation_20dB_slow_attack"], 1000000, 0.12, -54),
(params["change_rf_gain_0dB_manual"], 2000000, 0.25, -59),
(params["change_rf_gain_20dB_manual"], 2000000, 0.25, -38),
],
)
def test_adrv9025_dds_loopback(
test_dds_loopback,
iio_uri,
classname,
param_set,
channel,
frequency,
scale,
peak_min,
):
> test_dds_loopback(
iio_uri, classname, param_set, channel, frequency, scale, peak_min
)
test/test_adrv9025_p.py:405:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
uri = 'ip:10.1.0.143', classname = 'adi.adrv9025'
param_set = {'calibrate': 1, 'calibrate_rx_qec_en': 1, 'calibrate_tx_qec_en': 1, 'gain_control_mode_chan0': 'manual', ...}
channel = 1, frequency = 2000000, scale = 0.5, peak_min = -42, use_obs = False
use_rx2 = False
def dds_loopback(
uri,
classname,
param_set,
channel,
frequency,
scale,
peak_min,
use_obs=False,
use_rx2=False,
):
"""dds_loopback: Test DDS loopback with connected loopback cables.
This test requires a devices with TX and RX onboard where the transmit
signal can be recovered. TX FPGA DDSs are used to generate a sinusoid
which is then estimated on the RX side. The receive tone must be within
1% of its expected frequency with a specified peak
parameters:
uri: type=string
URI of IIO context of target board/system
classname: type=string
Name of pyadi interface class which contain attribute
param_set: type=dict
Dictionary of attribute and values to be set before tone is
generated and received
channel: type=list
List of integers or list of list of integers of channels to
enable through tx_enabled_channels
frequency: type=integer
Frequency in Hz of transmitted tone
scale: type=float
Scale of DDS tone. Range [0,1]
peak_min: type=float
Minimum acceptable value of maximum peak in dBFS of received tone
"""
# See if we can tone using DMAs
sdr = eval(classname + "(uri='" + uri + "')")
# Set custom device parameters
for p in param_set.keys():
setattr(sdr, p, param_set[p])
# Set common buffer settings
sdr.tx_cyclic_buffer = True
N = 2 ** 14
if use_obs and use_rx2:
raise Exception("Both RX2 and OBS are selected. Select one at a time.")
if use_rx2:
sdr.rx2_enabled_channels = [channel]
sdr.rx2_buffer_size = N * 2 * len(sdr.rx2_enabled_channels)
elif use_obs:
sdr.obs.rx_enabled_channels = [0]
sdr.obs.rx_buffer_size = N * 2 * len(sdr.obs.rx_enabled_channels)
else:
sdr.rx_enabled_channels = [channel]
sdr.rx_buffer_size = N * 2 * len(sdr.rx_enabled_channels)
# Create a sinewave waveform
if hasattr(sdr, "sample_rate"):
RXFS = int(sdr.sample_rate)
else:
RXFS = int(sdr.orx_sample_rate) if use_obs else int(sdr.rx_sample_rate)
sdr.dds_single_tone(frequency, scale, channel)
# Pass through SDR
try:
for _ in range(10): # Wait
data = sdr.rx2() if use_rx2 else sdr.obs.rx() if use_obs else sdr.rx()
except Exception as e:
del sdr
raise Exception(e)
del sdr
tone_peaks, tone_freqs = spec.spec_est(data, fs=RXFS, ref=2 ** 15, plot=False)
indx = np.argmax(tone_peaks)
diff = np.abs(tone_freqs[indx] - frequency)
s = "Peak: " + str(tone_peaks[indx]) + "@" + str(tone_freqs[indx])
print(s)
if do_html_log:
pytest.data_log = {
"html": gen_line_plot_html(
tone_freqs,
tone_peaks,
"Frequency (Hz)",
"Amplitude (dBFS)",
"{} ({})".format(s, classname),
)
}
> assert (frequency * 0.01) > diff
E assert (2000000 * 0.01) > 2000000.0
test/dma_tests.py:340: AssertionError
Check warning on line 0 in test.test_adrv9025_p
github-actions / Test Results
test_adrv9025_dds_loopback[param_set1-2000000-0.12--55-0-adi.adrv9025] (test.test_adrv9025_p) failed
results.xml [took 0s]
Raw output
assert (2000000 * 0.01) > 2000000.0
test_dds_loopback = <function dds_loopback at 0x7f5ea79e8af0>
iio_uri = 'ip:10.1.0.143', classname = 'adi.adrv9025'
param_set = {'calibrate': 1, 'calibrate_rx_qec_en': 1, 'calibrate_tx_qec_en': 1, 'gain_control_mode_chan0': 'manual', ...}
channel = 0, frequency = 2000000, scale = 0.12, peak_min = -55
@pytest.mark.iio_hardware(hardware)
@pytest.mark.parametrize("classname", [(classname)])
@pytest.mark.parametrize("channel", [0, 1])
@pytest.mark.parametrize(
"param_set, frequency, scale, peak_min",
[
(params["one_cw_tone_manual"], 2000000, 0.5, -42),
(params["one_cw_tone_manual"], 2000000, 0.12, -55),
(params["one_cw_tone_manual"], 2000000, 0.25, -48),
(params["one_cw_tone_slow_attack"], 1000000, 0.12, -44),
(params["one_cw_tone_slow_attack"], 2000000, 0.12, -44),
(params["one_cw_tone_slow_attack"], 500000, 0.12, -44),
(params["change_attenuation_5dB_manual"], 2000000, 0.25, -53),
(params["change_attenuation_10dB_manual"], 2000000, 0.25, -58),
(params["change_attenuation_0dB_slow_attack"], 1000000, 0.12, -35),
(params["change_attenuation_20dB_slow_attack"], 1000000, 0.12, -54),
(params["change_rf_gain_0dB_manual"], 2000000, 0.25, -59),
(params["change_rf_gain_20dB_manual"], 2000000, 0.25, -38),
],
)
def test_adrv9025_dds_loopback(
test_dds_loopback,
iio_uri,
classname,
param_set,
channel,
frequency,
scale,
peak_min,
):
> test_dds_loopback(
iio_uri, classname, param_set, channel, frequency, scale, peak_min
)
test/test_adrv9025_p.py:405:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
uri = 'ip:10.1.0.143', classname = 'adi.adrv9025'
param_set = {'calibrate': 1, 'calibrate_rx_qec_en': 1, 'calibrate_tx_qec_en': 1, 'gain_control_mode_chan0': 'manual', ...}
channel = 0, frequency = 2000000, scale = 0.12, peak_min = -55, use_obs = False
use_rx2 = False
def dds_loopback(
uri,
classname,
param_set,
channel,
frequency,
scale,
peak_min,
use_obs=False,
use_rx2=False,
):
"""dds_loopback: Test DDS loopback with connected loopback cables.
This test requires a devices with TX and RX onboard where the transmit
signal can be recovered. TX FPGA DDSs are used to generate a sinusoid
which is then estimated on the RX side. The receive tone must be within
1% of its expected frequency with a specified peak
parameters:
uri: type=string
URI of IIO context of target board/system
classname: type=string
Name of pyadi interface class which contain attribute
param_set: type=dict
Dictionary of attribute and values to be set before tone is
generated and received
channel: type=list
List of integers or list of list of integers of channels to
enable through tx_enabled_channels
frequency: type=integer
Frequency in Hz of transmitted tone
scale: type=float
Scale of DDS tone. Range [0,1]
peak_min: type=float
Minimum acceptable value of maximum peak in dBFS of received tone
"""
# See if we can tone using DMAs
sdr = eval(classname + "(uri='" + uri + "')")
# Set custom device parameters
for p in param_set.keys():
setattr(sdr, p, param_set[p])
# Set common buffer settings
sdr.tx_cyclic_buffer = True
N = 2 ** 14
if use_obs and use_rx2:
raise Exception("Both RX2 and OBS are selected. Select one at a time.")
if use_rx2:
sdr.rx2_enabled_channels = [channel]
sdr.rx2_buffer_size = N * 2 * len(sdr.rx2_enabled_channels)
elif use_obs:
sdr.obs.rx_enabled_channels = [0]
sdr.obs.rx_buffer_size = N * 2 * len(sdr.obs.rx_enabled_channels)
else:
sdr.rx_enabled_channels = [channel]
sdr.rx_buffer_size = N * 2 * len(sdr.rx_enabled_channels)
# Create a sinewave waveform
if hasattr(sdr, "sample_rate"):
RXFS = int(sdr.sample_rate)
else:
RXFS = int(sdr.orx_sample_rate) if use_obs else int(sdr.rx_sample_rate)
sdr.dds_single_tone(frequency, scale, channel)
# Pass through SDR
try:
for _ in range(10): # Wait
data = sdr.rx2() if use_rx2 else sdr.obs.rx() if use_obs else sdr.rx()
except Exception as e:
del sdr
raise Exception(e)
del sdr
tone_peaks, tone_freqs = spec.spec_est(data, fs=RXFS, ref=2 ** 15, plot=False)
indx = np.argmax(tone_peaks)
diff = np.abs(tone_freqs[indx] - frequency)
s = "Peak: " + str(tone_peaks[indx]) + "@" + str(tone_freqs[indx])
print(s)
if do_html_log:
pytest.data_log = {
"html": gen_line_plot_html(
tone_freqs,
tone_peaks,
"Frequency (Hz)",
"Amplitude (dBFS)",
"{} ({})".format(s, classname),
)
}
> assert (frequency * 0.01) > diff
E assert (2000000 * 0.01) > 2000000.0
test/dma_tests.py:340: AssertionError
Check warning on line 0 in test.test_adrv9025_p
github-actions / Test Results
test_adrv9025_dds_loopback[param_set1-2000000-0.12--55-1-adi.adrv9025] (test.test_adrv9025_p) failed
results.xml [took 0s]
Raw output
assert (2000000 * 0.01) > 2000000.0
test_dds_loopback = <function dds_loopback at 0x7f5ea79e8af0>
iio_uri = 'ip:10.1.0.143', classname = 'adi.adrv9025'
param_set = {'calibrate': 1, 'calibrate_rx_qec_en': 1, 'calibrate_tx_qec_en': 1, 'gain_control_mode_chan0': 'manual', ...}
channel = 1, frequency = 2000000, scale = 0.12, peak_min = -55
@pytest.mark.iio_hardware(hardware)
@pytest.mark.parametrize("classname", [(classname)])
@pytest.mark.parametrize("channel", [0, 1])
@pytest.mark.parametrize(
"param_set, frequency, scale, peak_min",
[
(params["one_cw_tone_manual"], 2000000, 0.5, -42),
(params["one_cw_tone_manual"], 2000000, 0.12, -55),
(params["one_cw_tone_manual"], 2000000, 0.25, -48),
(params["one_cw_tone_slow_attack"], 1000000, 0.12, -44),
(params["one_cw_tone_slow_attack"], 2000000, 0.12, -44),
(params["one_cw_tone_slow_attack"], 500000, 0.12, -44),
(params["change_attenuation_5dB_manual"], 2000000, 0.25, -53),
(params["change_attenuation_10dB_manual"], 2000000, 0.25, -58),
(params["change_attenuation_0dB_slow_attack"], 1000000, 0.12, -35),
(params["change_attenuation_20dB_slow_attack"], 1000000, 0.12, -54),
(params["change_rf_gain_0dB_manual"], 2000000, 0.25, -59),
(params["change_rf_gain_20dB_manual"], 2000000, 0.25, -38),
],
)
def test_adrv9025_dds_loopback(
test_dds_loopback,
iio_uri,
classname,
param_set,
channel,
frequency,
scale,
peak_min,
):
> test_dds_loopback(
iio_uri, classname, param_set, channel, frequency, scale, peak_min
)
test/test_adrv9025_p.py:405:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
uri = 'ip:10.1.0.143', classname = 'adi.adrv9025'
param_set = {'calibrate': 1, 'calibrate_rx_qec_en': 1, 'calibrate_tx_qec_en': 1, 'gain_control_mode_chan0': 'manual', ...}
channel = 1, frequency = 2000000, scale = 0.12, peak_min = -55, use_obs = False
use_rx2 = False
def dds_loopback(
uri,
classname,
param_set,
channel,
frequency,
scale,
peak_min,
use_obs=False,
use_rx2=False,
):
"""dds_loopback: Test DDS loopback with connected loopback cables.
This test requires a devices with TX and RX onboard where the transmit
signal can be recovered. TX FPGA DDSs are used to generate a sinusoid
which is then estimated on the RX side. The receive tone must be within
1% of its expected frequency with a specified peak
parameters:
uri: type=string
URI of IIO context of target board/system
classname: type=string
Name of pyadi interface class which contain attribute
param_set: type=dict
Dictionary of attribute and values to be set before tone is
generated and received
channel: type=list
List of integers or list of list of integers of channels to
enable through tx_enabled_channels
frequency: type=integer
Frequency in Hz of transmitted tone
scale: type=float
Scale of DDS tone. Range [0,1]
peak_min: type=float
Minimum acceptable value of maximum peak in dBFS of received tone
"""
# See if we can tone using DMAs
sdr = eval(classname + "(uri='" + uri + "')")
# Set custom device parameters
for p in param_set.keys():
setattr(sdr, p, param_set[p])
# Set common buffer settings
sdr.tx_cyclic_buffer = True
N = 2 ** 14
if use_obs and use_rx2:
raise Exception("Both RX2 and OBS are selected. Select one at a time.")
if use_rx2:
sdr.rx2_enabled_channels = [channel]
sdr.rx2_buffer_size = N * 2 * len(sdr.rx2_enabled_channels)
elif use_obs:
sdr.obs.rx_enabled_channels = [0]
sdr.obs.rx_buffer_size = N * 2 * len(sdr.obs.rx_enabled_channels)
else:
sdr.rx_enabled_channels = [channel]
sdr.rx_buffer_size = N * 2 * len(sdr.rx_enabled_channels)
# Create a sinewave waveform
if hasattr(sdr, "sample_rate"):
RXFS = int(sdr.sample_rate)
else:
RXFS = int(sdr.orx_sample_rate) if use_obs else int(sdr.rx_sample_rate)
sdr.dds_single_tone(frequency, scale, channel)
# Pass through SDR
try:
for _ in range(10): # Wait
data = sdr.rx2() if use_rx2 else sdr.obs.rx() if use_obs else sdr.rx()
except Exception as e:
del sdr
raise Exception(e)
del sdr
tone_peaks, tone_freqs = spec.spec_est(data, fs=RXFS, ref=2 ** 15, plot=False)
indx = np.argmax(tone_peaks)
diff = np.abs(tone_freqs[indx] - frequency)
s = "Peak: " + str(tone_peaks[indx]) + "@" + str(tone_freqs[indx])
print(s)
if do_html_log:
pytest.data_log = {
"html": gen_line_plot_html(
tone_freqs,
tone_peaks,
"Frequency (Hz)",
"Amplitude (dBFS)",
"{} ({})".format(s, classname),
)
}
> assert (frequency * 0.01) > diff
E assert (2000000 * 0.01) > 2000000.0
test/dma_tests.py:340: AssertionError
Check warning on line 0 in test.test_adrv9025_p
github-actions / Test Results
test_adrv9025_dds_loopback[param_set2-2000000-0.25--48-0-adi.adrv9025] (test.test_adrv9025_p) failed
results.xml [took 0s]
Raw output
assert (2000000 * 0.01) > 2000000.0
test_dds_loopback = <function dds_loopback at 0x7f5ea79e8af0>
iio_uri = 'ip:10.1.0.143', classname = 'adi.adrv9025'
param_set = {'calibrate': 1, 'calibrate_rx_qec_en': 1, 'calibrate_tx_qec_en': 1, 'gain_control_mode_chan0': 'manual', ...}
channel = 0, frequency = 2000000, scale = 0.25, peak_min = -48
@pytest.mark.iio_hardware(hardware)
@pytest.mark.parametrize("classname", [(classname)])
@pytest.mark.parametrize("channel", [0, 1])
@pytest.mark.parametrize(
"param_set, frequency, scale, peak_min",
[
(params["one_cw_tone_manual"], 2000000, 0.5, -42),
(params["one_cw_tone_manual"], 2000000, 0.12, -55),
(params["one_cw_tone_manual"], 2000000, 0.25, -48),
(params["one_cw_tone_slow_attack"], 1000000, 0.12, -44),
(params["one_cw_tone_slow_attack"], 2000000, 0.12, -44),
(params["one_cw_tone_slow_attack"], 500000, 0.12, -44),
(params["change_attenuation_5dB_manual"], 2000000, 0.25, -53),
(params["change_attenuation_10dB_manual"], 2000000, 0.25, -58),
(params["change_attenuation_0dB_slow_attack"], 1000000, 0.12, -35),
(params["change_attenuation_20dB_slow_attack"], 1000000, 0.12, -54),
(params["change_rf_gain_0dB_manual"], 2000000, 0.25, -59),
(params["change_rf_gain_20dB_manual"], 2000000, 0.25, -38),
],
)
def test_adrv9025_dds_loopback(
test_dds_loopback,
iio_uri,
classname,
param_set,
channel,
frequency,
scale,
peak_min,
):
> test_dds_loopback(
iio_uri, classname, param_set, channel, frequency, scale, peak_min
)
test/test_adrv9025_p.py:405:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
uri = 'ip:10.1.0.143', classname = 'adi.adrv9025'
param_set = {'calibrate': 1, 'calibrate_rx_qec_en': 1, 'calibrate_tx_qec_en': 1, 'gain_control_mode_chan0': 'manual', ...}
channel = 0, frequency = 2000000, scale = 0.25, peak_min = -48, use_obs = False
use_rx2 = False
def dds_loopback(
uri,
classname,
param_set,
channel,
frequency,
scale,
peak_min,
use_obs=False,
use_rx2=False,
):
"""dds_loopback: Test DDS loopback with connected loopback cables.
This test requires a devices with TX and RX onboard where the transmit
signal can be recovered. TX FPGA DDSs are used to generate a sinusoid
which is then estimated on the RX side. The receive tone must be within
1% of its expected frequency with a specified peak
parameters:
uri: type=string
URI of IIO context of target board/system
classname: type=string
Name of pyadi interface class which contain attribute
param_set: type=dict
Dictionary of attribute and values to be set before tone is
generated and received
channel: type=list
List of integers or list of list of integers of channels to
enable through tx_enabled_channels
frequency: type=integer
Frequency in Hz of transmitted tone
scale: type=float
Scale of DDS tone. Range [0,1]
peak_min: type=float
Minimum acceptable value of maximum peak in dBFS of received tone
"""
# See if we can tone using DMAs
sdr = eval(classname + "(uri='" + uri + "')")
# Set custom device parameters
for p in param_set.keys():
setattr(sdr, p, param_set[p])
# Set common buffer settings
sdr.tx_cyclic_buffer = True
N = 2 ** 14
if use_obs and use_rx2:
raise Exception("Both RX2 and OBS are selected. Select one at a time.")
if use_rx2:
sdr.rx2_enabled_channels = [channel]
sdr.rx2_buffer_size = N * 2 * len(sdr.rx2_enabled_channels)
elif use_obs:
sdr.obs.rx_enabled_channels = [0]
sdr.obs.rx_buffer_size = N * 2 * len(sdr.obs.rx_enabled_channels)
else:
sdr.rx_enabled_channels = [channel]
sdr.rx_buffer_size = N * 2 * len(sdr.rx_enabled_channels)
# Create a sinewave waveform
if hasattr(sdr, "sample_rate"):
RXFS = int(sdr.sample_rate)
else:
RXFS = int(sdr.orx_sample_rate) if use_obs else int(sdr.rx_sample_rate)
sdr.dds_single_tone(frequency, scale, channel)
# Pass through SDR
try:
for _ in range(10): # Wait
data = sdr.rx2() if use_rx2 else sdr.obs.rx() if use_obs else sdr.rx()
except Exception as e:
del sdr
raise Exception(e)
del sdr
tone_peaks, tone_freqs = spec.spec_est(data, fs=RXFS, ref=2 ** 15, plot=False)
indx = np.argmax(tone_peaks)
diff = np.abs(tone_freqs[indx] - frequency)
s = "Peak: " + str(tone_peaks[indx]) + "@" + str(tone_freqs[indx])
print(s)
if do_html_log:
pytest.data_log = {
"html": gen_line_plot_html(
tone_freqs,
tone_peaks,
"Frequency (Hz)",
"Amplitude (dBFS)",
"{} ({})".format(s, classname),
)
}
> assert (frequency * 0.01) > diff
E assert (2000000 * 0.01) > 2000000.0
test/dma_tests.py:340: AssertionError
Check warning on line 0 in test.test_adrv9025_p
github-actions / Test Results
test_adrv9025_dds_loopback[param_set2-2000000-0.25--48-1-adi.adrv9025] (test.test_adrv9025_p) failed
results.xml [took 0s]
Raw output
assert (2000000 * 0.01) > 2000000.0
test_dds_loopback = <function dds_loopback at 0x7f5ea79e8af0>
iio_uri = 'ip:10.1.0.143', classname = 'adi.adrv9025'
param_set = {'calibrate': 1, 'calibrate_rx_qec_en': 1, 'calibrate_tx_qec_en': 1, 'gain_control_mode_chan0': 'manual', ...}
channel = 1, frequency = 2000000, scale = 0.25, peak_min = -48
@pytest.mark.iio_hardware(hardware)
@pytest.mark.parametrize("classname", [(classname)])
@pytest.mark.parametrize("channel", [0, 1])
@pytest.mark.parametrize(
"param_set, frequency, scale, peak_min",
[
(params["one_cw_tone_manual"], 2000000, 0.5, -42),
(params["one_cw_tone_manual"], 2000000, 0.12, -55),
(params["one_cw_tone_manual"], 2000000, 0.25, -48),
(params["one_cw_tone_slow_attack"], 1000000, 0.12, -44),
(params["one_cw_tone_slow_attack"], 2000000, 0.12, -44),
(params["one_cw_tone_slow_attack"], 500000, 0.12, -44),
(params["change_attenuation_5dB_manual"], 2000000, 0.25, -53),
(params["change_attenuation_10dB_manual"], 2000000, 0.25, -58),
(params["change_attenuation_0dB_slow_attack"], 1000000, 0.12, -35),
(params["change_attenuation_20dB_slow_attack"], 1000000, 0.12, -54),
(params["change_rf_gain_0dB_manual"], 2000000, 0.25, -59),
(params["change_rf_gain_20dB_manual"], 2000000, 0.25, -38),
],
)
def test_adrv9025_dds_loopback(
test_dds_loopback,
iio_uri,
classname,
param_set,
channel,
frequency,
scale,
peak_min,
):
> test_dds_loopback(
iio_uri, classname, param_set, channel, frequency, scale, peak_min
)
test/test_adrv9025_p.py:405:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
uri = 'ip:10.1.0.143', classname = 'adi.adrv9025'
param_set = {'calibrate': 1, 'calibrate_rx_qec_en': 1, 'calibrate_tx_qec_en': 1, 'gain_control_mode_chan0': 'manual', ...}
channel = 1, frequency = 2000000, scale = 0.25, peak_min = -48, use_obs = False
use_rx2 = False
def dds_loopback(
uri,
classname,
param_set,
channel,
frequency,
scale,
peak_min,
use_obs=False,
use_rx2=False,
):
"""dds_loopback: Test DDS loopback with connected loopback cables.
This test requires a devices with TX and RX onboard where the transmit
signal can be recovered. TX FPGA DDSs are used to generate a sinusoid
which is then estimated on the RX side. The receive tone must be within
1% of its expected frequency with a specified peak
parameters:
uri: type=string
URI of IIO context of target board/system
classname: type=string
Name of pyadi interface class which contain attribute
param_set: type=dict
Dictionary of attribute and values to be set before tone is
generated and received
channel: type=list
List of integers or list of list of integers of channels to
enable through tx_enabled_channels
frequency: type=integer
Frequency in Hz of transmitted tone
scale: type=float
Scale of DDS tone. Range [0,1]
peak_min: type=float
Minimum acceptable value of maximum peak in dBFS of received tone
"""
# See if we can tone using DMAs
sdr = eval(classname + "(uri='" + uri + "')")
# Set custom device parameters
for p in param_set.keys():
setattr(sdr, p, param_set[p])
# Set common buffer settings
sdr.tx_cyclic_buffer = True
N = 2 ** 14
if use_obs and use_rx2:
raise Exception("Both RX2 and OBS are selected. Select one at a time.")
if use_rx2:
sdr.rx2_enabled_channels = [channel]
sdr.rx2_buffer_size = N * 2 * len(sdr.rx2_enabled_channels)
elif use_obs:
sdr.obs.rx_enabled_channels = [0]
sdr.obs.rx_buffer_size = N * 2 * len(sdr.obs.rx_enabled_channels)
else:
sdr.rx_enabled_channels = [channel]
sdr.rx_buffer_size = N * 2 * len(sdr.rx_enabled_channels)
# Create a sinewave waveform
if hasattr(sdr, "sample_rate"):
RXFS = int(sdr.sample_rate)
else:
RXFS = int(sdr.orx_sample_rate) if use_obs else int(sdr.rx_sample_rate)
sdr.dds_single_tone(frequency, scale, channel)
# Pass through SDR
try:
for _ in range(10): # Wait
data = sdr.rx2() if use_rx2 else sdr.obs.rx() if use_obs else sdr.rx()
except Exception as e:
del sdr
raise Exception(e)
del sdr
tone_peaks, tone_freqs = spec.spec_est(data, fs=RXFS, ref=2 ** 15, plot=False)
indx = np.argmax(tone_peaks)
diff = np.abs(tone_freqs[indx] - frequency)
s = "Peak: " + str(tone_peaks[indx]) + "@" + str(tone_freqs[indx])
print(s)
if do_html_log:
pytest.data_log = {
"html": gen_line_plot_html(
tone_freqs,
tone_peaks,
"Frequency (Hz)",
"Amplitude (dBFS)",
"{} ({})".format(s, classname),
)
}
> assert (frequency * 0.01) > diff
E assert (2000000 * 0.01) > 2000000.0
test/dma_tests.py:340: AssertionError
Check warning on line 0 in test.test_adrv9025_p
github-actions / Test Results
test_adrv9025_dds_loopback[param_set3-1000000-0.12--44-0-adi.adrv9025] (test.test_adrv9025_p) failed
results.xml [took 0s]
Raw output
assert (1000000 * 0.01) > 1000000.0
test_dds_loopback = <function dds_loopback at 0x7f5ea79e8af0>
iio_uri = 'ip:10.1.0.143', classname = 'adi.adrv9025'
param_set = {'calibrate': 1, 'calibrate_rx_qec_en': 1, 'calibrate_tx_qec_en': 1, 'ensm_mode': 'radio_on', ...}
channel = 0, frequency = 1000000, scale = 0.12, peak_min = -44
@pytest.mark.iio_hardware(hardware)
@pytest.mark.parametrize("classname", [(classname)])
@pytest.mark.parametrize("channel", [0, 1])
@pytest.mark.parametrize(
"param_set, frequency, scale, peak_min",
[
(params["one_cw_tone_manual"], 2000000, 0.5, -42),
(params["one_cw_tone_manual"], 2000000, 0.12, -55),
(params["one_cw_tone_manual"], 2000000, 0.25, -48),
(params["one_cw_tone_slow_attack"], 1000000, 0.12, -44),
(params["one_cw_tone_slow_attack"], 2000000, 0.12, -44),
(params["one_cw_tone_slow_attack"], 500000, 0.12, -44),
(params["change_attenuation_5dB_manual"], 2000000, 0.25, -53),
(params["change_attenuation_10dB_manual"], 2000000, 0.25, -58),
(params["change_attenuation_0dB_slow_attack"], 1000000, 0.12, -35),
(params["change_attenuation_20dB_slow_attack"], 1000000, 0.12, -54),
(params["change_rf_gain_0dB_manual"], 2000000, 0.25, -59),
(params["change_rf_gain_20dB_manual"], 2000000, 0.25, -38),
],
)
def test_adrv9025_dds_loopback(
test_dds_loopback,
iio_uri,
classname,
param_set,
channel,
frequency,
scale,
peak_min,
):
> test_dds_loopback(
iio_uri, classname, param_set, channel, frequency, scale, peak_min
)
test/test_adrv9025_p.py:405:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
uri = 'ip:10.1.0.143', classname = 'adi.adrv9025'
param_set = {'calibrate': 1, 'calibrate_rx_qec_en': 1, 'calibrate_tx_qec_en': 1, 'ensm_mode': 'radio_on', ...}
channel = 0, frequency = 1000000, scale = 0.12, peak_min = -44, use_obs = False
use_rx2 = False
def dds_loopback(
uri,
classname,
param_set,
channel,
frequency,
scale,
peak_min,
use_obs=False,
use_rx2=False,
):
"""dds_loopback: Test DDS loopback with connected loopback cables.
This test requires a devices with TX and RX onboard where the transmit
signal can be recovered. TX FPGA DDSs are used to generate a sinusoid
which is then estimated on the RX side. The receive tone must be within
1% of its expected frequency with a specified peak
parameters:
uri: type=string
URI of IIO context of target board/system
classname: type=string
Name of pyadi interface class which contain attribute
param_set: type=dict
Dictionary of attribute and values to be set before tone is
generated and received
channel: type=list
List of integers or list of list of integers of channels to
enable through tx_enabled_channels
frequency: type=integer
Frequency in Hz of transmitted tone
scale: type=float
Scale of DDS tone. Range [0,1]
peak_min: type=float
Minimum acceptable value of maximum peak in dBFS of received tone
"""
# See if we can tone using DMAs
sdr = eval(classname + "(uri='" + uri + "')")
# Set custom device parameters
for p in param_set.keys():
setattr(sdr, p, param_set[p])
# Set common buffer settings
sdr.tx_cyclic_buffer = True
N = 2 ** 14
if use_obs and use_rx2:
raise Exception("Both RX2 and OBS are selected. Select one at a time.")
if use_rx2:
sdr.rx2_enabled_channels = [channel]
sdr.rx2_buffer_size = N * 2 * len(sdr.rx2_enabled_channels)
elif use_obs:
sdr.obs.rx_enabled_channels = [0]
sdr.obs.rx_buffer_size = N * 2 * len(sdr.obs.rx_enabled_channels)
else:
sdr.rx_enabled_channels = [channel]
sdr.rx_buffer_size = N * 2 * len(sdr.rx_enabled_channels)
# Create a sinewave waveform
if hasattr(sdr, "sample_rate"):
RXFS = int(sdr.sample_rate)
else:
RXFS = int(sdr.orx_sample_rate) if use_obs else int(sdr.rx_sample_rate)
sdr.dds_single_tone(frequency, scale, channel)
# Pass through SDR
try:
for _ in range(10): # Wait
data = sdr.rx2() if use_rx2 else sdr.obs.rx() if use_obs else sdr.rx()
except Exception as e:
del sdr
raise Exception(e)
del sdr
tone_peaks, tone_freqs = spec.spec_est(data, fs=RXFS, ref=2 ** 15, plot=False)
indx = np.argmax(tone_peaks)
diff = np.abs(tone_freqs[indx] - frequency)
s = "Peak: " + str(tone_peaks[indx]) + "@" + str(tone_freqs[indx])
print(s)
if do_html_log:
pytest.data_log = {
"html": gen_line_plot_html(
tone_freqs,
tone_peaks,
"Frequency (Hz)",
"Amplitude (dBFS)",
"{} ({})".format(s, classname),
)
}
> assert (frequency * 0.01) > diff
E assert (1000000 * 0.01) > 1000000.0
test/dma_tests.py:340: AssertionError
Check warning on line 0 in test.test_adrv9025_p
github-actions / Test Results
test_adrv9025_dds_loopback[param_set3-1000000-0.12--44-1-adi.adrv9025] (test.test_adrv9025_p) failed
results.xml [took 0s]
Raw output
assert (1000000 * 0.01) > 1000000.0
test_dds_loopback = <function dds_loopback at 0x7f5ea79e8af0>
iio_uri = 'ip:10.1.0.143', classname = 'adi.adrv9025'
param_set = {'calibrate': 1, 'calibrate_rx_qec_en': 1, 'calibrate_tx_qec_en': 1, 'ensm_mode': 'radio_on', ...}
channel = 1, frequency = 1000000, scale = 0.12, peak_min = -44
@pytest.mark.iio_hardware(hardware)
@pytest.mark.parametrize("classname", [(classname)])
@pytest.mark.parametrize("channel", [0, 1])
@pytest.mark.parametrize(
"param_set, frequency, scale, peak_min",
[
(params["one_cw_tone_manual"], 2000000, 0.5, -42),
(params["one_cw_tone_manual"], 2000000, 0.12, -55),
(params["one_cw_tone_manual"], 2000000, 0.25, -48),
(params["one_cw_tone_slow_attack"], 1000000, 0.12, -44),
(params["one_cw_tone_slow_attack"], 2000000, 0.12, -44),
(params["one_cw_tone_slow_attack"], 500000, 0.12, -44),
(params["change_attenuation_5dB_manual"], 2000000, 0.25, -53),
(params["change_attenuation_10dB_manual"], 2000000, 0.25, -58),
(params["change_attenuation_0dB_slow_attack"], 1000000, 0.12, -35),
(params["change_attenuation_20dB_slow_attack"], 1000000, 0.12, -54),
(params["change_rf_gain_0dB_manual"], 2000000, 0.25, -59),
(params["change_rf_gain_20dB_manual"], 2000000, 0.25, -38),
],
)
def test_adrv9025_dds_loopback(
test_dds_loopback,
iio_uri,
classname,
param_set,
channel,
frequency,
scale,
peak_min,
):
> test_dds_loopback(
iio_uri, classname, param_set, channel, frequency, scale, peak_min
)
test/test_adrv9025_p.py:405:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
uri = 'ip:10.1.0.143', classname = 'adi.adrv9025'
param_set = {'calibrate': 1, 'calibrate_rx_qec_en': 1, 'calibrate_tx_qec_en': 1, 'ensm_mode': 'radio_on', ...}
channel = 1, frequency = 1000000, scale = 0.12, peak_min = -44, use_obs = False
use_rx2 = False
def dds_loopback(
uri,
classname,
param_set,
channel,
frequency,
scale,
peak_min,
use_obs=False,
use_rx2=False,
):
"""dds_loopback: Test DDS loopback with connected loopback cables.
This test requires a devices with TX and RX onboard where the transmit
signal can be recovered. TX FPGA DDSs are used to generate a sinusoid
which is then estimated on the RX side. The receive tone must be within
1% of its expected frequency with a specified peak
parameters:
uri: type=string
URI of IIO context of target board/system
classname: type=string
Name of pyadi interface class which contain attribute
param_set: type=dict
Dictionary of attribute and values to be set before tone is
generated and received
channel: type=list
List of integers or list of list of integers of channels to
enable through tx_enabled_channels
frequency: type=integer
Frequency in Hz of transmitted tone
scale: type=float
Scale of DDS tone. Range [0,1]
peak_min: type=float
Minimum acceptable value of maximum peak in dBFS of received tone
"""
# See if we can tone using DMAs
sdr = eval(classname + "(uri='" + uri + "')")
# Set custom device parameters
for p in param_set.keys():
setattr(sdr, p, param_set[p])
# Set common buffer settings
sdr.tx_cyclic_buffer = True
N = 2 ** 14
if use_obs and use_rx2:
raise Exception("Both RX2 and OBS are selected. Select one at a time.")
if use_rx2:
sdr.rx2_enabled_channels = [channel]
sdr.rx2_buffer_size = N * 2 * len(sdr.rx2_enabled_channels)
elif use_obs:
sdr.obs.rx_enabled_channels = [0]
sdr.obs.rx_buffer_size = N * 2 * len(sdr.obs.rx_enabled_channels)
else:
sdr.rx_enabled_channels = [channel]
sdr.rx_buffer_size = N * 2 * len(sdr.rx_enabled_channels)
# Create a sinewave waveform
if hasattr(sdr, "sample_rate"):
RXFS = int(sdr.sample_rate)
else:
RXFS = int(sdr.orx_sample_rate) if use_obs else int(sdr.rx_sample_rate)
sdr.dds_single_tone(frequency, scale, channel)
# Pass through SDR
try:
for _ in range(10): # Wait
data = sdr.rx2() if use_rx2 else sdr.obs.rx() if use_obs else sdr.rx()
except Exception as e:
del sdr
raise Exception(e)
del sdr
tone_peaks, tone_freqs = spec.spec_est(data, fs=RXFS, ref=2 ** 15, plot=False)
indx = np.argmax(tone_peaks)
diff = np.abs(tone_freqs[indx] - frequency)
s = "Peak: " + str(tone_peaks[indx]) + "@" + str(tone_freqs[indx])
print(s)
if do_html_log:
pytest.data_log = {
"html": gen_line_plot_html(
tone_freqs,
tone_peaks,
"Frequency (Hz)",
"Amplitude (dBFS)",
"{} ({})".format(s, classname),
)
}
> assert (frequency * 0.01) > diff
E assert (1000000 * 0.01) > 1000000.0
test/dma_tests.py:340: AssertionError
Check warning on line 0 in test.test_adrv9025_p
github-actions / Test Results
test_adrv9025_dds_loopback[param_set4-2000000-0.12--44-0-adi.adrv9025] (test.test_adrv9025_p) failed
results.xml [took 0s]
Raw output
assert (2000000 * 0.01) > 2000000.0
test_dds_loopback = <function dds_loopback at 0x7f5ea79e8af0>
iio_uri = 'ip:10.1.0.143', classname = 'adi.adrv9025'
param_set = {'calibrate': 1, 'calibrate_rx_qec_en': 1, 'calibrate_tx_qec_en': 1, 'ensm_mode': 'radio_on', ...}
channel = 0, frequency = 2000000, scale = 0.12, peak_min = -44
@pytest.mark.iio_hardware(hardware)
@pytest.mark.parametrize("classname", [(classname)])
@pytest.mark.parametrize("channel", [0, 1])
@pytest.mark.parametrize(
"param_set, frequency, scale, peak_min",
[
(params["one_cw_tone_manual"], 2000000, 0.5, -42),
(params["one_cw_tone_manual"], 2000000, 0.12, -55),
(params["one_cw_tone_manual"], 2000000, 0.25, -48),
(params["one_cw_tone_slow_attack"], 1000000, 0.12, -44),
(params["one_cw_tone_slow_attack"], 2000000, 0.12, -44),
(params["one_cw_tone_slow_attack"], 500000, 0.12, -44),
(params["change_attenuation_5dB_manual"], 2000000, 0.25, -53),
(params["change_attenuation_10dB_manual"], 2000000, 0.25, -58),
(params["change_attenuation_0dB_slow_attack"], 1000000, 0.12, -35),
(params["change_attenuation_20dB_slow_attack"], 1000000, 0.12, -54),
(params["change_rf_gain_0dB_manual"], 2000000, 0.25, -59),
(params["change_rf_gain_20dB_manual"], 2000000, 0.25, -38),
],
)
def test_adrv9025_dds_loopback(
test_dds_loopback,
iio_uri,
classname,
param_set,
channel,
frequency,
scale,
peak_min,
):
> test_dds_loopback(
iio_uri, classname, param_set, channel, frequency, scale, peak_min
)
test/test_adrv9025_p.py:405:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
uri = 'ip:10.1.0.143', classname = 'adi.adrv9025'
param_set = {'calibrate': 1, 'calibrate_rx_qec_en': 1, 'calibrate_tx_qec_en': 1, 'ensm_mode': 'radio_on', ...}
channel = 0, frequency = 2000000, scale = 0.12, peak_min = -44, use_obs = False
use_rx2 = False
def dds_loopback(
uri,
classname,
param_set,
channel,
frequency,
scale,
peak_min,
use_obs=False,
use_rx2=False,
):
"""dds_loopback: Test DDS loopback with connected loopback cables.
This test requires a devices with TX and RX onboard where the transmit
signal can be recovered. TX FPGA DDSs are used to generate a sinusoid
which is then estimated on the RX side. The receive tone must be within
1% of its expected frequency with a specified peak
parameters:
uri: type=string
URI of IIO context of target board/system
classname: type=string
Name of pyadi interface class which contain attribute
param_set: type=dict
Dictionary of attribute and values to be set before tone is
generated and received
channel: type=list
List of integers or list of list of integers of channels to
enable through tx_enabled_channels
frequency: type=integer
Frequency in Hz of transmitted tone
scale: type=float
Scale of DDS tone. Range [0,1]
peak_min: type=float
Minimum acceptable value of maximum peak in dBFS of received tone
"""
# See if we can tone using DMAs
sdr = eval(classname + "(uri='" + uri + "')")
# Set custom device parameters
for p in param_set.keys():
setattr(sdr, p, param_set[p])
# Set common buffer settings
sdr.tx_cyclic_buffer = True
N = 2 ** 14
if use_obs and use_rx2:
raise Exception("Both RX2 and OBS are selected. Select one at a time.")
if use_rx2:
sdr.rx2_enabled_channels = [channel]
sdr.rx2_buffer_size = N * 2 * len(sdr.rx2_enabled_channels)
elif use_obs:
sdr.obs.rx_enabled_channels = [0]
sdr.obs.rx_buffer_size = N * 2 * len(sdr.obs.rx_enabled_channels)
else:
sdr.rx_enabled_channels = [channel]
sdr.rx_buffer_size = N * 2 * len(sdr.rx_enabled_channels)
# Create a sinewave waveform
if hasattr(sdr, "sample_rate"):
RXFS = int(sdr.sample_rate)
else:
RXFS = int(sdr.orx_sample_rate) if use_obs else int(sdr.rx_sample_rate)
sdr.dds_single_tone(frequency, scale, channel)
# Pass through SDR
try:
for _ in range(10): # Wait
data = sdr.rx2() if use_rx2 else sdr.obs.rx() if use_obs else sdr.rx()
except Exception as e:
del sdr
raise Exception(e)
del sdr
tone_peaks, tone_freqs = spec.spec_est(data, fs=RXFS, ref=2 ** 15, plot=False)
indx = np.argmax(tone_peaks)
diff = np.abs(tone_freqs[indx] - frequency)
s = "Peak: " + str(tone_peaks[indx]) + "@" + str(tone_freqs[indx])
print(s)
if do_html_log:
pytest.data_log = {
"html": gen_line_plot_html(
tone_freqs,
tone_peaks,
"Frequency (Hz)",
"Amplitude (dBFS)",
"{} ({})".format(s, classname),
)
}
> assert (frequency * 0.01) > diff
E assert (2000000 * 0.01) > 2000000.0
test/dma_tests.py:340: AssertionError
Check warning on line 0 in test.test_adrv9025_p
github-actions / Test Results
test_adrv9025_dds_loopback[param_set4-2000000-0.12--44-1-adi.adrv9025] (test.test_adrv9025_p) failed
results.xml [took 0s]
Raw output
assert (2000000 * 0.01) > 2000000.0
test_dds_loopback = <function dds_loopback at 0x7f5ea79e8af0>
iio_uri = 'ip:10.1.0.143', classname = 'adi.adrv9025'
param_set = {'calibrate': 1, 'calibrate_rx_qec_en': 1, 'calibrate_tx_qec_en': 1, 'ensm_mode': 'radio_on', ...}
channel = 1, frequency = 2000000, scale = 0.12, peak_min = -44
@pytest.mark.iio_hardware(hardware)
@pytest.mark.parametrize("classname", [(classname)])
@pytest.mark.parametrize("channel", [0, 1])
@pytest.mark.parametrize(
"param_set, frequency, scale, peak_min",
[
(params["one_cw_tone_manual"], 2000000, 0.5, -42),
(params["one_cw_tone_manual"], 2000000, 0.12, -55),
(params["one_cw_tone_manual"], 2000000, 0.25, -48),
(params["one_cw_tone_slow_attack"], 1000000, 0.12, -44),
(params["one_cw_tone_slow_attack"], 2000000, 0.12, -44),
(params["one_cw_tone_slow_attack"], 500000, 0.12, -44),
(params["change_attenuation_5dB_manual"], 2000000, 0.25, -53),
(params["change_attenuation_10dB_manual"], 2000000, 0.25, -58),
(params["change_attenuation_0dB_slow_attack"], 1000000, 0.12, -35),
(params["change_attenuation_20dB_slow_attack"], 1000000, 0.12, -54),
(params["change_rf_gain_0dB_manual"], 2000000, 0.25, -59),
(params["change_rf_gain_20dB_manual"], 2000000, 0.25, -38),
],
)
def test_adrv9025_dds_loopback(
test_dds_loopback,
iio_uri,
classname,
param_set,
channel,
frequency,
scale,
peak_min,
):
> test_dds_loopback(
iio_uri, classname, param_set, channel, frequency, scale, peak_min
)
test/test_adrv9025_p.py:405:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
uri = 'ip:10.1.0.143', classname = 'adi.adrv9025'
param_set = {'calibrate': 1, 'calibrate_rx_qec_en': 1, 'calibrate_tx_qec_en': 1, 'ensm_mode': 'radio_on', ...}
channel = 1, frequency = 2000000, scale = 0.12, peak_min = -44, use_obs = False
use_rx2 = False
def dds_loopback(
uri,
classname,
param_set,
channel,
frequency,
scale,
peak_min,
use_obs=False,
use_rx2=False,
):
"""dds_loopback: Test DDS loopback with connected loopback cables.
This test requires a devices with TX and RX onboard where the transmit
signal can be recovered. TX FPGA DDSs are used to generate a sinusoid
which is then estimated on the RX side. The receive tone must be within
1% of its expected frequency with a specified peak
parameters:
uri: type=string
URI of IIO context of target board/system
classname: type=string
Name of pyadi interface class which contain attribute
param_set: type=dict
Dictionary of attribute and values to be set before tone is
generated and received
channel: type=list
List of integers or list of list of integers of channels to
enable through tx_enabled_channels
frequency: type=integer
Frequency in Hz of transmitted tone
scale: type=float
Scale of DDS tone. Range [0,1]
peak_min: type=float
Minimum acceptable value of maximum peak in dBFS of received tone
"""
# See if we can tone using DMAs
sdr = eval(classname + "(uri='" + uri + "')")
# Set custom device parameters
for p in param_set.keys():
setattr(sdr, p, param_set[p])
# Set common buffer settings
sdr.tx_cyclic_buffer = True
N = 2 ** 14
if use_obs and use_rx2:
raise Exception("Both RX2 and OBS are selected. Select one at a time.")
if use_rx2:
sdr.rx2_enabled_channels = [channel]
sdr.rx2_buffer_size = N * 2 * len(sdr.rx2_enabled_channels)
elif use_obs:
sdr.obs.rx_enabled_channels = [0]
sdr.obs.rx_buffer_size = N * 2 * len(sdr.obs.rx_enabled_channels)
else:
sdr.rx_enabled_channels = [channel]
sdr.rx_buffer_size = N * 2 * len(sdr.rx_enabled_channels)
# Create a sinewave waveform
if hasattr(sdr, "sample_rate"):
RXFS = int(sdr.sample_rate)
else:
RXFS = int(sdr.orx_sample_rate) if use_obs else int(sdr.rx_sample_rate)
sdr.dds_single_tone(frequency, scale, channel)
# Pass through SDR
try:
for _ in range(10): # Wait
data = sdr.rx2() if use_rx2 else sdr.obs.rx() if use_obs else sdr.rx()
except Exception as e:
del sdr
raise Exception(e)
del sdr
tone_peaks, tone_freqs = spec.spec_est(data, fs=RXFS, ref=2 ** 15, plot=False)
indx = np.argmax(tone_peaks)
diff = np.abs(tone_freqs[indx] - frequency)
s = "Peak: " + str(tone_peaks[indx]) + "@" + str(tone_freqs[indx])
print(s)
if do_html_log:
pytest.data_log = {
"html": gen_line_plot_html(
tone_freqs,
tone_peaks,
"Frequency (Hz)",
"Amplitude (dBFS)",
"{} ({})".format(s, classname),
)
}
> assert (frequency * 0.01) > diff
E assert (2000000 * 0.01) > 2000000.0
test/dma_tests.py:340: AssertionError
Check warning on line 0 in test.test_adrv9025_p
github-actions / Test Results
test_adrv9025_dds_loopback[param_set5-500000-0.12--44-0-adi.adrv9025] (test.test_adrv9025_p) failed
results.xml [took 0s]
Raw output
assert (500000 * 0.01) > 500000.0
test_dds_loopback = <function dds_loopback at 0x7f5ea79e8af0>
iio_uri = 'ip:10.1.0.143', classname = 'adi.adrv9025'
param_set = {'calibrate': 1, 'calibrate_rx_qec_en': 1, 'calibrate_tx_qec_en': 1, 'ensm_mode': 'radio_on', ...}
channel = 0, frequency = 500000, scale = 0.12, peak_min = -44
@pytest.mark.iio_hardware(hardware)
@pytest.mark.parametrize("classname", [(classname)])
@pytest.mark.parametrize("channel", [0, 1])
@pytest.mark.parametrize(
"param_set, frequency, scale, peak_min",
[
(params["one_cw_tone_manual"], 2000000, 0.5, -42),
(params["one_cw_tone_manual"], 2000000, 0.12, -55),
(params["one_cw_tone_manual"], 2000000, 0.25, -48),
(params["one_cw_tone_slow_attack"], 1000000, 0.12, -44),
(params["one_cw_tone_slow_attack"], 2000000, 0.12, -44),
(params["one_cw_tone_slow_attack"], 500000, 0.12, -44),
(params["change_attenuation_5dB_manual"], 2000000, 0.25, -53),
(params["change_attenuation_10dB_manual"], 2000000, 0.25, -58),
(params["change_attenuation_0dB_slow_attack"], 1000000, 0.12, -35),
(params["change_attenuation_20dB_slow_attack"], 1000000, 0.12, -54),
(params["change_rf_gain_0dB_manual"], 2000000, 0.25, -59),
(params["change_rf_gain_20dB_manual"], 2000000, 0.25, -38),
],
)
def test_adrv9025_dds_loopback(
test_dds_loopback,
iio_uri,
classname,
param_set,
channel,
frequency,
scale,
peak_min,
):
> test_dds_loopback(
iio_uri, classname, param_set, channel, frequency, scale, peak_min
)
test/test_adrv9025_p.py:405:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
uri = 'ip:10.1.0.143', classname = 'adi.adrv9025'
param_set = {'calibrate': 1, 'calibrate_rx_qec_en': 1, 'calibrate_tx_qec_en': 1, 'ensm_mode': 'radio_on', ...}
channel = 0, frequency = 500000, scale = 0.12, peak_min = -44, use_obs = False
use_rx2 = False
def dds_loopback(
uri,
classname,
param_set,
channel,
frequency,
scale,
peak_min,
use_obs=False,
use_rx2=False,
):
"""dds_loopback: Test DDS loopback with connected loopback cables.
This test requires a devices with TX and RX onboard where the transmit
signal can be recovered. TX FPGA DDSs are used to generate a sinusoid
which is then estimated on the RX side. The receive tone must be within
1% of its expected frequency with a specified peak
parameters:
uri: type=string
URI of IIO context of target board/system
classname: type=string
Name of pyadi interface class which contain attribute
param_set: type=dict
Dictionary of attribute and values to be set before tone is
generated and received
channel: type=list
List of integers or list of list of integers of channels to
enable through tx_enabled_channels
frequency: type=integer
Frequency in Hz of transmitted tone
scale: type=float
Scale of DDS tone. Range [0,1]
peak_min: type=float
Minimum acceptable value of maximum peak in dBFS of received tone
"""
# See if we can tone using DMAs
sdr = eval(classname + "(uri='" + uri + "')")
# Set custom device parameters
for p in param_set.keys():
setattr(sdr, p, param_set[p])
# Set common buffer settings
sdr.tx_cyclic_buffer = True
N = 2 ** 14
if use_obs and use_rx2:
raise Exception("Both RX2 and OBS are selected. Select one at a time.")
if use_rx2:
sdr.rx2_enabled_channels = [channel]
sdr.rx2_buffer_size = N * 2 * len(sdr.rx2_enabled_channels)
elif use_obs:
sdr.obs.rx_enabled_channels = [0]
sdr.obs.rx_buffer_size = N * 2 * len(sdr.obs.rx_enabled_channels)
else:
sdr.rx_enabled_channels = [channel]
sdr.rx_buffer_size = N * 2 * len(sdr.rx_enabled_channels)
# Create a sinewave waveform
if hasattr(sdr, "sample_rate"):
RXFS = int(sdr.sample_rate)
else:
RXFS = int(sdr.orx_sample_rate) if use_obs else int(sdr.rx_sample_rate)
sdr.dds_single_tone(frequency, scale, channel)
# Pass through SDR
try:
for _ in range(10): # Wait
data = sdr.rx2() if use_rx2 else sdr.obs.rx() if use_obs else sdr.rx()
except Exception as e:
del sdr
raise Exception(e)
del sdr
tone_peaks, tone_freqs = spec.spec_est(data, fs=RXFS, ref=2 ** 15, plot=False)
indx = np.argmax(tone_peaks)
diff = np.abs(tone_freqs[indx] - frequency)
s = "Peak: " + str(tone_peaks[indx]) + "@" + str(tone_freqs[indx])
print(s)
if do_html_log:
pytest.data_log = {
"html": gen_line_plot_html(
tone_freqs,
tone_peaks,
"Frequency (Hz)",
"Amplitude (dBFS)",
"{} ({})".format(s, classname),
)
}
> assert (frequency * 0.01) > diff
E assert (500000 * 0.01) > 500000.0
test/dma_tests.py:340: AssertionError
Check warning on line 0 in test.test_adrv9025_p
github-actions / Test Results
test_adrv9025_dds_loopback[param_set5-500000-0.12--44-1-adi.adrv9025] (test.test_adrv9025_p) failed
results.xml [took 0s]
Raw output
assert (500000 * 0.01) > 500000.0
test_dds_loopback = <function dds_loopback at 0x7f5ea79e8af0>
iio_uri = 'ip:10.1.0.143', classname = 'adi.adrv9025'
param_set = {'calibrate': 1, 'calibrate_rx_qec_en': 1, 'calibrate_tx_qec_en': 1, 'ensm_mode': 'radio_on', ...}
channel = 1, frequency = 500000, scale = 0.12, peak_min = -44
@pytest.mark.iio_hardware(hardware)
@pytest.mark.parametrize("classname", [(classname)])
@pytest.mark.parametrize("channel", [0, 1])
@pytest.mark.parametrize(
"param_set, frequency, scale, peak_min",
[
(params["one_cw_tone_manual"], 2000000, 0.5, -42),
(params["one_cw_tone_manual"], 2000000, 0.12, -55),
(params["one_cw_tone_manual"], 2000000, 0.25, -48),
(params["one_cw_tone_slow_attack"], 1000000, 0.12, -44),
(params["one_cw_tone_slow_attack"], 2000000, 0.12, -44),
(params["one_cw_tone_slow_attack"], 500000, 0.12, -44),
(params["change_attenuation_5dB_manual"], 2000000, 0.25, -53),
(params["change_attenuation_10dB_manual"], 2000000, 0.25, -58),
(params["change_attenuation_0dB_slow_attack"], 1000000, 0.12, -35),
(params["change_attenuation_20dB_slow_attack"], 1000000, 0.12, -54),
(params["change_rf_gain_0dB_manual"], 2000000, 0.25, -59),
(params["change_rf_gain_20dB_manual"], 2000000, 0.25, -38),
],
)
def test_adrv9025_dds_loopback(
test_dds_loopback,
iio_uri,
classname,
param_set,
channel,
frequency,
scale,
peak_min,
):
> test_dds_loopback(
iio_uri, classname, param_set, channel, frequency, scale, peak_min
)
test/test_adrv9025_p.py:405:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
uri = 'ip:10.1.0.143', classname = 'adi.adrv9025'
param_set = {'calibrate': 1, 'calibrate_rx_qec_en': 1, 'calibrate_tx_qec_en': 1, 'ensm_mode': 'radio_on', ...}
channel = 1, frequency = 500000, scale = 0.12, peak_min = -44, use_obs = False
use_rx2 = False
def dds_loopback(
uri,
classname,
param_set,
channel,
frequency,
scale,
peak_min,
use_obs=False,
use_rx2=False,
):
"""dds_loopback: Test DDS loopback with connected loopback cables.
This test requires a devices with TX and RX onboard where the transmit
signal can be recovered. TX FPGA DDSs are used to generate a sinusoid
which is then estimated on the RX side. The receive tone must be within
1% of its expected frequency with a specified peak
parameters:
uri: type=string
URI of IIO context of target board/system
classname: type=string
Name of pyadi interface class which contain attribute
param_set: type=dict
Dictionary of attribute and values to be set before tone is
generated and received
channel: type=list
List of integers or list of list of integers of channels to
enable through tx_enabled_channels
frequency: type=integer
Frequency in Hz of transmitted tone
scale: type=float
Scale of DDS tone. Range [0,1]
peak_min: type=float
Minimum acceptable value of maximum peak in dBFS of received tone
"""
# See if we can tone using DMAs
sdr = eval(classname + "(uri='" + uri + "')")
# Set custom device parameters
for p in param_set.keys():
setattr(sdr, p, param_set[p])
# Set common buffer settings
sdr.tx_cyclic_buffer = True
N = 2 ** 14
if use_obs and use_rx2:
raise Exception("Both RX2 and OBS are selected. Select one at a time.")
if use_rx2:
sdr.rx2_enabled_channels = [channel]
sdr.rx2_buffer_size = N * 2 * len(sdr.rx2_enabled_channels)
elif use_obs:
sdr.obs.rx_enabled_channels = [0]
sdr.obs.rx_buffer_size = N * 2 * len(sdr.obs.rx_enabled_channels)
else:
sdr.rx_enabled_channels = [channel]
sdr.rx_buffer_size = N * 2 * len(sdr.rx_enabled_channels)
# Create a sinewave waveform
if hasattr(sdr, "sample_rate"):
RXFS = int(sdr.sample_rate)
else:
RXFS = int(sdr.orx_sample_rate) if use_obs else int(sdr.rx_sample_rate)
sdr.dds_single_tone(frequency, scale, channel)
# Pass through SDR
try:
for _ in range(10): # Wait
data = sdr.rx2() if use_rx2 else sdr.obs.rx() if use_obs else sdr.rx()
except Exception as e:
del sdr
raise Exception(e)
del sdr
tone_peaks, tone_freqs = spec.spec_est(data, fs=RXFS, ref=2 ** 15, plot=False)
indx = np.argmax(tone_peaks)
diff = np.abs(tone_freqs[indx] - frequency)
s = "Peak: " + str(tone_peaks[indx]) + "@" + str(tone_freqs[indx])
print(s)
if do_html_log:
pytest.data_log = {
"html": gen_line_plot_html(
tone_freqs,
tone_peaks,
"Frequency (Hz)",
"Amplitude (dBFS)",
"{} ({})".format(s, classname),
)
}
> assert (frequency * 0.01) > diff
E assert (500000 * 0.01) > 500000.0
test/dma_tests.py:340: AssertionError
Check warning on line 0 in test.test_adrv9025_p
github-actions / Test Results
test_adrv9025_dds_loopback[param_set6-2000000-0.25--53-0-adi.adrv9025] (test.test_adrv9025_p) failed
results.xml [took 0s]
Raw output
assert (2000000 * 0.01) > 2000000.0
test_dds_loopback = <function dds_loopback at 0x7f5ea79e8af0>
iio_uri = 'ip:10.1.0.143', classname = 'adi.adrv9025'
param_set = {'calibrate': 1, 'calibrate_rx_qec_en': 1, 'calibrate_tx_qec_en': 1, 'ensm_mode': 'radio_on', ...}
channel = 0, frequency = 2000000, scale = 0.25, peak_min = -53
@pytest.mark.iio_hardware(hardware)
@pytest.mark.parametrize("classname", [(classname)])
@pytest.mark.parametrize("channel", [0, 1])
@pytest.mark.parametrize(
"param_set, frequency, scale, peak_min",
[
(params["one_cw_tone_manual"], 2000000, 0.5, -42),
(params["one_cw_tone_manual"], 2000000, 0.12, -55),
(params["one_cw_tone_manual"], 2000000, 0.25, -48),
(params["one_cw_tone_slow_attack"], 1000000, 0.12, -44),
(params["one_cw_tone_slow_attack"], 2000000, 0.12, -44),
(params["one_cw_tone_slow_attack"], 500000, 0.12, -44),
(params["change_attenuation_5dB_manual"], 2000000, 0.25, -53),
(params["change_attenuation_10dB_manual"], 2000000, 0.25, -58),
(params["change_attenuation_0dB_slow_attack"], 1000000, 0.12, -35),
(params["change_attenuation_20dB_slow_attack"], 1000000, 0.12, -54),
(params["change_rf_gain_0dB_manual"], 2000000, 0.25, -59),
(params["change_rf_gain_20dB_manual"], 2000000, 0.25, -38),
],
)
def test_adrv9025_dds_loopback(
test_dds_loopback,
iio_uri,
classname,
param_set,
channel,
frequency,
scale,
peak_min,
):
> test_dds_loopback(
iio_uri, classname, param_set, channel, frequency, scale, peak_min
)
test/test_adrv9025_p.py:405:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
uri = 'ip:10.1.0.143', classname = 'adi.adrv9025'
param_set = {'calibrate': 1, 'calibrate_rx_qec_en': 1, 'calibrate_tx_qec_en': 1, 'ensm_mode': 'radio_on', ...}
channel = 0, frequency = 2000000, scale = 0.25, peak_min = -53, use_obs = False
use_rx2 = False
def dds_loopback(
uri,
classname,
param_set,
channel,
frequency,
scale,
peak_min,
use_obs=False,
use_rx2=False,
):
"""dds_loopback: Test DDS loopback with connected loopback cables.
This test requires a devices with TX and RX onboard where the transmit
signal can be recovered. TX FPGA DDSs are used to generate a sinusoid
which is then estimated on the RX side. The receive tone must be within
1% of its expected frequency with a specified peak
parameters:
uri: type=string
URI of IIO context of target board/system
classname: type=string
Name of pyadi interface class which contain attribute
param_set: type=dict
Dictionary of attribute and values to be set before tone is
generated and received
channel: type=list
List of integers or list of list of integers of channels to
enable through tx_enabled_channels
frequency: type=integer
Frequency in Hz of transmitted tone
scale: type=float
Scale of DDS tone. Range [0,1]
peak_min: type=float
Minimum acceptable value of maximum peak in dBFS of received tone
"""
# See if we can tone using DMAs
sdr = eval(classname + "(uri='" + uri + "')")
# Set custom device parameters
for p in param_set.keys():
setattr(sdr, p, param_set[p])
# Set common buffer settings
sdr.tx_cyclic_buffer = True
N = 2 ** 14
if use_obs and use_rx2:
raise Exception("Both RX2 and OBS are selected. Select one at a time.")
if use_rx2:
sdr.rx2_enabled_channels = [channel]
sdr.rx2_buffer_size = N * 2 * len(sdr.rx2_enabled_channels)
elif use_obs:
sdr.obs.rx_enabled_channels = [0]
sdr.obs.rx_buffer_size = N * 2 * len(sdr.obs.rx_enabled_channels)
else:
sdr.rx_enabled_channels = [channel]
sdr.rx_buffer_size = N * 2 * len(sdr.rx_enabled_channels)
# Create a sinewave waveform
if hasattr(sdr, "sample_rate"):
RXFS = int(sdr.sample_rate)
else:
RXFS = int(sdr.orx_sample_rate) if use_obs else int(sdr.rx_sample_rate)
sdr.dds_single_tone(frequency, scale, channel)
# Pass through SDR
try:
for _ in range(10): # Wait
data = sdr.rx2() if use_rx2 else sdr.obs.rx() if use_obs else sdr.rx()
except Exception as e:
del sdr
raise Exception(e)
del sdr
tone_peaks, tone_freqs = spec.spec_est(data, fs=RXFS, ref=2 ** 15, plot=False)
indx = np.argmax(tone_peaks)
diff = np.abs(tone_freqs[indx] - frequency)
s = "Peak: " + str(tone_peaks[indx]) + "@" + str(tone_freqs[indx])
print(s)
if do_html_log:
pytest.data_log = {
"html": gen_line_plot_html(
tone_freqs,
tone_peaks,
"Frequency (Hz)",
"Amplitude (dBFS)",
"{} ({})".format(s, classname),
)
}
> assert (frequency * 0.01) > diff
E assert (2000000 * 0.01) > 2000000.0
test/dma_tests.py:340: AssertionError
Check warning on line 0 in test.test_adrv9025_p
github-actions / Test Results
test_adrv9025_dds_loopback[param_set6-2000000-0.25--53-1-adi.adrv9025] (test.test_adrv9025_p) failed
results.xml [took 0s]
Raw output
assert (2000000 * 0.01) > 2000000.0
test_dds_loopback = <function dds_loopback at 0x7f5ea79e8af0>
iio_uri = 'ip:10.1.0.143', classname = 'adi.adrv9025'
param_set = {'calibrate': 1, 'calibrate_rx_qec_en': 1, 'calibrate_tx_qec_en': 1, 'ensm_mode': 'radio_on', ...}
channel = 1, frequency = 2000000, scale = 0.25, peak_min = -53
@pytest.mark.iio_hardware(hardware)
@pytest.mark.parametrize("classname", [(classname)])
@pytest.mark.parametrize("channel", [0, 1])
@pytest.mark.parametrize(
"param_set, frequency, scale, peak_min",
[
(params["one_cw_tone_manual"], 2000000, 0.5, -42),
(params["one_cw_tone_manual"], 2000000, 0.12, -55),
(params["one_cw_tone_manual"], 2000000, 0.25, -48),
(params["one_cw_tone_slow_attack"], 1000000, 0.12, -44),
(params["one_cw_tone_slow_attack"], 2000000, 0.12, -44),
(params["one_cw_tone_slow_attack"], 500000, 0.12, -44),
(params["change_attenuation_5dB_manual"], 2000000, 0.25, -53),
(params["change_attenuation_10dB_manual"], 2000000, 0.25, -58),
(params["change_attenuation_0dB_slow_attack"], 1000000, 0.12, -35),
(params["change_attenuation_20dB_slow_attack"], 1000000, 0.12, -54),
(params["change_rf_gain_0dB_manual"], 2000000, 0.25, -59),
(params["change_rf_gain_20dB_manual"], 2000000, 0.25, -38),
],
)
def test_adrv9025_dds_loopback(
test_dds_loopback,
iio_uri,
classname,
param_set,
channel,
frequency,
scale,
peak_min,
):
> test_dds_loopback(
iio_uri, classname, param_set, channel, frequency, scale, peak_min
)
test/test_adrv9025_p.py:405:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
uri = 'ip:10.1.0.143', classname = 'adi.adrv9025'
param_set = {'calibrate': 1, 'calibrate_rx_qec_en': 1, 'calibrate_tx_qec_en': 1, 'ensm_mode': 'radio_on', ...}
channel = 1, frequency = 2000000, scale = 0.25, peak_min = -53, use_obs = False
use_rx2 = False
def dds_loopback(
uri,
classname,
param_set,
channel,
frequency,
scale,
peak_min,
use_obs=False,
use_rx2=False,
):
"""dds_loopback: Test DDS loopback with connected loopback cables.
This test requires a devices with TX and RX onboard where the transmit
signal can be recovered. TX FPGA DDSs are used to generate a sinusoid
which is then estimated on the RX side. The receive tone must be within
1% of its expected frequency with a specified peak
parameters:
uri: type=string
URI of IIO context of target board/system
classname: type=string
Name of pyadi interface class which contain attribute
param_set: type=dict
Dictionary of attribute and values to be set before tone is
generated and received
channel: type=list
List of integers or list of list of integers of channels to
enable through tx_enabled_channels
frequency: type=integer
Frequency in Hz of transmitted tone
scale: type=float
Scale of DDS tone. Range [0,1]
peak_min: type=float
Minimum acceptable value of maximum peak in dBFS of received tone
"""
# See if we can tone using DMAs
sdr = eval(classname + "(uri='" + uri + "')")
# Set custom device parameters
for p in param_set.keys():
setattr(sdr, p, param_set[p])
# Set common buffer settings
sdr.tx_cyclic_buffer = True
N = 2 ** 14
if use_obs and use_rx2:
raise Exception("Both RX2 and OBS are selected. Select one at a time.")
if use_rx2:
sdr.rx2_enabled_channels = [channel]
sdr.rx2_buffer_size = N * 2 * len(sdr.rx2_enabled_channels)
elif use_obs:
sdr.obs.rx_enabled_channels = [0]
sdr.obs.rx_buffer_size = N * 2 * len(sdr.obs.rx_enabled_channels)
else:
sdr.rx_enabled_channels = [channel]
sdr.rx_buffer_size = N * 2 * len(sdr.rx_enabled_channels)
# Create a sinewave waveform
if hasattr(sdr, "sample_rate"):
RXFS = int(sdr.sample_rate)
else:
RXFS = int(sdr.orx_sample_rate) if use_obs else int(sdr.rx_sample_rate)
sdr.dds_single_tone(frequency, scale, channel)
# Pass through SDR
try:
for _ in range(10): # Wait
data = sdr.rx2() if use_rx2 else sdr.obs.rx() if use_obs else sdr.rx()
except Exception as e:
del sdr
raise Exception(e)
del sdr
tone_peaks, tone_freqs = spec.spec_est(data, fs=RXFS, ref=2 ** 15, plot=False)
indx = np.argmax(tone_peaks)
diff = np.abs(tone_freqs[indx] - frequency)
s = "Peak: " + str(tone_peaks[indx]) + "@" + str(tone_freqs[indx])
print(s)
if do_html_log:
pytest.data_log = {
"html": gen_line_plot_html(
tone_freqs,
tone_peaks,
"Frequency (Hz)",
"Amplitude (dBFS)",
"{} ({})".format(s, classname),
)
}
> assert (frequency * 0.01) > diff
E assert (2000000 * 0.01) > 2000000.0
test/dma_tests.py:340: AssertionError
Check warning on line 0 in test.test_adrv9025_p
github-actions / Test Results
test_adrv9025_dds_loopback[param_set7-2000000-0.25--58-0-adi.adrv9025] (test.test_adrv9025_p) failed
results.xml [took 0s]
Raw output
assert (2000000 * 0.01) > 2000000.0
test_dds_loopback = <function dds_loopback at 0x7f5ea79e8af0>
iio_uri = 'ip:10.1.0.143', classname = 'adi.adrv9025'
param_set = {'calibrate': 1, 'calibrate_rx_qec_en': 1, 'calibrate_tx_qec_en': 1, 'ensm_mode': 'radio_on', ...}
channel = 0, frequency = 2000000, scale = 0.25, peak_min = -58
@pytest.mark.iio_hardware(hardware)
@pytest.mark.parametrize("classname", [(classname)])
@pytest.mark.parametrize("channel", [0, 1])
@pytest.mark.parametrize(
"param_set, frequency, scale, peak_min",
[
(params["one_cw_tone_manual"], 2000000, 0.5, -42),
(params["one_cw_tone_manual"], 2000000, 0.12, -55),
(params["one_cw_tone_manual"], 2000000, 0.25, -48),
(params["one_cw_tone_slow_attack"], 1000000, 0.12, -44),
(params["one_cw_tone_slow_attack"], 2000000, 0.12, -44),
(params["one_cw_tone_slow_attack"], 500000, 0.12, -44),
(params["change_attenuation_5dB_manual"], 2000000, 0.25, -53),
(params["change_attenuation_10dB_manual"], 2000000, 0.25, -58),
(params["change_attenuation_0dB_slow_attack"], 1000000, 0.12, -35),
(params["change_attenuation_20dB_slow_attack"], 1000000, 0.12, -54),
(params["change_rf_gain_0dB_manual"], 2000000, 0.25, -59),
(params["change_rf_gain_20dB_manual"], 2000000, 0.25, -38),
],
)
def test_adrv9025_dds_loopback(
test_dds_loopback,
iio_uri,
classname,
param_set,
channel,
frequency,
scale,
peak_min,
):
> test_dds_loopback(
iio_uri, classname, param_set, channel, frequency, scale, peak_min
)
test/test_adrv9025_p.py:405:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
uri = 'ip:10.1.0.143', classname = 'adi.adrv9025'
param_set = {'calibrate': 1, 'calibrate_rx_qec_en': 1, 'calibrate_tx_qec_en': 1, 'ensm_mode': 'radio_on', ...}
channel = 0, frequency = 2000000, scale = 0.25, peak_min = -58, use_obs = False
use_rx2 = False
def dds_loopback(
uri,
classname,
param_set,
channel,
frequency,
scale,
peak_min,
use_obs=False,
use_rx2=False,
):
"""dds_loopback: Test DDS loopback with connected loopback cables.
This test requires a devices with TX and RX onboard where the transmit
signal can be recovered. TX FPGA DDSs are used to generate a sinusoid
which is then estimated on the RX side. The receive tone must be within
1% of its expected frequency with a specified peak
parameters:
uri: type=string
URI of IIO context of target board/system
classname: type=string
Name of pyadi interface class which contain attribute
param_set: type=dict
Dictionary of attribute and values to be set before tone is
generated and received
channel: type=list
List of integers or list of list of integers of channels to
enable through tx_enabled_channels
frequency: type=integer
Frequency in Hz of transmitted tone
scale: type=float
Scale of DDS tone. Range [0,1]
peak_min: type=float
Minimum acceptable value of maximum peak in dBFS of received tone
"""
# See if we can tone using DMAs
sdr = eval(classname + "(uri='" + uri + "')")
# Set custom device parameters
for p in param_set.keys():
setattr(sdr, p, param_set[p])
# Set common buffer settings
sdr.tx_cyclic_buffer = True
N = 2 ** 14
if use_obs and use_rx2:
raise Exception("Both RX2 and OBS are selected. Select one at a time.")
if use_rx2:
sdr.rx2_enabled_channels = [channel]
sdr.rx2_buffer_size = N * 2 * len(sdr.rx2_enabled_channels)
elif use_obs:
sdr.obs.rx_enabled_channels = [0]
sdr.obs.rx_buffer_size = N * 2 * len(sdr.obs.rx_enabled_channels)
else:
sdr.rx_enabled_channels = [channel]
sdr.rx_buffer_size = N * 2 * len(sdr.rx_enabled_channels)
# Create a sinewave waveform
if hasattr(sdr, "sample_rate"):
RXFS = int(sdr.sample_rate)
else:
RXFS = int(sdr.orx_sample_rate) if use_obs else int(sdr.rx_sample_rate)
sdr.dds_single_tone(frequency, scale, channel)
# Pass through SDR
try:
for _ in range(10): # Wait
data = sdr.rx2() if use_rx2 else sdr.obs.rx() if use_obs else sdr.rx()
except Exception as e:
del sdr
raise Exception(e)
del sdr
tone_peaks, tone_freqs = spec.spec_est(data, fs=RXFS, ref=2 ** 15, plot=False)
indx = np.argmax(tone_peaks)
diff = np.abs(tone_freqs[indx] - frequency)
s = "Peak: " + str(tone_peaks[indx]) + "@" + str(tone_freqs[indx])
print(s)
if do_html_log:
pytest.data_log = {
"html": gen_line_plot_html(
tone_freqs,
tone_peaks,
"Frequency (Hz)",
"Amplitude (dBFS)",
"{} ({})".format(s, classname),
)
}
> assert (frequency * 0.01) > diff
E assert (2000000 * 0.01) > 2000000.0
test/dma_tests.py:340: AssertionError
Check warning on line 0 in test.test_adrv9025_p
github-actions / Test Results
test_adrv9025_dds_loopback[param_set7-2000000-0.25--58-1-adi.adrv9025] (test.test_adrv9025_p) failed
results.xml [took 0s]
Raw output
assert (2000000 * 0.01) > 2000000.0
test_dds_loopback = <function dds_loopback at 0x7f5ea79e8af0>
iio_uri = 'ip:10.1.0.143', classname = 'adi.adrv9025'
param_set = {'calibrate': 1, 'calibrate_rx_qec_en': 1, 'calibrate_tx_qec_en': 1, 'ensm_mode': 'radio_on', ...}
channel = 1, frequency = 2000000, scale = 0.25, peak_min = -58
@pytest.mark.iio_hardware(hardware)
@pytest.mark.parametrize("classname", [(classname)])
@pytest.mark.parametrize("channel", [0, 1])
@pytest.mark.parametrize(
"param_set, frequency, scale, peak_min",
[
(params["one_cw_tone_manual"], 2000000, 0.5, -42),
(params["one_cw_tone_manual"], 2000000, 0.12, -55),
(params["one_cw_tone_manual"], 2000000, 0.25, -48),
(params["one_cw_tone_slow_attack"], 1000000, 0.12, -44),
(params["one_cw_tone_slow_attack"], 2000000, 0.12, -44),
(params["one_cw_tone_slow_attack"], 500000, 0.12, -44),
(params["change_attenuation_5dB_manual"], 2000000, 0.25, -53),
(params["change_attenuation_10dB_manual"], 2000000, 0.25, -58),
(params["change_attenuation_0dB_slow_attack"], 1000000, 0.12, -35),
(params["change_attenuation_20dB_slow_attack"], 1000000, 0.12, -54),
(params["change_rf_gain_0dB_manual"], 2000000, 0.25, -59),
(params["change_rf_gain_20dB_manual"], 2000000, 0.25, -38),
],
)
def test_adrv9025_dds_loopback(
test_dds_loopback,
iio_uri,
classname,
param_set,
channel,
frequency,
scale,
peak_min,
):
> test_dds_loopback(
iio_uri, classname, param_set, channel, frequency, scale, peak_min
)
test/test_adrv9025_p.py:405:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
uri = 'ip:10.1.0.143', classname = 'adi.adrv9025'
param_set = {'calibrate': 1, 'calibrate_rx_qec_en': 1, 'calibrate_tx_qec_en': 1, 'ensm_mode': 'radio_on', ...}
channel = 1, frequency = 2000000, scale = 0.25, peak_min = -58, use_obs = False
use_rx2 = False
def dds_loopback(
uri,
classname,
param_set,
channel,
frequency,
scale,
peak_min,
use_obs=False,
use_rx2=False,
):
"""dds_loopback: Test DDS loopback with connected loopback cables.
This test requires a devices with TX and RX onboard where the transmit
signal can be recovered. TX FPGA DDSs are used to generate a sinusoid
which is then estimated on the RX side. The receive tone must be within
1% of its expected frequency with a specified peak
parameters:
uri: type=string
URI of IIO context of target board/system
classname: type=string
Name of pyadi interface class which contain attribute
param_set: type=dict
Dictionary of attribute and values to be set before tone is
generated and received
channel: type=list
List of integers or list of list of integers of channels to
enable through tx_enabled_channels
frequency: type=integer
Frequency in Hz of transmitted tone
scale: type=float
Scale of DDS tone. Range [0,1]
peak_min: type=float
Minimum acceptable value of maximum peak in dBFS of received tone
"""
# See if we can tone using DMAs
sdr = eval(classname + "(uri='" + uri + "')")
# Set custom device parameters
for p in param_set.keys():
setattr(sdr, p, param_set[p])
# Set common buffer settings
sdr.tx_cyclic_buffer = True
N = 2 ** 14
if use_obs and use_rx2:
raise Exception("Both RX2 and OBS are selected. Select one at a time.")
if use_rx2:
sdr.rx2_enabled_channels = [channel]
sdr.rx2_buffer_size = N * 2 * len(sdr.rx2_enabled_channels)
elif use_obs:
sdr.obs.rx_enabled_channels = [0]
sdr.obs.rx_buffer_size = N * 2 * len(sdr.obs.rx_enabled_channels)
else:
sdr.rx_enabled_channels = [channel]
sdr.rx_buffer_size = N * 2 * len(sdr.rx_enabled_channels)
# Create a sinewave waveform
if hasattr(sdr, "sample_rate"):
RXFS = int(sdr.sample_rate)
else:
RXFS = int(sdr.orx_sample_rate) if use_obs else int(sdr.rx_sample_rate)
sdr.dds_single_tone(frequency, scale, channel)
# Pass through SDR
try:
for _ in range(10): # Wait
data = sdr.rx2() if use_rx2 else sdr.obs.rx() if use_obs else sdr.rx()
except Exception as e:
del sdr
raise Exception(e)
del sdr
tone_peaks, tone_freqs = spec.spec_est(data, fs=RXFS, ref=2 ** 15, plot=False)
indx = np.argmax(tone_peaks)
diff = np.abs(tone_freqs[indx] - frequency)
s = "Peak: " + str(tone_peaks[indx]) + "@" + str(tone_freqs[indx])
print(s)
if do_html_log:
pytest.data_log = {
"html": gen_line_plot_html(
tone_freqs,
tone_peaks,
"Frequency (Hz)",
"Amplitude (dBFS)",
"{} ({})".format(s, classname),
)
}
> assert (frequency * 0.01) > diff
E assert (2000000 * 0.01) > 2000000.0
test/dma_tests.py:340: AssertionError
Check warning on line 0 in test.test_adrv9025_p
github-actions / Test Results
test_adrv9025_dds_loopback[param_set8-1000000-0.12--35-0-adi.adrv9025] (test.test_adrv9025_p) failed
results.xml [took 0s]
Raw output
assert (1000000 * 0.01) > 1000000.0
test_dds_loopback = <function dds_loopback at 0x7f5ea79e8af0>
iio_uri = 'ip:10.1.0.143', classname = 'adi.adrv9025'
param_set = {'calibrate': 1, 'calibrate_rx_qec_en': 1, 'calibrate_tx_qec_en': 1, 'ensm_mode': 'radio_on', ...}
channel = 0, frequency = 1000000, scale = 0.12, peak_min = -35
@pytest.mark.iio_hardware(hardware)
@pytest.mark.parametrize("classname", [(classname)])
@pytest.mark.parametrize("channel", [0, 1])
@pytest.mark.parametrize(
"param_set, frequency, scale, peak_min",
[
(params["one_cw_tone_manual"], 2000000, 0.5, -42),
(params["one_cw_tone_manual"], 2000000, 0.12, -55),
(params["one_cw_tone_manual"], 2000000, 0.25, -48),
(params["one_cw_tone_slow_attack"], 1000000, 0.12, -44),
(params["one_cw_tone_slow_attack"], 2000000, 0.12, -44),
(params["one_cw_tone_slow_attack"], 500000, 0.12, -44),
(params["change_attenuation_5dB_manual"], 2000000, 0.25, -53),
(params["change_attenuation_10dB_manual"], 2000000, 0.25, -58),
(params["change_attenuation_0dB_slow_attack"], 1000000, 0.12, -35),
(params["change_attenuation_20dB_slow_attack"], 1000000, 0.12, -54),
(params["change_rf_gain_0dB_manual"], 2000000, 0.25, -59),
(params["change_rf_gain_20dB_manual"], 2000000, 0.25, -38),
],
)
def test_adrv9025_dds_loopback(
test_dds_loopback,
iio_uri,
classname,
param_set,
channel,
frequency,
scale,
peak_min,
):
> test_dds_loopback(
iio_uri, classname, param_set, channel, frequency, scale, peak_min
)
test/test_adrv9025_p.py:405:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
uri = 'ip:10.1.0.143', classname = 'adi.adrv9025'
param_set = {'calibrate': 1, 'calibrate_rx_qec_en': 1, 'calibrate_tx_qec_en': 1, 'ensm_mode': 'radio_on', ...}
channel = 0, frequency = 1000000, scale = 0.12, peak_min = -35, use_obs = False
use_rx2 = False
def dds_loopback(
uri,
classname,
param_set,
channel,
frequency,
scale,
peak_min,
use_obs=False,
use_rx2=False,
):
"""dds_loopback: Test DDS loopback with connected loopback cables.
This test requires a devices with TX and RX onboard where the transmit
signal can be recovered. TX FPGA DDSs are used to generate a sinusoid
which is then estimated on the RX side. The receive tone must be within
1% of its expected frequency with a specified peak
parameters:
uri: type=string
URI of IIO context of target board/system
classname: type=string
Name of pyadi interface class which contain attribute
param_set: type=dict
Dictionary of attribute and values to be set before tone is
generated and received
channel: type=list
List of integers or list of list of integers of channels to
enable through tx_enabled_channels
frequency: type=integer
Frequency in Hz of transmitted tone
scale: type=float
Scale of DDS tone. Range [0,1]
peak_min: type=float
Minimum acceptable value of maximum peak in dBFS of received tone
"""
# See if we can tone using DMAs
sdr = eval(classname + "(uri='" + uri + "')")
# Set custom device parameters
for p in param_set.keys():
setattr(sdr, p, param_set[p])
# Set common buffer settings
sdr.tx_cyclic_buffer = True
N = 2 ** 14
if use_obs and use_rx2:
raise Exception("Both RX2 and OBS are selected. Select one at a time.")
if use_rx2:
sdr.rx2_enabled_channels = [channel]
sdr.rx2_buffer_size = N * 2 * len(sdr.rx2_enabled_channels)
elif use_obs:
sdr.obs.rx_enabled_channels = [0]
sdr.obs.rx_buffer_size = N * 2 * len(sdr.obs.rx_enabled_channels)
else:
sdr.rx_enabled_channels = [channel]
sdr.rx_buffer_size = N * 2 * len(sdr.rx_enabled_channels)
# Create a sinewave waveform
if hasattr(sdr, "sample_rate"):
RXFS = int(sdr.sample_rate)
else:
RXFS = int(sdr.orx_sample_rate) if use_obs else int(sdr.rx_sample_rate)
sdr.dds_single_tone(frequency, scale, channel)
# Pass through SDR
try:
for _ in range(10): # Wait
data = sdr.rx2() if use_rx2 else sdr.obs.rx() if use_obs else sdr.rx()
except Exception as e:
del sdr
raise Exception(e)
del sdr
tone_peaks, tone_freqs = spec.spec_est(data, fs=RXFS, ref=2 ** 15, plot=False)
indx = np.argmax(tone_peaks)
diff = np.abs(tone_freqs[indx] - frequency)
s = "Peak: " + str(tone_peaks[indx]) + "@" + str(tone_freqs[indx])
print(s)
if do_html_log:
pytest.data_log = {
"html": gen_line_plot_html(
tone_freqs,
tone_peaks,
"Frequency (Hz)",
"Amplitude (dBFS)",
"{} ({})".format(s, classname),
)
}
> assert (frequency * 0.01) > diff
E assert (1000000 * 0.01) > 1000000.0
test/dma_tests.py:340: AssertionError
Check warning on line 0 in test.test_adrv9025_p
github-actions / Test Results
test_adrv9025_dds_loopback[param_set8-1000000-0.12--35-1-adi.adrv9025] (test.test_adrv9025_p) failed
results.xml [took 0s]
Raw output
assert (1000000 * 0.01) > 1000000.0
test_dds_loopback = <function dds_loopback at 0x7f5ea79e8af0>
iio_uri = 'ip:10.1.0.143', classname = 'adi.adrv9025'
param_set = {'calibrate': 1, 'calibrate_rx_qec_en': 1, 'calibrate_tx_qec_en': 1, 'ensm_mode': 'radio_on', ...}
channel = 1, frequency = 1000000, scale = 0.12, peak_min = -35
@pytest.mark.iio_hardware(hardware)
@pytest.mark.parametrize("classname", [(classname)])
@pytest.mark.parametrize("channel", [0, 1])
@pytest.mark.parametrize(
"param_set, frequency, scale, peak_min",
[
(params["one_cw_tone_manual"], 2000000, 0.5, -42),
(params["one_cw_tone_manual"], 2000000, 0.12, -55),
(params["one_cw_tone_manual"], 2000000, 0.25, -48),
(params["one_cw_tone_slow_attack"], 1000000, 0.12, -44),
(params["one_cw_tone_slow_attack"], 2000000, 0.12, -44),
(params["one_cw_tone_slow_attack"], 500000, 0.12, -44),
(params["change_attenuation_5dB_manual"], 2000000, 0.25, -53),
(params["change_attenuation_10dB_manual"], 2000000, 0.25, -58),
(params["change_attenuation_0dB_slow_attack"], 1000000, 0.12, -35),
(params["change_attenuation_20dB_slow_attack"], 1000000, 0.12, -54),
(params["change_rf_gain_0dB_manual"], 2000000, 0.25, -59),
(params["change_rf_gain_20dB_manual"], 2000000, 0.25, -38),
],
)
def test_adrv9025_dds_loopback(
test_dds_loopback,
iio_uri,
classname,
param_set,
channel,
frequency,
scale,
peak_min,
):
> test_dds_loopback(
iio_uri, classname, param_set, channel, frequency, scale, peak_min
)
test/test_adrv9025_p.py:405:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
uri = 'ip:10.1.0.143', classname = 'adi.adrv9025'
param_set = {'calibrate': 1, 'calibrate_rx_qec_en': 1, 'calibrate_tx_qec_en': 1, 'ensm_mode': 'radio_on', ...}
channel = 1, frequency = 1000000, scale = 0.12, peak_min = -35, use_obs = False
use_rx2 = False
def dds_loopback(
uri,
classname,
param_set,
channel,
frequency,
scale,
peak_min,
use_obs=False,
use_rx2=False,
):
"""dds_loopback: Test DDS loopback with connected loopback cables.
This test requires a devices with TX and RX onboard where the transmit
signal can be recovered. TX FPGA DDSs are used to generate a sinusoid
which is then estimated on the RX side. The receive tone must be within
1% of its expected frequency with a specified peak
parameters:
uri: type=string
URI of IIO context of target board/system
classname: type=string
Name of pyadi interface class which contain attribute
param_set: type=dict
Dictionary of attribute and values to be set before tone is
generated and received
channel: type=list
List of integers or list of list of integers of channels to
enable through tx_enabled_channels
frequency: type=integer
Frequency in Hz of transmitted tone
scale: type=float
Scale of DDS tone. Range [0,1]
peak_min: type=float
Minimum acceptable value of maximum peak in dBFS of received tone
"""
# See if we can tone using DMAs
sdr = eval(classname + "(uri='" + uri + "')")
# Set custom device parameters
for p in param_set.keys():
setattr(sdr, p, param_set[p])
# Set common buffer settings
sdr.tx_cyclic_buffer = True
N = 2 ** 14
if use_obs and use_rx2:
raise Exception("Both RX2 and OBS are selected. Select one at a time.")
if use_rx2:
sdr.rx2_enabled_channels = [channel]
sdr.rx2_buffer_size = N * 2 * len(sdr.rx2_enabled_channels)
elif use_obs:
sdr.obs.rx_enabled_channels = [0]
sdr.obs.rx_buffer_size = N * 2 * len(sdr.obs.rx_enabled_channels)
else:
sdr.rx_enabled_channels = [channel]
sdr.rx_buffer_size = N * 2 * len(sdr.rx_enabled_channels)
# Create a sinewave waveform
if hasattr(sdr, "sample_rate"):
RXFS = int(sdr.sample_rate)
else:
RXFS = int(sdr.orx_sample_rate) if use_obs else int(sdr.rx_sample_rate)
sdr.dds_single_tone(frequency, scale, channel)
# Pass through SDR
try:
for _ in range(10): # Wait
data = sdr.rx2() if use_rx2 else sdr.obs.rx() if use_obs else sdr.rx()
except Exception as e:
del sdr
raise Exception(e)
del sdr
tone_peaks, tone_freqs = spec.spec_est(data, fs=RXFS, ref=2 ** 15, plot=False)
indx = np.argmax(tone_peaks)
diff = np.abs(tone_freqs[indx] - frequency)
s = "Peak: " + str(tone_peaks[indx]) + "@" + str(tone_freqs[indx])
print(s)
if do_html_log:
pytest.data_log = {
"html": gen_line_plot_html(
tone_freqs,
tone_peaks,
"Frequency (Hz)",
"Amplitude (dBFS)",
"{} ({})".format(s, classname),
)
}
> assert (frequency * 0.01) > diff
E assert (1000000 * 0.01) > 1000000.0
test/dma_tests.py:340: AssertionError
Check warning on line 0 in test.test_adrv9025_p
github-actions / Test Results
test_adrv9025_dds_loopback[param_set9-1000000-0.12--54-0-adi.adrv9025] (test.test_adrv9025_p) failed
results.xml [took 0s]
Raw output
assert (1000000 * 0.01) > 1000000.0
test_dds_loopback = <function dds_loopback at 0x7f5ea79e8af0>
iio_uri = 'ip:10.1.0.143', classname = 'adi.adrv9025'
param_set = {'calibrate': 1, 'calibrate_rx_qec_en': 1, 'calibrate_tx_qec_en': 1, 'ensm_mode': 'radio_on', ...}
channel = 0, frequency = 1000000, scale = 0.12, peak_min = -54
@pytest.mark.iio_hardware(hardware)
@pytest.mark.parametrize("classname", [(classname)])
@pytest.mark.parametrize("channel", [0, 1])
@pytest.mark.parametrize(
"param_set, frequency, scale, peak_min",
[
(params["one_cw_tone_manual"], 2000000, 0.5, -42),
(params["one_cw_tone_manual"], 2000000, 0.12, -55),
(params["one_cw_tone_manual"], 2000000, 0.25, -48),
(params["one_cw_tone_slow_attack"], 1000000, 0.12, -44),
(params["one_cw_tone_slow_attack"], 2000000, 0.12, -44),
(params["one_cw_tone_slow_attack"], 500000, 0.12, -44),
(params["change_attenuation_5dB_manual"], 2000000, 0.25, -53),
(params["change_attenuation_10dB_manual"], 2000000, 0.25, -58),
(params["change_attenuation_0dB_slow_attack"], 1000000, 0.12, -35),
(params["change_attenuation_20dB_slow_attack"], 1000000, 0.12, -54),
(params["change_rf_gain_0dB_manual"], 2000000, 0.25, -59),
(params["change_rf_gain_20dB_manual"], 2000000, 0.25, -38),
],
)
def test_adrv9025_dds_loopback(
test_dds_loopback,
iio_uri,
classname,
param_set,
channel,
frequency,
scale,
peak_min,
):
> test_dds_loopback(
iio_uri, classname, param_set, channel, frequency, scale, peak_min
)
test/test_adrv9025_p.py:405:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
uri = 'ip:10.1.0.143', classname = 'adi.adrv9025'
param_set = {'calibrate': 1, 'calibrate_rx_qec_en': 1, 'calibrate_tx_qec_en': 1, 'ensm_mode': 'radio_on', ...}
channel = 0, frequency = 1000000, scale = 0.12, peak_min = -54, use_obs = False
use_rx2 = False
def dds_loopback(
uri,
classname,
param_set,
channel,
frequency,
scale,
peak_min,
use_obs=False,
use_rx2=False,
):
"""dds_loopback: Test DDS loopback with connected loopback cables.
This test requires a devices with TX and RX onboard where the transmit
signal can be recovered. TX FPGA DDSs are used to generate a sinusoid
which is then estimated on the RX side. The receive tone must be within
1% of its expected frequency with a specified peak
parameters:
uri: type=string
URI of IIO context of target board/system
classname: type=string
Name of pyadi interface class which contain attribute
param_set: type=dict
Dictionary of attribute and values to be set before tone is
generated and received
channel: type=list
List of integers or list of list of integers of channels to
enable through tx_enabled_channels
frequency: type=integer
Frequency in Hz of transmitted tone
scale: type=float
Scale of DDS tone. Range [0,1]
peak_min: type=float
Minimum acceptable value of maximum peak in dBFS of received tone
"""
# See if we can tone using DMAs
sdr = eval(classname + "(uri='" + uri + "')")
# Set custom device parameters
for p in param_set.keys():
setattr(sdr, p, param_set[p])
# Set common buffer settings
sdr.tx_cyclic_buffer = True
N = 2 ** 14
if use_obs and use_rx2:
raise Exception("Both RX2 and OBS are selected. Select one at a time.")
if use_rx2:
sdr.rx2_enabled_channels = [channel]
sdr.rx2_buffer_size = N * 2 * len(sdr.rx2_enabled_channels)
elif use_obs:
sdr.obs.rx_enabled_channels = [0]
sdr.obs.rx_buffer_size = N * 2 * len(sdr.obs.rx_enabled_channels)
else:
sdr.rx_enabled_channels = [channel]
sdr.rx_buffer_size = N * 2 * len(sdr.rx_enabled_channels)
# Create a sinewave waveform
if hasattr(sdr, "sample_rate"):
RXFS = int(sdr.sample_rate)
else:
RXFS = int(sdr.orx_sample_rate) if use_obs else int(sdr.rx_sample_rate)
sdr.dds_single_tone(frequency, scale, channel)
# Pass through SDR
try:
for _ in range(10): # Wait
data = sdr.rx2() if use_rx2 else sdr.obs.rx() if use_obs else sdr.rx()
except Exception as e:
del sdr
raise Exception(e)
del sdr
tone_peaks, tone_freqs = spec.spec_est(data, fs=RXFS, ref=2 ** 15, plot=False)
indx = np.argmax(tone_peaks)
diff = np.abs(tone_freqs[indx] - frequency)
s = "Peak: " + str(tone_peaks[indx]) + "@" + str(tone_freqs[indx])
print(s)
if do_html_log:
pytest.data_log = {
"html": gen_line_plot_html(
tone_freqs,
tone_peaks,
"Frequency (Hz)",
"Amplitude (dBFS)",
"{} ({})".format(s, classname),
)
}
> assert (frequency * 0.01) > diff
E assert (1000000 * 0.01) > 1000000.0
test/dma_tests.py:340: AssertionError
Check warning on line 0 in test.test_adrv9025_p
github-actions / Test Results
test_adrv9025_dds_loopback[param_set9-1000000-0.12--54-1-adi.adrv9025] (test.test_adrv9025_p) failed
results.xml [took 0s]
Raw output
assert (1000000 * 0.01) > 1000000.0
test_dds_loopback = <function dds_loopback at 0x7f5ea79e8af0>
iio_uri = 'ip:10.1.0.143', classname = 'adi.adrv9025'
param_set = {'calibrate': 1, 'calibrate_rx_qec_en': 1, 'calibrate_tx_qec_en': 1, 'ensm_mode': 'radio_on', ...}
channel = 1, frequency = 1000000, scale = 0.12, peak_min = -54
@pytest.mark.iio_hardware(hardware)
@pytest.mark.parametrize("classname", [(classname)])
@pytest.mark.parametrize("channel", [0, 1])
@pytest.mark.parametrize(
"param_set, frequency, scale, peak_min",
[
(params["one_cw_tone_manual"], 2000000, 0.5, -42),
(params["one_cw_tone_manual"], 2000000, 0.12, -55),
(params["one_cw_tone_manual"], 2000000, 0.25, -48),
(params["one_cw_tone_slow_attack"], 1000000, 0.12, -44),
(params["one_cw_tone_slow_attack"], 2000000, 0.12, -44),
(params["one_cw_tone_slow_attack"], 500000, 0.12, -44),
(params["change_attenuation_5dB_manual"], 2000000, 0.25, -53),
(params["change_attenuation_10dB_manual"], 2000000, 0.25, -58),
(params["change_attenuation_0dB_slow_attack"], 1000000, 0.12, -35),
(params["change_attenuation_20dB_slow_attack"], 1000000, 0.12, -54),
(params["change_rf_gain_0dB_manual"], 2000000, 0.25, -59),
(params["change_rf_gain_20dB_manual"], 2000000, 0.25, -38),
],
)
def test_adrv9025_dds_loopback(
test_dds_loopback,
iio_uri,
classname,
param_set,
channel,
frequency,
scale,
peak_min,
):
> test_dds_loopback(
iio_uri, classname, param_set, channel, frequency, scale, peak_min
)
test/test_adrv9025_p.py:405:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
uri = 'ip:10.1.0.143', classname = 'adi.adrv9025'
param_set = {'calibrate': 1, 'calibrate_rx_qec_en': 1, 'calibrate_tx_qec_en': 1, 'ensm_mode': 'radio_on', ...}
channel = 1, frequency = 1000000, scale = 0.12, peak_min = -54, use_obs = False
use_rx2 = False
def dds_loopback(
uri,
classname,
param_set,
channel,
frequency,
scale,
peak_min,
use_obs=False,
use_rx2=False,
):
"""dds_loopback: Test DDS loopback with connected loopback cables.
This test requires a devices with TX and RX onboard where the transmit
signal can be recovered. TX FPGA DDSs are used to generate a sinusoid
which is then estimated on the RX side. The receive tone must be within
1% of its expected frequency with a specified peak
parameters:
uri: type=string
URI of IIO context of target board/system
classname: type=string
Name of pyadi interface class which contain attribute
param_set: type=dict
Dictionary of attribute and values to be set before tone is
generated and received
channel: type=list
List of integers or list of list of integers of channels to
enable through tx_enabled_channels
frequency: type=integer
Frequency in Hz of transmitted tone
scale: type=float
Scale of DDS tone. Range [0,1]
peak_min: type=float
Minimum acceptable value of maximum peak in dBFS of received tone
"""
# See if we can tone using DMAs
sdr = eval(classname + "(uri='" + uri + "')")
# Set custom device parameters
for p in param_set.keys():
setattr(sdr, p, param_set[p])
# Set common buffer settings
sdr.tx_cyclic_buffer = True
N = 2 ** 14
if use_obs and use_rx2:
raise Exception("Both RX2 and OBS are selected. Select one at a time.")
if use_rx2:
sdr.rx2_enabled_channels = [channel]
sdr.rx2_buffer_size = N * 2 * len(sdr.rx2_enabled_channels)
elif use_obs:
sdr.obs.rx_enabled_channels = [0]
sdr.obs.rx_buffer_size = N * 2 * len(sdr.obs.rx_enabled_channels)
else:
sdr.rx_enabled_channels = [channel]
sdr.rx_buffer_size = N * 2 * len(sdr.rx_enabled_channels)
# Create a sinewave waveform
if hasattr(sdr, "sample_rate"):
RXFS = int(sdr.sample_rate)
else:
RXFS = int(sdr.orx_sample_rate) if use_obs else int(sdr.rx_sample_rate)
sdr.dds_single_tone(frequency, scale, channel)
# Pass through SDR
try:
for _ in range(10): # Wait
data = sdr.rx2() if use_rx2 else sdr.obs.rx() if use_obs else sdr.rx()
except Exception as e:
del sdr
raise Exception(e)
del sdr
tone_peaks, tone_freqs = spec.spec_est(data, fs=RXFS, ref=2 ** 15, plot=False)
indx = np.argmax(tone_peaks)
diff = np.abs(tone_freqs[indx] - frequency)
s = "Peak: " + str(tone_peaks[indx]) + "@" + str(tone_freqs[indx])
print(s)
if do_html_log:
pytest.data_log = {
"html": gen_line_plot_html(
tone_freqs,
tone_peaks,
"Frequency (Hz)",
"Amplitude (dBFS)",
"{} ({})".format(s, classname),
)
}
> assert (frequency * 0.01) > diff
E assert (1000000 * 0.01) > 1000000.0
test/dma_tests.py:340: AssertionError
Check warning on line 0 in test.test_adrv9025_p
github-actions / Test Results
test_adrv9025_dds_loopback[param_set10-2000000-0.25--59-0-adi.adrv9025] (test.test_adrv9025_p) failed
results.xml [took 0s]
Raw output
assert (2000000 * 0.01) > 2000000.0
test_dds_loopback = <function dds_loopback at 0x7f5ea79e8af0>
iio_uri = 'ip:10.1.0.143', classname = 'adi.adrv9025'
param_set = {'calibrate': 1, 'calibrate_rx_qec_en': 1, 'calibrate_tx_qec_en': 1, 'ensm_mode': 'radio_on', ...}
channel = 0, frequency = 2000000, scale = 0.25, peak_min = -59
@pytest.mark.iio_hardware(hardware)
@pytest.mark.parametrize("classname", [(classname)])
@pytest.mark.parametrize("channel", [0, 1])
@pytest.mark.parametrize(
"param_set, frequency, scale, peak_min",
[
(params["one_cw_tone_manual"], 2000000, 0.5, -42),
(params["one_cw_tone_manual"], 2000000, 0.12, -55),
(params["one_cw_tone_manual"], 2000000, 0.25, -48),
(params["one_cw_tone_slow_attack"], 1000000, 0.12, -44),
(params["one_cw_tone_slow_attack"], 2000000, 0.12, -44),
(params["one_cw_tone_slow_attack"], 500000, 0.12, -44),
(params["change_attenuation_5dB_manual"], 2000000, 0.25, -53),
(params["change_attenuation_10dB_manual"], 2000000, 0.25, -58),
(params["change_attenuation_0dB_slow_attack"], 1000000, 0.12, -35),
(params["change_attenuation_20dB_slow_attack"], 1000000, 0.12, -54),
(params["change_rf_gain_0dB_manual"], 2000000, 0.25, -59),
(params["change_rf_gain_20dB_manual"], 2000000, 0.25, -38),
],
)
def test_adrv9025_dds_loopback(
test_dds_loopback,
iio_uri,
classname,
param_set,
channel,
frequency,
scale,
peak_min,
):
> test_dds_loopback(
iio_uri, classname, param_set, channel, frequency, scale, peak_min
)
test/test_adrv9025_p.py:405:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
uri = 'ip:10.1.0.143', classname = 'adi.adrv9025'
param_set = {'calibrate': 1, 'calibrate_rx_qec_en': 1, 'calibrate_tx_qec_en': 1, 'ensm_mode': 'radio_on', ...}
channel = 0, frequency = 2000000, scale = 0.25, peak_min = -59, use_obs = False
use_rx2 = False
def dds_loopback(
uri,
classname,
param_set,
channel,
frequency,
scale,
peak_min,
use_obs=False,
use_rx2=False,
):
"""dds_loopback: Test DDS loopback with connected loopback cables.
This test requires a devices with TX and RX onboard where the transmit
signal can be recovered. TX FPGA DDSs are used to generate a sinusoid
which is then estimated on the RX side. The receive tone must be within
1% of its expected frequency with a specified peak
parameters:
uri: type=string
URI of IIO context of target board/system
classname: type=string
Name of pyadi interface class which contain attribute
param_set: type=dict
Dictionary of attribute and values to be set before tone is
generated and received
channel: type=list
List of integers or list of list of integers of channels to
enable through tx_enabled_channels
frequency: type=integer
Frequency in Hz of transmitted tone
scale: type=float
Scale of DDS tone. Range [0,1]
peak_min: type=float
Minimum acceptable value of maximum peak in dBFS of received tone
"""
# See if we can tone using DMAs
sdr = eval(classname + "(uri='" + uri + "')")
# Set custom device parameters
for p in param_set.keys():
setattr(sdr, p, param_set[p])
# Set common buffer settings
sdr.tx_cyclic_buffer = True
N = 2 ** 14
if use_obs and use_rx2:
raise Exception("Both RX2 and OBS are selected. Select one at a time.")
if use_rx2:
sdr.rx2_enabled_channels = [channel]
sdr.rx2_buffer_size = N * 2 * len(sdr.rx2_enabled_channels)
elif use_obs:
sdr.obs.rx_enabled_channels = [0]
sdr.obs.rx_buffer_size = N * 2 * len(sdr.obs.rx_enabled_channels)
else:
sdr.rx_enabled_channels = [channel]
sdr.rx_buffer_size = N * 2 * len(sdr.rx_enabled_channels)
# Create a sinewave waveform
if hasattr(sdr, "sample_rate"):
RXFS = int(sdr.sample_rate)
else:
RXFS = int(sdr.orx_sample_rate) if use_obs else int(sdr.rx_sample_rate)
sdr.dds_single_tone(frequency, scale, channel)
# Pass through SDR
try:
for _ in range(10): # Wait
data = sdr.rx2() if use_rx2 else sdr.obs.rx() if use_obs else sdr.rx()
except Exception as e:
del sdr
raise Exception(e)
del sdr
tone_peaks, tone_freqs = spec.spec_est(data, fs=RXFS, ref=2 ** 15, plot=False)
indx = np.argmax(tone_peaks)
diff = np.abs(tone_freqs[indx] - frequency)
s = "Peak: " + str(tone_peaks[indx]) + "@" + str(tone_freqs[indx])
print(s)
if do_html_log:
pytest.data_log = {
"html": gen_line_plot_html(
tone_freqs,
tone_peaks,
"Frequency (Hz)",
"Amplitude (dBFS)",
"{} ({})".format(s, classname),
)
}
> assert (frequency * 0.01) > diff
E assert (2000000 * 0.01) > 2000000.0
test/dma_tests.py:340: AssertionError
Check warning on line 0 in test.test_adrv9025_p
github-actions / Test Results
test_adrv9025_dds_loopback[param_set10-2000000-0.25--59-1-adi.adrv9025] (test.test_adrv9025_p) failed
results.xml [took 0s]
Raw output
assert (2000000 * 0.01) > 2000000.0
test_dds_loopback = <function dds_loopback at 0x7f5ea79e8af0>
iio_uri = 'ip:10.1.0.143', classname = 'adi.adrv9025'
param_set = {'calibrate': 1, 'calibrate_rx_qec_en': 1, 'calibrate_tx_qec_en': 1, 'ensm_mode': 'radio_on', ...}
channel = 1, frequency = 2000000, scale = 0.25, peak_min = -59
@pytest.mark.iio_hardware(hardware)
@pytest.mark.parametrize("classname", [(classname)])
@pytest.mark.parametrize("channel", [0, 1])
@pytest.mark.parametrize(
"param_set, frequency, scale, peak_min",
[
(params["one_cw_tone_manual"], 2000000, 0.5, -42),
(params["one_cw_tone_manual"], 2000000, 0.12, -55),
(params["one_cw_tone_manual"], 2000000, 0.25, -48),
(params["one_cw_tone_slow_attack"], 1000000, 0.12, -44),
(params["one_cw_tone_slow_attack"], 2000000, 0.12, -44),
(params["one_cw_tone_slow_attack"], 500000, 0.12, -44),
(params["change_attenuation_5dB_manual"], 2000000, 0.25, -53),
(params["change_attenuation_10dB_manual"], 2000000, 0.25, -58),
(params["change_attenuation_0dB_slow_attack"], 1000000, 0.12, -35),
(params["change_attenuation_20dB_slow_attack"], 1000000, 0.12, -54),
(params["change_rf_gain_0dB_manual"], 2000000, 0.25, -59),
(params["change_rf_gain_20dB_manual"], 2000000, 0.25, -38),
],
)
def test_adrv9025_dds_loopback(
test_dds_loopback,
iio_uri,
classname,
param_set,
channel,
frequency,
scale,
peak_min,
):
> test_dds_loopback(
iio_uri, classname, param_set, channel, frequency, scale, peak_min
)
test/test_adrv9025_p.py:405:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
uri = 'ip:10.1.0.143', classname = 'adi.adrv9025'
param_set = {'calibrate': 1, 'calibrate_rx_qec_en': 1, 'calibrate_tx_qec_en': 1, 'ensm_mode': 'radio_on', ...}
channel = 1, frequency = 2000000, scale = 0.25, peak_min = -59, use_obs = False
use_rx2 = False
def dds_loopback(
uri,
classname,
param_set,
channel,
frequency,
scale,
peak_min,
use_obs=False,
use_rx2=False,
):
"""dds_loopback: Test DDS loopback with connected loopback cables.
This test requires a devices with TX and RX onboard where the transmit
signal can be recovered. TX FPGA DDSs are used to generate a sinusoid
which is then estimated on the RX side. The receive tone must be within
1% of its expected frequency with a specified peak
parameters:
uri: type=string
URI of IIO context of target board/system
classname: type=string
Name of pyadi interface class which contain attribute
param_set: type=dict
Dictionary of attribute and values to be set before tone is
generated and received
channel: type=list
List of integers or list of list of integers of channels to
enable through tx_enabled_channels
frequency: type=integer
Frequency in Hz of transmitted tone
scale: type=float
Scale of DDS tone. Range [0,1]
peak_min: type=float
Minimum acceptable value of maximum peak in dBFS of received tone
"""
# See if we can tone using DMAs
sdr = eval(classname + "(uri='" + uri + "')")
# Set custom device parameters
for p in param_set.keys():
setattr(sdr, p, param_set[p])
# Set common buffer settings
sdr.tx_cyclic_buffer = True
N = 2 ** 14
if use_obs and use_rx2:
raise Exception("Both RX2 and OBS are selected. Select one at a time.")
if use_rx2:
sdr.rx2_enabled_channels = [channel]
sdr.rx2_buffer_size = N * 2 * len(sdr.rx2_enabled_channels)
elif use_obs:
sdr.obs.rx_enabled_channels = [0]
sdr.obs.rx_buffer_size = N * 2 * len(sdr.obs.rx_enabled_channels)
else:
sdr.rx_enabled_channels = [channel]
sdr.rx_buffer_size = N * 2 * len(sdr.rx_enabled_channels)
# Create a sinewave waveform
if hasattr(sdr, "sample_rate"):
RXFS = int(sdr.sample_rate)
else:
RXFS = int(sdr.orx_sample_rate) if use_obs else int(sdr.rx_sample_rate)
sdr.dds_single_tone(frequency, scale, channel)
# Pass through SDR
try:
for _ in range(10): # Wait
data = sdr.rx2() if use_rx2 else sdr.obs.rx() if use_obs else sdr.rx()
except Exception as e:
del sdr
raise Exception(e)
del sdr
tone_peaks, tone_freqs = spec.spec_est(data, fs=RXFS, ref=2 ** 15, plot=False)
indx = np.argmax(tone_peaks)
diff = np.abs(tone_freqs[indx] - frequency)
s = "Peak: " + str(tone_peaks[indx]) + "@" + str(tone_freqs[indx])
print(s)
if do_html_log:
pytest.data_log = {
"html": gen_line_plot_html(
tone_freqs,
tone_peaks,
"Frequency (Hz)",
"Amplitude (dBFS)",
"{} ({})".format(s, classname),
)
}
> assert (frequency * 0.01) > diff
E assert (2000000 * 0.01) > 2000000.0
test/dma_tests.py:340: AssertionError
Check warning on line 0 in test.test_adrv9025_p
github-actions / Test Results
test_adrv9025_dds_loopback[param_set11-2000000-0.25--38-0-adi.adrv9025] (test.test_adrv9025_p) failed
results.xml [took 0s]
Raw output
assert (2000000 * 0.01) > 2000000.0
test_dds_loopback = <function dds_loopback at 0x7f5ea79e8af0>
iio_uri = 'ip:10.1.0.143', classname = 'adi.adrv9025'
param_set = {'calibrate': 1, 'calibrate_rx_qec_en': 1, 'calibrate_tx_qec_en': 1, 'ensm_mode': 'radio_on', ...}
channel = 0, frequency = 2000000, scale = 0.25, peak_min = -38
@pytest.mark.iio_hardware(hardware)
@pytest.mark.parametrize("classname", [(classname)])
@pytest.mark.parametrize("channel", [0, 1])
@pytest.mark.parametrize(
"param_set, frequency, scale, peak_min",
[
(params["one_cw_tone_manual"], 2000000, 0.5, -42),
(params["one_cw_tone_manual"], 2000000, 0.12, -55),
(params["one_cw_tone_manual"], 2000000, 0.25, -48),
(params["one_cw_tone_slow_attack"], 1000000, 0.12, -44),
(params["one_cw_tone_slow_attack"], 2000000, 0.12, -44),
(params["one_cw_tone_slow_attack"], 500000, 0.12, -44),
(params["change_attenuation_5dB_manual"], 2000000, 0.25, -53),
(params["change_attenuation_10dB_manual"], 2000000, 0.25, -58),
(params["change_attenuation_0dB_slow_attack"], 1000000, 0.12, -35),
(params["change_attenuation_20dB_slow_attack"], 1000000, 0.12, -54),
(params["change_rf_gain_0dB_manual"], 2000000, 0.25, -59),
(params["change_rf_gain_20dB_manual"], 2000000, 0.25, -38),
],
)
def test_adrv9025_dds_loopback(
test_dds_loopback,
iio_uri,
classname,
param_set,
channel,
frequency,
scale,
peak_min,
):
> test_dds_loopback(
iio_uri, classname, param_set, channel, frequency, scale, peak_min
)
test/test_adrv9025_p.py:405:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
uri = 'ip:10.1.0.143', classname = 'adi.adrv9025'
param_set = {'calibrate': 1, 'calibrate_rx_qec_en': 1, 'calibrate_tx_qec_en': 1, 'ensm_mode': 'radio_on', ...}
channel = 0, frequency = 2000000, scale = 0.25, peak_min = -38, use_obs = False
use_rx2 = False
def dds_loopback(
uri,
classname,
param_set,
channel,
frequency,
scale,
peak_min,
use_obs=False,
use_rx2=False,
):
"""dds_loopback: Test DDS loopback with connected loopback cables.
This test requires a devices with TX and RX onboard where the transmit
signal can be recovered. TX FPGA DDSs are used to generate a sinusoid
which is then estimated on the RX side. The receive tone must be within
1% of its expected frequency with a specified peak
parameters:
uri: type=string
URI of IIO context of target board/system
classname: type=string
Name of pyadi interface class which contain attribute
param_set: type=dict
Dictionary of attribute and values to be set before tone is
generated and received
channel: type=list
List of integers or list of list of integers of channels to
enable through tx_enabled_channels
frequency: type=integer
Frequency in Hz of transmitted tone
scale: type=float
Scale of DDS tone. Range [0,1]
peak_min: type=float
Minimum acceptable value of maximum peak in dBFS of received tone
"""
# See if we can tone using DMAs
sdr = eval(classname + "(uri='" + uri + "')")
# Set custom device parameters
for p in param_set.keys():
setattr(sdr, p, param_set[p])
# Set common buffer settings
sdr.tx_cyclic_buffer = True
N = 2 ** 14
if use_obs and use_rx2:
raise Exception("Both RX2 and OBS are selected. Select one at a time.")
if use_rx2:
sdr.rx2_enabled_channels = [channel]
sdr.rx2_buffer_size = N * 2 * len(sdr.rx2_enabled_channels)
elif use_obs:
sdr.obs.rx_enabled_channels = [0]
sdr.obs.rx_buffer_size = N * 2 * len(sdr.obs.rx_enabled_channels)
else:
sdr.rx_enabled_channels = [channel]
sdr.rx_buffer_size = N * 2 * len(sdr.rx_enabled_channels)
# Create a sinewave waveform
if hasattr(sdr, "sample_rate"):
RXFS = int(sdr.sample_rate)
else:
RXFS = int(sdr.orx_sample_rate) if use_obs else int(sdr.rx_sample_rate)
sdr.dds_single_tone(frequency, scale, channel)
# Pass through SDR
try:
for _ in range(10): # Wait
data = sdr.rx2() if use_rx2 else sdr.obs.rx() if use_obs else sdr.rx()
except Exception as e:
del sdr
raise Exception(e)
del sdr
tone_peaks, tone_freqs = spec.spec_est(data, fs=RXFS, ref=2 ** 15, plot=False)
indx = np.argmax(tone_peaks)
diff = np.abs(tone_freqs[indx] - frequency)
s = "Peak: " + str(tone_peaks[indx]) + "@" + str(tone_freqs[indx])
print(s)
if do_html_log:
pytest.data_log = {
"html": gen_line_plot_html(
tone_freqs,
tone_peaks,
"Frequency (Hz)",
"Amplitude (dBFS)",
"{} ({})".format(s, classname),
)
}
> assert (frequency * 0.01) > diff
E assert (2000000 * 0.01) > 2000000.0
test/dma_tests.py:340: AssertionError
Check warning on line 0 in test.test_adrv9025_p
github-actions / Test Results
test_adrv9025_dds_loopback[param_set11-2000000-0.25--38-1-adi.adrv9025] (test.test_adrv9025_p) failed
results.xml [took 0s]
Raw output
assert (2000000 * 0.01) > 2000000.0
test_dds_loopback = <function dds_loopback at 0x7f5ea79e8af0>
iio_uri = 'ip:10.1.0.143', classname = 'adi.adrv9025'
param_set = {'calibrate': 1, 'calibrate_rx_qec_en': 1, 'calibrate_tx_qec_en': 1, 'ensm_mode': 'radio_on', ...}
channel = 1, frequency = 2000000, scale = 0.25, peak_min = -38
@pytest.mark.iio_hardware(hardware)
@pytest.mark.parametrize("classname", [(classname)])
@pytest.mark.parametrize("channel", [0, 1])
@pytest.mark.parametrize(
"param_set, frequency, scale, peak_min",
[
(params["one_cw_tone_manual"], 2000000, 0.5, -42),
(params["one_cw_tone_manual"], 2000000, 0.12, -55),
(params["one_cw_tone_manual"], 2000000, 0.25, -48),
(params["one_cw_tone_slow_attack"], 1000000, 0.12, -44),
(params["one_cw_tone_slow_attack"], 2000000, 0.12, -44),
(params["one_cw_tone_slow_attack"], 500000, 0.12, -44),
(params["change_attenuation_5dB_manual"], 2000000, 0.25, -53),
(params["change_attenuation_10dB_manual"], 2000000, 0.25, -58),
(params["change_attenuation_0dB_slow_attack"], 1000000, 0.12, -35),
(params["change_attenuation_20dB_slow_attack"], 1000000, 0.12, -54),
(params["change_rf_gain_0dB_manual"], 2000000, 0.25, -59),
(params["change_rf_gain_20dB_manual"], 2000000, 0.25, -38),
],
)
def test_adrv9025_dds_loopback(
test_dds_loopback,
iio_uri,
classname,
param_set,
channel,
frequency,
scale,
peak_min,
):
> test_dds_loopback(
iio_uri, classname, param_set, channel, frequency, scale, peak_min
)
test/test_adrv9025_p.py:405:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
uri = 'ip:10.1.0.143', classname = 'adi.adrv9025'
param_set = {'calibrate': 1, 'calibrate_rx_qec_en': 1, 'calibrate_tx_qec_en': 1, 'ensm_mode': 'radio_on', ...}
channel = 1, frequency = 2000000, scale = 0.25, peak_min = -38, use_obs = False
use_rx2 = False
def dds_loopback(
uri,
classname,
param_set,
channel,
frequency,
scale,
peak_min,
use_obs=False,
use_rx2=False,
):
"""dds_loopback: Test DDS loopback with connected loopback cables.
This test requires a devices with TX and RX onboard where the transmit
signal can be recovered. TX FPGA DDSs are used to generate a sinusoid
which is then estimated on the RX side. The receive tone must be within
1% of its expected frequency with a specified peak
parameters:
uri: type=string
URI of IIO context of target board/system
classname: type=string
Name of pyadi interface class which contain attribute
param_set: type=dict
Dictionary of attribute and values to be set before tone is
generated and received
channel: type=list
List of integers or list of list of integers of channels to
enable through tx_enabled_channels
frequency: type=integer
Frequency in Hz of transmitted tone
scale: type=float
Scale of DDS tone. Range [0,1]
peak_min: type=float
Minimum acceptable value of maximum peak in dBFS of received tone
"""
# See if we can tone using DMAs
sdr = eval(classname + "(uri='" + uri + "')")
# Set custom device parameters
for p in param_set.keys():
setattr(sdr, p, param_set[p])
# Set common buffer settings
sdr.tx_cyclic_buffer = True
N = 2 ** 14
if use_obs and use_rx2:
raise Exception("Both RX2 and OBS are selected. Select one at a time.")
if use_rx2:
sdr.rx2_enabled_channels = [channel]
sdr.rx2_buffer_size = N * 2 * len(sdr.rx2_enabled_channels)
elif use_obs:
sdr.obs.rx_enabled_channels = [0]
sdr.obs.rx_buffer_size = N * 2 * len(sdr.obs.rx_enabled_channels)
else:
sdr.rx_enabled_channels = [channel]
sdr.rx_buffer_size = N * 2 * len(sdr.rx_enabled_channels)
# Create a sinewave waveform
if hasattr(sdr, "sample_rate"):
RXFS = int(sdr.sample_rate)
else:
RXFS = int(sdr.orx_sample_rate) if use_obs else int(sdr.rx_sample_rate)
sdr.dds_single_tone(frequency, scale, channel)
# Pass through SDR
try:
for _ in range(10): # Wait
data = sdr.rx2() if use_rx2 else sdr.obs.rx() if use_obs else sdr.rx()
except Exception as e:
del sdr
raise Exception(e)
del sdr
tone_peaks, tone_freqs = spec.spec_est(data, fs=RXFS, ref=2 ** 15, plot=False)
indx = np.argmax(tone_peaks)
diff = np.abs(tone_freqs[indx] - frequency)
s = "Peak: " + str(tone_peaks[indx]) + "@" + str(tone_freqs[indx])
print(s)
if do_html_log:
pytest.data_log = {
"html": gen_line_plot_html(
tone_freqs,
tone_peaks,
"Frequency (Hz)",
"Amplitude (dBFS)",
"{} ({})".format(s, classname),
)
}
> assert (frequency * 0.01) > diff
E assert (2000000 * 0.01) > 2000000.0
test/dma_tests.py:340: AssertionError