AD7616

Overview

The purpose of this testbench is to validate the serial interface functionality of the projects/ad7616_sdz reference design.

The entire HDL documentation can be found here AD7616-SDZ HDL project.

Block design

The testbench block design includes part of the AD7616-SDZ HDL reference design, along with VIPs used for clocking, reset, PS and DDR simulations.

Block diagram

The data path and clock domains are depicted in the below diagrams:

AD7616_SDZ parallel interface

AD7616 Parallel Interface/Testbench block diagram

AD7616_SDZ serial interface

AD7616 Serial Interface/Testbench block diagram

Configuration parameters and modes

The following parameter of this project that can be configured:

  • INTF: defines the device’s interface: Options: 0 - Parallel, 1 - Serial

Configuration files

The following configuration files are available:

Configuration mode

Parameters

INTF

cfg_pi

0

cfg_si

1

Tests

The following test program files are available:

Test program

Usage

test_program_pi

Tests the parallel interface capabilities.

test_program_si

Tests the serial interface capabilities.

Available configurations & tests combinations

Configuration

Test

Build command

cfg_pi

test_program_pi

make CFG=cfg_pi TST=test_program_pi

cfg_si

test_program_si

make CFG=cfg_si TST=test_program_si

Error

Mixing a wrong pair of CFG and TST will result in a simulation errror. Please check out the proposed combinations before running a custom test.

CPU/Memory interconnect addresses

Below are the CPU/Memory interconnect addresses used in this project:

Instance

Address

spi_ad7616_axi_regmap **

0x44A0_0000

axi_ad7616 *

0x44A8_0000

axi_ad7616_dma

0x44A3_0000

axi_intc

0x4120_0000

ad7616_clkgen

0x44A7_0000

ad7616_pwm_gen

0x44B0_0000

Legend

  • * instantiated only for parallel interface

  • ** instantiated only for serial interface

Interrupts

Below are the Programmable Logic interrupts used in this project:

Instance name

HDL

axi_ad7616_dma

13

spi_ad7616

12

Test stimulus

Parallel test program

The test program is structured into several tests as follows:

Environment bringup

The steps of the environment bringup are:

  • Create the environment

  • Start the environment

  • Start the clocks

  • Assert the resets

Sanity test

This test is used to check the communication with the AXI module of the AD7616 interface, by writing and reading the SCRATCH register.

Data acquisition test

  • Start the SPI clock generator (axi_clkgen)

  • Configure the PWM generator (axi_pwmgen)

  • Configure the DMA

  • Configure the axi_ad7616 IP

  • Submit a DMA transfer

  • Stop the PWM generator

  • Capture and compare the data

Stop the environment

  • Stop the clocks

Serial test program

The test program is structured into several tests as follows:

Environment bringup

The steps of the environment bringup are:

  • Create the environment

  • Start the environment

  • Start the clocks

  • Assert the resets

Sanity test

This test is used to check the communication with the AXI REGMAP module of the AD7616 SPI Engine interface, by reading the core VERSION register, along with writing and reading the SCRATCH register.

FIFO SPI test

The FIFO SPI test verifies the simple serial transfers, made through the Execution module.

The steps of this test are:

  • Start the SPI clock generator (axi_clkgen)

  • Enable SPI Engine & configure the Execution module

  • Set up the interrupts

  • Generate a FIFO transaction

  • Capture and compare the results, using the PEEK register of the AXI SPI Engine

Offload SPI test

The Offload SPI test verifies the Offload module functionality.

The steps of this test are:

  • Configure the conversion signal generator (axi_pwmgen)

  • Configure the DMA

  • Configure the Offload module

  • Start the Offload module

  • Capture and compare the Offload SDI data

Stop the environment

  • Stop the clocks

Building the testbench

The testbench is built upon ADI’s generic HDL reference design framework. ADI does not distribute compiled files of these projects so they must be built from the sources available here and here, with the specified hierarchy described Set up the Testbenches repository. To get the source you must clone the HDL repository, and then build the project as follows:.

Linux/Cygwin/WSL

Example 1

Build all the possible combinations of tests and configurations, using only the command line.

user@analog:~$
cd testbenches/project/ad7616
user@analog:~/testbenches/project/ad7616$
make

Example 2

Build all the possible combinations of tests and configurations, using the Vivado GUI. This command will launch Vivado, will run the simulation and display the waveforms.

user@analog:~$
cd testbenches/project/ad7616
user@analog:~/testbenches/project/ad7616$
make MODE=gui

Example 3

Build a particular combination of test and configuration, using the Vivado GUI. This command will launch Vivado, will run the simulation and display the waveforms.

user@analog:~$
cd testbenches/project/ad7616
user@analog:~/testbenches/project/ad7616$
make MODE=gui CFG=cfg_si TST=test_program_si

The built projects can be found in the runs folder, where each configuration specific build has it’s own folder named after the configuration file’s name. Example: if the following command was run for a single configuration in the clean folder (no runs folder available):

make CFG=cfg_si

Then the subfolder under runs name will be:

cfg_si

Resources

More information

Support

Analog Devices, Inc. will provide limited online support for anyone using the reference design with ADI components via the EngineerZone FPGA reference designs forum.

It should be noted, that the older the tools’ versions and release branches are, the lower the chances to receive support from ADI engineers.