Usage of PS region of ZYNQ Architecture

Pages List
List view
Home
Portfolio
HW
FW
SW
FPGA / Adaptive SoC
Daily
Photo
Etc
 
Adaptive SoC

Usage of PS region of ZYNQ Architecture


notion image

Entire project configuration when both PS and PL regions are used


notion image
The XSA file contains HW Platform information generated by the Vivado project, and SW development is conducted, based on this information on Vitis.
 
notion image
 
 

Serial communication between PC and ZYNQ


1. Vivado

Create a “Hello World” project in Vivado
notion image
Then click “Create Block Design” on the “IP INTEGRATOR” tab.
(In this example, we will only have serial communication between the PC and Zynq’s PS area (Uart), so we will not create a Design Source.)
 
Set the name of the block design.
notion image
 
Click the ‘+’ button (Add IP) in the right-hand diagram window,
notion image
 
Select ‘ZYNQ7 Processing System’.
notion image
 
Then the IP of Zynq’s PS is added.
notion image
 
In this example, Only the Uart peripheral of Zynq PS is used.
notion image
 
Select ‘MIO Configuration’ and check UART1 and set ‘Bank 1 I/O Voltage’ to ‘LVCMOS 1.8V’.
notion image
The MIO Configuration (Multiplexed I/O Configuration) determines whether each pin of the FPGA and the I/O peripheral are routed.
(Each pin of the FPGA can be connected to several I/O peripherals through a multi-plexer.)
 
Looking at the picture below, it can be seen that the UART1 to be used in the example is MIO48 and MIO49.
notion image
Referring to the circuit diagram of the Zybo z7 board, the bank voltage of the corresponding MIO is VCC1V8.
This means that the operating level of the MIO is 1.8 V.
Therefore, UART can operate normally only when ‘Bank 1 I/O Voltage’ is set to ‘LVCMOS 1.8V’.
 
Now, Remove unused parts from Zynq PS.
 
(1) Uncheck ‘M AXI GP0 interface’ in ‘PS-PL Configuration’.
notion image
 
(2) Uncheck ‘FCLK_CLK0’ in ‘Clock Configuration’.
notion image
Clock can be generated in the PS region and supplied to the PL region, but in this example, the PL region is not used, so the corresponding part is unchecked.
 
If you press OK, you can see that ZYNQ7 PS is simpler than before as follows.
notion image
 
Click ‘Run Block Automation’ in the upper left corner,
notion image
It may be seen that the interface (Fixed_io) is automatically set externally. (UART peripheral to MIO48, MIO49)
 
Press OK, and press ‘Validate Design (short key: F6)’ on the following screen.
notion image
Since this block diagram file is not a Verilog HDL file, it must be converted to a Verilog HDL file by ‘Create HDL Wrapper’.
 
Click “Create HDL Wrapper”.
notion image
 
Then Press ‘Okay’,
notion image
 
The HDL file is then created as follows.
notion image
 
Press ‘Generate Bitstream’ to create a Bitstream file with the corresponding HDL file.
notion image
 
Once the Bitstream file is created, select “File – Export – Export Hardware” to extract the XSA file.
notion image
 
When the Export Hardware Platform window appears, select Next.
notion image
 
If the ‘Include bitstream’ option is selected, Bitstream files can also be programmed into the FPGA on Vitis.
notion image
 
Set the name of the XSA file, select Next, and select Finish in the last window.
notion image
 
Then, it can be confirmed that an XSA file called ‘HelloWorld_XSA’ has been created in the HelloWorld project.
notion image
 
 

2. Vitis

Now, Create a project in Vitis.
Run Vitis, specify the workspace path.
notion image
 
When Vitis runs, click ‘Create Application Project’.
notion image
 
The following figure describes the process of loading an HW Platform (XSA file) generated by Vivado and developing SW on Vitis based on that Platform.
notion image
 
When you press Next, a window appears where you can select a platform, but the platform you currently have does not exist.
notion image
 
Load the XSA file from “Create a new platform from hardware (XSA)”.
(Create a Vitis Platform based on the hardware described in the XSA file.)
notion image
 
Select the XSA file generated by Vivado’s HelloWorld project.
notion image
 
The XSA file is then loaded as follows.
notion image
 
Set the Application Project Name.
notion image
Zynq’s ARM Cortex-A9 consists of a dual core, but in this example only one core will be used.
Select ‘ps7_cortexa9_0’ and press Next.
 
Since it does not use any OS, the Operating System selects ‘Standalone’.
notion image
 
In Vitis, there is a template that is basically provided as follows, and in this example, the ‘Hello World’ template is used.
notion image
 
When you press Finish, a Vitis project containing ‘helloworld.c’ is created as follows.
notion image
 
Modify the main statement of ‘helloworld.c’ as shown in the picture above, and proceed with Build.
notion image
 
For serial communication between PC and Zynq, open ‘Vitis Serial Terminal’ with the search function in the upper right.
notion image
 
The ‘Vitis Serial Terminal’ is created in the lower right, and Press the ‘+’ button of the Terminal window to proceed with the serial port connection setting.
notion image
 
The corresponding serial port is then connected as follows.
notion image
 
Now, run the code for ‘helloworld.c’ on the FPGA.
notion image
Click “Launch Hardware (Single Application Debug)” to program the Bitstream file and the “helloworld.c” code on the FPGA.
 
As shown in the following figure, if you enter decimal 777 in Terminal, a printf statement including the corresponding decimal is printed every second.
notion image