Skip to content

Commit

Permalink
HwAccel: update multiple tutorials for 2022.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Randy Hartgrove authored and GitHub Enterprise committed May 2, 2022
1 parent 291e744 commit 0b71944
Show file tree
Hide file tree
Showing 94 changed files with 421 additions and 515 deletions.
15 changes: 9 additions & 6 deletions Getting_Started/Vitis/Part2.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@

# Vitis Getting Started Tutorial

***Version: Vitis 2021.2***

## Part 2 : Installation and Configuration

To develop and deploy applications with Vitis, you need to install the Vitis unified software environment, the Xilinx Runtime library (XRT) and the platform files specific to the acceleration card used in your project.
Expand Down Expand Up @@ -74,15 +72,20 @@ The packages required for each platform can be found on the corresponding downlo

### Step 5 – Setup the environment to run Vitis

To configure the environment to run Vitis, run the following scripts which set up the environment to run in a specific command shell.
To configure the environment to run Vitis, run the following script which sets up the environment to run in a specific command shell.

```bash
source <Vitis_install_path>/Vitis/2021.2/settings64.sh
source /opt/xilinx/xrt/setup.sh
source <Vitis_install_path>/Vitis/2022.1/settings64.sh
```

*NOTE: .csh scripts are also provided but this tutorial assumes a bash shell is used.*

To configure XRT for Alveo Data Center accelerator cards run the following script. This is not required for Embedded platforms.

```bash
source /opt/xilinx/xrt/setup.sh
```

To specify the location of any Data-Center or Embedded platforms you have installed, set the following environment variable:

```bash
Expand Down Expand Up @@ -114,4 +117,4 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

<p class="sphinxhide" align="center"><sup>Copyright&copy; 2020–2021 Xilinx</sup></p>
<p class="sphinxhide" align="center"><sup>Copyright&copy; 2020–2022 Xilinx</sup></p>
4 changes: 1 addition & 3 deletions Getting_Started/Vitis/Part3.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@

# Vitis Getting Started Tutorial

***Version: Vitis 2021.2***

## Part 3 : Review the Kernel Code and Host Application

The example used in this tutorial is a trivial vector-add application. The simplicity of this example allows focusing on the key concepts of FPGA acceleration without being distracted by complicated algorithmic consideration.
Expand Down Expand Up @@ -119,4 +117,4 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

<p class="sphinxhide" align="center"><sup>Copyright&copy; 2020–2021 Xilinx</sup></p>
<p class="sphinxhide" align="center"><sup>Copyright&copy; 2020–2022 Xilinx</sup></p>
27 changes: 12 additions & 15 deletions Getting_Started/Vitis/Part4-data_center.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@

# Vitis Getting Started Tutorial

***Version: Vitis 2021.2***

## Part 4 : Build and Run the Data Center Application

In this fourth part of the Introduction to Vitis tutorial, you will compile and run the vector-add example using each of three build targets supported in the Vitis flow as described below. The overall flow is described in [Data Center Application Acceleration Flow](https://docs.xilinx.com/r/en-US/ug1393-vitis-application-acceleration/Data-Center-Application-Acceleration-Development-Flow), and includes the image flow diagram shown below. From the image you can see the standard G++ compilation process for the host application, and the use of the Vitis compiler (`v++`) for building the Xilinx device binary (`xclbin`). These are the steps you will be working through in this lab.
Expand All @@ -29,7 +27,7 @@

### Setting up the environment

> IMPORTANT: This tutorial requires Vitis 2021.1 or later to run.
> IMPORTANT: This tutorial requires Vitis 2022.1 or later to run.
*NOTE: The instructions provided below assume that you are running in a bash shell.*

Expand Down Expand Up @@ -61,9 +59,9 @@ Then, after changing into the target build directory, enter the following comman

```bash
g++ -Wall -g -std=c++11 ../../src/host.cpp -o app.exe -I${XILINX_XRT}/include/ -L${XILINX_XRT}/lib/ -lOpenCL -lpthread -lrt -lstdc++
emconfigutil --platform xilinx_u200_gen3x16_xdma_1_202110_1 --nd 1
v++ -c -t sw_emu --platform xilinx_u200_gen3x16_xdma_1_202110_1 --config ../../src/u200.cfg -k vadd -I../../src ../../src/vadd.cpp -o vadd.xo
v++ -l -t sw_emu --platform xilinx_u200_gen3x16_xdma_1_202110_1 --config ../../src/u200.cfg ./vadd.xo -o vadd.xclbin
emconfigutil --platform xilinx_u200_gen3x16_xdma_2_202110_1 --nd 1
v++ -c -t sw_emu --platform xilinx_u200_gen3x16_xdma_2_202110_1 --config ../../src/u200.cfg -k vadd -I../../src ../../src/vadd.cpp -o vadd.xo
v++ -l -t sw_emu --platform xilinx_u200_gen3x16_xdma_2_202110_1 --config ../../src/u200.cfg ./vadd.xo -o vadd.xclbin
```

Here is a brief explanation of each of these four commands:
Expand All @@ -75,10 +73,9 @@ Here is a brief explanation of each of these four commands:

The `-t` option of the `v++` command specifies the build target. Here it is set to `sw_emu` so we are building for software emulation.

Notice also the `--config` option which is used to specify the name of a configuration file containing additional options. Here we are using this configuration file to specify the name of the targeted platform and the mapping of kernel arguments to specific memory banks.
Notice also the `--config` option which is used to specify the name of a configuration file containing additional options. Here we are using this configuration file to specify the number of kernels and the mapping of kernel arguments to specific memory banks.

```bash
platform=xilinx_u200_gen3x16_xdma_1_202110_1
debug=1
save-temps=1

Expand Down Expand Up @@ -137,9 +134,9 @@ Then, after changing into the target build directory, enter the following comman

```bash
g++ -Wall -g -std=c++11 ../../src/host.cpp -o app.exe -I${XILINX_XRT}/include/ -L${XILINX_XRT}/lib/ -lOpenCL -lpthread -lrt -lstdc++
emconfigutil --platform xilinx_u200_gen3x16_xdma_1_202110_1 --nd 1
v++ -c -t hw_emu --platform xilinx_u200_gen3x16_xdma_1_202110_1 --config ../../src/u200.cfg -k vadd -I../../src ../../src/vadd.cpp -o vadd.xo
v++ -l -t hw_emu --platform xilinx_u200_gen3x16_xdma_1_202110_1 --config ../../src/u200.cfg ./vadd.xo -o vadd.xclbin
emconfigutil --platform xilinx_u200_gen3x16_xdma_2_202110_1 --nd 1
v++ -c -t hw_emu --platform xilinx_u200_gen3x16_xdma_2_202110_1 --config ../../src/u200.cfg -k vadd -I../../src ../../src/vadd.cpp -o vadd.xo
v++ -l -t hw_emu --platform xilinx_u200_gen3x16_xdma_2_202110_1 --config ../../src/u200.cfg ./vadd.xo -o vadd.xclbin
```

Refer to *Targeting Software Emulation* for a brief explanation of these different commands. The only difference with the previous step is the `v++` target (`-t`) option which is changed from `sw_emu` to `hw_emu`. All other options remain the same.
Expand Down Expand Up @@ -168,8 +165,8 @@ Then, after changing into the target build directory, enter the following comman

```bash
g++ -Wall -g -std=c++11 ../../src/host.cpp -o app.exe -I${XILINX_XRT}/include/ -L${XILINX_XRT}/lib/ -lOpenCL -lpthread -lrt -lstdc++
v++ -c -t hw --platform xilinx_u200_gen3x16_xdma_1_202110_1 --config ../../src/u200.cfg -k vadd -I../../src ../../src/vadd.cpp -o vadd.xo
v++ -l -t hw --platform xilinx_u200_gen3x16_xdma_1_202110_1 --config ../../src/u200.cfg ./vadd.xo -o vadd.xclbin
v++ -c -t hw --platform xilinx_u200_gen3x16_xdma_2_202110_1 --config ../../src/u200.cfg -k vadd -I../../src ../../src/vadd.cpp -o vadd.xo
v++ -l -t hw --platform xilinx_u200_gen3x16_xdma_2_202110_1 --config ../../src/u200.cfg ./vadd.xo -o vadd.xclbin
```

To target Hardware, the `v++ -t` option is set to `hw` and the `emconfigutil` command is not needed, as you will be running on an actual hardware platform rather than an emulated platform. All other options remain identical.
Expand All @@ -186,7 +183,7 @@ After the build completes you can run the application on a system with the Alveo

You should see the same TEST PASSED message indicating that the run completed successfully. If you look in the u200/hw folder you will see some of the files that were created during this build and run process. Refer to *Targeting Software Emulation* for a brief explanation of the different files.

Congratulations!! You have just completed your first run of a Vitis accelerated application on the Alveo U200 card! There are additional [Vitis-Tutorials](https://github.com/Xilinx/Vitis-Tutorials) to work through to learn additional details of the Vitis tools, and [Vitis_Accel_Examples](https://github.com/Xilinx/Vitis_Accel_Examples/tree/2021.2) to use for examples of host application and kernel coding.
Congratulations!! You have just completed your first run of a Vitis accelerated application on the Alveo U200 card! There are additional [Vitis-Tutorials](https://github.com/Xilinx/Vitis-Tutorials) to work through to learn additional details of the Vitis tools, and [Vitis_Accel_Examples](https://github.com/Xilinx/Vitis_Accel_Examples/tree/2022.1) to use for examples of host application and kernel coding.

## Next Step

Expand All @@ -205,4 +202,4 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

<p class="sphinxhide" align="center"><sup>Copyright&copy; 2020–2021 Xilinx</sup></p>
<p class="sphinxhide" align="center"><sup>Copyright&copy; 2020–2022 Xilinx</sup></p>
25 changes: 11 additions & 14 deletions Getting_Started/Vitis/Part4-embedded_platform.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@

# Vitis Getting Started Tutorial

***Version: Vitis 2021.2***

## Part 4 : Build and Run the Embedded Processor Application

In this fourth part of the Introduction to Vitis tutorial, you will compile and run the vector-add example using each of three build targets supported in the Vitis flow as described below. The overall flow is described in [Embedded Processor Application Acceleration Flow](https://docs.xilinx.com/r/en-US/ug1393-vitis-application-acceleration/Embedded-Processor-Application-Acceleration-Development-Flow), and includes the image flow diagram shown below. From the image you can see the G++ cross-compiler for building the host application for the Arm processor, and the use of the Vitis compiler (`v++`) for building the Xilinx device binary (`xclbin`). These are the steps you will be working through in this lab.
Expand All @@ -37,7 +35,6 @@

```bash
source <VITIS_install_path>/settings64.sh
source <XRT_install_path>/setup.sh
unset LD_LIBRARY_PATH
```

Expand Down Expand Up @@ -72,9 +69,9 @@ Then, after changing into the target build directory, enter the following comman

```bash
$CXX -Wall -g -std=c++11 ../../src/host.cpp -o ./app.exe -I/usr/include/xrt -lOpenCL -lpthread -lrt -lstdc++
v++ -c -t sw_emu --config ../../src/zcu102.cfg -k vadd -I../../src ../../src/vadd.cpp -o ./vadd.xo
v++ -l -t sw_emu --config ../../src/zcu102.cfg ./vadd.xo -o ./vadd.xclbin
v++ -p -t sw_emu --config ../../src/zcu102.cfg ./vadd.xclbin --package.out_dir ./package --package.rootfs ${ROOTFS}/rootfs.ext4 --package.sd_file ${ROOTFS}/Image --package.sd_file ./xrt.ini --package.sd_file ./app.exe --package.sd_file ./vadd.xclbin --package.sd_file ./run_sw_emu.sh
v++ -c -t sw_emu --platform xilinx_zcu102_base_202210_1 --config ../../src/zcu102.cfg -k vadd -I../../src ../../src/vadd.cpp -o ./vadd.xo
v++ -l -t sw_emu --platform xilinx_zcu102_base_202210_1 --config ../../src/zcu102.cfg ./vadd.xo -o ./vadd.xclbin
v++ -p -t sw_emu --platform xilinx_zcu102_base_202210_1 --config ../../src/zcu102.cfg ./vadd.xclbin --package.out_dir ./package --package.rootfs ${ROOTFS}/rootfs.ext4 --package.sd_file ${ROOTFS}/Image --package.sd_file ./xrt.ini --package.sd_file ./app.exe --package.sd_file ./vadd.xclbin --package.sd_file ./run_sw_emu.sh
```

Here is a brief explanation of each of these four commands:
Expand Down Expand Up @@ -164,9 +161,9 @@ Then, after changing into the target build directory, enter the following comman

```bash
$CXX -Wall -g -std=c++11 ../../src/host.cpp -o app.exe -I/usr/include/xrt -lOpenCL -lpthread -lrt -lstdc++
v++ -c -t hw_emu --config ../../src/zcu102.cfg -k vadd -I../../src ../../src/vadd.cpp -o vadd.xo
v++ -l -t hw_emu --config ../../src/zcu102.cfg ./vadd.xo -o vadd.xclbin
v++ -p -t hw_emu --config ../../src/zcu102.cfg ./vadd.xclbin --package.out_dir package --package.rootfs ${ROOTFS}/rootfs.ext4 --package.sd_file ${ROOTFS}/Image --package.sd_file xrt.ini --package.sd_file app.exe --package.sd_file vadd.xclbin --package.sd_file run_app.sh
v++ -c -t hw_emu --platform xilinx_zcu102_base_202210_1 --config ../../src/zcu102.cfg -k vadd -I../../src ../../src/vadd.cpp -o vadd.xo
v++ -l -t hw_emu --platform xilinx_zcu102_base_202210_1 --config ../../src/zcu102.cfg ./vadd.xo -o vadd.xclbin
v++ -p -t hw_emu --platform xilinx_zcu102_base_202210_1 --config ../../src/zcu102.cfg ./vadd.xclbin --package.out_dir package --package.rootfs ${ROOTFS}/rootfs.ext4 --package.sd_file ${ROOTFS}/Image --package.sd_file xrt.ini --package.sd_file app.exe --package.sd_file vadd.xclbin --package.sd_file run_app.sh
```

Refer to *Targeting Software Emulation* for a brief explanation of these different commands. The only difference with the previous step is the `v++` target (`-t`) option which is changed from `sw_emu` to `hw_emu`. All other options remain the same.
Expand Down Expand Up @@ -214,9 +211,9 @@ Then, after changing into the target build directory, enter the following comman

```bash
$CXX -Wall -g -std=c++11 ../../src/host.cpp -o app.exe -I/usr/include/xrt -lOpenCL -lpthread -lrt -lstdc++ -O
v++ -c -t hw --config ../../src/zcu102.cfg -k vadd -I../../src ../../src/vadd.cpp -o vadd.xo
v++ -l -t hw --config ../../src/zcu102.cfg ./vadd.xo -o vadd.xclbin
v++ -p -t hw --config ../../src/zcu102.cfg ./vadd.xclbin --package.out_dir package --package.rootfs ${ROOTFS}/rootfs.ext4 --package.sd_file ${ROOTFS}/Image --package.sd_file xrt.ini --package.sd_file app.exe --package.sd_file vadd.xclbin --package.sd_file run_app.sh
v++ -c -t hw --platform xilinx_zcu102_base_202210_1 --config ../../src/zcu102.cfg -k vadd -I../../src ../../src/vadd.cpp -o vadd.xo
v++ -l -t hw --platform xilinx_zcu102_base_202210_1 --config ../../src/zcu102.cfg ./vadd.xo -o vadd.xclbin
v++ -p -t hw --platform xilinx_zcu102_base_202210_1 --config ../../src/zcu102.cfg ./vadd.xclbin --package.out_dir package --package.rootfs ${ROOTFS}/rootfs.ext4 --package.sd_file ${ROOTFS}/Image --package.sd_file xrt.ini --package.sd_file app.exe --package.sd_file vadd.xclbin --package.sd_file run_app.sh
```

To target Hardware, the `v++ -t` option is set to `hw` and the `emconfigutil` command is not needed, as you will be running on an actual hardware platform rather than an emulated platform. All other options remain identical.
Expand All @@ -233,7 +230,7 @@ export XILINX_XRT=/usr

You should see the same TEST PASSED message indicating that the run completed successfully. If you look in the zcu102/hw folder you will see some of the files that were created during this build and run process. Refer to *Targeting Software Emulation* for a brief explanation of the different files.

Congratulations!! You have just completed your first run of a Vitis accelerated application on the ZCU102 card! There are additional [Vitis-Tutorials](https://github.com/Xilinx/Vitis-Tutorials) to work through to learn additional details of the Vitis tools, and [Vitis_Accel_Examples](https://github.com/Xilinx/Vitis_Accel_Examples/tree/2021.2) to use for examples of host application and kernel coding.
Congratulations!! You have just completed your first run of a Vitis accelerated application on the ZCU102 card! There are additional [Vitis-Tutorials](https://github.com/Xilinx/Vitis-Tutorials) to work through to learn additional details of the Vitis tools, and [Vitis_Accel_Examples](https://github.com/Xilinx/Vitis_Accel_Examples/tree/2022.1) to use for examples of host application and kernel coding.

## Next Step

Expand All @@ -252,4 +249,4 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

<p class="sphinxhide" align="center"><sup>Copyright&copy; 2020–2021 Xilinx</sup></p>
<p class="sphinxhide" align="center"><sup>Copyright&copy; 2020–2022 Xilinx</sup></p>
7 changes: 2 additions & 5 deletions Getting_Started/Vitis/Part5.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@

# Vitis Getting Started Tutorial

***Version: Vitis 2021.2***

## Part 5 : Visualizing Results and Analyzing Reports

Now that you have successfully built and run the vector-add example, now you can look at the results and reports generated along the way. This example is configured to generate build and run summaries for all three build targets (software emulation, hardware emulation and hardware). Any of these summary reports can be viewed and analyzed using the Vitis analyzer tool as described in [Using the Vitis Analyzer](https://docs.xilinx.com/r/en-US/ug1393-vitis-application-acceleration/Using-the-Vitis-Analyzer).
Expand Down Expand Up @@ -41,11 +39,10 @@ If you look into the directory where you ran the application, you will notice th

*IMPORTANT: If you targeted the ZCU102 hardware, these files are stored on the SD card and must be copied back to your workstation to continue this lab. Refer to [Running Emulation on an Embedded Processor Platform](https://docs.xilinx.com/r/en-US/ug1393-vitis-application-acceleration/Running-Emulation-on-an-Embedded-Processor-Platform) for more information.*

The generation of these files and reports is controlled by runtime options located in the `xrt.ini` file. This tutorial contains a pre-existing `xrt.ini` file which enables the generation of profile data and a timeline of execution with the following content:
The generation of these files and reports is controlled by runtime options located in the `xrt.ini` file. This tutorial contains a pre-existing `xrt.ini` file which enables the generation a timeline of execution, and the profile summary data, with the following content:

```bash
[Debug]
opencl_summary=true
opencl_trace=true
```

Expand Down Expand Up @@ -119,4 +116,4 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

<p class="sphinxhide" align="center"><sup>Copyright&copy; 2020–2021 Xilinx</sup></p>
<p class="sphinxhide" align="center"><sup>Copyright&copy; 2020–2022 Xilinx</sup></p>
4 changes: 2 additions & 2 deletions Getting_Started/Vitis/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

# Vitis™ Getting Started Tutorial

***Version: Vitis 2021.2***
***Version: Vitis 2022.1***

![img](./images/vitis_101.png)

Expand Down Expand Up @@ -109,4 +109,4 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

<p class="sphinxhide" align="center"><sup>Copyright&copy; 2020–2021 Xilinx</sup></p>
<p class="sphinxhide" align="center"><sup>Copyright&copy; 2020–2022 Xilinx</sup></p>
1 change: 0 additions & 1 deletion Getting_Started/Vitis/example/u200/xrt.ini
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
[Debug]
opencl_summary=true
opencl_trace=true
1 change: 0 additions & 1 deletion Getting_Started/Vitis/example/zcu102/xrt.ini
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
[Debug]
opencl_summary=true
opencl_trace=true
Loading

0 comments on commit 0b71944

Please sign in to comment.