You will create an acceleration application with PL kernel running on the platform created in step 2 and run it on this custom-VCK190 board.
Creating Vector Addition Application
Go to
WorkSpace
directory created in step1Run 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 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 custom_platform 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-versal-common-v2023.2/Image
.Set Root FS to
xilinx-versal-common-v2023.2/rootfs.ext4
.Set Sysroot to
xilinx-versal-common-v2023.1/sysroots/cortexa72-cortexa53-xilinx-linux
. Then click Next.Review the summary of your
vadd
system project and click Finish.
Note: In the platform selecting page if the platform you want to use is not in the current list, you can click + button to add the platform to the list.
After seconds the vadd system project, vadd host component and vadd kernel component will be ready in the component view.
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.
Click Start Emulator under HARDWARE EMULATION target. The Start Emulator setup page would be popped up. Then click Start.
Click Run after the emulator boots up to terminal
Click Stop emulator to stop emulation after emulation is finished.
Running the Application on Hardware
Copy
WrokSpace/vadd/build/hw/package/package/sd_card.img
to local if you build the project on a remote server or virtual machine.Program the
sd_card.img
to a SD card. Refer to AR#73711 for detailed steps.NOTE: The programmed SD card has two partitions. The FAT32 partition with boot components and the EXT4 partition with Linux root file system. By default, the Windows system cannot see the contents of EXT4 partition.
NOTE: Eject the SD card properly from the system after programming it.
Insert the SD card, and boot the VCK190 board with SD boot mode (SW1[4:1] = “1110”: OFF, OFF, OFF, ON) and power on.
NOTE: Refer to VCK190 Evaluation Board User Guide for details about boot mode.
Connect to UART console.
Launch the test application from UART console.
Use the following steps to run the application
You will need to log in with user
petalinux
first 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 and run the application as:
petalinux:/home/petalinux# cd /run/media/sd-mmcblk0p1 petalinux:/home/petalinux# ./simple_vadd krnl_vadd.xclbin
Expected print on UART console
Show Log
root@petalinux:/run/media/mmcblk0p1# ./vadd binary_container_1.xclbin EXE: /run/media/mmcblk0p1/simple_vadd [XRT] WARNING: The xrt.ini flag "opencl_summary" is deprecated and will be removed in a future release. A summary file is generated when when any profiling is enabled, so please use the appropriate settings from "opencl_trace=true", "device_counter=true", and "device_trace=true." [XRT] WARNING: The xrt.ini flag "opencl_device_counter" is deprecated and will be removed in a future release. Please use the equivalent flag "device_counter." INFO: Reading krnl_vadd.xclbin Loading: 'krnl_vadd.xclbin' [ 74.394840] zocl-drm amba_pl@0:zyxclmm_drm: zocl_create_client: created KDS client for pid(577), ret: 0 [ 74.395731] zocl-drm amba_pl@0:zyxclmm_drm: zocl_destroy_client: client exits pid(577) [ 74.401000] zocl-drm amba_pl@0:zyxclmm_drm: zocl_create_client: created KDS client for pid(577), ret: 0 Trying to program device[0]: edge [ 74.937477] [drm] skip kind 29(AIE_RESOURCES) return code: -22 [ 74.938038] [drm] found kind 8(IP_LAYOUT) [ 74.938641] [drm] found kind 9(DEBUG_IP_LAYOUT) [ 74.939375] [drm] skip kind 25(AIE_METADATA) return code: -22 [ 74.939688] [drm] found kind 7(CONNECTIVITY) [ 74.940087] [drm] found kind 6(MEM_TOPOLOGY) [ 74.940907] [drm] Memory 0 is not reserved in device tree. Will allocate memory from CMA [ 74.948647] [drm] Memory 1 is not reserved in device tree. Will allocate memory from CMA [ 74.963753] cu_drv CU.2.auto: cu_probe: CU[0] created [ 74.974174] cu_drv CU.2.auto: ffff000803cbac10 xrt_cu_intr_thread: CU[0] start [ 74.989334] [drm] zocl_xclbin_read_axlf f4f049d5-183a-e265-264d-ecfa34a51343 ret: 0 [ 75.037345] [drm] bitstream f4f049d5-183a-e265-264d-ecfa34a51343 locked, ref=1 [ 75.038188] zocl-drm amba_pl@0:zyxclmm_drm: ffff000800323c10 kds_add_context: Client pid(577) add context CU(0xffffffff) shared(true) [ 75.041054] zocl-drm amba_pl@0:zyxclmm_drm: ffff000800323c10 kds_del_context: Client pid(577) del context CU(0xffffffff) [ 75.042096] [drm] bitstream f4f049d5-183a-e265-264d-ecfa34a51343 unlocked, ref=0 [ 75.094803] [drm] bitstream f4f049d5-183a-e265-264d-ecfa34a51343 locked, ref=1 [ 75.095393] zocl-drm amba_pl@0:zyxclmm_drm: ffff000800323c10 kds_add_context: Client pid(577) add context CU(0xffffffff) shared(true) Device[0]: program successful! [ 75.188269] zocl-drm amba_pl@0:zyxclmm_drm: ffff000800323c10 kds_add_context: Client pid(577) add context CU(0xffffffff) shared(true) [ 75.192218] zocl-drm amba_pl@0:zyxclmm_drm: ffff000800323c10 kds_add_context: Client pid(577) add context CU(0x0) shared(true) TEST PASSED [ 78.347703] zocl-drm amba_pl@0:zyxclmm_drm: ffff000800323c10 kds_del_context: Client pid(577) del context CU(0xffffffff) [ 78.349191] zocl-drm amba_pl@0:zyxclmm_drm: ffff000800323c10 kds_del_context: Client pid(577) del context CU(0x0) [ 78.354584] zocl-drm amba_pl@0:zyxclmm_drm: ffff000800323c10 kds_del_context: Client pid(577) del context CU(0xffffffff) [ 78.355356] [drm] bitstream f4f049d5-183a-e265-264d-ecfa34a51343 unlocked, ref=0 [ 78.462912] zocl-drm amba_pl@0:zyxclmm_drm: zocl_destroy_client: client exits pid(577)
NOTE: The
[ 35.116279] [drm]
messages are print from XRT for debugging purpose. It only shows up on UART. It will now print on ssh. This debugging message can be turned off by turning down the system dmesg reporting level.echo "4" > /proc/sys/kernel/printk