DMA Tests#

Functions used by test fixtures for evaluating receive and transmit DMA/buffers

test.dma_tests.cw_loopback(uri, classname, channel, param_set, use_tx2=False, use_rx2=False)#

cw_loopback: Test CW loopback with connected loopback cables. This test requires a devices with TX and RX onboard where the transmit signal can be recovered. Sinuoidal data is passed to DMAs which is then estimated on the RX side. The receive tone must be within 1% of its expected frequency at the max peak found

parameters:
uri: type=string

URI of IIO context of target board/system

classname: type=string

Name of pyadi interface class which contain attribute

channel: type=list

List of integers or list of list of integers of channels to enable through tx_enabled_channels

param_set: type=dict

Dictionary of attribute and values to be set before tone is generated and received

use_tx2: type=bool

Boolean if set will use tx2() as tx method

use_rx2: type=bool

Boolean if set will use rx2() as rx method

test.dma_tests.cyclic_buffer(uri, classname, channel, param_set)#

cyclic_buffer: Construct Cyclic TX buffers and verify no errors occur when pushed. This is performed twice without closing the context

parameters:
uri: type=string

URI of IIO context of target board/system

classname: type=string

Name of pyadi interface class which contain attribute

channel: type=list

List of integers or list of list of integers of channels to enable through tx_enabled_channels

param_set: type=dict

Dictionary of attribute and values to be set before tone is generated

test.dma_tests.cyclic_buffer_exception(uri, classname, channel, param_set)#

cyclic_buffer_exception: Construct Cyclic TX buffers and verify errors occur when pushed. This is performed twice without closing the context and with resetting the TX buffers which should cause an exception

parameters:
uri: type=string

URI of IIO context of target board/system

classname: type=string

Name of pyadi interface class which contain attribute

channel: type=list

List of integers or list of list of integers of channels to enable through tx_enabled_channels

param_set: type=dict

Dictionary of attribute and values to be set before tone is generated

test.dma_tests.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

test.dma_tests.dds_two_tone(uri, classname, channel, param_set, frequency1, scale1, peak_min1, frequency2, scale2, peak_min2)#

dds_two_tone: 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 two sinusoids which are then estimated on the RX side. The receive tones must be within 1% of its respective 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

frequency1: type=integer

Frequency in Hz of the first transmitted tone

scale1: type=float

Scale of the first DDS tone. Range [0,1]

peak_min1: type=float

Minimum acceptable value of maximum peak in dBFS of the received first tone

frequency2: type=integer

Frequency in Hz of the second transmitted tone

scale2: type=float

Scale of the second DDS tone. Range [0,1]

peak_min2: type=float

Minimum acceptable value of maximum peak in dBFS of the received second tone

test.dma_tests.dma_dac_zeros(uri, classname, channel)#

dma_dac_zeros: Test DMA digital loopback with a zeros. This test requires a AD936x or similar device with internal loopback modes. The TX cores are put into zero source mode in cases when no output is desired

parameters:
uri: type=string

URI of IIO context of target board/system

classname: type=string

Name of pyadi interface class which contain attribute

channel: type=list

List of integers or list of list of integers of channels to enable through tx_enabled_channels

test.dma_tests.dma_loopback(uri, classname, channel)#

dma_loopback: Test DMA digital loopback with a triangle waveforms. This test requires a AD936x or similar device with internal loopback modes. A triangle wave is generated on I and Q or real1 and real2 and multiple periods are compared for missing samples within a buffer and delay between buffers.

parameters:
uri: type=string

URI of IIO context of target board/system

classname: type=string

Name of pyadi interface class which contain attribute

channel: type=list

List of integers or list of list of integers of channels to enable through tx_enabled_channels

test.dma_tests.dma_rx(uri, classname, channel, use_rx2=False, buffer_size=32768, annotated=False, param_set=None)#

dma_rx: Construct RX buffers and verify data is non-zero when pulled. Collected buffer is of size 2**15 and 10 buffers are checked

parameters:
uri: type=string

URI of IIO context of target board/system

classname: type=string

Name of pyadi interface class which contain attribute

channel: type=list

List of integers or list of list of integers of channels to enable through rx_enabled_channels

use_rx2: type=bool

If True, use rx2() instead of rx()

buffer_size: type=int

Size of RX buffer in samples. Defaults to 2**15

annotated: type=bool

If True, annotated output is provided (dict)

param_set: type=dict

Dictionary of attribute and values to be set before tone is received

test.dma_tests.dma_tx(uri, classname, channel, use_tx2=False)#

dma_tx: Construct TX buffers and verify no errors occur when pushed. Buffer is of size 2**15 and 10 buffers are pushed

parameters:
uri: type=string

URI of IIO context of target board/system

classname: type=string

Name of pyadi interface class which contain attribute

channel: type=list

List of integers or list of list of integers of channels to enable through tx_enabled_channels

test.dma_tests.gain_check(uri, classname, channel, param_set, dds_scale, min_rssi, max_rssi)#

gain_check: Test DDS loopback with connected loopback cables and verify calculated RSSI. This is only applicable for devices with RSSI calculations onboard. This test also 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 received on the RX side. RSSI is captured during this reception. The generated tone is at 10% RX sample rate.

parameters:
uri: type=string

URI of IIO context of target board/system

classname: type=string

Name of pyadi interface class which contain attribute

channel: type=list

List of integers or list of list of integers of channels to enable through tx_enabled_channels

param_set: type=dict

Dictionary of attribute and values to be set before tone is generated and received

dds_scale: type=float

Scale of DDS tone. Range [0,1]

min_rssi: type=float

Minimum acceptable value of RSSI attribute

max_rssi: type=float

Maximum acceptable value of RSSI attribute

test.dma_tests.hardwaregain(uri, classname, channel, dds_scale, frequency, hardwaregain_low, hardwaregain_high)#

hadwaregain: Test loopback with connected cables and verify calculated hardware gain, by measuring changes in the AGC. This is only applicable for devices with RSSI calculations onboard. This test also 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 received on the RX side.

parameters:
uri: type=string

URI of IIO context of target board/system

classname: type=string

Name of pyadi interface class which contain attribute

channel: type=list

List of integers or list of list of integers of channels to enable through tx_enabled_channels

dds_scale: type=float

Scale of DDS tone. Range [0,1]

frequency:

Frequency in hertz of the generated tone. This must be less than 1/2 the sample rate.

hardwaregain_low: type=float

Minimum acceptable value of hardwaregain attribute

hardwaregain_high: type=float

Maximum acceptable value of hardwaregain attribute

test.dma_tests.harmonic_vals(classname, uri, channel, param_set, low, high, plot=False)#

harmonic_vals: Test first five harmonics and check to be within certain intervals. This test also requires a devices with TX and RX onboard where thetransmit signal can be recovered.Sinuoidal data is passed to DMAs, which is then estimated on the RX side.

parameters:
uri: type=string

URI of IIO context of target board/system

classname: type=string

Name of pyadi interface class which contain attribute

channel: type=list

List of integers or list of list of integers of channels to enable through tx_enabled_channels

param_set: type=dict

Dictionary of attribute and values to be set before tone is generated and received

low: type=list

List of minimum values for certain harmonics

high: type=list

List of maximum values for certain harmonics

plot: type=boolean

Boolean, if set the values are also plotted

test.dma_tests.nco_loopback(uri, classname, param_set, channel, frequency, peak_min)#

nco_loopback: TX/DAC Test tone loopback with connected loopback cables. This test requires a devices with TX and RX onboard where the transmit signal can be recovered. TX/DAC internal NCOs 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

peak_min: type=float

Minimum acceptable value of maximum peak in dBFS of received tone

test.dma_tests.stress_context_creation(uri, classname, channel, repeats)#

stress_context_creation: Repeatedly create and destroy a context

parameters:
uri: type=string

URI of IIO context of target board/system

classname: type=string

Name of pyadi interface class which contain attribute

channel: type=list

List of integers or list of list of integers of channels to enable through tx_enabled_channels

repeats: type=integer

Number of times to re-create contexts

test.dma_tests.stress_rx_buffer_creation(uri, classname, channel, repeats)#

stress_rx_buffer_creation: Repeatedly create and destroy buffers

parameters:
uri: type=string

URI of IIO context of target board/system

classname: type=string

Name of pyadi interface class which contain attribute

channel: type=list

List of integers or list of list of integers of channels to enable through tx_enabled_channels

repeats: type=integer

Number of times to re-create contexts

test.dma_tests.stress_rx_buffer_length(uri, classname, channel, buffer_sizes)#

stress_rx_buffer_length: Repeatedly create and destroy buffers across different buffer sizes

parameters:
uri: type=string

URI of IIO context of target board/system

classname: type=string

Name of pyadi interface class which contain attribute

channel: type=list

List of integers or list of list of integers of channels to enable through tx_enabled_channels

buffer_sizes: type=list

List of buffer size to create and collect

test.dma_tests.stress_tx_buffer_creation(uri, classname, channel, repeats)#

stress_tx_buffer_creation: Repeatedly create and destroy TX buffers

parameters:
uri: type=string

URI of IIO context of target board/system

classname: type=string

Name of pyadi interface class which contain attribute

channel: type=list

List of integers or list of list of integers of channels to enable through tx_enabled_channels

repeats: type=integer

Number of times to re-create buffers

test.dma_tests.t_sfdr(uri, classname, channel, param_set, sfdr_min, use_obs=False, full_scale=0.9)#

t_sfdr: Test SFDR loopback of tone with connected loopback cables. This test requires a devices with TX and RX onboard where the transmit signal can be recovered. Sinuoidal data is passed to DMAs which is then estimated on the RX side. The peak and second peak are determined in the received signal to determine the sfdr.

parameters:
uri: type=string

URI of IIO context of target board/system

classname: type=string

Name of pyadi interface class which contain attribute

channel: type=list

List of integers or list of list of integers of channels to enable through tx_enabled_channels

param_set: type=dict

Dictionary of attribute and values to be set before tone is generated and received

sfdr_min: type=float

Minimum acceptable value of SFDR in dB

test.dma_tests.verify_overflow(uri, classname, channel, buffer_size, sample_rate)#

verify_overflow: Verify overflow flags occur as expected

parameters:
uri: type=string

URI of IIO context of target board/system

classname: type=string

Name of pyadi interface class which contain attribute

channel: type=list

List of integers or list of list of integers of channels to enable through tx_enabled_channels

buffer_size type=int

List of buffer size to create and collect

sample_rate=int

Value to set sample rate of device in samples per second

test.dma_tests.verify_underflow(uri, classname, channel, buffer_size, sample_rate)#

verify_overflow: Verify overflow flags occur as expected

parameters:
uri: type=string

URI of IIO context of target board/system

classname: type=string

Name of pyadi interface class which contain attribute

channel: type=list

List of integers or list of list of integers of channels to enable through tx_enabled_channels

buffer_size type=int

List of buffer size to create and collect

sample_rate=int

Value to set sample rate of device in samples per second