See AMD Vitis™ Development Environment on xilinx.com |
Using the AMD Vitis Unified integrated development environment (IDE) setup in step2, the platforminfo tool can report XPFM platform information.
Click for detailed logs
# Run in zcu104_software_platform directory
platforminfo ./zcu104_custom/export/zcu104_custom/zcu104_custom.xpfm
==========================
Basic Platform Information
==========================
Platform: zcu104_custom
File: /group/bcapps/sven/project/giten/Vitis-Tutorials1/Vitis_Platform_Creation/Design_Tutorials/02-Edge-AI-ZCU104/GUI/zcu104_custom/export/zcu104_custom/zcu104_custom.xpfm
Description:
=====================================
Hardware Platform (Shell) Information
=====================================
Vendor: xilinx
Board: ZCU104_Custom_Platform
Name: ZCU104_Custom_Platform
Version: 0.0
Generated Version: 2023.2
Hardware: 1
Software Emulation: 1
Hardware Emulation: 0
Hardware Emulation Platform: 0
FPGA Family: zynquplus
FPGA Device: xczu7ev
Board Vendor: xilinx.com
Board Name: xilinx.com:zcu104:1.1
Board Part: xczu7ev-ffvc1156-2-e
=================
Clock Information
=================
Default Clock Index: 2
Clock Index: 1
Frequency: 100.000000
Clock Index: 2
Frequency: 200.000000
Clock Index: 3
Frequency: 400.000000
==================
Memory Information
==================
Bus SP Tag: HP0
Bus SP Tag: HP1
Bus SP Tag: HP2
Bus SP Tag: HP3
Bus SP Tag: HPC0
Bus SP Tag: HPC1
=============================
Software Platform Information
=============================
Number of Runtimes: 1
Default System Configuration: zcu104_custom
System Configurations:
System Config Name: zcu104_custom
System Config Description:
System Config Default Processor Group: linux_psu_cortexa53
System Config Default Boot Image: standard
System Config Is QEMU Supported: 1
System Config Processor Groups:
Processor Group Name: linux_psu_cortexa53
Processor Group CPU Type: cortex-a53
Processor Group OS Name: Linux On psu_cortexa53
System Config Boot Images:
Boot Image Name: standard
Boot Image Type:
Boot Image BIF: boot/linux.bif
Boot Image Data: linux_psu_cortexa53/image
Boot Image Boot Mode:
Boot Image RootFileSystem:
Boot Image Mount Path:
Boot Image Read Me:
Boot Image QEMU Args: qemu/pmu_args.txt:qemu/qemu_args.txt
Boot Image QEMU Boot:
Boot Image QEMU Dev Tree:
Supported Runtimes:
Runtime: C/C++
You can verify clock information and memory information are set as expected.
Vector addition is the simplest acceleration PL kernel. The Vitis Unified IDE can create this application automatically. Running this test can check the AXI control bus, memory interface, and interrupt setting in platform are working properly.
-
Creating Vector Addition Application
- Go to
WorkSpace
directory created in step1 - Run Vitis by typing
vitis -w .
in the console.-w
is to specify the workspace..
means the current workspace directory. Close the welcome tab after Vitis launches. - Go to example view by clicking the example button and select and click Simple Vector Addition.
- Click Create Application from Template. The project creation wizard would pop up.
- Input the System project name as
vadd
and use the default location for System project location. Then click Next. - Select zcu104_custom platform, click Next.
Note: If the platform component is not in the current workspace user could click + button to add the platform component.
- Set Kernel Image to
xilinx-zynqmp-common-v2023.2/Image
. - Set Root FS to
xilinx-zynqmp-common-v2023.2/rootfs.ext4
. - Set Sysroot to
zcu104_software_platform/xilinx-zynqmp-common-v2023.1/sysroots/cortexa72-cortexa53-xilinx-linux
. Then click Next. - Review the summary of your
vadd
system project and click Finish.
- Input the System project name as
After seconds the vadd system project, vadd host component and vadd kernel component will be ready in the component view.
- Go to
-
Building Vector Addition Application
Vadd system project supports three targets: Software emulation, Hardware emulation and Hardware. User could select the target accordingly following steps below.
-
Go to flow navigator and select vadd system project.
-
Click Build All under the target
-
In the Build Component setup dialog please enable all the components. Then click OK.
After compilation is finished. Users can locate the
sd_card.img
by expanding the Output directory. This provides a logical view of the output. The actual path ofsd_card.img
file is located inWrokSpace/vadd/build/<TARGET>/package/package/
directory. For example, if user targets hardware emulation, thesd_card.img
file is in located inWrokSpace/vadd/build/hw_emu/package/package/
. Users can also view the complete path of thesd_card.img
file by simply hovering the mouse pointer over the image file. -
-
Running Hardware Emulation
After the compilation for hardware emulation is finished, please follow steps below to run hardware emulation.
-
Running Vector Addition Application on the Board
After the compilation for hardware is finished, please follow steps below to run on board.
-
Copy
vadd/build/hw/package/package/sd_card.img
to local if the Vitis IDE is running on a remote server. -
Write
sd_card.img
onto the SD Card with SD Card image writer applications like Etcher on Windows or dd on Linux. -
Boot ZCU104 board with the SD card in SD boot mode.
Steps to run the application:
First, login with user
petalinux
and set up a new password (it is then also the sudo password):-
Log into the system
petalinux login:petalinux You are required to change your password immediately (administrator enforced). New password: Retype new password: petalinux:~$ sudo su We trust you have received the usual lecture from the local System Administrator. It usually boils down to these three things: #1) Respect the privacy of others. #2) Think before you type. #3) With great power comes great responsibility. Password: petalinux:/home/petalinux#
-
Go to auto mounted FAT32 partition
petalinux:/home/petalinux# cd /run/media/mmcblk0p1/
-
Run vadd application
./simple_vadd krnl_vadd.xclbin
It should show program prints and XRT debug information.
TEST PASSED
-
-
Scripts are provided to create the test applications on the custom platform we created. To use these scripts, please run the following steps.
-
Run build
# cd to the step directory, e.g. cd step3_validate make all
The default verification uses hardware emulation. To verify vadd application on hardware board, run the following command to generate the SD card image.
cd step3_validate make sd_card
-
To clean the generated files, run the following commands:
make clean
The command line flow has slight differences comparing to Vitis IDE flow.
The vector addition application is called vadd
and binary_container_1.xclbin
in the Vitis IDE flow. The generated files in command line flow are called simple_vadd
and krnl_vadd.xclbin
.
You have completed creating a custom platform from scratch and verifying it with a simple vadd application and a relatively complex Vitis AI use cases.
Feel free to check more tutorials in this repository.
If user need to do iteration for your project, you could go through the Iteration Guidelines to do iterations.
Copyright © 2020–2023 Advanced Micro Devices, Inc