Skip to content

Commit 41c84e4

Browse files
authored
Re-enable 1DDR (#391)
* Re-enable 1DDR * 1 DDR - Remove SDAccel/tests/conftest.py * Update cl_dram_dma_axi_mstr.sv * Link 3rd party readme * Fix 3rd party readme
1 parent 03079ed commit 41c84e4

File tree

14 files changed

+335
-221
lines changed

14 files changed

+335
-221
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ waves.shm
3535
*.a
3636
*.ko
3737

38+
!SDAccel/aws_platform/xilinx_aws-vu9p-f1_1ddr-xpr-2pr_4_0/libxilinxopencl.so
39+
3840
nohup.out
3941
*.nohup.out
4042

Jenkinsfile

+148-135
Large diffs are not rendered by default.

SDAccel/Makefile

+106-41
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,12 @@ $(info XILINX_SDX = $(XILINX_SDX))
3535
endif
3636

3737
INSTALL_ROOT = /opt/Xilinx/SDx/2017.1.rte
38-
DSA = xilinx_aws-vu9p-f1_4ddr-xpr-2pr_4_0
39-
OPENCLLIB :=
40-
OPENCLFILE = $(XILINX_SDX)/runtime/platforms/$(DSA)/sw/lib/x86_64/libxilinxopencl.so
38+
INSTALL_1DDR = /opt/Xilinx/SDx/2017.1.rte.1ddr
39+
INSTALL_4DDR = /opt/Xilinx/SDx/2017.1.rte.4ddr
40+
INSTALL_4DDR_DEBUG = /opt/Xilinx/SDx/2017.1.rte.4ddr_debug
4141

42-
ifeq ($(wildcard $(OPENCLFILE)),)
43-
OPENCLLIB := ${XILINX_SDX}/lib/lnx64.o/libxilinxopencl.so
44-
else
45-
OPENCLLIB := $(OPENCLFILE)
46-
endif
42+
DSA = xilinx_aws-vu9p-f1_4ddr-xpr-2pr_4_0
43+
OPENCLFILE = ${SDACCEL_DIR}/aws_platform/libxilinxopencl.so
4744

4845
all:
4946
make -C ${SDACCEL_DIR}/userspace/src debug=$(debug) ec2=$(ec2)
@@ -57,39 +54,107 @@ clean:
5754

5855
install:
5956
make -C ${SDK_DIR}/linux_kernel_drivers/xdma install
60-
install -d $(INSTALL_ROOT)/runtime/platforms/$(DSA)/driver
61-
install -d $(INSTALL_ROOT)/runtime/bin
62-
install -d $(INSTALL_ROOT)/runtime/lib/x86_64
63-
install -m 755 ${SDACCEL_DIR}/userspace/src/libawsxcldrv.so $(INSTALL_ROOT)/runtime/platforms/$(DSA)/driver
64-
install -m 755 ${SDACCEL_DIR}/tools/awssak/xbsak $(INSTALL_ROOT)/runtime/bin
65-
install -m 755 ${XILINX_SDX}/runtime/bin/xclbincat $(INSTALL_ROOT)/runtime/bin
66-
install -m 755 ${XILINX_SDX}/runtime/bin/xclbinsplit $(INSTALL_ROOT)/runtime/bin
67-
#install -m 755 ${XILINX_SDX}/lib/lnx64.o/libxilinxopencl.so $(INSTALL_ROOT)/runtime/lib/x86_64
68-
install -m 755 ${OPENCLLIB} $(INSTALL_ROOT)/runtime/lib/x86_64
69-
install -m 755 ${XILINX_SDX}/lib/lnx64.o/libstdc++.so* $(INSTALL_ROOT)/runtime/lib/x86_64
70-
@echo "Generating SDAccel F1 runtime environment setup script, $(INSTALL_ROOT)/setup.sh for bash"
71-
@echo "export XILINX_OPENCL=$(INSTALL_ROOT)" > $(INSTALL_ROOT)/setup.sh
72-
@echo "export LD_LIBRARY_PATH=\$$XILINX_OPENCL/runtime/lib/x86_64:\$$LD_LIBRARY_PATH" >> $(INSTALL_ROOT)/setup.sh
73-
@echo "export PATH=\$$XILINX_OPENCL/runtime/bin:\$$PATH" >> $(INSTALL_ROOT)/setup.sh
74-
@echo "unset XILINX_SDACCEL" >> $(INSTALL_ROOT)/setup.sh
75-
@echo "unset XILINX_SDX" >> $(INSTALL_ROOT)/setup.sh
76-
@echo "unset XCL_EMULATION_MODE" >> $(INSTALL_ROOT)/setup.sh
77-
@echo "Generating SDAccel F1 runtime environment setup script, $(INSTALL_ROOT)/setup.csh for (t)csh"
78-
@echo "setenv XILINX_OPENCL $(INSTALL_ROOT)" > $(INSTALL_ROOT)/setup.csh
79-
@echo "if ( ! \$$?LD_LIBRARY_PATH ) then" >> $(INSTALL_ROOT)/setup.csh
80-
@echo " setenv LD_LIBRARY_PATH \$$XILINX_OPENCL/runtime/lib/x86_64" >> $(INSTALL_ROOT)/setup.csh
81-
@echo "else" >> $(INSTALL_ROOT)/setup.csh
82-
@echo " setenv LD_LIBRARY_PATH \$$XILINX_OPENCL/runtime/lib/x86_64:\$$LD_LIBRARY_PATH" >> $(INSTALL_ROOT)/setup.csh
83-
@echo "endif" >> $(INSTALL_ROOT)/setup.csh
84-
@echo "if ( ! \$$?PATH ) then" >> $(INSTALL_ROOT)/setup.csh
85-
@echo " setenv PATH \$$XILINX_OPENCL/runtime/bin" >> $(INSTALL_ROOT)/setup.csh
86-
@echo "else" >> $(INSTALL_ROOT)/setup.csh
87-
@echo " setenv PATH \$$XILINX_OPENCL/runtime/bin:\$$PATH" >> $(INSTALL_ROOT)/setup.csh
88-
@echo "endif" >> $(INSTALL_ROOT)/setup.csh
89-
@echo "unsetenv XILINX_SDACCEL" >> $(INSTALL_ROOT)/setup.csh
90-
@echo "unsetenv XILINX_SDX" >> $(INSTALL_ROOT)/setup.csh
91-
@echo "unsetenv XCL_EMULATION_MODE" >> $(INSTALL_ROOT)/setup.csh
92-
@echo "XILINX_OPENCL="$(INSTALL_ROOT)
57+
install -d $(INSTALL_1DDR)/runtime/platforms/xilinx_aws-vu9p-f1_1ddr-xpr-2pr_4_0/driver
58+
install -d $(INSTALL_1DDR)/runtime/bin
59+
install -d $(INSTALL_1DDR)/runtime/lib/x86_64
60+
install -m 755 ${SDACCEL_DIR}/userspace/src/libawsxcldrv.so $(INSTALL_1DDR)/runtime/platforms/xilinx_aws-vu9p-f1_1ddr-xpr-2pr_4_0/driver
61+
install -m 755 ${SDACCEL_DIR}/tools/awssak/xbsak $(INSTALL_1DDR)/runtime/bin
62+
install -m 755 ${XILINX_SDX}/runtime/bin/xclbincat $(INSTALL_1DDR)/runtime/bin
63+
install -m 755 ${XILINX_SDX}/runtime/bin/xclbinsplit $(INSTALL_1DDR)/runtime/bin
64+
#install -m 755 ${XILINX_SDX}/lib/lnx64.o/libxilinxopencl.so $(INSTALL_1DDR)/runtime/lib/x86_64
65+
install -m 755 ${OPENCLFILE} $(INSTALL_1DDR)/runtime/lib/x86_64
66+
install -m 755 ${XILINX_SDX}/lib/lnx64.o/libstdc++.so* $(INSTALL_1DDR)/runtime/lib/x86_64
67+
@echo "Generating SDAccel F1 runtime environment setup script, $(INSTALL_1DDR)/setup.sh for bash"
68+
@echo "export XILINX_OPENCL=$(INSTALL_1DDR)" > $(INSTALL_1DDR)/setup.sh
69+
@echo "export LD_LIBRARY_PATH=\$$XILINX_OPENCL/runtime/lib/x86_64:\$$LD_LIBRARY_PATH" >> $(INSTALL_1DDR)/setup.sh
70+
@echo "export PATH=\$$XILINX_OPENCL/runtime/bin:\$$PATH" >> $(INSTALL_1DDR)/setup.sh
71+
@echo "unset XILINX_SDACCEL" >> $(INSTALL_1DDR)/setup.sh
72+
@echo "unset XILINX_SDX" >> $(INSTALL_1DDR)/setup.sh
73+
@echo "unset XCL_EMULATION_MODE" >> $(INSTALL_1DDR)/setup.sh
74+
@echo "Generating SDAccel F1 runtime environment setup script, $(INSTALL_1DDR)/setup.csh for (t)csh"
75+
@echo "setenv XILINX_OPENCL $(INSTALL_1DDR)" > $(INSTALL_1DDR)/setup.csh
76+
@echo "if ( ! \$$?LD_LIBRARY_PATH ) then" >> $(INSTALL_1DDR)/setup.csh
77+
@echo " setenv LD_LIBRARY_PATH \$$XILINX_OPENCL/runtime/lib/x86_64" >> $(INSTALL_1DDR)/setup.csh
78+
@echo "else" >> $(INSTALL_1DDR)/setup.csh
79+
@echo " setenv LD_LIBRARY_PATH \$$XILINX_OPENCL/runtime/lib/x86_64:\$$LD_LIBRARY_PATH" >> $(INSTALL_1DDR)/setup.csh
80+
@echo "endif" >> $(INSTALL_1DDR)/setup.csh
81+
@echo "if ( ! \$$?PATH ) then" >> $(INSTALL_1DDR)/setup.csh
82+
@echo " setenv PATH \$$XILINX_OPENCL/runtime/bin" >> $(INSTALL_1DDR)/setup.csh
83+
@echo "else" >> $(INSTALL_1DDR)/setup.csh
84+
@echo " setenv PATH \$$XILINX_OPENCL/runtime/bin:\$$PATH" >> $(INSTALL_1DDR)/setup.csh
85+
@echo "endif" >> $(INSTALL_1DDR)/setup.csh
86+
@echo "unsetenv XILINX_SDACCEL" >> $(INSTALL_1DDR)/setup.csh
87+
@echo "unsetenv XILINX_SDX" >> $(INSTALL_1DDR)/setup.csh
88+
@echo "unsetenv XCL_EMULATION_MODE" >> $(INSTALL_1DDR)/setup.csh
89+
@echo "XILINX_OPENCL="$(INSTALL_1DDR)
90+
91+
install -d $(INSTALL_4DDR)/runtime/platforms/xilinx_aws-vu9p-f1_4ddr-xpr-2pr_4_0/driver
92+
install -d $(INSTALL_4DDR)/runtime/bin
93+
install -d $(INSTALL_4DDR)/runtime/lib/x86_64
94+
install -m 755 ${SDACCEL_DIR}/userspace/src/libawsxcldrv.so $(INSTALL_4DDR)/runtime/platforms/xilinx_aws-vu9p-f1_4ddr-xpr-2pr_4_0/driver
95+
install -m 755 ${SDACCEL_DIR}/tools/awssak/xbsak $(INSTALL_4DDR)/runtime/bin
96+
install -m 755 ${XILINX_SDX}/runtime/bin/xclbincat $(INSTALL_4DDR)/runtime/bin
97+
install -m 755 ${XILINX_SDX}/runtime/bin/xclbinsplit $(INSTALL_4DDR)/runtime/bin
98+
#install -m 755 ${XILINX_SDX}/lib/lnx64.o/libxilinxopencl.so $(INSTALL_4DDR)/runtime/lib/x86_64
99+
install -m 755 ${OPENCLFILE} $(INSTALL_4DDR)/runtime/lib/x86_64
100+
install -m 755 ${XILINX_SDX}/lib/lnx64.o/libstdc++.so* $(INSTALL_4DDR)/runtime/lib/x86_64
101+
@echo "Generating SDAccel F1 runtime environment setup script, $(INSTALL_4DDR)/setup.sh for bash"
102+
@echo "export XILINX_OPENCL=$(INSTALL_4DDR)" > $(INSTALL_4DDR)/setup.sh
103+
@echo "export LD_LIBRARY_PATH=\$$XILINX_OPENCL/runtime/lib/x86_64:\$$LD_LIBRARY_PATH" >> $(INSTALL_4DDR)/setup.sh
104+
@echo "export PATH=\$$XILINX_OPENCL/runtime/bin:\$$PATH" >> $(INSTALL_4DDR)/setup.sh
105+
@echo "unset XILINX_SDACCEL" >> $(INSTALL_4DDR)/setup.sh
106+
@echo "unset XILINX_SDX" >> $(INSTALL_4DDR)/setup.sh
107+
@echo "unset XCL_EMULATION_MODE" >> $(INSTALL_4DDR)/setup.sh
108+
@echo "Generating SDAccel F1 runtime environment setup script, $(INSTALL_4DDR)/setup.csh for (t)csh"
109+
@echo "setenv XILINX_OPENCL $(INSTALL_4DDR)" > $(INSTALL_4DDR)/setup.csh
110+
@echo "if ( ! \$$?LD_LIBRARY_PATH ) then" >> $(INSTALL_4DDR)/setup.csh
111+
@echo " setenv LD_LIBRARY_PATH \$$XILINX_OPENCL/runtime/lib/x86_64" >> $(INSTALL_4DDR)/setup.csh
112+
@echo "else" >> $(INSTALL_4DDR)/setup.csh
113+
@echo " setenv LD_LIBRARY_PATH \$$XILINX_OPENCL/runtime/lib/x86_64:\$$LD_LIBRARY_PATH" >> $(INSTALL_4DDR)/setup.csh
114+
@echo "endif" >> $(INSTALL_4DDR)/setup.csh
115+
@echo "if ( ! \$$?PATH ) then" >> $(INSTALL_4DDR)/setup.csh
116+
@echo " setenv PATH \$$XILINX_OPENCL/runtime/bin" >> $(INSTALL_4DDR)/setup.csh
117+
@echo "else" >> $(INSTALL_4DDR)/setup.csh
118+
@echo " setenv PATH \$$XILINX_OPENCL/runtime/bin:\$$PATH" >> $(INSTALL_4DDR)/setup.csh
119+
@echo "endif" >> $(INSTALL_4DDR)/setup.csh
120+
@echo "unsetenv XILINX_SDACCEL" >> $(INSTALL_4DDR)/setup.csh
121+
@echo "unsetenv XILINX_SDX" >> $(INSTALL_4DDR)/setup.csh
122+
@echo "unsetenv XCL_EMULATION_MODE" >> $(INSTALL_4DDR)/setup.csh
123+
@echo "XILINX_OPENCL="$(INSTALL_4DDR)
124+
125+
install -d $(INSTALL_4DDR_DEBUG)/runtime/platforms/xilinx_aws-vu9p-f1_4ddr-xpr-2pr-debug_4_0/driver
126+
install -d $(INSTALL_4DDR_DEBUG)/runtime/bin
127+
install -d $(INSTALL_4DDR_DEBUG)/runtime/lib/x86_64
128+
install -m 755 ${SDACCEL_DIR}/userspace/src/libawsxcldrv.so $(INSTALL_4DDR_DEBUG)/runtime/platforms/xilinx_aws-vu9p-f1_4ddr-xpr-2pr-debug_4_0/driver
129+
install -m 755 ${SDACCEL_DIR}/tools/awssak/xbsak $(INSTALL_4DDR_DEBUG)/runtime/bin
130+
install -m 755 ${XILINX_SDX}/runtime/bin/xclbincat $(INSTALL_4DDR_DEBUG)/runtime/bin
131+
install -m 755 ${XILINX_SDX}/runtime/bin/xclbinsplit $(INSTALL_4DDR_DEBUG)/runtime/bin
132+
#install -m 755 ${XILINX_SDX}/lib/lnx64.o/libxilinxopencl.so $(INSTALL_4DDR_DEBUG)/runtime/lib/x86_64
133+
install -m 755 ${OPENCLFILE} $(INSTALL_4DDR_DEBUG)/runtime/lib/x86_64
134+
install -m 755 ${XILINX_SDX}/lib/lnx64.o/libstdc++.so* $(INSTALL_4DDR_DEBUG)/runtime/lib/x86_64
135+
@echo "Generating SDAccel F1 runtime environment setup script, $(INSTALL_4DDR_DEBUG)/setup.sh for bash"
136+
@echo "export XILINX_OPENCL=$(INSTALL_4DDR_DEBUG)" > $(INSTALL_4DDR_DEBUG)/setup.sh
137+
@echo "export LD_LIBRARY_PATH=\$$XILINX_OPENCL/runtime/lib/x86_64:\$$LD_LIBRARY_PATH" >> $(INSTALL_4DDR_DEBUG)/setup.sh
138+
@echo "export PATH=\$$XILINX_OPENCL/runtime/bin:\$$PATH" >> $(INSTALL_4DDR_DEBUG)/setup.sh
139+
@echo "unset XILINX_SDACCEL" >> $(INSTALL_4DDR_DEBUG)/setup.sh
140+
@echo "unset XILINX_SDX" >> $(INSTALL_4DDR_DEBUG)/setup.sh
141+
@echo "unset XCL_EMULATION_MODE" >> $(INSTALL_4DDR_DEBUG)/setup.sh
142+
@echo "Generating SDAccel F1 runtime environment setup script, $(INSTALL_4DDR_DEBUG)/setup.csh for (t)csh"
143+
@echo "setenv XILINX_OPENCL $(INSTALL_4DDR_DEBUG)" > $(INSTALL_4DDR_DEBUG)/setup.csh
144+
@echo "if ( ! \$$?LD_LIBRARY_PATH ) then" >> $(INSTALL_4DDR_DEBUG)/setup.csh
145+
@echo " setenv LD_LIBRARY_PATH \$$XILINX_OPENCL/runtime/lib/x86_64" >> $(INSTALL_4DDR_DEBUG)/setup.csh
146+
@echo "else" >> $(INSTALL_4DDR_DEBUG)/setup.csh
147+
@echo " setenv LD_LIBRARY_PATH \$$XILINX_OPENCL/runtime/lib/x86_64:\$$LD_LIBRARY_PATH" >> $(INSTALL_4DDR_DEBUG)/setup.csh
148+
@echo "endif" >> $(INSTALL_4DDR_DEBUG)/setup.csh
149+
@echo "if ( ! \$$?PATH ) then" >> $(INSTALL_4DDR_DEBUG)/setup.csh
150+
@echo " setenv PATH \$$XILINX_OPENCL/runtime/bin" >> $(INSTALL_4DDR_DEBUG)/setup.csh
151+
@echo "else" >> $(INSTALL_4DDR_DEBUG)/setup.csh
152+
@echo " setenv PATH \$$XILINX_OPENCL/runtime/bin:\$$PATH" >> $(INSTALL_4DDR_DEBUG)/setup.csh
153+
@echo "endif" >> $(INSTALL_4DDR_DEBUG)/setup.csh
154+
@echo "unsetenv XILINX_SDACCEL" >> $(INSTALL_4DDR_DEBUG)/setup.csh
155+
@echo "unsetenv XILINX_SDX" >> $(INSTALL_4DDR_DEBUG)/setup.csh
156+
@echo "unsetenv XCL_EMULATION_MODE" >> $(INSTALL_4DDR_DEBUG)/setup.csh
157+
@echo "XILINX_OPENCL="$(INSTALL_4DDR_DEBUG)
93158

94159
.PHONY: all clean
95160

SDAccel/README.md

+2-6
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,7 @@ There are three simple steps for accelerating your application on an AWS F1 inst
77

88
This quick start guide will use a simple "Hello World" SDAccel example to get you started.
99

10-
It is highly recommended you read the documentation and utilize software and hardware emulation prior to running on F1. The F1 HW compile time is ~4hrs (4DDR), therefore, software and hardware emulation should be used during development.
11-
<!---
1210
It is highly recommended you read the documentation and utilize software and hardware emulation prior to running on F1. The F1 HW compile time is ~4hrs (4DDR) and ~1hr (1DDR), therefore, software and hardware emulation should be used during development.
13-
-->
1411

1512
# Table of Content
1613

@@ -69,13 +66,11 @@ It is highly recommended you read the documentation and utilize software and har
6966
* Select a platform:
7067
* AWS_PLATFORM_4DDR - Default AWS F1 platform with 4 DDRs and profiling support. Optimized for multi DDR use cases. This platform should be used for all production applications which require more than 1 DDR bank.
7168
* AWS_PLATFORM_4DDR_DEBUG - This platform is a debug variant of the 4DDR platform and should be used for hardware debugging of kernels. This version consists of an additional debug feature which allows advanced users to insert ILA’s in the kernels for debugging purposes. All other features are identical to the AWS_PLATFORM_4DDR platform.
72-
<!---
7369
* AWS_PLATFORM_1DDR - This platform consist of 1 DDR that is located in the shell region. This allow maximum space for kernels. This also allows much faster compile times for all the use cases which require only 1 DDR bank. This platform does not support APM and hence no profiling data can be obtained.
7470

7571
```
7672
$ export AWS_PLATFORM=$AWS_PLATFORM_1DDR
7773
```
78-
-->
7974
<a name="createapp"></a>
8075
# 1. Build the host application, Xilinx FPGA binary and verify you are ready for FPGA acceleration
8176

@@ -199,6 +194,7 @@ Here are the steps:
199194
* *Assuming the developer flow (compilation) was done on a separate instance you will need to:*
200195
* Copy the compiled host executable (exe) to new instance
201196
* Copy the \*.awsxclbin AWS FPGA binary file to the new instance
197+
* If using 1DDR platform or 4DDR Rtl kernel debug platform: Depending on the host code, the \*.awsxclbin may need to be renamed. Ex: ```cp vector_addition.hw.xilinx_aws-vu9p-f1_1ddr-xpr-2pr_4_0.awsxclbin vector_addition.hw.xilinx_aws-vu9p-f1_4ddr-xpr-2pr_4_0.awsxclbin```
202198
* Copy any data files required for execution to the new instance
203199
* [Clone the github repository to the new F1 instance and install runtime drivers](#gitsetenv)
204200
* Clone the github repository to the new F1 instance and install runtime drivers
@@ -226,7 +222,7 @@ Here are the steps:
226222
* Source the Runtime Environment & Execute your Host Application
227223
```
228224
$ sudo sh
229-
# source /opt/Xilinx/SDx/2017.1.rte/setup.sh # Other runtime env settings needed by the host app should be setup after this step
225+
# source /opt/Xilinx/SDx/2017.1.rte.4ddr/setup.sh # Use 2017.1.rte.1ddr or 2017.1.rte.4ddr_debug when using AWS_PLATFORM_1DDR or AWS_PLATFORM_4DDR_DEBUG. Other runtime env settings needed by the host app should be setup after this step
230226
# ./helloworld
231227
```
232228

12.7 MB
Binary file not shown.

SDAccel/examples/3rd_party/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
See [3rd Party README](../../docs/README_third_party.md) for additional information on porting to AWS F1

SDAccel/tests/test_build_sdaccel_example.py

+9-8
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ class TestBuildSDAccelExample(AwsFpgaTestBase):
4545
4646
'''
4747
ADD_EXAMPLEPATH = True
48+
ADD_RTENAME = True
4849

4950
@classmethod
5051
def setup_class(cls):
@@ -59,17 +60,17 @@ def setup_class(cls):
5960

6061
return
6162

62-
def test_sw_emu(self, examplePath):
63+
def test_sw_emu(self, examplePath, rteName):
6364
target = "sw_emu"
64-
self.base_test(examplePath=examplePath, target=target, check=True)
65+
self.base_test(examplePath=examplePath, target=target, rteName=rteName, check=True)
6566

66-
def test_hw_emu(self, examplePath):
67+
def test_hw_emu(self, examplePath, rteName):
6768
target = "hw_emu"
68-
self.base_test(examplePath=examplePath, target=target, check=True)
69+
self.base_test(examplePath=examplePath, target=target, rteName=rteName, check=True)
6970

70-
def test_hw_build(self, examplePath):
71+
def test_hw_build(self, examplePath, rteName):
7172
target = "hw"
72-
self.base_test(examplePath=examplePath, target=target, check=False)
73+
self.base_test(examplePath=examplePath, target=target, rteName=rteName, check=False)
7374

7475
def check_build(self, examplePath, target):
7576

@@ -84,7 +85,7 @@ def check_build(self, examplePath, target):
8485

8586
return xclbin
8687

87-
def base_test(self, examplePath, target, clean=True, check=True):
88+
def base_test(self, examplePath, target, rteName, clean=True, check=True):
8889

8990
full_example_path = self.get_sdaccel_example_fullpath(examplePath=examplePath)
9091
logger.info("SDAccel Example path={}".format(full_example_path))
@@ -107,7 +108,7 @@ def base_test(self, examplePath, target, clean=True, check=True):
107108
# Check for non zero xclbin
108109
xclbin = self.check_build(examplePath=examplePath, target=target)
109110

110-
xclbin_key = os.path.join(self.get_sdaccel_example_s3_xclbin_tag(examplePath=examplePath, target=target), basename(xclbin))
111+
xclbin_key = os.path.join(self.get_sdaccel_example_s3_xclbin_tag(examplePath=examplePath, target=target, rteName=rteName), basename(xclbin))
111112

112113
logger.info("Uploading xclbin to {}".format(os.path.join(self.s3_bucket, xclbin_key)))
113114
self.s3_client().upload_file(xclbin, self.s3_bucket, xclbin_key)

SDAccel/tests/test_create_sdaccel_afi.py

+14-8
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ class TestCreateSDAccelAfi(AwsFpgaTestBase):
5555
'''
5656

5757
ADD_EXAMPLEPATH = True
58+
ADD_RTENAME = True
5859

5960
@classmethod
6061
def setup_class(cls):
@@ -68,7 +69,7 @@ def setup_class(cls):
6869

6970
return
7071

71-
def call_create_afi_script(self, examplePath, xclbin, target):
72+
def call_create_afi_script(self, examplePath, xclbin, target, rteName):
7273

7374
full_example_path = self.get_sdaccel_example_fullpath(examplePath=examplePath)
7475
logger.info("SDAccel Example path={}".format(full_example_path))
@@ -79,12 +80,17 @@ def call_create_afi_script(self, examplePath, xclbin, target):
7980

8081
xclbin_basename = os.path.basename(xclbin)
8182
xclbin_filename = os.path.splitext(xclbin_basename)[0]
83+
aws_xclbin_filename_rte = xclbin_filename;
84+
if (rteName == '1ddr'):
85+
aws_xclbin_filename_rte = xclbin_filename.replace("1ddr", "4ddr")
86+
if (rteName == '4ddr_debug'):
87+
aws_xclbin_filename_rte = xclbin_filename.replace("2pr-debug", "2pr")
8288
aws_xclbin_path = AwsFpgaTestBase.get_sdaccel_xclbin_dir(examplePath)
83-
aws_xclbin_basename = os.path.join(aws_xclbin_path, xclbin_filename)
89+
aws_xclbin_basename = os.path.join(aws_xclbin_path, aws_xclbin_filename_rte)
8490
cmd = "{}/SDAccel/tools/create_sdaccel_afi.sh -s3_bucket={} -s3_dcp_key={} -xclbin={} -o={}".format(
8591
self.WORKSPACE,
8692
self.s3_bucket,
87-
self.get_sdaccel_example_s3_dcp_tag(examplePath=examplePath, target=target),
93+
self.get_sdaccel_example_s3_dcp_tag(examplePath=examplePath, target=target, rteName=rteName),
8894
xclbin,
8995
aws_xclbin_basename
9096
)
@@ -97,12 +103,12 @@ def call_create_afi_script(self, examplePath, xclbin, target):
97103
aws_xclbin = self.assert_non_zero_file(os.path.join(aws_xclbin_path, "*.{}.*.awsxclbin".format(target)))
98104
logger.info("Uploading aws_xclbin file: {}".format(aws_xclbin))
99105

100-
aws_xclbin_key = os.path.join(self.get_sdaccel_example_s3_xclbin_tag(examplePath=examplePath, target=target), basename(aws_xclbin))
106+
aws_xclbin_key = os.path.join(self.get_sdaccel_example_s3_xclbin_tag(examplePath=examplePath, target=target, rteName=rteName), basename(aws_xclbin))
101107
self.s3_client().upload_file(aws_xclbin, self.s3_bucket, aws_xclbin_key)
102108

103109
create_afi_response_file = self.assert_non_zero_file(os.path.join(full_example_path, "*afi_id.txt"))
104110

105-
create_afi_response_file_key = self.get_sdaccel_example_s3_afi_tag(examplePath=examplePath, target=target)
111+
create_afi_response_file_key = self.get_sdaccel_example_s3_afi_tag(examplePath=examplePath, target=target, rteName=rteName)
106112

107113
logger.info("Uploading create_afi output file: {}".format(create_afi_response_file))
108114
self.s3_client().upload_file(create_afi_response_file, self.s3_bucket, create_afi_response_file_key)
@@ -112,10 +118,10 @@ def call_create_afi_script(self, examplePath, xclbin, target):
112118
return create_afi_response
113119

114120

115-
def test_create_sdaccel_afi(self, examplePath, target="hw"):
121+
def test_create_sdaccel_afi(self, examplePath, rteName, target="hw"):
116122

117-
xclbin = self.get_sdaccel_xclbin_file(examplePath)
118-
create_afi_response = self.call_create_afi_script(examplePath, xclbin, target)
123+
xclbin = self.get_sdaccel_xclbin_file(examplePath, rteName)
124+
create_afi_response = self.call_create_afi_script(examplePath, xclbin, target, rteName)
119125

120126
afi = create_afi_response.get("FpgaImageId", None)
121127

0 commit comments

Comments
 (0)