This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
resources:fpga:peripherals:jesd204:tutorial:hdl_xilinx [15 May 2018 14:22] – created Adrian Costina | resources:fpga:peripherals:jesd204:tutorial:hdl_xilinx [14 Jan 2021 05:38] (current) – use wiki interwiki links Robin Getz | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== DAQ2 HDL Project for Xilinx ====== | ||
- | ====== DAQ2 HDL Project for Xilinx====== | + | The reference design is a processor based embedded system. The sources are split into three different folders: |
- | + | ||
- | ===== Xilinx block diagram ===== | + | |
- | {{: | + | |
- | + | ||
- | The reference design is a processor based embedded system. The sources are split between | + | |
* base design for the carrier board, [[https:// | * base design for the carrier board, [[https:// | ||
* base design for the evaluation board, [[https:// | * base design for the evaluation board, [[https:// | ||
- | * specific design for the project, in our case the ZCU102 [[https:// | + | * specific design for the project, in our case the ZCU102 [[https:// |
- | The reference design is a processor based (ARM or Microblaze) embedded system. A functional block diagram of the system is given above. The shared transceivers are followed by the individual JESD204B and ADC/DAC IP cores. The cores are programmable through an AXI-lite interface. | + | |
+ | ==== AD-FMCDAQ2-EBZ block diagram ==== | ||
+ | {{resources: | ||
+ | |||
+ | ==== Xilinx block diagram ==== | ||
+ | {{resources: | ||
+ | |||
+ | The reference design is a processor based (ARM or Microblaze) embedded system. A functional block diagram of the system is given above. The shared transceivers are followed by the individual JESD204B and ADC/DAC IP cores. The cores are programmable through an AXI-lite interface. | ||
The digital interface consists of 4 transmit and 4 receive lanes running at 10Gbps, by default. The transceivers interface the ADC/DAC cores at 128bits@250MHz. The data is sent or received based on the configuration of separate transmit and receive chains. | The digital interface consists of 4 transmit and 4 receive lanes running at 10Gbps, by default. The transceivers interface the ADC/DAC cores at 128bits@250MHz. The data is sent or received based on the configuration of separate transmit and receive chains. | ||
- | ===== Project | + | ===== Project |
+ | |||
+ | The entry point for project creation is '' | ||
- | The entry point for project creation is system_project.tcl. | + | [[https:// |
<code tcl> | <code tcl> | ||
Line 34: | Line 39: | ||
</ | </ | ||
- | When the project is created, system_bd.tcl is sourced. | + | When the project is created, |
Some parameters will be defined in the first part, which will configure the ADC/DAC FIFOs. These are part of the systems in which the DDR throughput is not enough to keep up with the ADC/DAC data rates. | Some parameters will be defined in the first part, which will configure the ADC/DAC FIFOs. These are part of the systems in which the DDR throughput is not enough to keep up with the ADC/DAC data rates. | ||
Line 50: | Line 55: | ||
</ | </ | ||
- | The next step is to instantiate the ZCU102 base design: | + | The next step is to instantiate the ZCU102 base design: |
<code tcl> | <code tcl> | ||
source $ad_hdl_dir/ | source $ad_hdl_dir/ | ||
Line 56: | Line 62: | ||
If ADC/DAC FIFOs will be used in the system, the corresponding tcl files must be sourced. | If ADC/DAC FIFOs will be used in the system, the corresponding tcl files must be sourced. | ||
+ | |||
<code tcl> | <code tcl> | ||
source $ad_hdl_dir/ | source $ad_hdl_dir/ | ||
Line 61: | Line 68: | ||
</ | </ | ||
- | The next step is to source the DAQ2 specific design. | + | The next step is to source the DAQ2 specific design. |
<code tcl> | <code tcl> | ||
source ../ | source ../ | ||
</ | </ | ||
- | The generic design is optimized to supports the maximum number of carriers with minimal changes. If the specific carrier has different parameters than the default | + | The generic design is optimized to supports the maximum number of carriers with minimal changes. If the specific carrier has different parameters than the default, some minor IP parameter changes need to be done. In the case below, the generic design uses parameters for 7 Series FPGAs, so parameters must be adjusted for Ultrascale+. |
<code tcl> | <code tcl> | ||
Line 79: | Line 87: | ||
===== DAQ2 Design ===== | ===== DAQ2 Design ===== | ||
- | When using the JESD204 Framework, we source the JESD204 support script. In this script several procedures which simplify the design are defined: | + | When using the JESD204 Framework we need to source the JESD204 support script. In this script several procedures which simplify the design are defined: |
<code tcl> | <code tcl> | ||
Line 85: | Line 93: | ||
</ | </ | ||
- | ==== Physical | + | ==== Physical |
- | The physical layer is responsible for instantiating and configuring the high speed serial transceivers in the FPGA. | + | The physical layer is responsible for instantiating and configuring the high speed serial transceivers in the FPGA. |
The physical layer is implemented with the use of two modules: AXI_ADXCVR and UTIL_ADXCVR. | The physical layer is implemented with the use of two modules: AXI_ADXCVR and UTIL_ADXCVR. | ||
- | AXI_ADXCVR Provides an AXI interface for performing DRP reads and writes to the transceivers, | + | AXI_ADXCVR Provides an AXI interface for performing DRP reads and writes to the transceivers, |
- | Given that the hardware implements 4 data lines, that's how we'll configure the NUM_OF_LANES parameter. | + | Given that the hardware implements 4 data lines, that's how we'll configure the NUM_OF_LANES parameter. |
- | QPLL_ENABLE parameter gives control to this IP of the QPLL reconfiguration for the Transceiver QUAD. If the QUAD is shared with other RX IPs (as it is in this design), the second ADXCVR IP will need to have QPLL_ENALBE | + | QPLL_ENABLE parameter gives control to this IP of the QPLL reconfiguration for the Transceiver QUAD. If the QUAD is shared with other RX IPs (as it is in this design), the second ADXCVR IP will need to have QPLL_ENABLE |
<code tcl> | <code tcl> | ||
Line 100: | Line 108: | ||
</ | </ | ||
- | Instantiation of the ADC transceiver controller. For this IP, QPLL_ENABLE is set to 0. | + | Instantiation of the ADC transceiver controller. For this IP, QPLL_ENABLE is set to 0. |
<code tcl> | <code tcl> | ||
ad_ip_instance axi_adxcvr axi_ad9680_xcvr | ad_ip_instance axi_adxcvr axi_ad9680_xcvr | ||
Line 108: | Line 117: | ||
</ | </ | ||
- | Given that the IP uses the same QUAD as the DAC, when channel reconfiguration may affect the DAC and vice versa. When using the JESD204B framework, this is taken into consideration by software. | + | Given that the IP uses the same QUAD as the DAC, performing |
The actual transceiver blocks are instantiated in UTIL_ADXCVR. | The actual transceiver blocks are instantiated in UTIL_ADXCVR. | ||
Line 123: | Line 132: | ||
</ | </ | ||
- | Xilinx JESD204-PHY IP can be used as an alternative to implement | + | Xilinx JESD204-PHY IP can be used as an alternative to implementing |
=== Clocking === | === Clocking === | ||
Line 129: | Line 138: | ||
Reference clocks are needed to be feed to the QPLL/CPLL. In this design, we are using tx reference clock for QPLL and rx reference clock for QPLL. If the system works at 10Gbps, the QPLL clock will be used for both the RX and TX channels. | Reference clocks are needed to be feed to the QPLL/CPLL. In this design, we are using tx reference clock for QPLL and rx reference clock for QPLL. If the system works at 10Gbps, the QPLL clock will be used for both the RX and TX channels. | ||
What is important to note is that the reference clocks for the transceiver QUAD must be connected to the MGTREFCLK pins either for the QUAD or an adjacent QUAD. | What is important to note is that the reference clocks for the transceiver QUAD must be connected to the MGTREFCLK pins either for the QUAD or an adjacent QUAD. | ||
+ | |||
<code tcl> | <code tcl> | ||
create_bd_port -dir I tx_ref_clk_0 | create_bd_port -dir I tx_ref_clk_0 | ||
Line 140: | Line 150: | ||
==== Data Link Layer ==== | ==== Data Link Layer ==== | ||
- | The JESD204 | + | The JESD204 |
- | The ADI AD-IP-JESD204 implements the data link layer, supporting | + | The ADI AD-IP-JESD204 implements the data link layer, supporting |
<code tcl> | <code tcl> | ||
adi_axi_jesd204_tx_create axi_ad9144_jesd 4 | adi_axi_jesd204_tx_create axi_ad9144_jesd 4 | ||
Line 150: | Line 161: | ||
The IP is equivalent with the Xilinx licensed JESD204 IP. | The IP is equivalent with the Xilinx licensed JESD204 IP. | ||
- | ==== Transport | + | ==== Transport |
The transport layer peripherals are responsible for converter specific data framing and de-framing and provide a generic FIFO interface to the rest of the system. | The transport layer peripherals are responsible for converter specific data framing and de-framing and provide a generic FIFO interface to the rest of the system. | ||
Line 160: | Line 172: | ||
==== JESD204 Connections ==== | ==== JESD204 Connections ==== | ||
+ | |||
When UTIL_ADXCVR is instantiated, | When UTIL_ADXCVR is instantiated, | ||
Because of this, the UTIL_ADXCVR IP will rearrange the inside channels so that they correspond to the outside pin connection for the RX path, keeping a common transport layer. | Because of this, the UTIL_ADXCVR IP will rearrange the inside channels so that they correspond to the outside pin connection for the RX path, keeping a common transport layer. | ||
- | Each channel from the QUAD has assigned a specific pin for TX and RX. After rearranging the channels so they correspond to the RX pins, the TX pins may not be in the order they are connected to the DAC. The below {0 2 3 1} parameter will connect the physical layer to the data link layer as if the channels and pin connections are in order. | + | Each channel from the QUAD has assigned a specific pin for TX and RX. After rearranging the channels so they correspond to the RX pins, the TX pins may not be in the order they are connected to the DAC. The below {0 2 3 1} parameter will connect the physical layer to the data link layer as if the channels and pin connections are in order. |
<code tcl> | <code tcl> | ||
Line 170: | Line 183: | ||
==== Additional IPs ==== | ==== Additional IPs ==== | ||
- | For a complete system, we use additional modules to transfer data. The transport layer transfers data continously | + | |
+ | For a complete system, we use additional modules to transfer data. The transport layer transfers data continuously | ||
When a FIFO is used, the DMA connection to the DDR can run at a lower speed, as data capture cannot be done continuously. | When a FIFO is used, the DMA connection to the DDR can run at a lower speed, as data capture cannot be done continuously. | ||
Line 210: | Line 224: | ||
</ | </ | ||
- | ==== Misc connections | + | ==== Misc Connections |
<code tcl> | <code tcl> | ||
ad_connect | ad_connect | ||
Line 264: | Line 279: | ||
==== CPU Address Allocation ==== | ==== CPU Address Allocation ==== | ||
- | The below instructions assign addresses to all AXI modules in the design. | + | |
+ | The below instructions assign addresses to all AXI modules in the design. | ||
<code tcl> | <code tcl> | ||
# interconnect (cpu) | # interconnect (cpu) | ||
Line 277: | Line 294: | ||
</ | </ | ||
- | ==== High perfomance port connections | + | ==== High Perfomance Port Connections |
- | The below instructions assign an HP port to all AXI masters, through an interconnect. | + | |
- | If there is a single master per interconnect, | + | The below instructions assign an HP port to all AXI masters, through an interconnect. |
+ | If there is a single master per interconnect, | ||
+ | The HP3 connections allow the physical layer to transmit eyescan data to memory, without software interference. | ||
<code tcl> | <code tcl> | ||
Line 303: | Line 322: | ||
</ | </ | ||
- | ===== System | + | ===== System |
- | The reference clock that is used for the transceivers, | + | The reference clock that is used for the transceivers, |
<code tcl> | <code tcl> | ||
Line 321: | Line 340: | ||
As shown below, the transceiver channels and ADC channels are not connected one to one. | As shown below, the transceiver channels and ADC channels are not connected one to one. | ||
+ | |||
<code xdc> | <code xdc> | ||
set_property | set_property | ||
Line 340: | Line 360: | ||
</ | </ | ||
- | The reference clocks run at 500 MHz, and the frame clock at 250, in the maximum throughput configuration, which is the default. | + | The reference clocks run at 500 MHz, and the frame clock at 250, in the maximum throughput configuration(default). |
<code xdc> | <code xdc> | ||
create_clock -name tx_ref_clk | create_clock -name tx_ref_clk | ||
Line 348: | Line 369: | ||
create_clock -name rx_div_clk | create_clock -name rx_div_clk | ||
</ | </ | ||
+ | |||
+ | ===== Building the HDL Project ===== | ||
+ | |||
+ | When building the project, you should always use the recommended version of the tools for the specific [[/ | ||
+ | |||
+ | < | ||
+ | mkdir adi | ||
+ | cd adi | ||
+ | git clone https:// | ||
+ | cd hdl/ | ||
+ | git status ## check for everything, including branch name | ||
+ | git checkout hdl_2018_r1 ## change to the hdl_2018_r2 branch | ||
+ | make -C projects/ | ||
+ | </ | ||
+ | |||
+ | ===== Building BOOT.BIN ===== | ||
+ | |||
+ | The boot image '' | ||
+ | |||
+ | The script can be downloaded from here: | ||
+ | |||
+ | * [[https:// | ||
+ | |||
+ | |||
+ | **NOTE: After downloading the script you need to make it executable**\\ | ||
+ | < | ||
+ | $ chmod +x build_zynqmp_boot_bin.sh | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | usage: build_zynqmp_boot_bin.sh system_top.hdf u-boot.elf (download | bl31.elf | < | ||
+ | </ | ||
+ | |||
+ | * Path to '' | ||
+ | * The 3rd argument must either be '' | ||
+ | * An optionally 4th '' | ||
+ | * Build output is located in a local directory named: output_boot_bin. | ||
+ | * This script requires Xilinx XSDK and bootgen in the PATH.\\ | ||
+ | * A simple way is to source vivado settings[32|64].sh: | ||
+ | |||
+ | < | ||
+ | $ source / | ||
+ | </ | ||
+ | |||
+ | **NOTE: u-boot.elf**\\ | ||
+ | For those who don't want to build u-boot themselves.\\ | ||
+ | The **u-boot.elf** can be extracted from the project folder on the [[resources/ | ||
+ | |||
+ | ===== References ===== | ||
+ | |||
+ | [[resources/ | ||
+ | [[resources/ | ||
+ | [[resources/ | ||
+ |