Skip to content

Commit ef05306

Browse files
authored
Release v1.4.17 (#505)
* Updated XDMA Driver to allow builds on newer kernels * Updated documentation on Alveo U200 to F1 platform porting * Added Vitis 2019.2 Patching for AR#73068
1 parent cbd4e77 commit ef05306

File tree

7 files changed

+43
-76
lines changed

7 files changed

+43
-76
lines changed

RELEASE_NOTES.md

+5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# AWS EC2 FPGA HDK+SDK Release Notes
22

3+
## Release 1.4.17 (See [ERRATA](./ERRATA.md) for unsupported features)
4+
* Updated XDMA Driver to allow builds on newer kernels
5+
* Updated documentation on Alveo U200 to F1 platform porting
6+
* Added Vitis 2019.2 Patching for AR#73068
7+
38
## Release 1.4.16 (See [ERRATA](./ERRATA.md) for unsupported features)
49
* FPGA developer kit now supports Xilinx Vivado/Vitis 2020.1
510
* To upgrade, use [Developer AMI v1.9.0](https://aws.amazon.com/marketplace/pp/B06VVYBLZZ) on the AWS Marketplace.

Vitis/docs/Alveo_to_AWS_F1_Migration.md

-61
Original file line numberDiff line numberDiff line change
@@ -161,67 +161,6 @@ A detailed working example walking through all the steps required to migrate an
161161
In this example, the source code for the software program and the FPGA kernels remains identical whether targeting U200 or F1 instances.
162162
Only command line changes are necessary to port the application.
163163

164-
The Vitis flow leverages dedicated compilation steps to build the software program and FPGA accelerators. These steps are described below.
165-
166-
167-
168-
### Compiling the software program
169-
170-
The software program is compiled exactly in the same way in both case:
171-
172-
```bash
173-
g++ -D__USE_XOPEN2K8 -I/$(XILINX_XRT)/include/ -I./src -O3 -Wall -fmessage-length=0 -std=c++11 ../src/host.cpp -L/$(XILINX_XRT)/lib/ -lxilinxopencl -lpthread -lrt -o host
174-
```
175-
176-
The software program is linked with the XRT libraries which manages the specific requirements of each FPGA platform, allowing the source code to remain the same for U200 and F1.
177-
178-
See [here](https://www.xilinx.com/html_docs/xilinx2020_1/vitis_doc/buildinghostprogram.html#asy1528754332783) for more details about building the host program for the Vitis flow.
179-
180-
181-
### Compiling the FPGA binary
182-
183-
When building the FPGA binary only a few options need to be changed when retargeting from U200 and F1 instances. These options are contained in a specific file (called options.cfg in our example) and which is passed to the Vitis v++ compiler with the `--config` command line option.
184-
185-
Here is a side-by-side view of the both options.cfg files:
186-
187-
| Contents of options.cfg for Alveo U200 | Contents of options.cfg for AWS F1 |
188-
| ------------------------------------------------------------ | ------------------------------------------------------------ |
189-
| platform=xilinx_u200_xdma_201830_2<br />[connectivity] <br />sp=vadd_1.in1:DDR[1] <br />sp=vadd_1.in2:DDR[1] <br />sp=vadd_1.out:DDR[1] | platform=xilinx_aws-vu9p-f1_shell-v04261818_201920_2<br />[connectivity] <br />sp=vadd_1.in1:DDR[0] <br />sp=vadd_1.in2:DDR[0] <br />sp=vadd_1.out:DDR[0] |
190-
191-
The platform option specifies which acceleration platform is targeted for the build.
192-
193-
The `sp` option is used to specify the assignment of kernel interfaces to DDR interfaces. The original U200 design is connecting the kernel interfaces to DDR[1] which is located in the shell. Keeping the same settings would produce a working design on F1 instances, but in order to produce exactly the same configuration and target the DDR interface located in the F1 shell, the `sp` options are modified to use DDR[0].
194-
195-
Putting all the platform specific options in a dedicated file allows the v++ build commands remain strictly identical:
196-
197-
```bash
198-
// Step 1: compile the kernel from source code
199-
v++ -c -g -t hw -R 1 -k vadd --profile_kernel data:all:all:all --profile_kernel stall:all:all:all --save-temps --temp_dir ./temp_dir --report_dir ./report_dir --log_dir ./log_dir --config ./options.cfg -I../src ../src/vadd.cpp -o ./vadd.hw.xo
200-
201-
// Step 2: link the compiled kernel with the shell and produce the FPGA binary
202-
v++ -l -g -t hw -R 1 --profile_kernel data:all:all:all --profile_kernel stall:all:all:all --temp_dir ./temp_dir --report_dir ./report_dir --log_dir ./log_dir --config ./options.cfg -I../src vadd.hw.xo -o add.hw.xclbin
203-
```
204-
205-
See [here](https://www.xilinx.com/html_docs/xilinx2020_1/vitis_doc/vitiscommandcompiler.html#wrj1504034328013) for more information about the v++ command line options and configuration files.
206-
207-
208-
209-
### Creating the Amazon FPGA Image
210-
211-
Once you have compiled the host program and the FPGA binary, you are ready to execute the FPGA-accelerated application on a server equipped with an Alveo U200 acceleration card.
212-
213-
When targeting F1 instances, you need to go through the additional step of creating an Amazon FPGA Image (AFI). This is done with the `create_vitis_afi.sh` command provided by AWS. This command reads in the FPGA binary generated by the v++ linker and requires information about the user’s AWS S3 bucket.
214-
215-
In this example, the command looks as follows:
216-
217-
```bash
218-
$AWS_FPGA_REPO_DIR/Vitis/tools/create_vitis_afi.sh -xclbin=./vadd.xclbin -o=./vadd -s3_bucket=<bucket-name> -s3_dcp_key=f1-dcp-folder -s3_logs_key=f1-logs
219-
```
220-
221-
For more details about the `create_vitis_afi.sh` command, you can consult the AWS documentation [here](https://github.com/aws/aws-fpga/blob/master/Vitis/README.md#2-create-an-amazon-fpga-image-afi).
222-
223-
224-
225164
## Summary – Migration Checklist
226165

227166
Because Vitis provides platform-independent APIs and interfaces to the developer, the process of migrating applications across similar FPGA acceleration cards is greatly facilitated.

Vitis/docs/Alveo_to_AWS_F1_Migration/example/README.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,18 @@ The Vitis development flow provides platform independent APIs and interfaces to
77

88
## Example Overview
99

10-
The accelerator used in this example is a simple vector-add kernel. The `src` directory contains the source code for the project:
10+
The accelerator used in this example is a simple vector-add kernel. The [`src`](./src) directory contains the source code for the project:
1111

12-
- `vadd.cpp` contains the C++ source code of the accelerator which adds 2 arbitrarily sized input vectors.
13-
- `host.cpp` contains the main function running on the host CPU. The host application is written in C++ and uses OpenCL™ APIs to interact with the FPGA accelerator.
12+
- [`vadd.cpp`](./src/vadd.cpp) contains the C++ source code of the accelerator which adds 2 arbitrarily sized input vectors.
13+
- [`host.cpp`](./src/host.cpp) contains the main function running on the host CPU. The host application is written in C++ and uses OpenCL™ APIs to interact with the FPGA accelerator.
1414

15-
The `u200` and `f1` directories contain the Makefiles and scripts for building for Alveo U200 and AWS F1 respectively.
15+
The [`u200`](./u200) and The [`u200`](./u200) and [`f1`](./f1) directories contain the Makefiles and scripts for building for Alveo U200 and AWS F1 respectively. directories contain the Makefiles and scripts for building for Alveo U200 and AWS F1 respectively.
1616

1717

1818

1919
## Building for Alveo U200
2020

21-
*Note: The instructions below assume that the required tools and platforms are installed and that the environment is properly setup to run Vitis.*
21+
*Note: The instructions below assume that the required tools and platforms are installed and that the environment is properly setup to run Vitis. It is also a good idea to complete the Vitis example flow end-to-end before running this example.*
2222

2323
1. Go to the `u200` directory
2424

Vitis/tests/test_build_vitis_example.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ def base_test(self, examplePath, target, rteName, xilinxVersion, clean=True, che
103103
if check:
104104
check_string = "check"
105105

106-
(rc, stdout_lines, stderr_lines) = self.run_cmd("make {0} TARGET={1} DEVICE={2} all".format(check_string, target, os.environ['AWS_PLATFORM']))
106+
(rc, stdout_lines, stderr_lines) = self.run_cmd("make {0} TARGET={1} DEVICE={2} all PROFILE=yes".format(check_string, target, os.environ['AWS_PLATFORM']))
107107
assert rc == 0, "Vitis build failed with rc={}".format(rc)
108108

109109
# Check for non zero xclbin

hdk/hdk_version.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
HDK_VERSION=1.4.16
1+
HDK_VERSION=1.4.17

shared/bin/set_common_functions.sh

+29-6
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,7 @@ function get_base_vivado_version {
6969
local MYVIVADO_ENV_VAR_BACKUP=$MYVIVADO
7070

7171
unset MYVIVADO
72-
local __vivado_version=$(get_vivado_v
73-
ersion)
72+
local __vivado_version=$(get_vivado_version)
7473
export MYVIVADO=$MYVIVADO_ENV_VAR_BACKUP
7574
elif is_xilinx_path_set
7675
then
@@ -116,8 +115,9 @@ function get_vivado_version {
116115
}
117116

118117
function setup_patches {
118+
local caller_script="${BASH_SOURCE[1]}"
119119
patch_AR71715
120-
patch_AR73068
120+
patch_AR73068 "$caller_script"
121121
}
122122

123123
function is_patch_applied {
@@ -211,13 +211,28 @@ function install_patch {
211211
fi
212212
}
213213

214-
function patch_AR73068_2019_2 {
215-
info_msg "Patching Vivado 2019.2 with Xilinx Patch AR73068"
214+
function fix_patch_vitis_AR73068_2019_2 {
215+
local patch_object="$1"
216+
local patch_dir_name="${patch_object%.*}"
217+
pushd patches/$patch_dir_name
218+
219+
sed -i '/.*checksum.*/d' ./vivado/data/ip/xilinx/ddr4_v2_2/component.xml
220+
sed -i 's/coreRevision>73068/coreRevision>8/' ./vivado/data/ip/xilinx/ddr4_v2_2/component.xml
221+
popd
222+
}
216223

224+
function patch_AR73068_2019_2 {
225+
info_msg "Patching Vivado/Vitis 2019.2 with Xilinx Patch AR73068"
226+
local fix_patch="$1"
217227
local patch_bucket="https://aws-fpga-developer-ami.s3.amazonaws.com/1.8.0/Patches/AR73068"
218228
local patch_object="AR73068_Vivado_2019_2_preliminary_rev1.zip"
219229

220230
install_patch "AR73068" "$patch_bucket" "$patch_object"
231+
232+
if [[ "$fix_patch" == true ]]; then
233+
info_msg "Fixing Patch AR73068 for Vitis"
234+
fix_patch_vitis_AR73068_2019_2 "$patch_object"
235+
fi
221236
}
222237

223238
function patch_AR73068_2019_1 {
@@ -258,9 +273,17 @@ function patch_AR73068_2017_4 {
258273

259274
function patch_AR73068 {
260275
local base_vivado_version=$(get_base_vivado_version)
276+
local caller_script="$1"
277+
local fix_patch=false
278+
279+
# Vitis specific changes
280+
if [[ "$caller_script" =~ "vitis_setup.sh" ]]; then
281+
info_msg "Patching Vitis with AR73068"
282+
fix_patch=true
283+
fi
261284

262285
if [[ "${base_vivado_version}" =~ "Vivado v2019.2" ]]; then
263-
patch_AR73068_2019_2
286+
patch_AR73068_2019_2 "$fix_patch"
264287
elif [[ "${base_vivado_version}" =~ "Vivado v2019.1" ]]; then
265288
patch_AR73068_2019_1
266289
elif [[ "${base_vivado_version}" =~ "Vivado v2018.3" ]]; then

vitis_setup.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,8 @@ fi
165165

166166
info_msg " XILINX_VITIS is set to $XILINX_VITIS"
167167
# Install patches as required.
168-
#info_msg " Checking & installing required patches"
169-
#setup_patches
168+
info_msg " Checking & installing required patches"
169+
setup_patches
170170

171171

172172
# Update Xilinx Vitis Examples from GitHub

0 commit comments

Comments
 (0)