Pages List
List view
FPGA
Creating a Custom AXI4-Lite IP
1. Create a Vivado Project for Custom AXI4-Lite IP
- Click “Create Project” to create a new Vivado project.
Looking at it now, I think “Simple_Counter_AXI_IP_Test” would be more appropriate for the project name.
Because “Simple_Counter_AXI_IP” is created inside this project, and this project itself performs data communication tests by connecting that IP to ZYNQ PS and AXI Bus.
In any case, the IP covered in this example is “Simple Counter” AXI4-Lite IP, which receives the maximum number of clocks to be counted from the ZYNQ PS and stores it in the register.
Data communication between the ZYNQ PS and the “Simple Counter” IP takes place through the AXI4-Lite Interface.
- Create Block Design, add and Configure the ZYNQ7 PS.
2. Create a AXI IP
- Click “Tools – Create and Package New IP” to proceed to the IP creation & packaging stage.
- Select “Create AXI4 Peripheral” and click “Next”.
(This option means that we will create an AXI4 IP for use in our current project.)
- Type the name of the IP as “Simple_Counter” and click “Next”.
- Select “Edit IP” and click “Finish”.
(For the design of logic inside IP or the addition of existing logic.)
- Then, the IP Edit window appears as follows.
- Now add the logic of that IP to the IP’s “Design Sources” (in this example, “simple_counter.v”)
- Open all Verilog files where Each module in “Design Sources” is defined
- The “Simple Counter” AXI IP’s Top Module is “Simple_Counter_v1_0” and should have a “Simple_Counter_v1_0_S00_AXI4_Lite” module as an instance inside.
And inside the “Simple_Counter_v1_0_S00_AXI4_Lite” module, the “Simple_counter” module should exist as an instance.
① Modify “Simple_Counter_v1_0_S00_AXI4_Lite” Verilog file
- Define the port of the “Simple_Counter_v1_0_S00_AXI4_Lite” module as follows, and Create & Connect the “Simple_counter” module as an instance.
② Modify “Simple_Counter_v1_0” Verilog file
- As above, Define the port of the “Simple_Counter_v1_0” module and Connect them to the port of the “Simple_Counter_v1_0_S00_AXI4_Lite” instance.
- When the Verilog file modification is complete, you can proceed the IP packaging procedure in “Package IP – Simple_Counter”.
- In the “Identification” step, enter the information of the IP.
- In the “Compatibility” step, set up the FPGA/SOC Family for which the IP is compatible.
- In the “File Groups” phase, all content created and set for IP to date is created as a file (including IP driver files)
- However, due to Xilinx’s Vivado Tool error, “Makefile” among the automatically generated files needs to be modified.
- Open “Makefile” and copy & paste the contents of one of the files attached to this article, “Fixed_Makefile”.
- In the “Customization Parameters” step, click “Merge changes form Customization Parameters Wizard” to update the parameters.
- In the “Addressing and Memory” step, you can check the IP Address and Memory information.
- In the “Customization GUI” step, you can see the GUI of the IP that has been set so far, and you can also edit this GUI.
- Finally, in the “Review and Package” step, the IP can be packaged. (After IP packaging, a final review must be carried out.)
When you click the “Package IP” button, the IP packaging is complete and the corresponding IP creation window is closed, returning to the original project.
3. Connect the AXI IP you just created with the ZYNQ PS
- Back to the original project, call the IP you just created to Block Design.
- When the “Simple Counter” AXI IP is called, a “Run Connection Automation” button is created at the top.
- When you press the “Run Connection Automation” button, the “Connection Automation” window appears as follows.
Click “OK” right away without having to configure anything else.
- Then, the “ZYNQ PS” and “Simple Counter” IP are automatically connected to the AXI Interface.
- Click “Optimize Routing” and “Regulate Layout” to organize the IP Blocks neatly.
- Now, to check the “count_done” output of IP with LED, Assign it to the external pin through “Make External”.
- Change the IP output signal “count_done” to “USER_LED1_GREEN”.
- Create a Constaint file and assign the “USER_LED1_GREEN” Net to the “V13” pin to which the green LED on the board is connected.
- Since all the HW settings for the “Simple Counter” IP test are completed, proceed with “Validation” for Block Design.
- When Block Design’s “Validation” is complete, click “Create HDL Wrapper” to convert Block Design into HDL code.
- When HDL code generation is completed, click “Generate Output Products” and proceed with Synthesis in advance in IP units.
(In the subsequent Synthesis process, only IP with changes will be Synthesized, so time saving is possible.)
- Now proceed with the full Synthesis, and when done, review if I/O Ports are set up as we intended.
- Proceed to the “Implementation” and “Generate Bitstream” processes, and when completed, export the Hardware Platform to create an XSA file.
4. Create SW that controls AXI IP by ZYNQ PS In Vitis SDK
- Run Vitis and create a SW Application based on the HW Platform file (XSA) exported from Vivado.
- Create main.c and write code as follows.
And upload the code to the board to check the actual behavior.
Then, you can visually check that the green LED on the board toggles every second, and the Max Count Value we wrote on the “Simple Counter” AXI IP is also read again and output to the serial monitor.
Creating a Custom AXI4-Lite IP1. Create a Vivado Project for Custom AXI4-Lite IP2. Create a AXI IP① Modify “Simple_Counter_v1_0_S00_AXI4_Lite” Verilog file② Modify “Simple_Counter_v1_0” Verilog file3. Connect the AXI IP you just created with the ZYNQ PS4. Create SW that controls AXI IP by ZYNQ PS In Vitis SDK