Visible to Intel only — Ixiasoft
Visible to Intel only — Ixiasoft
4.6.1.2.1. Dynamic Reconfiguration with Debug Kit
This design example is a simulation design example that is capable to perform dynamic calibration for PHY Lite for Parallel Interfaces IP in Intel® Arria® 10 and Intel® Cyclone® 10 GX devices.
- A fully configurable PHY Lite for Parallel Interfaces IP
- An Avalon controller to perform address translation
- A NIOS II processor to perform dynamic calibration for PHY Lite for Parallel Interfaces IP
- A set of application program interface (API) to configure delay chains for PHY Lite for Parallel Interfaces IP
Example Design Files | Description |
---|---|
<example_design_folder>/readme.txt | This file provide simple instructions to generate and use the example design. |
<example_design_folder>/hello_world.c | This is the main test program. |
<example_design_folder>/phylite_debug_kit.qsys | This is the system design file. |
<example_design_folder>/phylite_dynamic_reconfigurations.c | This file contains the set of APIs use in the test program. |
<example_design_folder>/phylite_dynamic_reconfiguration.h | This is the header file for the APIs. |
<example_design_folder>/phylite_niosii_bridge.v <example_design_folder>/phylite_niosii_bridge_hw.tcl | This is an interconnect module between PHY Lite for Parallel Interfaces IP and NIOS II processor. |
<example_design_folder>/issp.tcl | This is the In-System Source and Probes module. Use this file to reset the system and to probe the status of the interface_locked signal and dynamic calibration done status from NIOS II processor. |
API Function | Argument | Return Value | Description |
---|---|---|---|
hw_get_num_groups | ID | Integer | Read from AVL_CTRL_REG_NUM_GROUPS register for the specified ID. |
hw_get_group_info | ID, GROUP_NUM | {16'h0000, num_lanes[7:0], num_pins[7:0]} | Read from AVL_CTRL_REG_GROUP_ INFO register for the specified ID and group number. The return values are the number of lanes and number of pins available for the specified ID and group number. |
hw_get_num_lanes | ID, GROUP_NUM | Integer | Read from the AVL_CTRL_REG_GROUP_ INFO register for the specified ID and group number. The return values are the number of lanes available for the specified ID and group number. |
hw_get_num_pins | ID, GROUP_NUM | Integer | Read from the AVL_CTRL_REG_GROUP_ INFO register for the specified ID and group number. The return values are the number of pins available for the specified ID and group number. |
hw_get_input_delay | ID, GROUP_NUM, PIN_NUM, CSR | Integer | Read from the AVL_CTRL_REG_IDELAY register for the specified ID, group number, and pin ID.
Specified CSR to:
|
hw_get_output_delay | ID, GROUP_NUM, PIN_NUM, CSR | Integer | Read from the AVL_CTRL_REG_ODELAY register for the specified ID, group number and pin number.
Specified CSR to:
|
hw_get_strobe_input_delay | ID, GROUP_NUM, PIN_NUM, CSR | Integer | Read from the AVL_CTRL_REG_DQS_DELAY delay register for the specified ID, group number and pin number.
Specified CSR to:
|
hw_get_strobe_enable_delay | ID, GROUP_NUM, PIN_NUM, CSR | Integer | Read from the AVL_CTRL_REG_DQS_EN_DELAY register for the specified ID, group number and pin number.
Specified CSR to:
|
hw_get_strobe_enable_phase | ID, GROUP_NUM, PIN_NUM, CSR | Integer | Read from the AVL_CTRL_REG_DQS_EN_PHASE_SHIFT register for the specified ID, group number and pin number.
Specified CSR to:
|
hw_get_read_valid_enable_delay | ID, GROUP_NUM, PIN_NUM, CSR | Integer | Read from the AVL_CTRL_REG_RD_VALID_DELAY register for the specified ID, group number and pin number.
Specified CSR to:
|
hw_set_input_delay | ID, GROUP_NUM, PIN_NUM, input delay value (integer) | — | Write to AVL_CTRL_REG_IDELAY register for the specified ID, group number and pin number. Refer to the Control Registers Description topic for valid value range. |
hw_set_output_delay | ID, GROUP_NUM, PIN_NUM, output delay value (integer) | — | Write to AVL_CTRL_REG_ODELAY register for the specified ID, group number and pin number. Refer to the Control Registers Description topic for valid value range. |
hw_set_strobe_input_delay | ID, GROUP_NUM, PIN_NUM, strobe input delay value (integer) | — | Write to AVL_CTRL_REG_DQS_DELAY register for the specified ID, group number and pin number. Refer to the Control Registers Description topic for valid value range. |
hw_set_strobe_enable_delay | ID, GROUP_NUM, PIN_NUM, strobe enable delay value (integer) | — | Write to AVL_CTRL_REG_DQS_EN_DELAY register for the specified ID, group number and pin number. Refer to the Control Registers Description topic for valid value range. |
hw_set_strobe_enable_phase | ID, GROUP_NUM, PIN_NUM, strobe enable phase value (integer) | — | Write to AVL_CTRL_REG_DQS_EN_PHASE_SHIFT register for the specified ID, group number and pin number. Refer to the Control Registers Description topic for valid value range. |
hw_set_read_valid_enable_delay | ID, GROUP_NUM, PIN_NUM, read valid enable delay value (integer) | — | Write to AVL_CTRL_REG_RD_VALID_DELAY register for the specified ID, group number and pin number. Refer to the Control Registers Description topic for valid value range. |
Avalon Controller
The example design provides an Avalon controller to simplify the access to the dynamic reconfiguration registers of an interface. The Avalon controller is useful when there are multiple groups or instantiation of the PHY Lite for Parallel Interfaces IP. A single controller can support multiple interfaces in an I/O column.
The input interface is as follows:
avl_in_address[31:0] = {8'h00,interface_id[3:0],grp[4:0],pin[5:0],csr[0],register[7:0]}
Register [7:0] | Register Name | Pin [5:0] | Csr[0] | Register Access Type | Data on avl_readdata / writedata | Description |
---|---|---|---|---|---|---|
8'h00 | AVL_CTRL_REG_NUM_GROUPS | 0 | 0: Access to Avalon register. | Avalon register: RO CSR register: N/A |
{24'h000000,num_grps[7:0]} | Number of groups within an interface. |
8'h01 | AVL_CTRL_REG_GROUP_INFO | 0 | 0: Access to Avalon register. | Avalon register: RO CSR register: N/A |
{16'h0000,num_lanes[7:0],num_pins[7:0]} | Number of pins within a group. |
8'h02 | AVL_CTRL_REG_IDELAY | 0-47 | 0: Access to Avalon register. | Avalon register: RW CSR register: N/A |
{23'h000000,dq_delay[8:0]} | Pin input delay. Use this register to set pin PVT compensated input delay. |
8'h03 | AVL_CTRL_REG_ODELAY | 0-47 | 0: Access to Avalon register. 1: Access to CSR register. Only read operation is allowed. |
Avalon register: RW CSR register: RO |
{19'h00000,output_delay[12:0]} | Pin output delay. Use this register to read and set the pin output delay. |
8'h04 | AVL_CTRL_REG_DQS_DELAY | 0: DQS A 1: DQS B 19 |
0: Access to Avalon register. | Avalon register: RW CSR register: N/A |
{22'h000000,dqs_delay[9:0]} | Strobe input delay of a pin. Use this register to set the strobe PVT compensated input delay. |
8'h05 | AVL_CTRL_REG_DQS_EN_DELAY | 0 | 0: Access to Avalon register. 1: Access to CSR register. Only read operation is allowed. |
Avalon register: RW CSR register: RO |
{26'h0000000,dqs_en_delay[5:0]} | Strobe enable input delay of a pin. Use this register to set the strobe enable delay. |
8'h06 | AVL_CTRL_REG_DQS_EN_PHASE_SHIFT | 0: DQS A 1: DQS B 19 |
0: Access to Avalon register. 1: Access to CSR register. Only read operation is allowed. |
Avalon register: RW CSR register: RO |
{19'h00000,phase[12:0]} | Strobe enable input phase of a pin. Use this register to set the strobe enable phase. |
8'h07 | AVL_CTRL_REG_RD_VALID_DELAY | 0 | 0: Access to Avalon register. 1: Access to CSR register. Only read operation is allowed. |
Avalon register: RW CSR register: RO |
{25'h0000000,rd_vld_delay[6:0]} | Read val to set the read valid delay. |
Example of Accessing Dynamic Reconfiguration Control Registers using Avalon Controller
- Number of groups: 1. The group index is automatically set to 0x00.
- Interface ID: 0x04
- Pin width: 5
- Strobe configuration: Differential
avl_in_address[31:0] = {8'h00,interface_id[3:0],grp[4:0],pin[5:0],csr[0],register[7:0]}
avl_in_address[31:0] = {8'h00,0x04,0x00,0x00,0x00,0x04}
avl_in_address[31:0] = {8'h00,interface_id[3:0],grp[4:0],pin[5:0],csr[0],register[7:0]}
avl_in_address[31:0] = {8'h00,0x04,0x00,0x06,0x00,0x02}
Generate the Dynamic Reconfiguration with Debug Kit Design Example
- In Intel® Quartus® Prime, select File > New Project Wizard to create a new project directory and specify phylite_debug_kit as the project name.
- Select device and instantiate PHY Lite for Parallel Interfaces IP and turn on the Use dynamic reconfiguration option.
- Click Generate Example Design.
- In your example design directory, open the phylite_debug_kit.qsys file and click Generate HDL to generate the .qsys design example files.
- In Intel® Quartus® Prime, right click on the design example project and select Settings.
- In Files tab, browse to the <generated design example folder/phylite_debug_kit> and add in phylite_debug_kit.qip file into your project.
- Select Start Compilation to compile the design example project.
- In Intel® Quartus® Prime, select Tools > Nios II Software Build Tool for Eclipse. Create a new workspace when prompted.
- In Nios II - Eclipse software, select File > New > Nios II Application and BSP from Template.
- In the Nios II Application and BSP from Template window, select phylite_debug_kit_sopcinfo file in SOPC Information File name parameter to load the CPU settings.
- Specify a project name in the Project name parameter.
- Select Hello World for the Project Template.
- Click Finish to generate the project.
- Copy hello_world.c, phylite_dynamic_reconfiguration.c, and phylite_dynamic_reconfiguration.h files from the generated example design folder into your Eclipse project folder. You can refresh the Nios II Eclipse window by pressing F5 to make sure these files are added into your Eclipse project.
- In the Nios II Eclipse window, click Project > Build Project to generate .elf file.
- Run the following command in Nios II Command Shell to convert the .elf file into .hex.
elf2hex --input=<elf_filename>.elf --base=0x40000 --end=0x7ffff --width=32 --output=phylite_debug_kit_inst_mem.hex
- Copy and add the phylite_debug_kit_inst_mem.hex file into the ed_synth project folder.
- Add the following command in the ed_synth.qsf to include the phylite_debug_kit_inst_mem.hex in your project compilation.
set_global_assignment -name MISC_FILE phylite_debug_kit_inst_mem.hex
- Compile the ed_synth project file to generate .sof file to run the example design on your hardware.
Run the Dynamic Reconfiguration with Debug Kit Design Example
- Download the phylite_debug_kit.sof file into the FPGA.
- From the Quartus installation directory, double click on the Nios II Command Shell.bat to launch the Intel Nios® II command shell (command shell A). Repeat the same step to launch a second command shell (command shell B).
- In command shell B, use the following command to run Nios II terminal application for result printouts.
nios2-terminal --cable=<jtag_cable_num>
- Use the following command in command shell A to reset the system and start the dynamic reconfiguration application.
quartus_stp -t issp.tcl phylite_debug_kit.qpf