This lab describes the process of generating a AMD Versal™ adaptive SoC QDMA design containing 4 PFs, 252 VFs and AXI4 Memory Mapped interface connected to the network on chip (NoC) IP and DDR memory. This design has the following configurations:
• AXI4 memory mapped (AXI MM) connected to DDR through the NoC IP
• Gen3 x 16
• 4 physical functions (PFs) and 252 virtual functions (VFs) with Mailbox connections.
• MSI-X interrupts
This lab provides step by step instructions to configure a Control, Interfaces and Processing System (CIPS) QDMA design and network on chip (NoC) IP. The following figure shows the AXI4 Memory Mapped (AXI-MM) interface to DDR using the NoC IP. At the end of this lab, you can synthesize and implement the design, and generate a Programmable Device Image (PDI) file. The PDI file is used to program the AMD Versal adaptive SoC and run data traffic on a system. For the AXI-MM interface host to chip (H2C) transfers, data is read from Host and sent to DDR memory. For chip to host (C2H) transfers, data is read from DDR memory and written to host.
This lab targets a xcvc1902-vsvd1760-1LP-e-S-es1 part on a VCK5000 board. This lab connects to DDR memory found outside the adaptive SoC.
AXI4 Memory Mapped to DDR Design
Lab 2 initial configurations are the same as in Lab 1. So follow Start the AMD Vivado™ Design Suite, Instantiate CIPS IP, and Set the PCIe® Reset Pin sections from Lab 1. Refer to Lab1: QDMA AXI MM Interface to NoC and DDR Lab.
-
In the Configuration Options pane, select CPM4 PCIE Controller 0 Configuration to customize the DMA .
-
In the Basic tab, set the following options:
-
In the Capabilities tab, set the following option:
- Total Physical Functions: 4
- MSI-X Options: MSI-X Internal
This option enables the CPM QDMA in MSI-X internal mode.
- Select SRIOV Capability option
- Select Mailbox Enable Option
Note: Mailbox for CPM is a separate IP called PCIe qdma mailbox IP that you need to add to the IP canvas.
-
In the PF ID tab, there are 4 PFs listed with device ID. Based on your need, you can modify the device ID. For this lab, keep the default device ID.
-
In the PCIe: BAR tab, set the following options:
First row (for BAR0):
- Select the Bar checkbox.
- Set type to DMA.
- Select the 64 bit checkbox.
- Select the Prefetchable checkbox.
- Set size to 128 Kilobytes.
- PCIe to AXI Translation should be set to the address that is set in the Address Settings section.
Note: By default DMA will not be selected for any BAR, User need to select DMA option in Type section in order to get DMA bar.
For each DMA bar that is selected, "PCIe to AXI Translation" needs to be set with default address offset + PF address offset value.
- Mialbox Address offset will come from "Address Editor" tab when configuring the NoC IP. This will be constant for all the PF's
- PF address offset values are at bits[26:24]
- 3'b000 : PF0
- 3'b001 : PF1
- 3'b010 : PF2
- 3'b011 : PF3
- Mailbox Address offset + PF address offset should be programmed in "PCIe to AXI Translation" column.
Note: PCIe to AXI Address translation is very important parameter option that need to be set properly in order for NoC to send mailbox access to proper Mailbox IP.
-
In the PCIe: DMA tab, keep all default selections.
-
In the SRIOV Config tab, keep all default selection.
-
In SRIOV VF BARs tab, select following options: In this Tab, the user must select BARs for each VFG. In this lab, select only DMA bar with the default size.
First row (for BAR0):
- Select the Bar checkbox.
- Set type to DMA.
- Select the 64 bit checkbox.
- Select the Prefetchable checkbox.
- Set size to 16 Kilobytes.
- Set Address Settings to PCIe to AXI Translation.
Note: By default, the DMA is not selected for any BARs. Select the DMA option in the Type section in order to specify DMA BAR.
For each DMA bar that is selected, "PCIe to AXI Translation" needs to be set with default address offset + PF address offset value.
- Mialbox Address offset will come from "Address Editor" tab when configuring the NoC IP. This will be constant for all the PF's
- PF address offset values are at bits[26:24]
- 3'b100 : VFG0
- 3'b101 : VFG1
- 3'b110 : VFG2
- 3'b111 : VFG3
- Mailbox Address offset + PF address offset should be programmed in "PCIe to AXI Translation" column.
Note: PCIe to AXI Address translation is very important parameter option that need to be set properly in order for NoC to send mailbox access to proper Mailbox IP.
-
Click OK and click Finish in the CIPS configuration page to generate the CIPS QDMA IP.
Next you will add and configure a Network on Chip (NoC) IP core for the DDR connection.
-
Right-click the block design canvas and from the context menu select Add IP.
-
The IP catalog pops up. In the Search field, type AXI NoC to filter a list of IP.
-
From the filtered list, double-click the AXI NoC IP core to instantiate the IP on the block design canvas. Customize the IP as follows:
-
In the General tab, set the following options:
- Number of AXI Slave Interfaces: 2.
- Number of AXI Master Interfaces: 1(AXI Master connecting to Mailbox IP).
- Number of AXI Clocks: 3.
The number of AXI clocks is set to two because there are two clocks needed for the AXI Slave input, and none needed for AXI Master output.
- Memory Controller: Single Memory Controller.
- Number of Memory Controller Port: 4.
- All others options use the default settings.
-
In the Inputs tab, set the following options. First row (for S00_AXI):
- Connected To: PS PCIe.
- Clock: aclk0 (input clock).
- All other options use default settings. Second row (for S01_AXI):
- Connected To: PS PCIe.
- Clock: aclk1 (input clock).
- All other options use default settings.
-
In the Outputs tab, set AXI Master output to proper clock. Assign aclk3 to M00_AXI interface.
-
In the Connectivity tab, set the NoC connectivity as follows:
- For S00_AXI, select the MC Port 0 and MM_AXI pl checkbox.
- For S01_AXI, select the MC Port 0 and MM_AXI pl checkbox.
- This settings assures Mailbox can be assessed from either of the ports. All others options use the default settings.
-
In the DDR Basic tab, set the following options:
- Input System clock period (ps): 5000 (200.000 MHz).
- Select the Enable Internal Responder checkbox.
- All others options use the default settings.
Note: This is a sample configuration. Your DDR configuration and frequencies should be based on your design requirements.
-
In the DDR Memory tab, set the following options:
- Memory Device Type: Components.
- Memory Speed Grade: DDR4-3200AA(22-22-22).
- Base Component Width: x16.
- All others options use the default settings.
-
Click OK to generate a NoC IP with DDR.
Next, generate a clock source for the NoC module. To do this, you will configure and generate the Simulation Clock and Reset Generator IP core.
- Click Add IP, and search for Simulation Clock and Reset Generator.
- From the filtered list, double-click the Simulation Clock and Reset Generator IP core to instantiate the IP on the block design canvas. Configure the core as follows:
- For Number of SYS clocks, select 1.
- For Sys Clock 0 Frequency (MHz), enter 200.
- For Number of AXI Clocks, select 0.
- For Number of Resets Ports, select 0.
- Click OK to generate IP.
Next, generate a Mailbox IP and connect to NoC for Mailbox VF/PF communication.
-
Click Add IP, and search for PCIe QDMA Mailbox.
-
From the filtered list, double-click the PCIe QDMA Mailbox IP core to instantiate the IP on the block design canvas. Configure the core as follows:
- Select number of PFs that are needed. In this Lab, select 4 PFs.
- Select number of VFs. In this Lab, select VFs, as 4 for each PF.
Note: Number of VFs should match number of VF that are selected in CIPS IP. This important to match the PFs and VFs that are selected. Otherwise IP will not work properly.
-
In addition, add AXI SmartConnect IP. This IP is needed as Mailbox IP can only take in AXI4- Lite access. AXI interface from the NoC is full AXI.
- Configure the IP to have one Master, one Slave one clock, and one reset
-
Make the connections between the IP cores, as shown in following figure.
-
Set GT_REFCLK_D, GT_PCIEA0_RX, GT_PCIEA0_TX,SYS_CLK0_IN, and CH0_DDR4_0 as primary ports. To do so:
a. Select pins gt_refclk0, and PCIE0_GT of versal_cips_0,SYS_CLK0_IN of clk_gen_sim_0, and CH0_DDR4_0 of axi_noc_0 by pressing Ctrl+click.
b. Click the Make External (Ctrl + T) icon in the toolbar at the top of the canvas.
-
Connect AXI MasterMM0_AXI from NoC to SmartConnect IP. Output of SmartConnect connect to AXI Slave input of Mailbox IP.
-
Connect dma_flr and dma_usr_irq from Mailbox IP to dma0_usr_irq and dma0_usr_flr input in CIPS IP.
-
Change the Mailbox IP input ports usr_flr and usr_irq as primary input ports.
-
All other colc and reset pins connect as shown in picture below.
CPM4 Mailbox Connection
Next, set the necessary address settings for the NoC IP.
-
Open the Address Editor tab, as shown in the following figure. Expand the tree by clicking the down-arrow on versal_cips_0. Expand CPM_PCIE_NOC_0, and expand CPM_PCIE_NOC_1.
-
For S00_AXI, right-click in the Master Base Address cell, and select Assign from the context menu.
Note: The address 0x00000 is assigned to the DDR.
-
For pcie_qdma_mailbox0, right-click in the Master Base Address cell,and select Assign from the context menu. Optionally, you can also assign a fixed value; the value must be valid for NoC addressing.
-
And similarly for pcie_qdma_mailbox0 on NoC1, right-click in the Master Base Address cell, and select Assign from the context menu. Also, you must assign an address range to 2G for both NoC0 and NoC1 for mailbox access.
Note: These Mailbox addresses must be reflected in the PCIe to AXI Translation column in the PCIE BAR tab and SRIOV BARs tab in CIPS IP configuration.
-
To validate the design, open the Diagram tab, and click the Validate Design icon , or right-click anywhere in the canvas and, from the context menu, select Validate Design.
After validation, confirmation of the successful validation displays in a popup window.
After validation, create a design wrapper. A design wrapper file enables you to add any needed logic. For this lab, additional logic is not needed.
-
In the AMD Vivado™ IDE Sources window, right-click on design_1 (design_1.bd).
-
From the context menu, select Create HDL Wrapper to generate a wrapper file.
A design_1_wrapper file is added to the Sources window as shown in the following figure.
The IP package includes the DDR pin placement for the evaluation board. To implement the project design, and generate a Programmable Device Image (PDI) file:
- In the Flow Navigator, click Synthesis and Implementation.
Copyright © 2020–2023 Advanced Micro Devices, Inc