Step 2 - Clocking the PL Kernels - 2022.2 English

Vitis Tutorials: AI Engine Development

Document ID
Release Date
2022.2 English

In this design you will use three kernels called: MM2S, S2MM, and Polar_Clip, to connect to the PLIO. The MM2S and S2MM are AXI memory-mapped to AXI4-Stream HLS designs to handle mapping from DDR and streaming the data to the AI Engine. The Polar_Clip is a free running kernel that only contains two AXI4-Stream interfaces (input and output) that will receive data from the AI Engine, process the data, and send it back to the AI Engine. Clocking of these PLIO kernels is separate from the ADF Graph and these are specified when compiling the kernel, and when linking the design together.

Run the following commands: bash v++ -c --platform $PLATFORM_REPO_PATHS/xilinx_vck190_base_202210_1/xilinx_vck190_base_202210_1.xpfm -k mm2s ./pl_kernels/mm2s.cpp \ --hls.clock 150000000:mm2s -o mm2s.xo --save-temps v++ -c --platform $PLATFORM_REPO_PATHS/xilinx_vck190_base_202210_1/xilinx_vck190_base_202210_1.xpfm -k s2mm ./pl_kernels/s2mm.cpp \ --hls.clock 150000000:s2mm -o s2mm.xo --save-temps v++ -c --platform $PLATFORM_REPO_PATHS/xilinx_vck190_base_202210_1/xilinx_vck190_base_202210_1.xpfm --hls.clock 200000000:polar_clip -k polar_clip \ ./pl_kernels/polar_clip.cpp -o polar_clip.xo --save-temps

Or this command:

make kernels

A brief explanation of the v++ options:

Flag/Switch Description
-c Tells v++ to run the compiler.
--platform (required) The platform to be compiled towards.
-k (required) Kernel name.
--hls.clock Tells the Vitis compiler to use a specific clock defined by a 9-digit number (in the previous example above the clock is 100 MHz). Specifying this will help with the compiler make optimizations based on kernel timing.
-o (required) The output, which will always be .xo.
--save-temps (optional) Will create a folder structure and save the compilation of the kernel.

For additional information, see Vitis Compiler Command.

After completion, you will have the mm2s.xo, s2mm.xo, polar_clip.xo files ready to be used by v++. The host application will communicate with these kernels to read/write data into memory.