From 5788af726a46f9cb0b84d96038b12112163f5ec7 Mon Sep 17 00:00:00 2001 From: SDA USR <1391+sdausr@users.noreply.gitenterprise.xilinx.com> Date: Fri, 16 Sep 2022 14:09:36 +0800 Subject: [PATCH] Squashed 'hpc' changes from 843c1ba..0dcda94 (#701) 0dcda94 Merge pull request #144 from tuol/cr_1140424 a76d87e Merge pull request #145 from tuol/cr_1140420 cd2dbfd make two benchmark case disable, due to similiar issue with their corresponding cases in tests 35211e8 lower build frequency 331c32b Merge pull request #142 from liyuanz/next 28b07ab update mk 9861fbd Merge pull request #141 from tuol/cr_1137645 3cee823 add missing header of vector and future e01e471 Merge pull request #140 from tuol/cr_1135038 aeb6da3 fix error in description.json 6f9dea0 Merge pull request #137 from yuanqian/update_doc_next_portal d2fb2df Merge pull request #138 from liyuanz/add_mem 2aa1d70 Merge pull request #139 from liyuanz/add_mem 390ad14 add mem and time 474e03e update ca904f2 add mem 66ec334 update doc in next branch for portal ab09c33 Merge pull request #136 from liyuanz/next 3e33b54 update makefile 5fbdc9c Merge pull request #134 from changg/22.2_mks a477498 fix u280 0b9d86c 22.2 mk update 2e27386 change 2022.1_stable_latest to 2022.2_stable_latest Co-authored-by: sdausr --- hpc/Jenkinsfile | 2 +- .../data_h128_w128_t10_pe2/description.json | 4 +- .../data_h128_w128_t15_pe2/description.json | 4 +- .../data_h128_w128_t15_pe4/description.json | 4 +- .../RTM_x36_y60_z40_t4_p2/description.json | 2 +- .../RTM_x50_y60_z80_t4_p2/description.json | 2 +- hpc/L2/benchmarks/cg_gemv_jacobi/Makefile | 94 ++++++++---- .../cg_gemv_jacobi/description.json | 7 +- hpc/L2/benchmarks/cg_gemv_jacobi/utils.mk | 68 ++++++-- hpc/L2/benchmarks/cg_spmv_jacobi/Makefile | 98 +++++++----- .../cg_spmv_jacobi/description.json | 2 +- hpc/L2/benchmarks/cg_spmv_jacobi/utils.mk | 68 ++++++-- .../cgSolver/krnl_cgSolver_gemv/Makefile | 94 ++++++++---- .../krnl_cgSolver_gemv/description.json | 5 - .../krnl_cgSolver_gemv/tests/Makefile | 94 ++++++++---- .../krnl_cgSolver_gemv/tests/utils.mk | 68 ++++++-- .../cgSolver/krnl_cgSolver_gemv/utils.mk | 68 ++++++-- .../krnl_cgSolver_gemv_jacobi_16ch/Makefile | 94 ++++++++---- .../description.json | 5 - .../tests/Makefile | 94 ++++++++---- .../tests/utils.mk | 68 ++++++-- .../krnl_cgSolver_gemv_jacobi_16ch/utils.mk | 68 ++++++-- .../krnl_cgSolver_gemv_jacobi_1ch/Makefile | 94 ++++++++---- .../description.json | 5 - .../tests/Makefile | 94 ++++++++---- .../tests/utils.mk | 68 ++++++-- .../krnl_cgSolver_gemv_jacobi_1ch/utils.mk | 68 ++++++-- .../krnl_cgSolver_gemv_jacobi_8ch/Makefile | 94 ++++++++---- .../description.json | 5 - .../tests/Makefile | 94 ++++++++---- .../tests/utils.mk | 68 ++++++-- .../krnl_cgSolver_gemv_jacobi_8ch/utils.mk | 68 ++++++-- .../krnl_cgSolver_spmv_jacobi_16ch/Makefile | 98 +++++++----- .../krnl_cgSolver_spmv_jacobi_16ch/utils.mk | 68 ++++++-- hpc/L2/tests/mlp/fcn_1CU/Makefile | 97 +++++++----- hpc/L2/tests/mlp/fcn_1CU/description.json | 12 +- hpc/L2/tests/mlp/fcn_1CU/utils.mk | 68 ++++++-- hpc/L2/tests/rtm2d/rtm/Makefile | 94 ++++++++---- hpc/L2/tests/rtm2d/rtm/description.json | 5 - .../tests/dataset_h128_w128_t10_s1/Makefile | 94 ++++++++---- .../dataset_h128_w128_t10_s1/description.json | 1 - .../tests/dataset_h128_w128_t10_s1/utils.mk | 68 ++++++-- hpc/L2/tests/rtm2d/rtm/utils.mk | 68 ++++++-- hpc/L2/tests/rtm2d/rtmbackward/Makefile | 94 ++++++++---- .../tests/rtm2d/rtmbackward/description.json | 5 - .../tests/dataset_h128_w128_t10/Makefile | 94 ++++++++---- .../dataset_h128_w128_t10/description.json | 1 - .../tests/dataset_h128_w128_t10/utils.mk | 68 ++++++-- hpc/L2/tests/rtm2d/rtmbackward/utils.mk | 68 ++++++-- hpc/L2/tests/rtm2d/rtmforward/Makefile | 94 ++++++++---- .../tests/rtm2d/rtmforward/description.json | 5 - .../tests/dataset_h128_w128_t10/Makefile | 94 ++++++++---- .../dataset_h128_w128_t10/description.json | 1 - .../tests/dataset_h128_w128_t10/utils.mk | 68 ++++++-- hpc/L2/tests/rtm2d/rtmforward/utils.mk | 68 ++++++-- .../rtm3d/rtmforward_Domain_HBC/Makefile | 94 ++++++++---- .../rtmforward_Domain_HBC/description.json | 5 - .../tests/dataset_z70_y60_x80_t4/Makefile | 94 ++++++++---- .../dataset_z70_y60_x80_t4/description.json | 1 - .../tests/dataset_z70_y60_x80_t4/utils.mk | 68 ++++++-- .../rtm3d/rtmforward_Domain_HBC/utils.mk | 68 ++++++-- .../rtm3d/rtmforward_Domain_RBC/Makefile | 94 ++++++++---- .../rtmforward_Domain_RBC/description.json | 5 - .../tests/dataset_z90_y60_x80_t4/Makefile | 98 +++++++----- .../dataset_z90_y60_x80_t4/description.json | 1 - .../tests/dataset_z90_y60_x80_t4/utils.mk | 68 ++++++-- .../rtm3d/rtmforward_Domain_RBC/utils.mk | 68 ++++++-- hpc/L3/examples/mlp/Makefile | 93 ++++++----- hpc/L3/examples/mlp/utils.mk | 68 ++++++-- hpc/L3/include/sw/fpga_xrt.hpp | 2 + hpc/L3/tests/rtm2d/Makefile | 145 +++++++++--------- hpc/L3/tests/rtm2d/description.json | 12 +- hpc/L3/tests/rtm2d/utils.mk | 86 +++++++++-- hpc/docs/Makefile | 22 +-- hpc/docs/src/benchmark.rst | 4 +- hpc/docs/src/index.rst | 16 +- hpc/docs/src/user_guide/L1/L1.rst | 6 +- hpc/docs/src/user_guide/L1/L1_overview.rst | 6 +- hpc/docs/src/user_guide/L2/L2.rst | 6 +- hpc/docs/src/user_guide/L2/L2_cg.rst | 4 +- hpc/docs/src/user_guide/L2/L2_overview.rst | 6 +- hpc/docs/src/user_guide/L2/L2_test.rst | 6 +- hpc/docs/src/user_guide/L3/L3.rst | 6 +- 83 files changed, 2878 insertions(+), 1278 deletions(-) diff --git a/hpc/Jenkinsfile b/hpc/Jenkinsfile index a8e67a6bcb..eee49af262 100644 --- a/hpc/Jenkinsfile +++ b/hpc/Jenkinsfile @@ -1,4 +1,4 @@ @Library('pipeline-library')_ VitisLibPipeline (branch: 'next', libname: 'xf_hpc', TARGETS: 'hls_csim:hls_csynth:hls_cosim:vitis_sw_emu:vitis_hw_emu:vitis_hw_build', - upstream_dependencies: 'xf_blas,next,../blas;xf_sparse,next,../sparse', devtest: 'RunDeploy.sh', TOOLVERSION: '2022.1_stable_latest', mail_on:'daily:PR') + upstream_dependencies: 'xf_blas,next,../blas;xf_sparse,next,../sparse', devtest: 'RunDeploy.sh', TOOLVERSION: '2022.2_stable_latest', mail_on:'daily:PR') diff --git a/hpc/L1/tests/hw/rtm2d/backward/tests/data_h128_w128_t10_pe2/description.json b/hpc/L1/tests/hw/rtm2d/backward/tests/data_h128_w128_t10_pe2/description.json index d83d66d713..946f38efa2 100644 --- a/hpc/L1/tests/hw/rtm2d/backward/tests/data_h128_w128_t10_pe2/description.json +++ b/hpc/L1/tests/hw/rtm2d/backward/tests/data_h128_w128_t10_pe2/description.json @@ -35,7 +35,7 @@ "env": "", "index": 0, "max_memory_MB": { - "vivado_syn": 16384, + "vivado_syn": 32768, "hls_csim": 10240, "hls_cosim": 16384, "vivado_impl": 16384, @@ -59,4 +59,4 @@ ] }, "topfunction": "top" -} \ No newline at end of file +} diff --git a/hpc/L1/tests/hw/rtm2d/backward/tests/data_h128_w128_t15_pe2/description.json b/hpc/L1/tests/hw/rtm2d/backward/tests/data_h128_w128_t15_pe2/description.json index c6b38065af..b1eb939632 100644 --- a/hpc/L1/tests/hw/rtm2d/backward/tests/data_h128_w128_t15_pe2/description.json +++ b/hpc/L1/tests/hw/rtm2d/backward/tests/data_h128_w128_t15_pe2/description.json @@ -35,7 +35,7 @@ "env": "", "index": 0, "max_memory_MB": { - "vivado_syn": 16384, + "vivado_syn": 32768, "hls_csim": 10240, "hls_cosim": 16384, "vivado_impl": 16384, @@ -59,4 +59,4 @@ ] }, "topfunction": "top" -} \ No newline at end of file +} diff --git a/hpc/L1/tests/hw/rtm2d/forward/tests/data_h128_w128_t15_pe4/description.json b/hpc/L1/tests/hw/rtm2d/forward/tests/data_h128_w128_t15_pe4/description.json index 5fbe8a2812..35eb922e99 100644 --- a/hpc/L1/tests/hw/rtm2d/forward/tests/data_h128_w128_t15_pe4/description.json +++ b/hpc/L1/tests/hw/rtm2d/forward/tests/data_h128_w128_t15_pe4/description.json @@ -35,7 +35,7 @@ "env": "", "index": 0, "max_memory_MB": { - "vivado_syn": 16384, + "vivado_syn": 32768, "hls_csim": 10240, "hls_cosim": 16384, "vivado_impl": 16384, @@ -59,4 +59,4 @@ ] }, "topfunction": "top" -} \ No newline at end of file +} diff --git a/hpc/L1/tests/hw/rtm3d/forward_rbc/tests/RTM_x36_y60_z40_t4_p2/description.json b/hpc/L1/tests/hw/rtm3d/forward_rbc/tests/RTM_x36_y60_z40_t4_p2/description.json index 937a07f77b..a26f3aab73 100644 --- a/hpc/L1/tests/hw/rtm3d/forward_rbc/tests/RTM_x36_y60_z40_t4_p2/description.json +++ b/hpc/L1/tests/hw/rtm3d/forward_rbc/tests/RTM_x36_y60_z40_t4_p2/description.json @@ -35,7 +35,7 @@ "env": "", "index": 0, "max_memory_MB": { - "vivado_syn": 16384, + "vivado_syn": 32768, "hls_csim": 10240, "hls_cosim": 16384, "vivado_impl": 40960, diff --git a/hpc/L1/tests/hw/rtm3d/forward_rbc/tests/RTM_x50_y60_z80_t4_p2/description.json b/hpc/L1/tests/hw/rtm3d/forward_rbc/tests/RTM_x50_y60_z80_t4_p2/description.json index 896a112305..11981f2f9c 100644 --- a/hpc/L1/tests/hw/rtm3d/forward_rbc/tests/RTM_x50_y60_z80_t4_p2/description.json +++ b/hpc/L1/tests/hw/rtm3d/forward_rbc/tests/RTM_x50_y60_z80_t4_p2/description.json @@ -35,7 +35,7 @@ "env": "", "index": 0, "max_memory_MB": { - "vivado_syn": 16384, + "vivado_syn": 32768, "hls_csim": 10240, "hls_cosim": 16384, "vivado_impl": 40960, diff --git a/hpc/L2/benchmarks/cg_gemv_jacobi/Makefile b/hpc/L2/benchmarks/cg_gemv_jacobi/Makefile index e76ee12e71..5560d53d1b 100644 --- a/hpc/L2/benchmarks/cg_gemv_jacobi/Makefile +++ b/hpc/L2/benchmarks/cg_gemv_jacobi/Makefile @@ -11,7 +11,7 @@ # 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. -# vitis makefile-generator v2.0.6 +# vitis makefile-generator v2.0.7 ############################## Help Section ############################## .PHONY: help @@ -34,9 +34,15 @@ help:: $(ECHO) " Command to build host application." $(ECHO) " By default, HOST_ARCH=x86. HOST_ARCH is required for SoC shells" $(ECHO) "" - $(ECHO) " NOTE: For embedded devices, e.g. zcu102/zcu104/vck190, env variable SYSROOT and EDGE_COMMON_SW need to be set first, and HOST_ARCH is either aarch32 or aarch64. For example," - $(ECHO) " export SYSROOT=< path-to-platform-sysroot >" - $(ECHO) " export EDGE_COMMON_SW=< path-to-rootfs-and-Image-files >" + $(ECHO) " NOTE: For embedded devices, e.g. zcu102/zcu104/vck190, HOST_ARCH is either aarch32 or aarch64." + $(ECHO) " a.IF Download the platform, and common-image from Xilinx Download Center(Suggested):" + $(ECHO) " Run the sdk.sh script from the common-image directory to install sysroot using the command : ./sdk.sh -y -d ./ -p " + $(ECHO) " Unzip the rootfs file : gunzip ./rootfs.ext4.gz" + $(ECHO) " export SYSROOT=< path-to-platform-sysroot >" + $(ECHO) " b. User could also define SYSROOT, K_IMAGE and ROOTFS by themselves: " + $(ECHO) " export SYSROOT=< path-to-platform-sysroot >" + $(ECHO) " export K_IMAGE=< path-to-Image-files >" + $(ECHO) " export ROOTFS=< path-to-rootfs >" $(ECHO) "" $(ECHO) " make clean " $(ECHO) " Command to remove the generated non-hardware files." @@ -61,7 +67,7 @@ ifeq ($(PLATFORM),) PLATFORM := $(DEVICE) endif ifeq ($(PLATFORM),) -PLATFORM := xilinx_u280_xdma_201920_3 +PLATFORM := xilinx_u280_gen3x16_xdma_1_202120_1 endif # #################### Checking if PLATFORM in whitelist ############################ @@ -87,12 +93,17 @@ RUN_DEPS := # get global setting ifeq ($(HOST_ARCH), x86) CXXFLAGS += -fmessage-length=0 -I$(CUR_DIR)/src/ -I$(XILINX_XRT)/include -I$(XILINX_HLS)/include -std=c++14 -O3 -Wall -Wno-unknown-pragmas -Wno-unused-label -LDFLAGS += -pthread -L$(XILINX_XRT)/lib -L$(XILINX_HLS)/lnx64/tools/fpo_v7_0 -Wl,--as-needed -lOpenCL -lxrt_coreutil -lgmp -lmpfr -lIp_floating_point_v7_0_bitacc_cmodel +LDFLAGS += -pthread -L$(XILINX_XRT)/lib -L$(XILINX_HLS)/lnx64/tools/fpo_v7_1 -Wl,--as-needed -lOpenCL -lxrt_coreutil -lgmp -lmpfr -lIp_floating_point_v7_1_bitacc_cmodel VPP_FLAGS += -t $(TARGET) --platform $(XPLATFORM) --save-temps VPP_LDFLAGS += --optimize 2 -R 2 else ifeq ($(HOST_ARCH), aarch64) +ifeq ($(ps_on_x86), on) +CXXFLAGS += -fmessage-length=0 -I$(CUR_DIR)/src/ -I$(XILINX_XRT)/include -I$(XILINX_HLS)/include -std=c++14 -O3 -Wall -Wno-unknown-pragmas -Wno-unused-label +LDFLAGS += -pthread -L$(XILINX_XRT)/lib -L$(XILINX_HLS)/lnx64/tools/fpo_v7_1 -Wl,--as-needed -lOpenCL -lxrt_coreutil -lgmp -lmpfr -lIp_floating_point_v7_1_bitacc_cmodel +else CXXFLAGS += -I$(CUR_DIR)/src/ -fmessage-length=0 --sysroot=$(SYSROOT) -I$(SYSROOT)/usr/include/xrt -I$(XILINX_HLS)/include -std=c++14 -O3 -Wall -Wno-unknown-pragmas -Wno-unused-label -LDFLAGS += -pthread -L$(SYSROOT)/usr/lib -L$(XILINX_VITIS_AIETOOLS)/lib/aarch64.o -Wl,--as-needed -lxilinxopencl -lxrt_coreutil +LDFLAGS += -pthread -L$(SYSROOT)/usr/lib -Wl,--as-needed -lxilinxopencl -lxrt_coreutil +endif VPP_FLAGS += -t $(TARGET) --platform $(XPLATFORM) --save-temps VPP_LDFLAGS += --optimize 2 -R 2 endif @@ -107,15 +118,23 @@ ifeq ($(TARGET),hw_emu) CXXFLAGS += -D HW_EMU_TEST endif -ifeq (,$(findstring opencv,$(CXXFLAGS))) -CXXFLAGS += $(XRT_CXXFLAGS) -endif - #Inclue Required Host Source Files +ifeq ($(ps_on_x86), on) HOST_SRCS += $(XFLIB_DIR)/L2/src/sw/cgSolver/test_cgSolver_gemv_jacobi.cpp $(XFLIB_DIR)/../blas/L2/src/xcl2/xcl2.cpp CXXFLAGS += -D HW_CLK=3e-9 -D CG_numTasks=1 -D CG_dataType=double -D CG_numChannels=16 -D CG_parEntries=4 -D CG_instrBytes=64 CXXFLAGS += -I $(XFLIB_DIR)/L1/include/ -I $(XFLIB_DIR)/L2/include/sw/cgSolver -I $(XFLIB_DIR)/L2/include/common/cgSolver -I $(XFLIB_DIR)/L2/include/sw/ -I $(XFLIB_DIR)/../blas/L1/tests/sw/include/ -I $(XFLIB_DIR)/../blas/L2/include/xcl2 CXXFLAGS += -O3 +else +HOST_SRCS += $(XFLIB_DIR)/L2/src/sw/cgSolver/test_cgSolver_gemv_jacobi.cpp $(XFLIB_DIR)/../blas/L2/src/xcl2/xcl2.cpp +CXXFLAGS += -D HW_CLK=3e-9 -D CG_numTasks=1 -D CG_dataType=double -D CG_numChannels=16 -D CG_parEntries=4 -D CG_instrBytes=64 +CXXFLAGS += -I $(XFLIB_DIR)/L1/include/ -I $(XFLIB_DIR)/L2/include/sw/cgSolver -I $(XFLIB_DIR)/L2/include/common/cgSolver -I $(XFLIB_DIR)/L2/include/sw/ -I $(XFLIB_DIR)/../blas/L1/tests/sw/include/ -I $(XFLIB_DIR)/../blas/L2/include/xcl2 +CXXFLAGS += -O3 +endif + +# workaround for opencv +ifeq (,$(findstring opencv,$(CXXFLAGS))) +CXXFLAGS += $(XRT_CXXFLAGS) +endif EXE_NAME := host.exe EXE_FILE := $(BUILD_DIR)/$(EXE_NAME) @@ -251,11 +270,6 @@ $(EMCONFIG): emconfigutil --platform $(XPLATFORM) --od $(BUILD_DIR) ############################## Preparing sdcard folder ############################## ifneq ($(HOST_ARCH), x86) -ifneq (,$(findstring zc706, $(PLATFORM_NAME))) -K_IMAGE := $(SYSROOT)/../../uImage -else -K_IMAGE := $(SYSROOT)/../../Image -endif RUN_SCRIPT := $(BUILD_DIR)/run_script.sh $(RUN_SCRIPT): rm -rf $(RUN_SCRIPT) @@ -271,7 +285,7 @@ endif @echo './$(EXE_NAME) $(PKG_HOST_ARGS)' >> $(RUN_SCRIPT) @echo 'return_code=$$?' >> $(RUN_SCRIPT) @echo 'if [ $$return_code -ne 0 ]; then' >> $(RUN_SCRIPT) - @echo ' echo "ERROR: Embedded host run failed, RC=$$return_code"' >> $(RUN_SCRIPT) + @echo ' echo "ERROR: TEST FAILED, RC=$$return_code"' >> $(RUN_SCRIPT) @echo 'else' >> $(RUN_SCRIPT) @echo ' echo "INFO: TEST PASSED, RC=0"' >> $(RUN_SCRIPT) @echo 'fi' >> $(RUN_SCRIPT) @@ -289,23 +303,28 @@ SD_DIRS_WITH_PREFIX = $(foreach sd_dir,$(DATA_DIR),--package.sd_dir $(sd_dir)) PACKAGE_FILES := $(BINARY_CONTAINERS) PACKAGE_FILES += $(AIE_CONTAINER) SD_CARD := $(CUR_DIR)/package_$(TARGET) -vck190_dfx_hw := false -$(SD_CARD): $(EXE_FILE) $(BINARY_CONTAINERS) $(RUN_SCRIPT) $(EMCONFIG) +$(SD_CARD): $(EXE_FILE) $(BINARY_CONTAINERS) $(RUN_SCRIPT) $(EMCONFIG) check_kimage check_rootfs @echo "Generating sd_card folder...." mkdir -p $(SD_CARD) chmod a+rx $(BUILD_DIR)/run_script.sh -ifneq (,$(findstring vck190_base_dfx, $(PLATFORM_NAME))) -ifeq ($(TARGET),hw) - $(VPP) -t $(TARGET) --platform $(XPLATFORM) -p $(PACKAGE_FILES) -o $(BINARY_CONTAINERS_PKG) - $(VPP) -t $(TARGET) --platform $(XPLATFORM) -p --package.out_dir $(SD_CARD) --package.rootfs $(SYSROOT)/../../rootfs.ext4 --package.kernel_image $(K_IMAGE) $(SD_FILES_WITH_PREFIX) $(SD_DIRS_WITH_PREFIX) --package.sd_file $(BINARY_CONTAINERS_PKG) +# 1. DFX HW Flow +ifeq ($(dfx_hw), on) + $(VPP) -t $(TARGET) --platform $(XPLATFORM) -p $(PACKAGE_FILES) $(VPP_PACKAGE) -o $(BINARY_CONTAINERS_PKG) + $(VPP) -t $(TARGET) --platform $(XPLATFORM) -p --package.out_dir $(SD_CARD) --package.rootfs $(ROOTFS) --package.kernel_image $(K_IMAGE) $(SD_FILES_WITH_PREFIX) $(SD_DIRS_WITH_PREFIX) --package.sd_file $(BINARY_CONTAINERS_PKG) @echo "### ***** sd_card generation done! ***** ###" -vck190_dfx_hw := true endif +# 2. PS_ON_X86 - From 2022.2, Target:sw_emu +ifeq ($(ps_on_x86), on) + @echo "### ***** running PS X86 SE_EMU ***** ###" + $(VPP) -t $(TARGET) --platform $(XPLATFORM) -o $(BINARY_CONTAINERS_PKG) -p $(PACKAGE_FILES) $(VPP_PACKAGE) --package.out_dir $(SD_CARD) --package.emu_ps x86 endif -ifeq ($(vck190_dfx_hw), false) - $(VPP) -t $(TARGET) --platform $(XPLATFORM) -o $(BINARY_CONTAINERS_PKG) -p $(PACKAGE_FILES) $(VPP_PACKAGE) --package.out_dir $(SD_CARD) --package.rootfs $(SYSROOT)/../../rootfs.ext4 --package.kernel_image $(K_IMAGE) $(SD_FILES_WITH_PREFIX) $(SD_DIRS_WITH_PREFIX) +#3. General Embeded flow +ifeq ($(dfx_hw), off) +ifeq ($(ps_on_x86), off) + $(VPP) -t $(TARGET) --platform $(XPLATFORM) -o $(BINARY_CONTAINERS_PKG) -p $(PACKAGE_FILES) $(VPP_PACKAGE) --package.out_dir $(SD_CARD) --package.rootfs $(ROOTFS) --package.kernel_image $(K_IMAGE) $(SD_FILES_WITH_PREFIX) $(SD_DIRS_WITH_PREFIX) @echo "### ***** sd_card generation done! ***** ###" endif +endif .PHONY: sd_card sd_card: $(SD_CARD) @@ -329,7 +348,7 @@ ifeq ($(HOST_ARCH), x86) else @echo $(RUN_DEPS) - $(SD_CARD)/launch_$(TARGET).sh -no-reboot -run-app $(notdir $(RUN_SCRIPT)) + $(SD_CARD)/launch_$(TARGET).sh -no-reboot -run-app $(notdir $(RUN_SCRIPT)) 2>&1 | tee $(SD_CARD)/qemu_output.log grep "TEST PASSED, RC=0" $(SD_CARD)/qemu_output.log || exit 1 endif @@ -340,24 +359,32 @@ ifeq ($(HOST_ARCH), x86) LD_LIBRARY_PATH=$(LIBRARY_PATH):$$LD_LIBRARY_PATH \ XCL_EMULATION_MODE=$(TARGET) $(EXE_FILE) $(HOST_ARGS) +else +ifeq ($(ps_on_x86), on) + LD_LIBRARY_PATH=$(LIBRARY_PATH):$$LD_LIBRARY_PATH \ + XCL_EMULATION_MODE=$(TARGET) $(EXE_FILE) $(HOST_ARGS) + else @echo $(RUN_DEPS) - $(SD_CARD)/launch_$(TARGET).sh -no-reboot -run-app $(notdir $(RUN_SCRIPT)) + $(SD_CARD)/launch_$(TARGET).sh -no-reboot -run-app $(notdir $(RUN_SCRIPT)) 2>&1 | tee $(SD_CARD)/qemu_output.log grep "TEST PASSED, RC=0" $(SD_CARD)/qemu_output.log || exit 1 +endif endif endif #hw ifeq ($(TARGET), hw) ifneq (,$(findstring aws-vu9p-f1, $(PLATFORM_NAME))) -ifneq ($(JENKINS_INTERNAL_BUILD), 1) +ifeq (,$(wildcard $(BUILD_DIR)/cgSolver.awsxclbin)) $(ECHO) "This makefile does not directly support converting .xclbin to .awsxclbin, please refer https://github.com/aws/aws-fpga/blob/master/Vitis/README.md for next operations" else - $(ECHO) "Running inside Xilinx regression without converting to .awsxclbin" - $(EXE_FILE) $(HOST_ARGS) + $(ECHO) "Running HW using generated .awsxclbin" + LD_LIBRARY_PATH=$(LIBRARY_PATH):$$LD_LIBRARY_PATH \ + $(EXE_FILE) $(subst .xclbin,.awsxclbin,$(HOST_ARGS)) endif else ifeq ($(HOST_ARCH), x86) + LD_LIBRARY_PATH=$(LIBRARY_PATH):$$LD_LIBRARY_PATH \ $(EXE_FILE) $(HOST_ARGS) else @@ -391,12 +418,11 @@ cleanh: cleank: -$(RMDIR) $(BUILD_DIR)/*.xclbin _vimage *xclbin.run_summary qemu-memory-_* emulation/ _vimage/ pl*start_simulation. sh *.xclbin - -$(RMDIR) _x_temp.*/_x.* _x_temp.*/.Xil _x_temp.*/profile_summary.* xo_* _x* - -$(RMDIR) _x_temp.*/dltmp* _x_temp.*/kernel_info.dat _x_temp.*/*.log - -$(RMDIR) _x_temp.* + -$(RMDIR) _x_temp.* cleanall: cleanh cleank -$(RMDIR) $(BUILD_DIR) emconfig.json *.html $(TEMP_DIR) $(CUR_DIR)/reports *.csv *.run_summary $(CUR_DIR)/*.raw package_* $(BUILD_DIR)/run_script.sh .ipcache *.str -$(RMDIR) $(CUR_DIR)/Work $(CUR_DIR)/*.xpe $(CUR_DIR)/hw.o $(CUR_DIR)/*.xsa $(CUR_DIR)/xnwOut + -$(RMDIR) clean: cleanh \ No newline at end of file diff --git a/hpc/L2/benchmarks/cg_gemv_jacobi/description.json b/hpc/L2/benchmarks/cg_gemv_jacobi/description.json index a698ab10a8..68f18716c1 100644 --- a/hpc/L2/benchmarks/cg_gemv_jacobi/description.json +++ b/hpc/L2/benchmarks/cg_gemv_jacobi/description.json @@ -43,11 +43,6 @@ ] } }, - "pre_launch": [ - { - "launch_cmd": "make data_gen" - } - ], "launch": [ { "name": "generic launch for all flows", @@ -147,7 +142,7 @@ } ], "testinfo": { - "disable": false, + "disable": true, "jobs": [ { "index": 0, diff --git a/hpc/L2/benchmarks/cg_gemv_jacobi/utils.mk b/hpc/L2/benchmarks/cg_gemv_jacobi/utils.mk index 9b889021fc..2e9ea4d63a 100644 --- a/hpc/L2/benchmarks/cg_gemv_jacobi/utils.mk +++ b/hpc/L2/benchmarks/cg_gemv_jacobi/utils.mk @@ -12,7 +12,7 @@ # 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. -# vitis makefile-generator v2.0.6 +# vitis makefile-generator v2.0.7 # #+------------------------------------------------------------------------------- # The following parameters are assigned with default values. These parameters can @@ -50,6 +50,7 @@ ifndef XILINX_XRT export XILINX_XRT endif +.PHONY: check_device check_device: @set -eu; \ inallowlist=False; \ @@ -82,8 +83,9 @@ endif endif -#get suffix of kernel by PLATFORM +# Special processing for tool version/platform type VITIS_VER = $(shell v++ --version | grep 'v++' | sed 's/^[[:space:]]*//' | sed -e 's/^[*]* v++ v//g' | cut -d " " -f1) +# 1) for versal flow from 2022.1 DEVICE_TYPE = $(shell platforminfo -p $(PLATFORM) | grep 'FPGA Family' | sed 's/.*://' | sed '/ai_engine/d' | sed 's/^[[:space:]]*//') ifeq ($(DEVICE_TYPE), versal) ifeq ($(shell expr $(VITIS_VER) \>= 2022.1), 1) @@ -94,6 +96,22 @@ endif else LINK_TARGET_FMT := xclbin endif +# 2) dfx flow +dfx_hw := off +ifeq ($(findstring _dfx_, $(PLATFORM_NAME)),_dfx_) +ifeq ($(TARGET),hw) +dfx_hw := on +endif +endif +# 3) for embeded sw_emu flow from 2022.2 +ps_on_x86 := off +ifneq ($(HOST_ARCH), x86) +ifeq ($(shell expr $(VITIS_VER) \>= 2022.2), 1) +ifeq ($(TARGET), sw_emu) +ps_on_x86 := on +endif +endif +endif #Checks for Device Family ifeq ($(HOST_ARCH), aarch32) @@ -107,6 +125,7 @@ ifneq ($(HOST_ARCH), $(filter $(HOST_ARCH),aarch64 aarch32 x86)) $(error HOST_ARCH variable not set, please set correctly and rerun) endif +.PHONY: check_version check_sysroot check_kimage check_rootfs check_version: ifneq (, $(shell which git)) ifneq (,$(wildcard $(XFLIB_DIR)/.git)) @@ -114,17 +133,46 @@ ifneq (,$(wildcard $(XFLIB_DIR)/.git)) endif endif -#Checks for SYSROOT +#Set/Check SYSROOT/K_IMAGE/ROOTFS +ifneq ($(HOST_ARCH), x86) +ifneq (,$(findstring zc706, $(PLATFORM_NAME))) +K_IMAGE ?= $(SYSROOT)/../../uImage +else +K_IMAGE ?= $(SYSROOT)/../../Image +endif +ROOTFS ?= $(SYSROOT)/../../rootfs.ext4 +endif + check_sysroot: ifneq ($(HOST_ARCH), x86) -ifndef SYSROOT +ifeq (,$(wildcard $(SYSROOT))) $(error SYSROOT ENV variable is not set, please set ENV variable correctly and rerun) endif endif +check_kimage: +ifneq ($(HOST_ARCH), x86) +ifeq (,$(wildcard $(K_IMAGE))) + $(error K_IMAGE ENV variable is not set, please set ENV variable correctly and rerun) +endif +endif +check_rootfs: +ifneq ($(HOST_ARCH), x86) +ifeq (,$(wildcard $(ROOTFS))) + $(error ROOTFS ENV variable is not set, please set ENV variable correctly and rerun) +endif +endif #Checks for g++ -CXX := g++ ifeq ($(HOST_ARCH), x86) +X86_CXX := true +else +ifeq ($(ps_on_x86), true) +X86_CXX := true +endif +endif + +CXX := g++ +ifeq ($(X86_CXX), true) ifeq ($(shell expr $(VITIS_VER) \>= 2022.1), 1) CXX_VER := 8.3.0 else @@ -144,11 +192,13 @@ endif $(warning [WARNING]: g++ version too old. Using g++ provided by the tool: $(CXX)) endif endif -else ifeq ($(HOST_ARCH), aarch64) +else +ifeq ($(HOST_ARCH), aarch64) CXX := $(XILINX_VITIS)/gnu/aarch64/lin/aarch64-linux/bin/aarch64-linux-gnu-g++ else ifeq ($(HOST_ARCH), aarch32) CXX := $(XILINX_VITIS)/gnu/aarch32/lin/gcc-arm-linux-gnueabi/bin/arm-linux-gnueabihf-g++ endif +endif #Check OS and setting env for xrt c++ api OSDIST = $(shell lsb_release -i |awk -F: '{print tolower($$2)}' | tr -d ' \t' ) @@ -268,9 +318,3 @@ RMDIR = rm -rf MV = mv -f CP = cp -rf ECHO:= @echo -ifneq (,$(shell echo $(XPLATFORM) | awk '/xilinx_u280_xdma_201920_3/')) -VPP_FLAGS += --advanced.param compiler.ignorePlatformCompatibilityCheck=true -ifeq ($(TARGET), hw) -VPP_LDFLAGS += --advanced.param compiler.userPreSysLinkOverlayTcl=preSysLink.tcl -endif -endif diff --git a/hpc/L2/benchmarks/cg_spmv_jacobi/Makefile b/hpc/L2/benchmarks/cg_spmv_jacobi/Makefile index 279b87f176..eb42f88c78 100644 --- a/hpc/L2/benchmarks/cg_spmv_jacobi/Makefile +++ b/hpc/L2/benchmarks/cg_spmv_jacobi/Makefile @@ -11,7 +11,7 @@ # 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. -# vitis makefile-generator v2.0.6 +# vitis makefile-generator v2.0.7 ############################## Help Section ############################## .PHONY: help @@ -34,9 +34,15 @@ help:: $(ECHO) " Command to build host application." $(ECHO) " By default, HOST_ARCH=x86. HOST_ARCH is required for SoC shells" $(ECHO) "" - $(ECHO) " NOTE: For embedded devices, e.g. zcu102/zcu104/vck190, env variable SYSROOT and EDGE_COMMON_SW need to be set first, and HOST_ARCH is either aarch32 or aarch64. For example," - $(ECHO) " export SYSROOT=< path-to-platform-sysroot >" - $(ECHO) " export EDGE_COMMON_SW=< path-to-rootfs-and-Image-files >" + $(ECHO) " NOTE: For embedded devices, e.g. zcu102/zcu104/vck190, HOST_ARCH is either aarch32 or aarch64." + $(ECHO) " a.IF Download the platform, and common-image from Xilinx Download Center(Suggested):" + $(ECHO) " Run the sdk.sh script from the common-image directory to install sysroot using the command : ./sdk.sh -y -d ./ -p " + $(ECHO) " Unzip the rootfs file : gunzip ./rootfs.ext4.gz" + $(ECHO) " export SYSROOT=< path-to-platform-sysroot >" + $(ECHO) " b. User could also define SYSROOT, K_IMAGE and ROOTFS by themselves: " + $(ECHO) " export SYSROOT=< path-to-platform-sysroot >" + $(ECHO) " export K_IMAGE=< path-to-Image-files >" + $(ECHO) " export ROOTFS=< path-to-rootfs >" $(ECHO) "" $(ECHO) " make clean " $(ECHO) " Command to remove the generated non-hardware files." @@ -61,7 +67,7 @@ ifeq ($(PLATFORM),) PLATFORM := $(DEVICE) endif ifeq ($(PLATFORM),) -PLATFORM := xilinx_u280_xdma_201920_3 +PLATFORM := xilinx_u280_gen3x16_xdma_1_202120_1 endif # #################### Checking if PLATFORM in whitelist ############################ @@ -87,12 +93,17 @@ RUN_DEPS := # get global setting ifeq ($(HOST_ARCH), x86) CXXFLAGS += -fmessage-length=0 -I$(CUR_DIR)/src/ -I$(XILINX_XRT)/include -I$(XILINX_HLS)/include -std=c++14 -O3 -Wall -Wno-unknown-pragmas -Wno-unused-label -LDFLAGS += -pthread -L$(XILINX_XRT)/lib -L$(XILINX_HLS)/lnx64/tools/fpo_v7_0 -Wl,--as-needed -lOpenCL -lxrt_coreutil -lgmp -lmpfr -lIp_floating_point_v7_0_bitacc_cmodel +LDFLAGS += -pthread -L$(XILINX_XRT)/lib -L$(XILINX_HLS)/lnx64/tools/fpo_v7_1 -Wl,--as-needed -lOpenCL -lxrt_coreutil -lgmp -lmpfr -lIp_floating_point_v7_1_bitacc_cmodel VPP_FLAGS += -t $(TARGET) --platform $(XPLATFORM) --save-temps VPP_LDFLAGS += --optimize 2 -R 2 else ifeq ($(HOST_ARCH), aarch64) +ifeq ($(ps_on_x86), true) +CXXFLAGS += -fmessage-length=0 -I$(CUR_DIR)/src/ -I$(XILINX_XRT)/include -I$(XILINX_HLS)/include -std=c++14 -O3 -Wall -Wno-unknown-pragmas -Wno-unused-label +LDFLAGS += -pthread -L$(XILINX_XRT)/lib -L$(XILINX_HLS)/lnx64/tools/fpo_v7_1 -Wl,--as-needed -lOpenCL -lxrt_coreutil -lgmp -lmpfr -lIp_floating_point_v7_1_bitacc_cmodel +else CXXFLAGS += -I$(CUR_DIR)/src/ -fmessage-length=0 --sysroot=$(SYSROOT) -I$(SYSROOT)/usr/include/xrt -I$(XILINX_HLS)/include -std=c++14 -O3 -Wall -Wno-unknown-pragmas -Wno-unused-label -LDFLAGS += -pthread -L$(SYSROOT)/usr/lib -L$(XILINX_VITIS_AIETOOLS)/lib/aarch64.o -Wl,--as-needed -lxilinxopencl -lxrt_coreutil +LDFLAGS += -pthread -L$(SYSROOT)/usr/lib -Wl,--as-needed -lxilinxopencl -lxrt_coreutil +endif VPP_FLAGS += -t $(TARGET) --platform $(XPLATFORM) --save-temps VPP_LDFLAGS += --optimize 2 -R 2 endif @@ -107,15 +118,23 @@ ifeq ($(TARGET),hw_emu) CXXFLAGS += -D HW_EMU_TEST endif -ifeq (,$(findstring opencv,$(CXXFLAGS))) -CXXFLAGS += $(XRT_CXXFLAGS) -endif - #Inclue Required Host Source Files +ifeq ($(ps_on_x86), true) HOST_SRCS += $(XFLIB_DIR)/L2/src/sw/cgSolver/test_cgSolver_spmv_jacobi.cpp $(XFLIB_DIR)/../blas/L2/src/xcl2/xcl2.cpp CXXFLAGS += -D HW_CLK=4e-9 -D CG_numTasks=1 -D CG_dataType=double -D CG_numChannels=16 -D CG_parEntries=4 -D CG_instrBytes=64 -D SPARSE_dataType=double -D SPARSE_indexType=uint16_t -D SPARSE_parEntries=4 -D SPARSE_hbmChannels=16 -D SPARSE_hbmMemBits=256 CXXFLAGS += -I $(XFLIB_DIR)/L1/include/ -I $(XFLIB_DIR)/L2/include/sw/cgSolver -I $(XFLIB_DIR)/L2/include/common/cgSolver -I $(XFLIB_DIR)/L2/include/sw/ -I $(XFLIB_DIR)/../blas/L1/tests/sw/include/ -I $(XFLIB_DIR)/../blas/L2/include/xcl2 -I $(XFLIB_DIR)/../sparse/L2/include/sw/fp64 -I $(XFLIB_DIR)/.. CXXFLAGS += -g -O0 +else +HOST_SRCS += $(XFLIB_DIR)/L2/src/sw/cgSolver/test_cgSolver_spmv_jacobi.cpp $(XFLIB_DIR)/../blas/L2/src/xcl2/xcl2.cpp +CXXFLAGS += -D HW_CLK=4e-9 -D CG_numTasks=1 -D CG_dataType=double -D CG_numChannels=16 -D CG_parEntries=4 -D CG_instrBytes=64 -D SPARSE_dataType=double -D SPARSE_indexType=uint16_t -D SPARSE_parEntries=4 -D SPARSE_hbmChannels=16 -D SPARSE_hbmMemBits=256 +CXXFLAGS += -I $(XFLIB_DIR)/L1/include/ -I $(XFLIB_DIR)/L2/include/sw/cgSolver -I $(XFLIB_DIR)/L2/include/common/cgSolver -I $(XFLIB_DIR)/L2/include/sw/ -I $(XFLIB_DIR)/../blas/L1/tests/sw/include/ -I $(XFLIB_DIR)/../blas/L2/include/xcl2 -I $(XFLIB_DIR)/../sparse/L2/include/sw/fp64 -I $(XFLIB_DIR)/.. +CXXFLAGS += -g -O0 +endif + +# workaround for opencv +ifeq (,$(findstring opencv,$(CXXFLAGS))) +CXXFLAGS += $(XRT_CXXFLAGS) +endif EXE_NAME := host.exe EXE_FILE := $(BUILD_DIR)/$(EXE_NAME) @@ -156,7 +175,7 @@ VPP_FLAGS_selMultXkernel += --hls.clock 333000000:selMultXkernel VPP_FLAGS_rowAccKernel += --hls.clock 333000000:rowAccKernel VPP_FLAGS_assembleYkernel += --hls.clock 333000000:assembleYkernel ifneq ($(HOST_ARCH), x86) -VPP_LDFLAGS_cgSolver += --clock.defaultFreqHz 333000000 +VPP_LDFLAGS_cgSolver += --clock.defaultFreqHz 300000000 else VPP_LDFLAGS_cgSolver += --kernel_frequency 300 endif @@ -294,11 +313,6 @@ $(EMCONFIG): emconfigutil --platform $(XPLATFORM) --od $(BUILD_DIR) ############################## Preparing sdcard folder ############################## ifneq ($(HOST_ARCH), x86) -ifneq (,$(findstring zc706, $(PLATFORM_NAME))) -K_IMAGE := $(SYSROOT)/../../uImage -else -K_IMAGE := $(SYSROOT)/../../Image -endif RUN_SCRIPT := $(BUILD_DIR)/run_script.sh $(RUN_SCRIPT): rm -rf $(RUN_SCRIPT) @@ -314,7 +328,7 @@ endif @echo './$(EXE_NAME) $(PKG_HOST_ARGS)' >> $(RUN_SCRIPT) @echo 'return_code=$$?' >> $(RUN_SCRIPT) @echo 'if [ $$return_code -ne 0 ]; then' >> $(RUN_SCRIPT) - @echo ' echo "ERROR: Embedded host run failed, RC=$$return_code"' >> $(RUN_SCRIPT) + @echo ' echo "ERROR: TEST FAILED, RC=$$return_code"' >> $(RUN_SCRIPT) @echo 'else' >> $(RUN_SCRIPT) @echo ' echo "INFO: TEST PASSED, RC=0"' >> $(RUN_SCRIPT) @echo 'fi' >> $(RUN_SCRIPT) @@ -332,23 +346,28 @@ SD_DIRS_WITH_PREFIX = $(foreach sd_dir,$(DATA_DIR),--package.sd_dir $(sd_dir)) PACKAGE_FILES := $(BINARY_CONTAINERS) PACKAGE_FILES += $(AIE_CONTAINER) SD_CARD := $(CUR_DIR)/package_$(TARGET) -vck190_dfx_hw := false -$(SD_CARD): $(EXE_FILE) $(BINARY_CONTAINERS) $(RUN_SCRIPT) $(EMCONFIG) +$(SD_CARD): $(EXE_FILE) $(BINARY_CONTAINERS) $(RUN_SCRIPT) $(EMCONFIG) check_kimage check_rootfs @echo "Generating sd_card folder...." mkdir -p $(SD_CARD) chmod a+rx $(BUILD_DIR)/run_script.sh -ifneq (,$(findstring vck190_base_dfx, $(PLATFORM_NAME))) -ifeq ($(TARGET),hw) - $(VPP) -t $(TARGET) --platform $(XPLATFORM) -p $(PACKAGE_FILES) -o $(BINARY_CONTAINERS_PKG) - $(VPP) -t $(TARGET) --platform $(XPLATFORM) -p --package.out_dir $(SD_CARD) --package.rootfs $(SYSROOT)/../../rootfs.ext4 --package.kernel_image $(K_IMAGE) $(SD_FILES_WITH_PREFIX) $(SD_DIRS_WITH_PREFIX) --package.sd_file $(BINARY_CONTAINERS_PKG) +# 1. DFX HW Flow +ifeq ($(dfx_hw), true) + $(VPP) -t $(TARGET) --platform $(XPLATFORM) -p $(PACKAGE_FILES) $(VPP_PACKAGE) -o $(BINARY_CONTAINERS_PKG) + $(VPP) -t $(TARGET) --platform $(XPLATFORM) -p --package.out_dir $(SD_CARD) --package.rootfs $(ROOTFS) --package.kernel_image $(K_IMAGE) $(SD_FILES_WITH_PREFIX) $(SD_DIRS_WITH_PREFIX) --package.sd_file $(BINARY_CONTAINERS_PKG) @echo "### ***** sd_card generation done! ***** ###" -vck190_dfx_hw := true endif +# 2. PS_ON_X86 - From 2022.2, Target:sw_emu +ifeq ($(ps_on_x86), true) + @echo "### ***** running PS X86 SE_EMU ***** ###" + $(VPP) -t $(TARGET) --platform $(XPLATFORM) -o $(BINARY_CONTAINERS_PKG) -p $(PACKAGE_FILES) $(VPP_PACKAGE) --package.out_dir $(SD_CARD) --package.emu_ps x86 endif -ifeq ($(vck190_dfx_hw), false) - $(VPP) -t $(TARGET) --platform $(XPLATFORM) -o $(BINARY_CONTAINERS_PKG) -p $(PACKAGE_FILES) $(VPP_PACKAGE) --package.out_dir $(SD_CARD) --package.rootfs $(SYSROOT)/../../rootfs.ext4 --package.kernel_image $(K_IMAGE) $(SD_FILES_WITH_PREFIX) $(SD_DIRS_WITH_PREFIX) +#3. General Embeded flow +ifeq ($(dfx_hw), false) +ifeq ($(ps_on_x86), false) + $(VPP) -t $(TARGET) --platform $(XPLATFORM) -o $(BINARY_CONTAINERS_PKG) -p $(PACKAGE_FILES) $(VPP_PACKAGE) --package.out_dir $(SD_CARD) --package.rootfs $(ROOTFS) --package.kernel_image $(K_IMAGE) $(SD_FILES_WITH_PREFIX) $(SD_DIRS_WITH_PREFIX) @echo "### ***** sd_card generation done! ***** ###" endif +endif .PHONY: sd_card sd_card: $(SD_CARD) @@ -372,7 +391,7 @@ ifeq ($(HOST_ARCH), x86) else @echo $(RUN_DEPS) - $(SD_CARD)/launch_$(TARGET).sh -no-reboot -run-app $(notdir $(RUN_SCRIPT)) + $(SD_CARD)/launch_$(TARGET).sh -no-reboot -run-app $(notdir $(RUN_SCRIPT)) 2>&1 | tee $(SD_CARD)/qemu_output.log grep "TEST PASSED, RC=0" $(SD_CARD)/qemu_output.log || exit 1 endif @@ -383,24 +402,32 @@ ifeq ($(HOST_ARCH), x86) LD_LIBRARY_PATH=$(LIBRARY_PATH):$$LD_LIBRARY_PATH \ XCL_EMULATION_MODE=$(TARGET) $(EXE_FILE) $(HOST_ARGS) +else +ifeq ($(ps_on_x86), true) + LD_LIBRARY_PATH=$(LIBRARY_PATH):$$LD_LIBRARY_PATH \ + XCL_EMULATION_MODE=$(TARGET) $(EXE_FILE) $(HOST_ARGS) + else @echo $(RUN_DEPS) - $(SD_CARD)/launch_$(TARGET).sh -no-reboot -run-app $(notdir $(RUN_SCRIPT)) + $(SD_CARD)/launch_$(TARGET).sh -no-reboot -run-app $(notdir $(RUN_SCRIPT)) 2>&1 | tee $(SD_CARD)/qemu_output.log grep "TEST PASSED, RC=0" $(SD_CARD)/qemu_output.log || exit 1 +endif endif endif #hw ifeq ($(TARGET), hw) ifneq (,$(findstring aws-vu9p-f1, $(PLATFORM_NAME))) -ifneq ($(JENKINS_INTERNAL_BUILD), 1) +ifeq (,$(wildcard $(BUILD_DIR)/cgSolver.awsxclbin)) $(ECHO) "This makefile does not directly support converting .xclbin to .awsxclbin, please refer https://github.com/aws/aws-fpga/blob/master/Vitis/README.md for next operations" else - $(ECHO) "Running inside Xilinx regression without converting to .awsxclbin" - $(EXE_FILE) $(HOST_ARGS) + $(ECHO) "Running HW using generated .awsxclbin" + LD_LIBRARY_PATH=$(LIBRARY_PATH):$$LD_LIBRARY_PATH \ + $(EXE_FILE) $(subst .xclbin,.awsxclbin,$(HOST_ARGS)) endif else ifeq ($(HOST_ARCH), x86) + LD_LIBRARY_PATH=$(LIBRARY_PATH):$$LD_LIBRARY_PATH \ $(EXE_FILE) $(HOST_ARGS) else @@ -434,12 +461,11 @@ cleanh: cleank: -$(RMDIR) $(BUILD_DIR)/*.xclbin _vimage *xclbin.run_summary qemu-memory-_* emulation/ _vimage/ pl*start_simulation. sh *.xclbin - -$(RMDIR) _x_temp.*/_x.* _x_temp.*/.Xil _x_temp.*/profile_summary.* xo_* _x* - -$(RMDIR) _x_temp.*/dltmp* _x_temp.*/kernel_info.dat _x_temp.*/*.log - -$(RMDIR) _x_temp.* + -$(RMDIR) _x_temp.* cleanall: cleanh cleank -$(RMDIR) $(BUILD_DIR) emconfig.json *.html $(TEMP_DIR) $(CUR_DIR)/reports *.csv *.run_summary $(CUR_DIR)/*.raw package_* $(BUILD_DIR)/run_script.sh .ipcache *.str -$(RMDIR) $(CUR_DIR)/Work $(CUR_DIR)/*.xpe $(CUR_DIR)/hw.o $(CUR_DIR)/*.xsa $(CUR_DIR)/xnwOut + -$(RMDIR) -clean: cleanh +clean: cleanh \ No newline at end of file diff --git a/hpc/L2/benchmarks/cg_spmv_jacobi/description.json b/hpc/L2/benchmarks/cg_spmv_jacobi/description.json index 83eeae8a40..6b42c2295c 100644 --- a/hpc/L2/benchmarks/cg_spmv_jacobi/description.json +++ b/hpc/L2/benchmarks/cg_spmv_jacobi/description.json @@ -193,7 +193,7 @@ } ], "testinfo": { - "disable": false, + "disable": true, "jobs": [ { "index": 0, diff --git a/hpc/L2/benchmarks/cg_spmv_jacobi/utils.mk b/hpc/L2/benchmarks/cg_spmv_jacobi/utils.mk index 9b889021fc..8965e30749 100644 --- a/hpc/L2/benchmarks/cg_spmv_jacobi/utils.mk +++ b/hpc/L2/benchmarks/cg_spmv_jacobi/utils.mk @@ -12,7 +12,7 @@ # 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. -# vitis makefile-generator v2.0.6 +# vitis makefile-generator v2.0.7 # #+------------------------------------------------------------------------------- # The following parameters are assigned with default values. These parameters can @@ -50,6 +50,7 @@ ifndef XILINX_XRT export XILINX_XRT endif +.PHONY: check_device check_device: @set -eu; \ inallowlist=False; \ @@ -82,8 +83,9 @@ endif endif -#get suffix of kernel by PLATFORM +# Special processing for tool version/platform type VITIS_VER = $(shell v++ --version | grep 'v++' | sed 's/^[[:space:]]*//' | sed -e 's/^[*]* v++ v//g' | cut -d " " -f1) +# 1) for versal flow from 2022.1 DEVICE_TYPE = $(shell platforminfo -p $(PLATFORM) | grep 'FPGA Family' | sed 's/.*://' | sed '/ai_engine/d' | sed 's/^[[:space:]]*//') ifeq ($(DEVICE_TYPE), versal) ifeq ($(shell expr $(VITIS_VER) \>= 2022.1), 1) @@ -94,6 +96,22 @@ endif else LINK_TARGET_FMT := xclbin endif +# 2) dfx flow +dfx_hw := false +ifeq ($(findstring _dfx_, $(PLATFORM_NAME)),_dfx_) +ifeq ($(TARGET),hw) +dfx_hw := true +endif +endif +# 3) for embeded sw_emu flow from 2022.2 +ps_on_x86 := false +ifneq ($(HOST_ARCH), x86) +ifeq ($(shell expr $(VITIS_VER) \>= 2022.2), 1) +ifeq ($(TARGET), sw_emu) +ps_on_x86 := true +endif +endif +endif #Checks for Device Family ifeq ($(HOST_ARCH), aarch32) @@ -107,6 +125,7 @@ ifneq ($(HOST_ARCH), $(filter $(HOST_ARCH),aarch64 aarch32 x86)) $(error HOST_ARCH variable not set, please set correctly and rerun) endif +.PHONY: check_version check_sysroot check_kimage check_rootfs check_version: ifneq (, $(shell which git)) ifneq (,$(wildcard $(XFLIB_DIR)/.git)) @@ -114,17 +133,46 @@ ifneq (,$(wildcard $(XFLIB_DIR)/.git)) endif endif -#Checks for SYSROOT +#Set/Check SYSROOT/K_IMAGE/ROOTFS +ifneq ($(HOST_ARCH), x86) +ifneq (,$(findstring zc706, $(PLATFORM_NAME))) +K_IMAGE ?= $(SYSROOT)/../../uImage +else +K_IMAGE ?= $(SYSROOT)/../../Image +endif +ROOTFS ?= $(SYSROOT)/../../rootfs.ext4 +endif + check_sysroot: ifneq ($(HOST_ARCH), x86) -ifndef SYSROOT +ifeq (,$(wildcard $(SYSROOT))) $(error SYSROOT ENV variable is not set, please set ENV variable correctly and rerun) endif endif +check_kimage: +ifneq ($(HOST_ARCH), x86) +ifeq (,$(wildcard $(K_IMAGE))) + $(error K_IMAGE ENV variable is not set, please set ENV variable correctly and rerun) +endif +endif +check_rootfs: +ifneq ($(HOST_ARCH), x86) +ifeq (,$(wildcard $(ROOTFS))) + $(error ROOTFS ENV variable is not set, please set ENV variable correctly and rerun) +endif +endif #Checks for g++ -CXX := g++ ifeq ($(HOST_ARCH), x86) +X86_CXX := true +else +ifeq ($(ps_on_x86), true) +X86_CXX := true +endif +endif + +CXX := g++ +ifeq ($(X86_CXX), true) ifeq ($(shell expr $(VITIS_VER) \>= 2022.1), 1) CXX_VER := 8.3.0 else @@ -144,11 +192,13 @@ endif $(warning [WARNING]: g++ version too old. Using g++ provided by the tool: $(CXX)) endif endif -else ifeq ($(HOST_ARCH), aarch64) +else +ifeq ($(HOST_ARCH), aarch64) CXX := $(XILINX_VITIS)/gnu/aarch64/lin/aarch64-linux/bin/aarch64-linux-gnu-g++ else ifeq ($(HOST_ARCH), aarch32) CXX := $(XILINX_VITIS)/gnu/aarch32/lin/gcc-arm-linux-gnueabi/bin/arm-linux-gnueabihf-g++ endif +endif #Check OS and setting env for xrt c++ api OSDIST = $(shell lsb_release -i |awk -F: '{print tolower($$2)}' | tr -d ' \t' ) @@ -268,9 +318,3 @@ RMDIR = rm -rf MV = mv -f CP = cp -rf ECHO:= @echo -ifneq (,$(shell echo $(XPLATFORM) | awk '/xilinx_u280_xdma_201920_3/')) -VPP_FLAGS += --advanced.param compiler.ignorePlatformCompatibilityCheck=true -ifeq ($(TARGET), hw) -VPP_LDFLAGS += --advanced.param compiler.userPreSysLinkOverlayTcl=preSysLink.tcl -endif -endif diff --git a/hpc/L2/tests/cgSolver/krnl_cgSolver_gemv/Makefile b/hpc/L2/tests/cgSolver/krnl_cgSolver_gemv/Makefile index eee062da76..a1994bcee6 100644 --- a/hpc/L2/tests/cgSolver/krnl_cgSolver_gemv/Makefile +++ b/hpc/L2/tests/cgSolver/krnl_cgSolver_gemv/Makefile @@ -11,7 +11,7 @@ # 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. -# vitis makefile-generator v2.0.6 +# vitis makefile-generator v2.0.7 ############################## Help Section ############################## .PHONY: help @@ -34,9 +34,15 @@ help:: $(ECHO) " Command to build host application." $(ECHO) " By default, HOST_ARCH=x86. HOST_ARCH is required for SoC shells" $(ECHO) "" - $(ECHO) " NOTE: For embedded devices, e.g. zcu102/zcu104/vck190, env variable SYSROOT and EDGE_COMMON_SW need to be set first, and HOST_ARCH is either aarch32 or aarch64. For example," - $(ECHO) " export SYSROOT=< path-to-platform-sysroot >" - $(ECHO) " export EDGE_COMMON_SW=< path-to-rootfs-and-Image-files >" + $(ECHO) " NOTE: For embedded devices, e.g. zcu102/zcu104/vck190, HOST_ARCH is either aarch32 or aarch64." + $(ECHO) " a.IF Download the platform, and common-image from Xilinx Download Center(Suggested):" + $(ECHO) " Run the sdk.sh script from the common-image directory to install sysroot using the command : ./sdk.sh -y -d ./ -p " + $(ECHO) " Unzip the rootfs file : gunzip ./rootfs.ext4.gz" + $(ECHO) " export SYSROOT=< path-to-platform-sysroot >" + $(ECHO) " b. User could also define SYSROOT, K_IMAGE and ROOTFS by themselves: " + $(ECHO) " export SYSROOT=< path-to-platform-sysroot >" + $(ECHO) " export K_IMAGE=< path-to-Image-files >" + $(ECHO) " export ROOTFS=< path-to-rootfs >" $(ECHO) "" $(ECHO) " make clean " $(ECHO) " Command to remove the generated non-hardware files." @@ -61,7 +67,7 @@ ifeq ($(PLATFORM),) PLATFORM := $(DEVICE) endif ifeq ($(PLATFORM),) -PLATFORM := xilinx_u280_xdma_201920_3 +PLATFORM := xilinx_u280_gen3x16_xdma_1_202120_1 endif # #################### Checking if PLATFORM in whitelist ############################ @@ -87,12 +93,17 @@ RUN_DEPS := # get global setting ifeq ($(HOST_ARCH), x86) CXXFLAGS += -fmessage-length=0 -I$(CUR_DIR)/src/ -I$(XILINX_XRT)/include -I$(XILINX_HLS)/include -std=c++14 -O3 -Wall -Wno-unknown-pragmas -Wno-unused-label -LDFLAGS += -pthread -L$(XILINX_XRT)/lib -L$(XILINX_HLS)/lnx64/tools/fpo_v7_0 -Wl,--as-needed -lOpenCL -lxrt_coreutil -lgmp -lmpfr -lIp_floating_point_v7_0_bitacc_cmodel +LDFLAGS += -pthread -L$(XILINX_XRT)/lib -L$(XILINX_HLS)/lnx64/tools/fpo_v7_1 -Wl,--as-needed -lOpenCL -lxrt_coreutil -lgmp -lmpfr -lIp_floating_point_v7_1_bitacc_cmodel VPP_FLAGS += -t $(TARGET) --platform $(XPLATFORM) --save-temps VPP_LDFLAGS += --optimize 2 -R 2 else ifeq ($(HOST_ARCH), aarch64) +ifeq ($(ps_on_x86), on) +CXXFLAGS += -fmessage-length=0 -I$(CUR_DIR)/src/ -I$(XILINX_XRT)/include -I$(XILINX_HLS)/include -std=c++14 -O3 -Wall -Wno-unknown-pragmas -Wno-unused-label +LDFLAGS += -pthread -L$(XILINX_XRT)/lib -L$(XILINX_HLS)/lnx64/tools/fpo_v7_1 -Wl,--as-needed -lOpenCL -lxrt_coreutil -lgmp -lmpfr -lIp_floating_point_v7_1_bitacc_cmodel +else CXXFLAGS += -I$(CUR_DIR)/src/ -fmessage-length=0 --sysroot=$(SYSROOT) -I$(SYSROOT)/usr/include/xrt -I$(XILINX_HLS)/include -std=c++14 -O3 -Wall -Wno-unknown-pragmas -Wno-unused-label -LDFLAGS += -pthread -L$(SYSROOT)/usr/lib -L$(XILINX_VITIS_AIETOOLS)/lib/aarch64.o -Wl,--as-needed -lxilinxopencl -lxrt_coreutil +LDFLAGS += -pthread -L$(SYSROOT)/usr/lib -Wl,--as-needed -lxilinxopencl -lxrt_coreutil +endif VPP_FLAGS += -t $(TARGET) --platform $(XPLATFORM) --save-temps VPP_LDFLAGS += --optimize 2 -R 2 endif @@ -107,15 +118,23 @@ ifeq ($(TARGET),hw_emu) CXXFLAGS += -D HW_EMU_TEST endif -ifeq (,$(findstring opencv,$(CXXFLAGS))) -CXXFLAGS += $(XRT_CXXFLAGS) -endif - #Inclue Required Host Source Files +ifeq ($(ps_on_x86), on) HOST_SRCS += $(XFLIB_DIR)/L2/src/sw/cgSolver/test_cgSolver_gemv.cpp $(XFLIB_DIR)/../blas/L2/src/xcl2/xcl2.cpp CXXFLAGS += -D HW_CLK=3e-9 -D CG_numTasks=1 -D CG_dataType=double -D CG_numChannels=1 -D CG_parEntries=4 -D CG_instrBytes=64 CXXFLAGS += -I $(XFLIB_DIR)/L1/include/ -I $(XFLIB_DIR)/L2/include/sw/cgSolver -I $(XFLIB_DIR)/L2/include/common/cgSolver -I $(XFLIB_DIR)/L2/include/sw/ -I $(XFLIB_DIR)/../blas/L1/tests/sw/include/ -I $(XFLIB_DIR)/../blas/L2/include/xcl2 CXXFLAGS += -O3 +else +HOST_SRCS += $(XFLIB_DIR)/L2/src/sw/cgSolver/test_cgSolver_gemv.cpp $(XFLIB_DIR)/../blas/L2/src/xcl2/xcl2.cpp +CXXFLAGS += -D HW_CLK=3e-9 -D CG_numTasks=1 -D CG_dataType=double -D CG_numChannels=1 -D CG_parEntries=4 -D CG_instrBytes=64 +CXXFLAGS += -I $(XFLIB_DIR)/L1/include/ -I $(XFLIB_DIR)/L2/include/sw/cgSolver -I $(XFLIB_DIR)/L2/include/common/cgSolver -I $(XFLIB_DIR)/L2/include/sw/ -I $(XFLIB_DIR)/../blas/L1/tests/sw/include/ -I $(XFLIB_DIR)/../blas/L2/include/xcl2 +CXXFLAGS += -O3 +endif + +# workaround for opencv +ifeq (,$(findstring opencv,$(CXXFLAGS))) +CXXFLAGS += $(XRT_CXXFLAGS) +endif EXE_NAME := host.exe EXE_FILE := $(BUILD_DIR)/$(EXE_NAME) @@ -237,11 +256,6 @@ $(EMCONFIG): emconfigutil --platform $(XPLATFORM) --od $(BUILD_DIR) ############################## Preparing sdcard folder ############################## ifneq ($(HOST_ARCH), x86) -ifneq (,$(findstring zc706, $(PLATFORM_NAME))) -K_IMAGE := $(SYSROOT)/../../uImage -else -K_IMAGE := $(SYSROOT)/../../Image -endif RUN_SCRIPT := $(BUILD_DIR)/run_script.sh $(RUN_SCRIPT): rm -rf $(RUN_SCRIPT) @@ -257,7 +271,7 @@ endif @echo './$(EXE_NAME) $(PKG_HOST_ARGS)' >> $(RUN_SCRIPT) @echo 'return_code=$$?' >> $(RUN_SCRIPT) @echo 'if [ $$return_code -ne 0 ]; then' >> $(RUN_SCRIPT) - @echo ' echo "ERROR: Embedded host run failed, RC=$$return_code"' >> $(RUN_SCRIPT) + @echo ' echo "ERROR: TEST FAILED, RC=$$return_code"' >> $(RUN_SCRIPT) @echo 'else' >> $(RUN_SCRIPT) @echo ' echo "INFO: TEST PASSED, RC=0"' >> $(RUN_SCRIPT) @echo 'fi' >> $(RUN_SCRIPT) @@ -275,23 +289,28 @@ SD_DIRS_WITH_PREFIX = $(foreach sd_dir,$(DATA_DIR),--package.sd_dir $(sd_dir)) PACKAGE_FILES := $(BINARY_CONTAINERS) PACKAGE_FILES += $(AIE_CONTAINER) SD_CARD := $(CUR_DIR)/package_$(TARGET) -vck190_dfx_hw := false -$(SD_CARD): $(EXE_FILE) $(BINARY_CONTAINERS) $(RUN_SCRIPT) $(EMCONFIG) +$(SD_CARD): $(EXE_FILE) $(BINARY_CONTAINERS) $(RUN_SCRIPT) $(EMCONFIG) check_kimage check_rootfs @echo "Generating sd_card folder...." mkdir -p $(SD_CARD) chmod a+rx $(BUILD_DIR)/run_script.sh -ifneq (,$(findstring vck190_base_dfx, $(PLATFORM_NAME))) -ifeq ($(TARGET),hw) - $(VPP) -t $(TARGET) --platform $(XPLATFORM) -p $(PACKAGE_FILES) -o $(BINARY_CONTAINERS_PKG) - $(VPP) -t $(TARGET) --platform $(XPLATFORM) -p --package.out_dir $(SD_CARD) --package.rootfs $(SYSROOT)/../../rootfs.ext4 --package.kernel_image $(K_IMAGE) $(SD_FILES_WITH_PREFIX) $(SD_DIRS_WITH_PREFIX) --package.sd_file $(BINARY_CONTAINERS_PKG) +# 1. DFX HW Flow +ifeq ($(dfx_hw), on) + $(VPP) -t $(TARGET) --platform $(XPLATFORM) -p $(PACKAGE_FILES) $(VPP_PACKAGE) -o $(BINARY_CONTAINERS_PKG) + $(VPP) -t $(TARGET) --platform $(XPLATFORM) -p --package.out_dir $(SD_CARD) --package.rootfs $(ROOTFS) --package.kernel_image $(K_IMAGE) $(SD_FILES_WITH_PREFIX) $(SD_DIRS_WITH_PREFIX) --package.sd_file $(BINARY_CONTAINERS_PKG) @echo "### ***** sd_card generation done! ***** ###" -vck190_dfx_hw := true endif +# 2. PS_ON_X86 - From 2022.2, Target:sw_emu +ifeq ($(ps_on_x86), on) + @echo "### ***** running PS X86 SE_EMU ***** ###" + $(VPP) -t $(TARGET) --platform $(XPLATFORM) -o $(BINARY_CONTAINERS_PKG) -p $(PACKAGE_FILES) $(VPP_PACKAGE) --package.out_dir $(SD_CARD) --package.emu_ps x86 endif -ifeq ($(vck190_dfx_hw), false) - $(VPP) -t $(TARGET) --platform $(XPLATFORM) -o $(BINARY_CONTAINERS_PKG) -p $(PACKAGE_FILES) $(VPP_PACKAGE) --package.out_dir $(SD_CARD) --package.rootfs $(SYSROOT)/../../rootfs.ext4 --package.kernel_image $(K_IMAGE) $(SD_FILES_WITH_PREFIX) $(SD_DIRS_WITH_PREFIX) +#3. General Embeded flow +ifeq ($(dfx_hw), off) +ifeq ($(ps_on_x86), off) + $(VPP) -t $(TARGET) --platform $(XPLATFORM) -o $(BINARY_CONTAINERS_PKG) -p $(PACKAGE_FILES) $(VPP_PACKAGE) --package.out_dir $(SD_CARD) --package.rootfs $(ROOTFS) --package.kernel_image $(K_IMAGE) $(SD_FILES_WITH_PREFIX) $(SD_DIRS_WITH_PREFIX) @echo "### ***** sd_card generation done! ***** ###" endif +endif .PHONY: sd_card sd_card: $(SD_CARD) @@ -315,7 +334,7 @@ ifeq ($(HOST_ARCH), x86) else @echo $(RUN_DEPS) - $(SD_CARD)/launch_$(TARGET).sh -no-reboot -run-app $(notdir $(RUN_SCRIPT)) + $(SD_CARD)/launch_$(TARGET).sh -no-reboot -run-app $(notdir $(RUN_SCRIPT)) 2>&1 | tee $(SD_CARD)/qemu_output.log grep "TEST PASSED, RC=0" $(SD_CARD)/qemu_output.log || exit 1 endif @@ -326,24 +345,32 @@ ifeq ($(HOST_ARCH), x86) LD_LIBRARY_PATH=$(LIBRARY_PATH):$$LD_LIBRARY_PATH \ XCL_EMULATION_MODE=$(TARGET) $(EXE_FILE) $(HOST_ARGS) +else +ifeq ($(ps_on_x86), on) + LD_LIBRARY_PATH=$(LIBRARY_PATH):$$LD_LIBRARY_PATH \ + XCL_EMULATION_MODE=$(TARGET) $(EXE_FILE) $(HOST_ARGS) + else @echo $(RUN_DEPS) - $(SD_CARD)/launch_$(TARGET).sh -no-reboot -run-app $(notdir $(RUN_SCRIPT)) + $(SD_CARD)/launch_$(TARGET).sh -no-reboot -run-app $(notdir $(RUN_SCRIPT)) 2>&1 | tee $(SD_CARD)/qemu_output.log grep "TEST PASSED, RC=0" $(SD_CARD)/qemu_output.log || exit 1 +endif endif endif #hw ifeq ($(TARGET), hw) ifneq (,$(findstring aws-vu9p-f1, $(PLATFORM_NAME))) -ifneq ($(JENKINS_INTERNAL_BUILD), 1) +ifeq (,$(wildcard $(BUILD_DIR)/cgSolver.awsxclbin)) $(ECHO) "This makefile does not directly support converting .xclbin to .awsxclbin, please refer https://github.com/aws/aws-fpga/blob/master/Vitis/README.md for next operations" else - $(ECHO) "Running inside Xilinx regression without converting to .awsxclbin" - $(EXE_FILE) $(HOST_ARGS) + $(ECHO) "Running HW using generated .awsxclbin" + LD_LIBRARY_PATH=$(LIBRARY_PATH):$$LD_LIBRARY_PATH \ + $(EXE_FILE) $(subst .xclbin,.awsxclbin,$(HOST_ARGS)) endif else ifeq ($(HOST_ARCH), x86) + LD_LIBRARY_PATH=$(LIBRARY_PATH):$$LD_LIBRARY_PATH \ $(EXE_FILE) $(HOST_ARGS) else @@ -377,12 +404,11 @@ cleanh: cleank: -$(RMDIR) $(BUILD_DIR)/*.xclbin _vimage *xclbin.run_summary qemu-memory-_* emulation/ _vimage/ pl*start_simulation. sh *.xclbin - -$(RMDIR) _x_temp.*/_x.* _x_temp.*/.Xil _x_temp.*/profile_summary.* xo_* _x* - -$(RMDIR) _x_temp.*/dltmp* _x_temp.*/kernel_info.dat _x_temp.*/*.log - -$(RMDIR) _x_temp.* + -$(RMDIR) _x_temp.* cleanall: cleanh cleank -$(RMDIR) $(BUILD_DIR) emconfig.json *.html $(TEMP_DIR) $(CUR_DIR)/reports *.csv *.run_summary $(CUR_DIR)/*.raw package_* $(BUILD_DIR)/run_script.sh .ipcache *.str -$(RMDIR) $(CUR_DIR)/Work $(CUR_DIR)/*.xpe $(CUR_DIR)/hw.o $(CUR_DIR)/*.xsa $(CUR_DIR)/xnwOut + -$(RMDIR) clean: cleanh \ No newline at end of file diff --git a/hpc/L2/tests/cgSolver/krnl_cgSolver_gemv/description.json b/hpc/L2/tests/cgSolver/krnl_cgSolver_gemv/description.json index 2cd2841c07..8f4fbc15bb 100644 --- a/hpc/L2/tests/cgSolver/krnl_cgSolver_gemv/description.json +++ b/hpc/L2/tests/cgSolver/krnl_cgSolver_gemv/description.json @@ -27,11 +27,6 @@ ] } }, - "pre_launch": [ - { - "launch_cmd": "make data_gen" - } - ], "launch": [ { "name": "generic launch for all flows", diff --git a/hpc/L2/tests/cgSolver/krnl_cgSolver_gemv/tests/Makefile b/hpc/L2/tests/cgSolver/krnl_cgSolver_gemv/tests/Makefile index 328b1b8dc7..7b67a812c0 100644 --- a/hpc/L2/tests/cgSolver/krnl_cgSolver_gemv/tests/Makefile +++ b/hpc/L2/tests/cgSolver/krnl_cgSolver_gemv/tests/Makefile @@ -11,7 +11,7 @@ # 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. -# vitis makefile-generator v2.0.6 +# vitis makefile-generator v2.0.7 ############################## Help Section ############################## .PHONY: help @@ -34,9 +34,15 @@ help:: $(ECHO) " Command to build host application." $(ECHO) " By default, HOST_ARCH=x86. HOST_ARCH is required for SoC shells" $(ECHO) "" - $(ECHO) " NOTE: For embedded devices, e.g. zcu102/zcu104/vck190, env variable SYSROOT and EDGE_COMMON_SW need to be set first, and HOST_ARCH is either aarch32 or aarch64. For example," - $(ECHO) " export SYSROOT=< path-to-platform-sysroot >" - $(ECHO) " export EDGE_COMMON_SW=< path-to-rootfs-and-Image-files >" + $(ECHO) " NOTE: For embedded devices, e.g. zcu102/zcu104/vck190, HOST_ARCH is either aarch32 or aarch64." + $(ECHO) " a.IF Download the platform, and common-image from Xilinx Download Center(Suggested):" + $(ECHO) " Run the sdk.sh script from the common-image directory to install sysroot using the command : ./sdk.sh -y -d ./ -p " + $(ECHO) " Unzip the rootfs file : gunzip ./rootfs.ext4.gz" + $(ECHO) " export SYSROOT=< path-to-platform-sysroot >" + $(ECHO) " b. User could also define SYSROOT, K_IMAGE and ROOTFS by themselves: " + $(ECHO) " export SYSROOT=< path-to-platform-sysroot >" + $(ECHO) " export K_IMAGE=< path-to-Image-files >" + $(ECHO) " export ROOTFS=< path-to-rootfs >" $(ECHO) "" $(ECHO) " make clean " $(ECHO) " Command to remove the generated non-hardware files." @@ -61,7 +67,7 @@ ifeq ($(PLATFORM),) PLATFORM := $(DEVICE) endif ifeq ($(PLATFORM),) -PLATFORM := xilinx_u280_xdma_201920_3 +PLATFORM := xilinx_u280_gen3x16_xdma_1_202120_1 endif # #################### Checking if PLATFORM in whitelist ############################ @@ -87,12 +93,17 @@ RUN_DEPS := # get global setting ifeq ($(HOST_ARCH), x86) CXXFLAGS += -fmessage-length=0 -I$(CUR_DIR)/src/ -I$(XILINX_XRT)/include -I$(XILINX_HLS)/include -std=c++14 -O3 -Wall -Wno-unknown-pragmas -Wno-unused-label -LDFLAGS += -pthread -L$(XILINX_XRT)/lib -L$(XILINX_HLS)/lnx64/tools/fpo_v7_0 -Wl,--as-needed -lOpenCL -lxrt_coreutil -lgmp -lmpfr -lIp_floating_point_v7_0_bitacc_cmodel +LDFLAGS += -pthread -L$(XILINX_XRT)/lib -L$(XILINX_HLS)/lnx64/tools/fpo_v7_1 -Wl,--as-needed -lOpenCL -lxrt_coreutil -lgmp -lmpfr -lIp_floating_point_v7_1_bitacc_cmodel VPP_FLAGS += -t $(TARGET) --platform $(XPLATFORM) --save-temps VPP_LDFLAGS += --optimize 2 -R 2 else ifeq ($(HOST_ARCH), aarch64) +ifeq ($(ps_on_x86), true) +CXXFLAGS += -fmessage-length=0 -I$(CUR_DIR)/src/ -I$(XILINX_XRT)/include -I$(XILINX_HLS)/include -std=c++14 -O3 -Wall -Wno-unknown-pragmas -Wno-unused-label +LDFLAGS += -pthread -L$(XILINX_XRT)/lib -L$(XILINX_HLS)/lnx64/tools/fpo_v7_1 -Wl,--as-needed -lOpenCL -lxrt_coreutil -lgmp -lmpfr -lIp_floating_point_v7_1_bitacc_cmodel +else CXXFLAGS += -I$(CUR_DIR)/src/ -fmessage-length=0 --sysroot=$(SYSROOT) -I$(SYSROOT)/usr/include/xrt -I$(XILINX_HLS)/include -std=c++14 -O3 -Wall -Wno-unknown-pragmas -Wno-unused-label -LDFLAGS += -pthread -L$(SYSROOT)/usr/lib -L$(XILINX_VITIS_AIETOOLS)/lib/aarch64.o -Wl,--as-needed -lxilinxopencl -lxrt_coreutil +LDFLAGS += -pthread -L$(SYSROOT)/usr/lib -Wl,--as-needed -lxilinxopencl -lxrt_coreutil +endif VPP_FLAGS += -t $(TARGET) --platform $(XPLATFORM) --save-temps VPP_LDFLAGS += --optimize 2 -R 2 endif @@ -107,15 +118,23 @@ ifeq ($(TARGET),hw_emu) CXXFLAGS += -D HW_EMU_TEST endif -ifeq (,$(findstring opencv,$(CXXFLAGS))) -CXXFLAGS += $(XRT_CXXFLAGS) -endif - #Inclue Required Host Source Files +ifeq ($(ps_on_x86), true) HOST_SRCS += $(XFLIB_DIR)/L2/src/sw/cgSolver/test_cgSolver_gemv.cpp $(XFLIB_DIR)/../blas/L2/src/xcl2/xcl2.cpp CXXFLAGS += -D HW_CLK=3e-9 -D CG_numTasks=1 -D CG_dataType=double -D CG_numChannels=1 -D CG_parEntries=4 -D CG_instrBytes=64 CXXFLAGS += -I $(XFLIB_DIR)/L1/include/ -I $(XFLIB_DIR)/L2/include/sw/cgSolver -I $(XFLIB_DIR)/L2/include/common/cgSolver -I $(XFLIB_DIR)/L2/include/sw/ -I $(XFLIB_DIR)/../blas/L1/tests/sw/include/ -I $(XFLIB_DIR)/../blas/L2/include/xcl2 CXXFLAGS += -O3 +else +HOST_SRCS += $(XFLIB_DIR)/L2/src/sw/cgSolver/test_cgSolver_gemv.cpp $(XFLIB_DIR)/../blas/L2/src/xcl2/xcl2.cpp +CXXFLAGS += -D HW_CLK=3e-9 -D CG_numTasks=1 -D CG_dataType=double -D CG_numChannels=1 -D CG_parEntries=4 -D CG_instrBytes=64 +CXXFLAGS += -I $(XFLIB_DIR)/L1/include/ -I $(XFLIB_DIR)/L2/include/sw/cgSolver -I $(XFLIB_DIR)/L2/include/common/cgSolver -I $(XFLIB_DIR)/L2/include/sw/ -I $(XFLIB_DIR)/../blas/L1/tests/sw/include/ -I $(XFLIB_DIR)/../blas/L2/include/xcl2 +CXXFLAGS += -O3 +endif + +# workaround for opencv +ifeq (,$(findstring opencv,$(CXXFLAGS))) +CXXFLAGS += $(XRT_CXXFLAGS) +endif EXE_NAME := host.exe EXE_FILE := $(BUILD_DIR)/$(EXE_NAME) @@ -258,11 +277,6 @@ $(EMCONFIG): emconfigutil --platform $(XPLATFORM) --od $(BUILD_DIR) ############################## Preparing sdcard folder ############################## ifneq ($(HOST_ARCH), x86) -ifneq (,$(findstring zc706, $(PLATFORM_NAME))) -K_IMAGE := $(SYSROOT)/../../uImage -else -K_IMAGE := $(SYSROOT)/../../Image -endif RUN_SCRIPT := $(BUILD_DIR)/run_script.sh $(RUN_SCRIPT): rm -rf $(RUN_SCRIPT) @@ -278,7 +292,7 @@ endif @echo './$(EXE_NAME) $(PKG_HOST_ARGS)' >> $(RUN_SCRIPT) @echo 'return_code=$$?' >> $(RUN_SCRIPT) @echo 'if [ $$return_code -ne 0 ]; then' >> $(RUN_SCRIPT) - @echo ' echo "ERROR: Embedded host run failed, RC=$$return_code"' >> $(RUN_SCRIPT) + @echo ' echo "ERROR: TEST FAILED, RC=$$return_code"' >> $(RUN_SCRIPT) @echo 'else' >> $(RUN_SCRIPT) @echo ' echo "INFO: TEST PASSED, RC=0"' >> $(RUN_SCRIPT) @echo 'fi' >> $(RUN_SCRIPT) @@ -296,23 +310,28 @@ SD_DIRS_WITH_PREFIX = $(foreach sd_dir,$(DATA_DIR),--package.sd_dir $(sd_dir)) PACKAGE_FILES := $(BINARY_CONTAINERS) PACKAGE_FILES += $(AIE_CONTAINER) SD_CARD := $(CUR_DIR)/package_$(TARGET) -vck190_dfx_hw := false -$(SD_CARD): $(EXE_FILE) $(BINARY_CONTAINERS) $(RUN_SCRIPT) $(EMCONFIG) +$(SD_CARD): $(EXE_FILE) $(BINARY_CONTAINERS) $(RUN_SCRIPT) $(EMCONFIG) check_kimage check_rootfs @echo "Generating sd_card folder...." mkdir -p $(SD_CARD) chmod a+rx $(BUILD_DIR)/run_script.sh -ifneq (,$(findstring vck190_base_dfx, $(PLATFORM_NAME))) -ifeq ($(TARGET),hw) - $(VPP) -t $(TARGET) --platform $(XPLATFORM) -p $(PACKAGE_FILES) -o $(BINARY_CONTAINERS_PKG) - $(VPP) -t $(TARGET) --platform $(XPLATFORM) -p --package.out_dir $(SD_CARD) --package.rootfs $(SYSROOT)/../../rootfs.ext4 --package.kernel_image $(K_IMAGE) $(SD_FILES_WITH_PREFIX) $(SD_DIRS_WITH_PREFIX) --package.sd_file $(BINARY_CONTAINERS_PKG) +# 1. DFX HW Flow +ifeq ($(dfx_hw), true) + $(VPP) -t $(TARGET) --platform $(XPLATFORM) -p $(PACKAGE_FILES) $(VPP_PACKAGE) -o $(BINARY_CONTAINERS_PKG) + $(VPP) -t $(TARGET) --platform $(XPLATFORM) -p --package.out_dir $(SD_CARD) --package.rootfs $(ROOTFS) --package.kernel_image $(K_IMAGE) $(SD_FILES_WITH_PREFIX) $(SD_DIRS_WITH_PREFIX) --package.sd_file $(BINARY_CONTAINERS_PKG) @echo "### ***** sd_card generation done! ***** ###" -vck190_dfx_hw := true endif +# 2. PS_ON_X86 - From 2022.2, Target:sw_emu +ifeq ($(ps_on_x86), true) + @echo "### ***** running PS X86 SE_EMU ***** ###" + $(VPP) -t $(TARGET) --platform $(XPLATFORM) -o $(BINARY_CONTAINERS_PKG) -p $(PACKAGE_FILES) $(VPP_PACKAGE) --package.out_dir $(SD_CARD) --package.emu_ps x86 endif -ifeq ($(vck190_dfx_hw), false) - $(VPP) -t $(TARGET) --platform $(XPLATFORM) -o $(BINARY_CONTAINERS_PKG) -p $(PACKAGE_FILES) $(VPP_PACKAGE) --package.out_dir $(SD_CARD) --package.rootfs $(SYSROOT)/../../rootfs.ext4 --package.kernel_image $(K_IMAGE) $(SD_FILES_WITH_PREFIX) $(SD_DIRS_WITH_PREFIX) +#3. General Embeded flow +ifeq ($(dfx_hw), false) +ifeq ($(ps_on_x86), false) + $(VPP) -t $(TARGET) --platform $(XPLATFORM) -o $(BINARY_CONTAINERS_PKG) -p $(PACKAGE_FILES) $(VPP_PACKAGE) --package.out_dir $(SD_CARD) --package.rootfs $(ROOTFS) --package.kernel_image $(K_IMAGE) $(SD_FILES_WITH_PREFIX) $(SD_DIRS_WITH_PREFIX) @echo "### ***** sd_card generation done! ***** ###" endif +endif .PHONY: sd_card sd_card: $(SD_CARD) @@ -336,7 +355,7 @@ ifeq ($(HOST_ARCH), x86) else @echo $(RUN_DEPS) - $(SD_CARD)/launch_$(TARGET).sh -no-reboot -run-app $(notdir $(RUN_SCRIPT)) + $(SD_CARD)/launch_$(TARGET).sh -no-reboot -run-app $(notdir $(RUN_SCRIPT)) 2>&1 | tee $(SD_CARD)/qemu_output.log grep "TEST PASSED, RC=0" $(SD_CARD)/qemu_output.log || exit 1 endif @@ -347,24 +366,32 @@ ifeq ($(HOST_ARCH), x86) LD_LIBRARY_PATH=$(LIBRARY_PATH):$$LD_LIBRARY_PATH \ XCL_EMULATION_MODE=$(TARGET) $(EXE_FILE) $(HOST_ARGS) +else +ifeq ($(ps_on_x86), true) + LD_LIBRARY_PATH=$(LIBRARY_PATH):$$LD_LIBRARY_PATH \ + XCL_EMULATION_MODE=$(TARGET) $(EXE_FILE) $(HOST_ARGS) + else @echo $(RUN_DEPS) - $(SD_CARD)/launch_$(TARGET).sh -no-reboot -run-app $(notdir $(RUN_SCRIPT)) + $(SD_CARD)/launch_$(TARGET).sh -no-reboot -run-app $(notdir $(RUN_SCRIPT)) 2>&1 | tee $(SD_CARD)/qemu_output.log grep "TEST PASSED, RC=0" $(SD_CARD)/qemu_output.log || exit 1 +endif endif endif #hw ifeq ($(TARGET), hw) ifneq (,$(findstring aws-vu9p-f1, $(PLATFORM_NAME))) -ifneq ($(JENKINS_INTERNAL_BUILD), 1) +ifeq (,$(wildcard $(BUILD_DIR)/cgSolver.awsxclbin)) $(ECHO) "This makefile does not directly support converting .xclbin to .awsxclbin, please refer https://github.com/aws/aws-fpga/blob/master/Vitis/README.md for next operations" else - $(ECHO) "Running inside Xilinx regression without converting to .awsxclbin" - $(EXE_FILE) $(HOST_ARGS) + $(ECHO) "Running HW using generated .awsxclbin" + LD_LIBRARY_PATH=$(LIBRARY_PATH):$$LD_LIBRARY_PATH \ + $(EXE_FILE) $(subst .xclbin,.awsxclbin,$(HOST_ARGS)) endif else ifeq ($(HOST_ARCH), x86) + LD_LIBRARY_PATH=$(LIBRARY_PATH):$$LD_LIBRARY_PATH \ $(EXE_FILE) $(HOST_ARGS) else @@ -398,12 +425,11 @@ cleanh: cleank: -$(RMDIR) $(BUILD_DIR)/*.xclbin _vimage *xclbin.run_summary qemu-memory-_* emulation/ _vimage/ pl*start_simulation. sh *.xclbin - -$(RMDIR) _x_temp.*/_x.* _x_temp.*/.Xil _x_temp.*/profile_summary.* xo_* _x* - -$(RMDIR) _x_temp.*/dltmp* _x_temp.*/kernel_info.dat _x_temp.*/*.log - -$(RMDIR) _x_temp.* + -$(RMDIR) _x_temp.* cleanall: cleanh cleank -$(RMDIR) $(BUILD_DIR) emconfig.json *.html $(TEMP_DIR) $(CUR_DIR)/reports *.csv *.run_summary $(CUR_DIR)/*.raw package_* $(BUILD_DIR)/run_script.sh .ipcache *.str -$(RMDIR) $(CUR_DIR)/Work $(CUR_DIR)/*.xpe $(CUR_DIR)/hw.o $(CUR_DIR)/*.xsa $(CUR_DIR)/xnwOut + -$(RMDIR) clean: cleanh \ No newline at end of file diff --git a/hpc/L2/tests/cgSolver/krnl_cgSolver_gemv/tests/utils.mk b/hpc/L2/tests/cgSolver/krnl_cgSolver_gemv/tests/utils.mk index 9b889021fc..8965e30749 100644 --- a/hpc/L2/tests/cgSolver/krnl_cgSolver_gemv/tests/utils.mk +++ b/hpc/L2/tests/cgSolver/krnl_cgSolver_gemv/tests/utils.mk @@ -12,7 +12,7 @@ # 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. -# vitis makefile-generator v2.0.6 +# vitis makefile-generator v2.0.7 # #+------------------------------------------------------------------------------- # The following parameters are assigned with default values. These parameters can @@ -50,6 +50,7 @@ ifndef XILINX_XRT export XILINX_XRT endif +.PHONY: check_device check_device: @set -eu; \ inallowlist=False; \ @@ -82,8 +83,9 @@ endif endif -#get suffix of kernel by PLATFORM +# Special processing for tool version/platform type VITIS_VER = $(shell v++ --version | grep 'v++' | sed 's/^[[:space:]]*//' | sed -e 's/^[*]* v++ v//g' | cut -d " " -f1) +# 1) for versal flow from 2022.1 DEVICE_TYPE = $(shell platforminfo -p $(PLATFORM) | grep 'FPGA Family' | sed 's/.*://' | sed '/ai_engine/d' | sed 's/^[[:space:]]*//') ifeq ($(DEVICE_TYPE), versal) ifeq ($(shell expr $(VITIS_VER) \>= 2022.1), 1) @@ -94,6 +96,22 @@ endif else LINK_TARGET_FMT := xclbin endif +# 2) dfx flow +dfx_hw := false +ifeq ($(findstring _dfx_, $(PLATFORM_NAME)),_dfx_) +ifeq ($(TARGET),hw) +dfx_hw := true +endif +endif +# 3) for embeded sw_emu flow from 2022.2 +ps_on_x86 := false +ifneq ($(HOST_ARCH), x86) +ifeq ($(shell expr $(VITIS_VER) \>= 2022.2), 1) +ifeq ($(TARGET), sw_emu) +ps_on_x86 := true +endif +endif +endif #Checks for Device Family ifeq ($(HOST_ARCH), aarch32) @@ -107,6 +125,7 @@ ifneq ($(HOST_ARCH), $(filter $(HOST_ARCH),aarch64 aarch32 x86)) $(error HOST_ARCH variable not set, please set correctly and rerun) endif +.PHONY: check_version check_sysroot check_kimage check_rootfs check_version: ifneq (, $(shell which git)) ifneq (,$(wildcard $(XFLIB_DIR)/.git)) @@ -114,17 +133,46 @@ ifneq (,$(wildcard $(XFLIB_DIR)/.git)) endif endif -#Checks for SYSROOT +#Set/Check SYSROOT/K_IMAGE/ROOTFS +ifneq ($(HOST_ARCH), x86) +ifneq (,$(findstring zc706, $(PLATFORM_NAME))) +K_IMAGE ?= $(SYSROOT)/../../uImage +else +K_IMAGE ?= $(SYSROOT)/../../Image +endif +ROOTFS ?= $(SYSROOT)/../../rootfs.ext4 +endif + check_sysroot: ifneq ($(HOST_ARCH), x86) -ifndef SYSROOT +ifeq (,$(wildcard $(SYSROOT))) $(error SYSROOT ENV variable is not set, please set ENV variable correctly and rerun) endif endif +check_kimage: +ifneq ($(HOST_ARCH), x86) +ifeq (,$(wildcard $(K_IMAGE))) + $(error K_IMAGE ENV variable is not set, please set ENV variable correctly and rerun) +endif +endif +check_rootfs: +ifneq ($(HOST_ARCH), x86) +ifeq (,$(wildcard $(ROOTFS))) + $(error ROOTFS ENV variable is not set, please set ENV variable correctly and rerun) +endif +endif #Checks for g++ -CXX := g++ ifeq ($(HOST_ARCH), x86) +X86_CXX := true +else +ifeq ($(ps_on_x86), true) +X86_CXX := true +endif +endif + +CXX := g++ +ifeq ($(X86_CXX), true) ifeq ($(shell expr $(VITIS_VER) \>= 2022.1), 1) CXX_VER := 8.3.0 else @@ -144,11 +192,13 @@ endif $(warning [WARNING]: g++ version too old. Using g++ provided by the tool: $(CXX)) endif endif -else ifeq ($(HOST_ARCH), aarch64) +else +ifeq ($(HOST_ARCH), aarch64) CXX := $(XILINX_VITIS)/gnu/aarch64/lin/aarch64-linux/bin/aarch64-linux-gnu-g++ else ifeq ($(HOST_ARCH), aarch32) CXX := $(XILINX_VITIS)/gnu/aarch32/lin/gcc-arm-linux-gnueabi/bin/arm-linux-gnueabihf-g++ endif +endif #Check OS and setting env for xrt c++ api OSDIST = $(shell lsb_release -i |awk -F: '{print tolower($$2)}' | tr -d ' \t' ) @@ -268,9 +318,3 @@ RMDIR = rm -rf MV = mv -f CP = cp -rf ECHO:= @echo -ifneq (,$(shell echo $(XPLATFORM) | awk '/xilinx_u280_xdma_201920_3/')) -VPP_FLAGS += --advanced.param compiler.ignorePlatformCompatibilityCheck=true -ifeq ($(TARGET), hw) -VPP_LDFLAGS += --advanced.param compiler.userPreSysLinkOverlayTcl=preSysLink.tcl -endif -endif diff --git a/hpc/L2/tests/cgSolver/krnl_cgSolver_gemv/utils.mk b/hpc/L2/tests/cgSolver/krnl_cgSolver_gemv/utils.mk index 9b889021fc..2e9ea4d63a 100644 --- a/hpc/L2/tests/cgSolver/krnl_cgSolver_gemv/utils.mk +++ b/hpc/L2/tests/cgSolver/krnl_cgSolver_gemv/utils.mk @@ -12,7 +12,7 @@ # 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. -# vitis makefile-generator v2.0.6 +# vitis makefile-generator v2.0.7 # #+------------------------------------------------------------------------------- # The following parameters are assigned with default values. These parameters can @@ -50,6 +50,7 @@ ifndef XILINX_XRT export XILINX_XRT endif +.PHONY: check_device check_device: @set -eu; \ inallowlist=False; \ @@ -82,8 +83,9 @@ endif endif -#get suffix of kernel by PLATFORM +# Special processing for tool version/platform type VITIS_VER = $(shell v++ --version | grep 'v++' | sed 's/^[[:space:]]*//' | sed -e 's/^[*]* v++ v//g' | cut -d " " -f1) +# 1) for versal flow from 2022.1 DEVICE_TYPE = $(shell platforminfo -p $(PLATFORM) | grep 'FPGA Family' | sed 's/.*://' | sed '/ai_engine/d' | sed 's/^[[:space:]]*//') ifeq ($(DEVICE_TYPE), versal) ifeq ($(shell expr $(VITIS_VER) \>= 2022.1), 1) @@ -94,6 +96,22 @@ endif else LINK_TARGET_FMT := xclbin endif +# 2) dfx flow +dfx_hw := off +ifeq ($(findstring _dfx_, $(PLATFORM_NAME)),_dfx_) +ifeq ($(TARGET),hw) +dfx_hw := on +endif +endif +# 3) for embeded sw_emu flow from 2022.2 +ps_on_x86 := off +ifneq ($(HOST_ARCH), x86) +ifeq ($(shell expr $(VITIS_VER) \>= 2022.2), 1) +ifeq ($(TARGET), sw_emu) +ps_on_x86 := on +endif +endif +endif #Checks for Device Family ifeq ($(HOST_ARCH), aarch32) @@ -107,6 +125,7 @@ ifneq ($(HOST_ARCH), $(filter $(HOST_ARCH),aarch64 aarch32 x86)) $(error HOST_ARCH variable not set, please set correctly and rerun) endif +.PHONY: check_version check_sysroot check_kimage check_rootfs check_version: ifneq (, $(shell which git)) ifneq (,$(wildcard $(XFLIB_DIR)/.git)) @@ -114,17 +133,46 @@ ifneq (,$(wildcard $(XFLIB_DIR)/.git)) endif endif -#Checks for SYSROOT +#Set/Check SYSROOT/K_IMAGE/ROOTFS +ifneq ($(HOST_ARCH), x86) +ifneq (,$(findstring zc706, $(PLATFORM_NAME))) +K_IMAGE ?= $(SYSROOT)/../../uImage +else +K_IMAGE ?= $(SYSROOT)/../../Image +endif +ROOTFS ?= $(SYSROOT)/../../rootfs.ext4 +endif + check_sysroot: ifneq ($(HOST_ARCH), x86) -ifndef SYSROOT +ifeq (,$(wildcard $(SYSROOT))) $(error SYSROOT ENV variable is not set, please set ENV variable correctly and rerun) endif endif +check_kimage: +ifneq ($(HOST_ARCH), x86) +ifeq (,$(wildcard $(K_IMAGE))) + $(error K_IMAGE ENV variable is not set, please set ENV variable correctly and rerun) +endif +endif +check_rootfs: +ifneq ($(HOST_ARCH), x86) +ifeq (,$(wildcard $(ROOTFS))) + $(error ROOTFS ENV variable is not set, please set ENV variable correctly and rerun) +endif +endif #Checks for g++ -CXX := g++ ifeq ($(HOST_ARCH), x86) +X86_CXX := true +else +ifeq ($(ps_on_x86), true) +X86_CXX := true +endif +endif + +CXX := g++ +ifeq ($(X86_CXX), true) ifeq ($(shell expr $(VITIS_VER) \>= 2022.1), 1) CXX_VER := 8.3.0 else @@ -144,11 +192,13 @@ endif $(warning [WARNING]: g++ version too old. Using g++ provided by the tool: $(CXX)) endif endif -else ifeq ($(HOST_ARCH), aarch64) +else +ifeq ($(HOST_ARCH), aarch64) CXX := $(XILINX_VITIS)/gnu/aarch64/lin/aarch64-linux/bin/aarch64-linux-gnu-g++ else ifeq ($(HOST_ARCH), aarch32) CXX := $(XILINX_VITIS)/gnu/aarch32/lin/gcc-arm-linux-gnueabi/bin/arm-linux-gnueabihf-g++ endif +endif #Check OS and setting env for xrt c++ api OSDIST = $(shell lsb_release -i |awk -F: '{print tolower($$2)}' | tr -d ' \t' ) @@ -268,9 +318,3 @@ RMDIR = rm -rf MV = mv -f CP = cp -rf ECHO:= @echo -ifneq (,$(shell echo $(XPLATFORM) | awk '/xilinx_u280_xdma_201920_3/')) -VPP_FLAGS += --advanced.param compiler.ignorePlatformCompatibilityCheck=true -ifeq ($(TARGET), hw) -VPP_LDFLAGS += --advanced.param compiler.userPreSysLinkOverlayTcl=preSysLink.tcl -endif -endif diff --git a/hpc/L2/tests/cgSolver/krnl_cgSolver_gemv_jacobi_16ch/Makefile b/hpc/L2/tests/cgSolver/krnl_cgSolver_gemv_jacobi_16ch/Makefile index 083b167c89..25338c4382 100644 --- a/hpc/L2/tests/cgSolver/krnl_cgSolver_gemv_jacobi_16ch/Makefile +++ b/hpc/L2/tests/cgSolver/krnl_cgSolver_gemv_jacobi_16ch/Makefile @@ -11,7 +11,7 @@ # 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. -# vitis makefile-generator v2.0.6 +# vitis makefile-generator v2.0.7 ############################## Help Section ############################## .PHONY: help @@ -34,9 +34,15 @@ help:: $(ECHO) " Command to build host application." $(ECHO) " By default, HOST_ARCH=x86. HOST_ARCH is required for SoC shells" $(ECHO) "" - $(ECHO) " NOTE: For embedded devices, e.g. zcu102/zcu104/vck190, env variable SYSROOT and EDGE_COMMON_SW need to be set first, and HOST_ARCH is either aarch32 or aarch64. For example," - $(ECHO) " export SYSROOT=< path-to-platform-sysroot >" - $(ECHO) " export EDGE_COMMON_SW=< path-to-rootfs-and-Image-files >" + $(ECHO) " NOTE: For embedded devices, e.g. zcu102/zcu104/vck190, HOST_ARCH is either aarch32 or aarch64." + $(ECHO) " a.IF Download the platform, and common-image from Xilinx Download Center(Suggested):" + $(ECHO) " Run the sdk.sh script from the common-image directory to install sysroot using the command : ./sdk.sh -y -d ./ -p " + $(ECHO) " Unzip the rootfs file : gunzip ./rootfs.ext4.gz" + $(ECHO) " export SYSROOT=< path-to-platform-sysroot >" + $(ECHO) " b. User could also define SYSROOT, K_IMAGE and ROOTFS by themselves: " + $(ECHO) " export SYSROOT=< path-to-platform-sysroot >" + $(ECHO) " export K_IMAGE=< path-to-Image-files >" + $(ECHO) " export ROOTFS=< path-to-rootfs >" $(ECHO) "" $(ECHO) " make clean " $(ECHO) " Command to remove the generated non-hardware files." @@ -61,7 +67,7 @@ ifeq ($(PLATFORM),) PLATFORM := $(DEVICE) endif ifeq ($(PLATFORM),) -PLATFORM := xilinx_u280_xdma_201920_3 +PLATFORM := xilinx_u280_gen3x16_xdma_1_202120_1 endif # #################### Checking if PLATFORM in whitelist ############################ @@ -87,12 +93,17 @@ RUN_DEPS := # get global setting ifeq ($(HOST_ARCH), x86) CXXFLAGS += -fmessage-length=0 -I$(CUR_DIR)/src/ -I$(XILINX_XRT)/include -I$(XILINX_HLS)/include -std=c++14 -O3 -Wall -Wno-unknown-pragmas -Wno-unused-label -LDFLAGS += -pthread -L$(XILINX_XRT)/lib -L$(XILINX_HLS)/lnx64/tools/fpo_v7_0 -Wl,--as-needed -lOpenCL -lxrt_coreutil -lgmp -lmpfr -lIp_floating_point_v7_0_bitacc_cmodel +LDFLAGS += -pthread -L$(XILINX_XRT)/lib -L$(XILINX_HLS)/lnx64/tools/fpo_v7_1 -Wl,--as-needed -lOpenCL -lxrt_coreutil -lgmp -lmpfr -lIp_floating_point_v7_1_bitacc_cmodel VPP_FLAGS += -t $(TARGET) --platform $(XPLATFORM) --save-temps VPP_LDFLAGS += --optimize 2 -R 2 else ifeq ($(HOST_ARCH), aarch64) +ifeq ($(ps_on_x86), on) +CXXFLAGS += -fmessage-length=0 -I$(CUR_DIR)/src/ -I$(XILINX_XRT)/include -I$(XILINX_HLS)/include -std=c++14 -O3 -Wall -Wno-unknown-pragmas -Wno-unused-label +LDFLAGS += -pthread -L$(XILINX_XRT)/lib -L$(XILINX_HLS)/lnx64/tools/fpo_v7_1 -Wl,--as-needed -lOpenCL -lxrt_coreutil -lgmp -lmpfr -lIp_floating_point_v7_1_bitacc_cmodel +else CXXFLAGS += -I$(CUR_DIR)/src/ -fmessage-length=0 --sysroot=$(SYSROOT) -I$(SYSROOT)/usr/include/xrt -I$(XILINX_HLS)/include -std=c++14 -O3 -Wall -Wno-unknown-pragmas -Wno-unused-label -LDFLAGS += -pthread -L$(SYSROOT)/usr/lib -L$(XILINX_VITIS_AIETOOLS)/lib/aarch64.o -Wl,--as-needed -lxilinxopencl -lxrt_coreutil +LDFLAGS += -pthread -L$(SYSROOT)/usr/lib -Wl,--as-needed -lxilinxopencl -lxrt_coreutil +endif VPP_FLAGS += -t $(TARGET) --platform $(XPLATFORM) --save-temps VPP_LDFLAGS += --optimize 2 -R 2 endif @@ -107,15 +118,23 @@ ifeq ($(TARGET),hw_emu) CXXFLAGS += -D HW_EMU_TEST endif -ifeq (,$(findstring opencv,$(CXXFLAGS))) -CXXFLAGS += $(XRT_CXXFLAGS) -endif - #Inclue Required Host Source Files +ifeq ($(ps_on_x86), on) HOST_SRCS += $(XFLIB_DIR)/L2/src/sw/cgSolver/test_cgSolver_gemv_jacobi.cpp $(XFLIB_DIR)/../blas/L2/src/xcl2/xcl2.cpp CXXFLAGS += -D HW_CLK=3e-9 -D CG_numTasks=1 -D CG_dataType=double -D CG_numChannels=16 -D CG_parEntries=4 -D CG_instrBytes=64 CXXFLAGS += -I $(XFLIB_DIR)/L1/include/ -I $(XFLIB_DIR)/L2/include/sw/cgSolver -I $(XFLIB_DIR)/L2/include/sw/ -I $(XFLIB_DIR)/L2/include/common/cgSolver -I $(XFLIB_DIR)/../blas/L1/tests/sw/include/ -I $(XFLIB_DIR)/../blas/L2/include/xcl2 CXXFLAGS += -O3 +else +HOST_SRCS += $(XFLIB_DIR)/L2/src/sw/cgSolver/test_cgSolver_gemv_jacobi.cpp $(XFLIB_DIR)/../blas/L2/src/xcl2/xcl2.cpp +CXXFLAGS += -D HW_CLK=3e-9 -D CG_numTasks=1 -D CG_dataType=double -D CG_numChannels=16 -D CG_parEntries=4 -D CG_instrBytes=64 +CXXFLAGS += -I $(XFLIB_DIR)/L1/include/ -I $(XFLIB_DIR)/L2/include/sw/cgSolver -I $(XFLIB_DIR)/L2/include/sw/ -I $(XFLIB_DIR)/L2/include/common/cgSolver -I $(XFLIB_DIR)/../blas/L1/tests/sw/include/ -I $(XFLIB_DIR)/../blas/L2/include/xcl2 +CXXFLAGS += -O3 +endif + +# workaround for opencv +ifeq (,$(findstring opencv,$(CXXFLAGS))) +CXXFLAGS += $(XRT_CXXFLAGS) +endif EXE_NAME := host.exe EXE_FILE := $(BUILD_DIR)/$(EXE_NAME) @@ -253,11 +272,6 @@ $(EMCONFIG): emconfigutil --platform $(XPLATFORM) --od $(BUILD_DIR) ############################## Preparing sdcard folder ############################## ifneq ($(HOST_ARCH), x86) -ifneq (,$(findstring zc706, $(PLATFORM_NAME))) -K_IMAGE := $(SYSROOT)/../../uImage -else -K_IMAGE := $(SYSROOT)/../../Image -endif RUN_SCRIPT := $(BUILD_DIR)/run_script.sh $(RUN_SCRIPT): rm -rf $(RUN_SCRIPT) @@ -273,7 +287,7 @@ endif @echo './$(EXE_NAME) $(PKG_HOST_ARGS)' >> $(RUN_SCRIPT) @echo 'return_code=$$?' >> $(RUN_SCRIPT) @echo 'if [ $$return_code -ne 0 ]; then' >> $(RUN_SCRIPT) - @echo ' echo "ERROR: Embedded host run failed, RC=$$return_code"' >> $(RUN_SCRIPT) + @echo ' echo "ERROR: TEST FAILED, RC=$$return_code"' >> $(RUN_SCRIPT) @echo 'else' >> $(RUN_SCRIPT) @echo ' echo "INFO: TEST PASSED, RC=0"' >> $(RUN_SCRIPT) @echo 'fi' >> $(RUN_SCRIPT) @@ -291,23 +305,28 @@ SD_DIRS_WITH_PREFIX = $(foreach sd_dir,$(DATA_DIR),--package.sd_dir $(sd_dir)) PACKAGE_FILES := $(BINARY_CONTAINERS) PACKAGE_FILES += $(AIE_CONTAINER) SD_CARD := $(CUR_DIR)/package_$(TARGET) -vck190_dfx_hw := false -$(SD_CARD): $(EXE_FILE) $(BINARY_CONTAINERS) $(RUN_SCRIPT) $(EMCONFIG) +$(SD_CARD): $(EXE_FILE) $(BINARY_CONTAINERS) $(RUN_SCRIPT) $(EMCONFIG) check_kimage check_rootfs @echo "Generating sd_card folder...." mkdir -p $(SD_CARD) chmod a+rx $(BUILD_DIR)/run_script.sh -ifneq (,$(findstring vck190_base_dfx, $(PLATFORM_NAME))) -ifeq ($(TARGET),hw) - $(VPP) -t $(TARGET) --platform $(XPLATFORM) -p $(PACKAGE_FILES) -o $(BINARY_CONTAINERS_PKG) - $(VPP) -t $(TARGET) --platform $(XPLATFORM) -p --package.out_dir $(SD_CARD) --package.rootfs $(SYSROOT)/../../rootfs.ext4 --package.kernel_image $(K_IMAGE) $(SD_FILES_WITH_PREFIX) $(SD_DIRS_WITH_PREFIX) --package.sd_file $(BINARY_CONTAINERS_PKG) +# 1. DFX HW Flow +ifeq ($(dfx_hw), on) + $(VPP) -t $(TARGET) --platform $(XPLATFORM) -p $(PACKAGE_FILES) $(VPP_PACKAGE) -o $(BINARY_CONTAINERS_PKG) + $(VPP) -t $(TARGET) --platform $(XPLATFORM) -p --package.out_dir $(SD_CARD) --package.rootfs $(ROOTFS) --package.kernel_image $(K_IMAGE) $(SD_FILES_WITH_PREFIX) $(SD_DIRS_WITH_PREFIX) --package.sd_file $(BINARY_CONTAINERS_PKG) @echo "### ***** sd_card generation done! ***** ###" -vck190_dfx_hw := true endif +# 2. PS_ON_X86 - From 2022.2, Target:sw_emu +ifeq ($(ps_on_x86), on) + @echo "### ***** running PS X86 SE_EMU ***** ###" + $(VPP) -t $(TARGET) --platform $(XPLATFORM) -o $(BINARY_CONTAINERS_PKG) -p $(PACKAGE_FILES) $(VPP_PACKAGE) --package.out_dir $(SD_CARD) --package.emu_ps x86 endif -ifeq ($(vck190_dfx_hw), false) - $(VPP) -t $(TARGET) --platform $(XPLATFORM) -o $(BINARY_CONTAINERS_PKG) -p $(PACKAGE_FILES) $(VPP_PACKAGE) --package.out_dir $(SD_CARD) --package.rootfs $(SYSROOT)/../../rootfs.ext4 --package.kernel_image $(K_IMAGE) $(SD_FILES_WITH_PREFIX) $(SD_DIRS_WITH_PREFIX) +#3. General Embeded flow +ifeq ($(dfx_hw), off) +ifeq ($(ps_on_x86), off) + $(VPP) -t $(TARGET) --platform $(XPLATFORM) -o $(BINARY_CONTAINERS_PKG) -p $(PACKAGE_FILES) $(VPP_PACKAGE) --package.out_dir $(SD_CARD) --package.rootfs $(ROOTFS) --package.kernel_image $(K_IMAGE) $(SD_FILES_WITH_PREFIX) $(SD_DIRS_WITH_PREFIX) @echo "### ***** sd_card generation done! ***** ###" endif +endif .PHONY: sd_card sd_card: $(SD_CARD) @@ -331,7 +350,7 @@ ifeq ($(HOST_ARCH), x86) else @echo $(RUN_DEPS) - $(SD_CARD)/launch_$(TARGET).sh -no-reboot -run-app $(notdir $(RUN_SCRIPT)) + $(SD_CARD)/launch_$(TARGET).sh -no-reboot -run-app $(notdir $(RUN_SCRIPT)) 2>&1 | tee $(SD_CARD)/qemu_output.log grep "TEST PASSED, RC=0" $(SD_CARD)/qemu_output.log || exit 1 endif @@ -342,24 +361,32 @@ ifeq ($(HOST_ARCH), x86) LD_LIBRARY_PATH=$(LIBRARY_PATH):$$LD_LIBRARY_PATH \ XCL_EMULATION_MODE=$(TARGET) $(EXE_FILE) $(HOST_ARGS) +else +ifeq ($(ps_on_x86), on) + LD_LIBRARY_PATH=$(LIBRARY_PATH):$$LD_LIBRARY_PATH \ + XCL_EMULATION_MODE=$(TARGET) $(EXE_FILE) $(HOST_ARGS) + else @echo $(RUN_DEPS) - $(SD_CARD)/launch_$(TARGET).sh -no-reboot -run-app $(notdir $(RUN_SCRIPT)) + $(SD_CARD)/launch_$(TARGET).sh -no-reboot -run-app $(notdir $(RUN_SCRIPT)) 2>&1 | tee $(SD_CARD)/qemu_output.log grep "TEST PASSED, RC=0" $(SD_CARD)/qemu_output.log || exit 1 +endif endif endif #hw ifeq ($(TARGET), hw) ifneq (,$(findstring aws-vu9p-f1, $(PLATFORM_NAME))) -ifneq ($(JENKINS_INTERNAL_BUILD), 1) +ifeq (,$(wildcard $(BUILD_DIR)/cgSolver.awsxclbin)) $(ECHO) "This makefile does not directly support converting .xclbin to .awsxclbin, please refer https://github.com/aws/aws-fpga/blob/master/Vitis/README.md for next operations" else - $(ECHO) "Running inside Xilinx regression without converting to .awsxclbin" - $(EXE_FILE) $(HOST_ARGS) + $(ECHO) "Running HW using generated .awsxclbin" + LD_LIBRARY_PATH=$(LIBRARY_PATH):$$LD_LIBRARY_PATH \ + $(EXE_FILE) $(subst .xclbin,.awsxclbin,$(HOST_ARGS)) endif else ifeq ($(HOST_ARCH), x86) + LD_LIBRARY_PATH=$(LIBRARY_PATH):$$LD_LIBRARY_PATH \ $(EXE_FILE) $(HOST_ARGS) else @@ -393,12 +420,11 @@ cleanh: cleank: -$(RMDIR) $(BUILD_DIR)/*.xclbin _vimage *xclbin.run_summary qemu-memory-_* emulation/ _vimage/ pl*start_simulation. sh *.xclbin - -$(RMDIR) _x_temp.*/_x.* _x_temp.*/.Xil _x_temp.*/profile_summary.* xo_* _x* - -$(RMDIR) _x_temp.*/dltmp* _x_temp.*/kernel_info.dat _x_temp.*/*.log - -$(RMDIR) _x_temp.* + -$(RMDIR) _x_temp.* cleanall: cleanh cleank -$(RMDIR) $(BUILD_DIR) emconfig.json *.html $(TEMP_DIR) $(CUR_DIR)/reports *.csv *.run_summary $(CUR_DIR)/*.raw package_* $(BUILD_DIR)/run_script.sh .ipcache *.str -$(RMDIR) $(CUR_DIR)/Work $(CUR_DIR)/*.xpe $(CUR_DIR)/hw.o $(CUR_DIR)/*.xsa $(CUR_DIR)/xnwOut + -$(RMDIR) clean: cleanh \ No newline at end of file diff --git a/hpc/L2/tests/cgSolver/krnl_cgSolver_gemv_jacobi_16ch/description.json b/hpc/L2/tests/cgSolver/krnl_cgSolver_gemv_jacobi_16ch/description.json index 2d93542082..45bded62fd 100644 --- a/hpc/L2/tests/cgSolver/krnl_cgSolver_gemv_jacobi_16ch/description.json +++ b/hpc/L2/tests/cgSolver/krnl_cgSolver_gemv_jacobi_16ch/description.json @@ -45,11 +45,6 @@ ] } }, - "pre_launch": [ - { - "launch_cmd": "make data_gen" - } - ], "launch": [ { "name": "generic launch for all flows", diff --git a/hpc/L2/tests/cgSolver/krnl_cgSolver_gemv_jacobi_16ch/tests/Makefile b/hpc/L2/tests/cgSolver/krnl_cgSolver_gemv_jacobi_16ch/tests/Makefile index 61dcbfaad7..3eb599935e 100644 --- a/hpc/L2/tests/cgSolver/krnl_cgSolver_gemv_jacobi_16ch/tests/Makefile +++ b/hpc/L2/tests/cgSolver/krnl_cgSolver_gemv_jacobi_16ch/tests/Makefile @@ -11,7 +11,7 @@ # 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. -# vitis makefile-generator v2.0.6 +# vitis makefile-generator v2.0.7 ############################## Help Section ############################## .PHONY: help @@ -34,9 +34,15 @@ help:: $(ECHO) " Command to build host application." $(ECHO) " By default, HOST_ARCH=x86. HOST_ARCH is required for SoC shells" $(ECHO) "" - $(ECHO) " NOTE: For embedded devices, e.g. zcu102/zcu104/vck190, env variable SYSROOT and EDGE_COMMON_SW need to be set first, and HOST_ARCH is either aarch32 or aarch64. For example," - $(ECHO) " export SYSROOT=< path-to-platform-sysroot >" - $(ECHO) " export EDGE_COMMON_SW=< path-to-rootfs-and-Image-files >" + $(ECHO) " NOTE: For embedded devices, e.g. zcu102/zcu104/vck190, HOST_ARCH is either aarch32 or aarch64." + $(ECHO) " a.IF Download the platform, and common-image from Xilinx Download Center(Suggested):" + $(ECHO) " Run the sdk.sh script from the common-image directory to install sysroot using the command : ./sdk.sh -y -d ./ -p " + $(ECHO) " Unzip the rootfs file : gunzip ./rootfs.ext4.gz" + $(ECHO) " export SYSROOT=< path-to-platform-sysroot >" + $(ECHO) " b. User could also define SYSROOT, K_IMAGE and ROOTFS by themselves: " + $(ECHO) " export SYSROOT=< path-to-platform-sysroot >" + $(ECHO) " export K_IMAGE=< path-to-Image-files >" + $(ECHO) " export ROOTFS=< path-to-rootfs >" $(ECHO) "" $(ECHO) " make clean " $(ECHO) " Command to remove the generated non-hardware files." @@ -61,7 +67,7 @@ ifeq ($(PLATFORM),) PLATFORM := $(DEVICE) endif ifeq ($(PLATFORM),) -PLATFORM := xilinx_u280_xdma_201920_3 +PLATFORM := xilinx_u280_gen3x16_xdma_1_202120_1 endif # #################### Checking if PLATFORM in whitelist ############################ @@ -87,12 +93,17 @@ RUN_DEPS := # get global setting ifeq ($(HOST_ARCH), x86) CXXFLAGS += -fmessage-length=0 -I$(CUR_DIR)/src/ -I$(XILINX_XRT)/include -I$(XILINX_HLS)/include -std=c++14 -O3 -Wall -Wno-unknown-pragmas -Wno-unused-label -LDFLAGS += -pthread -L$(XILINX_XRT)/lib -L$(XILINX_HLS)/lnx64/tools/fpo_v7_0 -Wl,--as-needed -lOpenCL -lxrt_coreutil -lgmp -lmpfr -lIp_floating_point_v7_0_bitacc_cmodel +LDFLAGS += -pthread -L$(XILINX_XRT)/lib -L$(XILINX_HLS)/lnx64/tools/fpo_v7_1 -Wl,--as-needed -lOpenCL -lxrt_coreutil -lgmp -lmpfr -lIp_floating_point_v7_1_bitacc_cmodel VPP_FLAGS += -t $(TARGET) --platform $(XPLATFORM) --save-temps VPP_LDFLAGS += --optimize 2 -R 2 else ifeq ($(HOST_ARCH), aarch64) +ifeq ($(ps_on_x86), true) +CXXFLAGS += -fmessage-length=0 -I$(CUR_DIR)/src/ -I$(XILINX_XRT)/include -I$(XILINX_HLS)/include -std=c++14 -O3 -Wall -Wno-unknown-pragmas -Wno-unused-label +LDFLAGS += -pthread -L$(XILINX_XRT)/lib -L$(XILINX_HLS)/lnx64/tools/fpo_v7_1 -Wl,--as-needed -lOpenCL -lxrt_coreutil -lgmp -lmpfr -lIp_floating_point_v7_1_bitacc_cmodel +else CXXFLAGS += -I$(CUR_DIR)/src/ -fmessage-length=0 --sysroot=$(SYSROOT) -I$(SYSROOT)/usr/include/xrt -I$(XILINX_HLS)/include -std=c++14 -O3 -Wall -Wno-unknown-pragmas -Wno-unused-label -LDFLAGS += -pthread -L$(SYSROOT)/usr/lib -L$(XILINX_VITIS_AIETOOLS)/lib/aarch64.o -Wl,--as-needed -lxilinxopencl -lxrt_coreutil +LDFLAGS += -pthread -L$(SYSROOT)/usr/lib -Wl,--as-needed -lxilinxopencl -lxrt_coreutil +endif VPP_FLAGS += -t $(TARGET) --platform $(XPLATFORM) --save-temps VPP_LDFLAGS += --optimize 2 -R 2 endif @@ -107,15 +118,23 @@ ifeq ($(TARGET),hw_emu) CXXFLAGS += -D HW_EMU_TEST endif -ifeq (,$(findstring opencv,$(CXXFLAGS))) -CXXFLAGS += $(XRT_CXXFLAGS) -endif - #Inclue Required Host Source Files +ifeq ($(ps_on_x86), true) HOST_SRCS += $(XFLIB_DIR)/L2/src/sw/cgSolver/test_cgSolver_gemv_jacobi.cpp $(XFLIB_DIR)/../blas/L2/src/xcl2/xcl2.cpp CXXFLAGS += -D HW_CLK=3e-9 -D CG_numTasks=1 -D CG_dataType=double -D CG_numChannels=16 -D CG_parEntries=4 -D CG_instrBytes=64 CXXFLAGS += -I $(XFLIB_DIR)/L1/include/ -I $(XFLIB_DIR)/L2/include/sw/cgSolver -I $(XFLIB_DIR)/L2/include/sw/ -I $(XFLIB_DIR)/L2/include/common/cgSolver -I $(XFLIB_DIR)/../blas/L1/tests/sw/include/ -I $(XFLIB_DIR)/../blas/L2/include/xcl2 CXXFLAGS += -O3 +else +HOST_SRCS += $(XFLIB_DIR)/L2/src/sw/cgSolver/test_cgSolver_gemv_jacobi.cpp $(XFLIB_DIR)/../blas/L2/src/xcl2/xcl2.cpp +CXXFLAGS += -D HW_CLK=3e-9 -D CG_numTasks=1 -D CG_dataType=double -D CG_numChannels=16 -D CG_parEntries=4 -D CG_instrBytes=64 +CXXFLAGS += -I $(XFLIB_DIR)/L1/include/ -I $(XFLIB_DIR)/L2/include/sw/cgSolver -I $(XFLIB_DIR)/L2/include/sw/ -I $(XFLIB_DIR)/L2/include/common/cgSolver -I $(XFLIB_DIR)/../blas/L1/tests/sw/include/ -I $(XFLIB_DIR)/../blas/L2/include/xcl2 +CXXFLAGS += -O3 +endif + +# workaround for opencv +ifeq (,$(findstring opencv,$(CXXFLAGS))) +CXXFLAGS += $(XRT_CXXFLAGS) +endif EXE_NAME := host.exe EXE_FILE := $(BUILD_DIR)/$(EXE_NAME) @@ -253,11 +272,6 @@ $(EMCONFIG): emconfigutil --platform $(XPLATFORM) --od $(BUILD_DIR) ############################## Preparing sdcard folder ############################## ifneq ($(HOST_ARCH), x86) -ifneq (,$(findstring zc706, $(PLATFORM_NAME))) -K_IMAGE := $(SYSROOT)/../../uImage -else -K_IMAGE := $(SYSROOT)/../../Image -endif RUN_SCRIPT := $(BUILD_DIR)/run_script.sh $(RUN_SCRIPT): rm -rf $(RUN_SCRIPT) @@ -273,7 +287,7 @@ endif @echo './$(EXE_NAME) $(PKG_HOST_ARGS)' >> $(RUN_SCRIPT) @echo 'return_code=$$?' >> $(RUN_SCRIPT) @echo 'if [ $$return_code -ne 0 ]; then' >> $(RUN_SCRIPT) - @echo ' echo "ERROR: Embedded host run failed, RC=$$return_code"' >> $(RUN_SCRIPT) + @echo ' echo "ERROR: TEST FAILED, RC=$$return_code"' >> $(RUN_SCRIPT) @echo 'else' >> $(RUN_SCRIPT) @echo ' echo "INFO: TEST PASSED, RC=0"' >> $(RUN_SCRIPT) @echo 'fi' >> $(RUN_SCRIPT) @@ -291,23 +305,28 @@ SD_DIRS_WITH_PREFIX = $(foreach sd_dir,$(DATA_DIR),--package.sd_dir $(sd_dir)) PACKAGE_FILES := $(BINARY_CONTAINERS) PACKAGE_FILES += $(AIE_CONTAINER) SD_CARD := $(CUR_DIR)/package_$(TARGET) -vck190_dfx_hw := false -$(SD_CARD): $(EXE_FILE) $(BINARY_CONTAINERS) $(RUN_SCRIPT) $(EMCONFIG) +$(SD_CARD): $(EXE_FILE) $(BINARY_CONTAINERS) $(RUN_SCRIPT) $(EMCONFIG) check_kimage check_rootfs @echo "Generating sd_card folder...." mkdir -p $(SD_CARD) chmod a+rx $(BUILD_DIR)/run_script.sh -ifneq (,$(findstring vck190_base_dfx, $(PLATFORM_NAME))) -ifeq ($(TARGET),hw) - $(VPP) -t $(TARGET) --platform $(XPLATFORM) -p $(PACKAGE_FILES) -o $(BINARY_CONTAINERS_PKG) - $(VPP) -t $(TARGET) --platform $(XPLATFORM) -p --package.out_dir $(SD_CARD) --package.rootfs $(SYSROOT)/../../rootfs.ext4 --package.kernel_image $(K_IMAGE) $(SD_FILES_WITH_PREFIX) $(SD_DIRS_WITH_PREFIX) --package.sd_file $(BINARY_CONTAINERS_PKG) +# 1. DFX HW Flow +ifeq ($(dfx_hw), true) + $(VPP) -t $(TARGET) --platform $(XPLATFORM) -p $(PACKAGE_FILES) $(VPP_PACKAGE) -o $(BINARY_CONTAINERS_PKG) + $(VPP) -t $(TARGET) --platform $(XPLATFORM) -p --package.out_dir $(SD_CARD) --package.rootfs $(ROOTFS) --package.kernel_image $(K_IMAGE) $(SD_FILES_WITH_PREFIX) $(SD_DIRS_WITH_PREFIX) --package.sd_file $(BINARY_CONTAINERS_PKG) @echo "### ***** sd_card generation done! ***** ###" -vck190_dfx_hw := true endif +# 2. PS_ON_X86 - From 2022.2, Target:sw_emu +ifeq ($(ps_on_x86), true) + @echo "### ***** running PS X86 SE_EMU ***** ###" + $(VPP) -t $(TARGET) --platform $(XPLATFORM) -o $(BINARY_CONTAINERS_PKG) -p $(PACKAGE_FILES) $(VPP_PACKAGE) --package.out_dir $(SD_CARD) --package.emu_ps x86 endif -ifeq ($(vck190_dfx_hw), false) - $(VPP) -t $(TARGET) --platform $(XPLATFORM) -o $(BINARY_CONTAINERS_PKG) -p $(PACKAGE_FILES) $(VPP_PACKAGE) --package.out_dir $(SD_CARD) --package.rootfs $(SYSROOT)/../../rootfs.ext4 --package.kernel_image $(K_IMAGE) $(SD_FILES_WITH_PREFIX) $(SD_DIRS_WITH_PREFIX) +#3. General Embeded flow +ifeq ($(dfx_hw), false) +ifeq ($(ps_on_x86), false) + $(VPP) -t $(TARGET) --platform $(XPLATFORM) -o $(BINARY_CONTAINERS_PKG) -p $(PACKAGE_FILES) $(VPP_PACKAGE) --package.out_dir $(SD_CARD) --package.rootfs $(ROOTFS) --package.kernel_image $(K_IMAGE) $(SD_FILES_WITH_PREFIX) $(SD_DIRS_WITH_PREFIX) @echo "### ***** sd_card generation done! ***** ###" endif +endif .PHONY: sd_card sd_card: $(SD_CARD) @@ -331,7 +350,7 @@ ifeq ($(HOST_ARCH), x86) else @echo $(RUN_DEPS) - $(SD_CARD)/launch_$(TARGET).sh -no-reboot -run-app $(notdir $(RUN_SCRIPT)) + $(SD_CARD)/launch_$(TARGET).sh -no-reboot -run-app $(notdir $(RUN_SCRIPT)) 2>&1 | tee $(SD_CARD)/qemu_output.log grep "TEST PASSED, RC=0" $(SD_CARD)/qemu_output.log || exit 1 endif @@ -342,24 +361,32 @@ ifeq ($(HOST_ARCH), x86) LD_LIBRARY_PATH=$(LIBRARY_PATH):$$LD_LIBRARY_PATH \ XCL_EMULATION_MODE=$(TARGET) $(EXE_FILE) $(HOST_ARGS) +else +ifeq ($(ps_on_x86), true) + LD_LIBRARY_PATH=$(LIBRARY_PATH):$$LD_LIBRARY_PATH \ + XCL_EMULATION_MODE=$(TARGET) $(EXE_FILE) $(HOST_ARGS) + else @echo $(RUN_DEPS) - $(SD_CARD)/launch_$(TARGET).sh -no-reboot -run-app $(notdir $(RUN_SCRIPT)) + $(SD_CARD)/launch_$(TARGET).sh -no-reboot -run-app $(notdir $(RUN_SCRIPT)) 2>&1 | tee $(SD_CARD)/qemu_output.log grep "TEST PASSED, RC=0" $(SD_CARD)/qemu_output.log || exit 1 +endif endif endif #hw ifeq ($(TARGET), hw) ifneq (,$(findstring aws-vu9p-f1, $(PLATFORM_NAME))) -ifneq ($(JENKINS_INTERNAL_BUILD), 1) +ifeq (,$(wildcard $(BUILD_DIR)/cgSolver.awsxclbin)) $(ECHO) "This makefile does not directly support converting .xclbin to .awsxclbin, please refer https://github.com/aws/aws-fpga/blob/master/Vitis/README.md for next operations" else - $(ECHO) "Running inside Xilinx regression without converting to .awsxclbin" - $(EXE_FILE) $(HOST_ARGS) + $(ECHO) "Running HW using generated .awsxclbin" + LD_LIBRARY_PATH=$(LIBRARY_PATH):$$LD_LIBRARY_PATH \ + $(EXE_FILE) $(subst .xclbin,.awsxclbin,$(HOST_ARGS)) endif else ifeq ($(HOST_ARCH), x86) + LD_LIBRARY_PATH=$(LIBRARY_PATH):$$LD_LIBRARY_PATH \ $(EXE_FILE) $(HOST_ARGS) else @@ -393,12 +420,11 @@ cleanh: cleank: -$(RMDIR) $(BUILD_DIR)/*.xclbin _vimage *xclbin.run_summary qemu-memory-_* emulation/ _vimage/ pl*start_simulation. sh *.xclbin - -$(RMDIR) _x_temp.*/_x.* _x_temp.*/.Xil _x_temp.*/profile_summary.* xo_* _x* - -$(RMDIR) _x_temp.*/dltmp* _x_temp.*/kernel_info.dat _x_temp.*/*.log - -$(RMDIR) _x_temp.* + -$(RMDIR) _x_temp.* cleanall: cleanh cleank -$(RMDIR) $(BUILD_DIR) emconfig.json *.html $(TEMP_DIR) $(CUR_DIR)/reports *.csv *.run_summary $(CUR_DIR)/*.raw package_* $(BUILD_DIR)/run_script.sh .ipcache *.str -$(RMDIR) $(CUR_DIR)/Work $(CUR_DIR)/*.xpe $(CUR_DIR)/hw.o $(CUR_DIR)/*.xsa $(CUR_DIR)/xnwOut + -$(RMDIR) clean: cleanh \ No newline at end of file diff --git a/hpc/L2/tests/cgSolver/krnl_cgSolver_gemv_jacobi_16ch/tests/utils.mk b/hpc/L2/tests/cgSolver/krnl_cgSolver_gemv_jacobi_16ch/tests/utils.mk index 9b889021fc..8965e30749 100644 --- a/hpc/L2/tests/cgSolver/krnl_cgSolver_gemv_jacobi_16ch/tests/utils.mk +++ b/hpc/L2/tests/cgSolver/krnl_cgSolver_gemv_jacobi_16ch/tests/utils.mk @@ -12,7 +12,7 @@ # 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. -# vitis makefile-generator v2.0.6 +# vitis makefile-generator v2.0.7 # #+------------------------------------------------------------------------------- # The following parameters are assigned with default values. These parameters can @@ -50,6 +50,7 @@ ifndef XILINX_XRT export XILINX_XRT endif +.PHONY: check_device check_device: @set -eu; \ inallowlist=False; \ @@ -82,8 +83,9 @@ endif endif -#get suffix of kernel by PLATFORM +# Special processing for tool version/platform type VITIS_VER = $(shell v++ --version | grep 'v++' | sed 's/^[[:space:]]*//' | sed -e 's/^[*]* v++ v//g' | cut -d " " -f1) +# 1) for versal flow from 2022.1 DEVICE_TYPE = $(shell platforminfo -p $(PLATFORM) | grep 'FPGA Family' | sed 's/.*://' | sed '/ai_engine/d' | sed 's/^[[:space:]]*//') ifeq ($(DEVICE_TYPE), versal) ifeq ($(shell expr $(VITIS_VER) \>= 2022.1), 1) @@ -94,6 +96,22 @@ endif else LINK_TARGET_FMT := xclbin endif +# 2) dfx flow +dfx_hw := false +ifeq ($(findstring _dfx_, $(PLATFORM_NAME)),_dfx_) +ifeq ($(TARGET),hw) +dfx_hw := true +endif +endif +# 3) for embeded sw_emu flow from 2022.2 +ps_on_x86 := false +ifneq ($(HOST_ARCH), x86) +ifeq ($(shell expr $(VITIS_VER) \>= 2022.2), 1) +ifeq ($(TARGET), sw_emu) +ps_on_x86 := true +endif +endif +endif #Checks for Device Family ifeq ($(HOST_ARCH), aarch32) @@ -107,6 +125,7 @@ ifneq ($(HOST_ARCH), $(filter $(HOST_ARCH),aarch64 aarch32 x86)) $(error HOST_ARCH variable not set, please set correctly and rerun) endif +.PHONY: check_version check_sysroot check_kimage check_rootfs check_version: ifneq (, $(shell which git)) ifneq (,$(wildcard $(XFLIB_DIR)/.git)) @@ -114,17 +133,46 @@ ifneq (,$(wildcard $(XFLIB_DIR)/.git)) endif endif -#Checks for SYSROOT +#Set/Check SYSROOT/K_IMAGE/ROOTFS +ifneq ($(HOST_ARCH), x86) +ifneq (,$(findstring zc706, $(PLATFORM_NAME))) +K_IMAGE ?= $(SYSROOT)/../../uImage +else +K_IMAGE ?= $(SYSROOT)/../../Image +endif +ROOTFS ?= $(SYSROOT)/../../rootfs.ext4 +endif + check_sysroot: ifneq ($(HOST_ARCH), x86) -ifndef SYSROOT +ifeq (,$(wildcard $(SYSROOT))) $(error SYSROOT ENV variable is not set, please set ENV variable correctly and rerun) endif endif +check_kimage: +ifneq ($(HOST_ARCH), x86) +ifeq (,$(wildcard $(K_IMAGE))) + $(error K_IMAGE ENV variable is not set, please set ENV variable correctly and rerun) +endif +endif +check_rootfs: +ifneq ($(HOST_ARCH), x86) +ifeq (,$(wildcard $(ROOTFS))) + $(error ROOTFS ENV variable is not set, please set ENV variable correctly and rerun) +endif +endif #Checks for g++ -CXX := g++ ifeq ($(HOST_ARCH), x86) +X86_CXX := true +else +ifeq ($(ps_on_x86), true) +X86_CXX := true +endif +endif + +CXX := g++ +ifeq ($(X86_CXX), true) ifeq ($(shell expr $(VITIS_VER) \>= 2022.1), 1) CXX_VER := 8.3.0 else @@ -144,11 +192,13 @@ endif $(warning [WARNING]: g++ version too old. Using g++ provided by the tool: $(CXX)) endif endif -else ifeq ($(HOST_ARCH), aarch64) +else +ifeq ($(HOST_ARCH), aarch64) CXX := $(XILINX_VITIS)/gnu/aarch64/lin/aarch64-linux/bin/aarch64-linux-gnu-g++ else ifeq ($(HOST_ARCH), aarch32) CXX := $(XILINX_VITIS)/gnu/aarch32/lin/gcc-arm-linux-gnueabi/bin/arm-linux-gnueabihf-g++ endif +endif #Check OS and setting env for xrt c++ api OSDIST = $(shell lsb_release -i |awk -F: '{print tolower($$2)}' | tr -d ' \t' ) @@ -268,9 +318,3 @@ RMDIR = rm -rf MV = mv -f CP = cp -rf ECHO:= @echo -ifneq (,$(shell echo $(XPLATFORM) | awk '/xilinx_u280_xdma_201920_3/')) -VPP_FLAGS += --advanced.param compiler.ignorePlatformCompatibilityCheck=true -ifeq ($(TARGET), hw) -VPP_LDFLAGS += --advanced.param compiler.userPreSysLinkOverlayTcl=preSysLink.tcl -endif -endif diff --git a/hpc/L2/tests/cgSolver/krnl_cgSolver_gemv_jacobi_16ch/utils.mk b/hpc/L2/tests/cgSolver/krnl_cgSolver_gemv_jacobi_16ch/utils.mk index 9b889021fc..2e9ea4d63a 100644 --- a/hpc/L2/tests/cgSolver/krnl_cgSolver_gemv_jacobi_16ch/utils.mk +++ b/hpc/L2/tests/cgSolver/krnl_cgSolver_gemv_jacobi_16ch/utils.mk @@ -12,7 +12,7 @@ # 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. -# vitis makefile-generator v2.0.6 +# vitis makefile-generator v2.0.7 # #+------------------------------------------------------------------------------- # The following parameters are assigned with default values. These parameters can @@ -50,6 +50,7 @@ ifndef XILINX_XRT export XILINX_XRT endif +.PHONY: check_device check_device: @set -eu; \ inallowlist=False; \ @@ -82,8 +83,9 @@ endif endif -#get suffix of kernel by PLATFORM +# Special processing for tool version/platform type VITIS_VER = $(shell v++ --version | grep 'v++' | sed 's/^[[:space:]]*//' | sed -e 's/^[*]* v++ v//g' | cut -d " " -f1) +# 1) for versal flow from 2022.1 DEVICE_TYPE = $(shell platforminfo -p $(PLATFORM) | grep 'FPGA Family' | sed 's/.*://' | sed '/ai_engine/d' | sed 's/^[[:space:]]*//') ifeq ($(DEVICE_TYPE), versal) ifeq ($(shell expr $(VITIS_VER) \>= 2022.1), 1) @@ -94,6 +96,22 @@ endif else LINK_TARGET_FMT := xclbin endif +# 2) dfx flow +dfx_hw := off +ifeq ($(findstring _dfx_, $(PLATFORM_NAME)),_dfx_) +ifeq ($(TARGET),hw) +dfx_hw := on +endif +endif +# 3) for embeded sw_emu flow from 2022.2 +ps_on_x86 := off +ifneq ($(HOST_ARCH), x86) +ifeq ($(shell expr $(VITIS_VER) \>= 2022.2), 1) +ifeq ($(TARGET), sw_emu) +ps_on_x86 := on +endif +endif +endif #Checks for Device Family ifeq ($(HOST_ARCH), aarch32) @@ -107,6 +125,7 @@ ifneq ($(HOST_ARCH), $(filter $(HOST_ARCH),aarch64 aarch32 x86)) $(error HOST_ARCH variable not set, please set correctly and rerun) endif +.PHONY: check_version check_sysroot check_kimage check_rootfs check_version: ifneq (, $(shell which git)) ifneq (,$(wildcard $(XFLIB_DIR)/.git)) @@ -114,17 +133,46 @@ ifneq (,$(wildcard $(XFLIB_DIR)/.git)) endif endif -#Checks for SYSROOT +#Set/Check SYSROOT/K_IMAGE/ROOTFS +ifneq ($(HOST_ARCH), x86) +ifneq (,$(findstring zc706, $(PLATFORM_NAME))) +K_IMAGE ?= $(SYSROOT)/../../uImage +else +K_IMAGE ?= $(SYSROOT)/../../Image +endif +ROOTFS ?= $(SYSROOT)/../../rootfs.ext4 +endif + check_sysroot: ifneq ($(HOST_ARCH), x86) -ifndef SYSROOT +ifeq (,$(wildcard $(SYSROOT))) $(error SYSROOT ENV variable is not set, please set ENV variable correctly and rerun) endif endif +check_kimage: +ifneq ($(HOST_ARCH), x86) +ifeq (,$(wildcard $(K_IMAGE))) + $(error K_IMAGE ENV variable is not set, please set ENV variable correctly and rerun) +endif +endif +check_rootfs: +ifneq ($(HOST_ARCH), x86) +ifeq (,$(wildcard $(ROOTFS))) + $(error ROOTFS ENV variable is not set, please set ENV variable correctly and rerun) +endif +endif #Checks for g++ -CXX := g++ ifeq ($(HOST_ARCH), x86) +X86_CXX := true +else +ifeq ($(ps_on_x86), true) +X86_CXX := true +endif +endif + +CXX := g++ +ifeq ($(X86_CXX), true) ifeq ($(shell expr $(VITIS_VER) \>= 2022.1), 1) CXX_VER := 8.3.0 else @@ -144,11 +192,13 @@ endif $(warning [WARNING]: g++ version too old. Using g++ provided by the tool: $(CXX)) endif endif -else ifeq ($(HOST_ARCH), aarch64) +else +ifeq ($(HOST_ARCH), aarch64) CXX := $(XILINX_VITIS)/gnu/aarch64/lin/aarch64-linux/bin/aarch64-linux-gnu-g++ else ifeq ($(HOST_ARCH), aarch32) CXX := $(XILINX_VITIS)/gnu/aarch32/lin/gcc-arm-linux-gnueabi/bin/arm-linux-gnueabihf-g++ endif +endif #Check OS and setting env for xrt c++ api OSDIST = $(shell lsb_release -i |awk -F: '{print tolower($$2)}' | tr -d ' \t' ) @@ -268,9 +318,3 @@ RMDIR = rm -rf MV = mv -f CP = cp -rf ECHO:= @echo -ifneq (,$(shell echo $(XPLATFORM) | awk '/xilinx_u280_xdma_201920_3/')) -VPP_FLAGS += --advanced.param compiler.ignorePlatformCompatibilityCheck=true -ifeq ($(TARGET), hw) -VPP_LDFLAGS += --advanced.param compiler.userPreSysLinkOverlayTcl=preSysLink.tcl -endif -endif diff --git a/hpc/L2/tests/cgSolver/krnl_cgSolver_gemv_jacobi_1ch/Makefile b/hpc/L2/tests/cgSolver/krnl_cgSolver_gemv_jacobi_1ch/Makefile index 5aa46e425a..d6ef9d63d8 100644 --- a/hpc/L2/tests/cgSolver/krnl_cgSolver_gemv_jacobi_1ch/Makefile +++ b/hpc/L2/tests/cgSolver/krnl_cgSolver_gemv_jacobi_1ch/Makefile @@ -11,7 +11,7 @@ # 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. -# vitis makefile-generator v2.0.6 +# vitis makefile-generator v2.0.7 ############################## Help Section ############################## .PHONY: help @@ -34,9 +34,15 @@ help:: $(ECHO) " Command to build host application." $(ECHO) " By default, HOST_ARCH=x86. HOST_ARCH is required for SoC shells" $(ECHO) "" - $(ECHO) " NOTE: For embedded devices, e.g. zcu102/zcu104/vck190, env variable SYSROOT and EDGE_COMMON_SW need to be set first, and HOST_ARCH is either aarch32 or aarch64. For example," - $(ECHO) " export SYSROOT=< path-to-platform-sysroot >" - $(ECHO) " export EDGE_COMMON_SW=< path-to-rootfs-and-Image-files >" + $(ECHO) " NOTE: For embedded devices, e.g. zcu102/zcu104/vck190, HOST_ARCH is either aarch32 or aarch64." + $(ECHO) " a.IF Download the platform, and common-image from Xilinx Download Center(Suggested):" + $(ECHO) " Run the sdk.sh script from the common-image directory to install sysroot using the command : ./sdk.sh -y -d ./ -p " + $(ECHO) " Unzip the rootfs file : gunzip ./rootfs.ext4.gz" + $(ECHO) " export SYSROOT=< path-to-platform-sysroot >" + $(ECHO) " b. User could also define SYSROOT, K_IMAGE and ROOTFS by themselves: " + $(ECHO) " export SYSROOT=< path-to-platform-sysroot >" + $(ECHO) " export K_IMAGE=< path-to-Image-files >" + $(ECHO) " export ROOTFS=< path-to-rootfs >" $(ECHO) "" $(ECHO) " make clean " $(ECHO) " Command to remove the generated non-hardware files." @@ -61,7 +67,7 @@ ifeq ($(PLATFORM),) PLATFORM := $(DEVICE) endif ifeq ($(PLATFORM),) -PLATFORM := xilinx_u280_xdma_201920_3 +PLATFORM := xilinx_u280_gen3x16_xdma_1_202120_1 endif # #################### Checking if PLATFORM in whitelist ############################ @@ -87,12 +93,17 @@ RUN_DEPS := # get global setting ifeq ($(HOST_ARCH), x86) CXXFLAGS += -fmessage-length=0 -I$(CUR_DIR)/src/ -I$(XILINX_XRT)/include -I$(XILINX_HLS)/include -std=c++14 -O3 -Wall -Wno-unknown-pragmas -Wno-unused-label -LDFLAGS += -pthread -L$(XILINX_XRT)/lib -L$(XILINX_HLS)/lnx64/tools/fpo_v7_0 -Wl,--as-needed -lOpenCL -lxrt_coreutil -lgmp -lmpfr -lIp_floating_point_v7_0_bitacc_cmodel +LDFLAGS += -pthread -L$(XILINX_XRT)/lib -L$(XILINX_HLS)/lnx64/tools/fpo_v7_1 -Wl,--as-needed -lOpenCL -lxrt_coreutil -lgmp -lmpfr -lIp_floating_point_v7_1_bitacc_cmodel VPP_FLAGS += -t $(TARGET) --platform $(XPLATFORM) --save-temps VPP_LDFLAGS += --optimize 2 -R 2 else ifeq ($(HOST_ARCH), aarch64) +ifeq ($(ps_on_x86), on) +CXXFLAGS += -fmessage-length=0 -I$(CUR_DIR)/src/ -I$(XILINX_XRT)/include -I$(XILINX_HLS)/include -std=c++14 -O3 -Wall -Wno-unknown-pragmas -Wno-unused-label +LDFLAGS += -pthread -L$(XILINX_XRT)/lib -L$(XILINX_HLS)/lnx64/tools/fpo_v7_1 -Wl,--as-needed -lOpenCL -lxrt_coreutil -lgmp -lmpfr -lIp_floating_point_v7_1_bitacc_cmodel +else CXXFLAGS += -I$(CUR_DIR)/src/ -fmessage-length=0 --sysroot=$(SYSROOT) -I$(SYSROOT)/usr/include/xrt -I$(XILINX_HLS)/include -std=c++14 -O3 -Wall -Wno-unknown-pragmas -Wno-unused-label -LDFLAGS += -pthread -L$(SYSROOT)/usr/lib -L$(XILINX_VITIS_AIETOOLS)/lib/aarch64.o -Wl,--as-needed -lxilinxopencl -lxrt_coreutil +LDFLAGS += -pthread -L$(SYSROOT)/usr/lib -Wl,--as-needed -lxilinxopencl -lxrt_coreutil +endif VPP_FLAGS += -t $(TARGET) --platform $(XPLATFORM) --save-temps VPP_LDFLAGS += --optimize 2 -R 2 endif @@ -107,15 +118,23 @@ ifeq ($(TARGET),hw_emu) CXXFLAGS += -D HW_EMU_TEST endif -ifeq (,$(findstring opencv,$(CXXFLAGS))) -CXXFLAGS += $(XRT_CXXFLAGS) -endif - #Inclue Required Host Source Files +ifeq ($(ps_on_x86), on) HOST_SRCS += $(XFLIB_DIR)/L2/src/sw/cgSolver/test_cgSolver_gemv_jacobi.cpp $(XFLIB_DIR)/../blas/L2/src/xcl2/xcl2.cpp CXXFLAGS += -D HW_CLK=3e-9 -D CG_numTasks=1 -D CG_dataType=double -D CG_numChannels=1 -D CG_parEntries=4 -D CG_instrBytes=64 CXXFLAGS += -I $(XFLIB_DIR)/L1/include/ -I $(XFLIB_DIR)/L2/include/common/cgSolver -I $(XFLIB_DIR)/L2/include/sw/cgSolver -I $(XFLIB_DIR)/L2/include/sw/ -I $(XFLIB_DIR)/../blas/L1/tests/sw/include/ -I $(XFLIB_DIR)/../blas/L2/include/xcl2 CXXFLAGS += -O3 +else +HOST_SRCS += $(XFLIB_DIR)/L2/src/sw/cgSolver/test_cgSolver_gemv_jacobi.cpp $(XFLIB_DIR)/../blas/L2/src/xcl2/xcl2.cpp +CXXFLAGS += -D HW_CLK=3e-9 -D CG_numTasks=1 -D CG_dataType=double -D CG_numChannels=1 -D CG_parEntries=4 -D CG_instrBytes=64 +CXXFLAGS += -I $(XFLIB_DIR)/L1/include/ -I $(XFLIB_DIR)/L2/include/common/cgSolver -I $(XFLIB_DIR)/L2/include/sw/cgSolver -I $(XFLIB_DIR)/L2/include/sw/ -I $(XFLIB_DIR)/../blas/L1/tests/sw/include/ -I $(XFLIB_DIR)/../blas/L2/include/xcl2 +CXXFLAGS += -O3 +endif + +# workaround for opencv +ifeq (,$(findstring opencv,$(CXXFLAGS))) +CXXFLAGS += $(XRT_CXXFLAGS) +endif EXE_NAME := host.exe EXE_FILE := $(BUILD_DIR)/$(EXE_NAME) @@ -258,11 +277,6 @@ $(EMCONFIG): emconfigutil --platform $(XPLATFORM) --od $(BUILD_DIR) ############################## Preparing sdcard folder ############################## ifneq ($(HOST_ARCH), x86) -ifneq (,$(findstring zc706, $(PLATFORM_NAME))) -K_IMAGE := $(SYSROOT)/../../uImage -else -K_IMAGE := $(SYSROOT)/../../Image -endif RUN_SCRIPT := $(BUILD_DIR)/run_script.sh $(RUN_SCRIPT): rm -rf $(RUN_SCRIPT) @@ -278,7 +292,7 @@ endif @echo './$(EXE_NAME) $(PKG_HOST_ARGS)' >> $(RUN_SCRIPT) @echo 'return_code=$$?' >> $(RUN_SCRIPT) @echo 'if [ $$return_code -ne 0 ]; then' >> $(RUN_SCRIPT) - @echo ' echo "ERROR: Embedded host run failed, RC=$$return_code"' >> $(RUN_SCRIPT) + @echo ' echo "ERROR: TEST FAILED, RC=$$return_code"' >> $(RUN_SCRIPT) @echo 'else' >> $(RUN_SCRIPT) @echo ' echo "INFO: TEST PASSED, RC=0"' >> $(RUN_SCRIPT) @echo 'fi' >> $(RUN_SCRIPT) @@ -296,23 +310,28 @@ SD_DIRS_WITH_PREFIX = $(foreach sd_dir,$(DATA_DIR),--package.sd_dir $(sd_dir)) PACKAGE_FILES := $(BINARY_CONTAINERS) PACKAGE_FILES += $(AIE_CONTAINER) SD_CARD := $(CUR_DIR)/package_$(TARGET) -vck190_dfx_hw := false -$(SD_CARD): $(EXE_FILE) $(BINARY_CONTAINERS) $(RUN_SCRIPT) $(EMCONFIG) +$(SD_CARD): $(EXE_FILE) $(BINARY_CONTAINERS) $(RUN_SCRIPT) $(EMCONFIG) check_kimage check_rootfs @echo "Generating sd_card folder...." mkdir -p $(SD_CARD) chmod a+rx $(BUILD_DIR)/run_script.sh -ifneq (,$(findstring vck190_base_dfx, $(PLATFORM_NAME))) -ifeq ($(TARGET),hw) - $(VPP) -t $(TARGET) --platform $(XPLATFORM) -p $(PACKAGE_FILES) -o $(BINARY_CONTAINERS_PKG) - $(VPP) -t $(TARGET) --platform $(XPLATFORM) -p --package.out_dir $(SD_CARD) --package.rootfs $(SYSROOT)/../../rootfs.ext4 --package.kernel_image $(K_IMAGE) $(SD_FILES_WITH_PREFIX) $(SD_DIRS_WITH_PREFIX) --package.sd_file $(BINARY_CONTAINERS_PKG) +# 1. DFX HW Flow +ifeq ($(dfx_hw), on) + $(VPP) -t $(TARGET) --platform $(XPLATFORM) -p $(PACKAGE_FILES) $(VPP_PACKAGE) -o $(BINARY_CONTAINERS_PKG) + $(VPP) -t $(TARGET) --platform $(XPLATFORM) -p --package.out_dir $(SD_CARD) --package.rootfs $(ROOTFS) --package.kernel_image $(K_IMAGE) $(SD_FILES_WITH_PREFIX) $(SD_DIRS_WITH_PREFIX) --package.sd_file $(BINARY_CONTAINERS_PKG) @echo "### ***** sd_card generation done! ***** ###" -vck190_dfx_hw := true endif +# 2. PS_ON_X86 - From 2022.2, Target:sw_emu +ifeq ($(ps_on_x86), on) + @echo "### ***** running PS X86 SE_EMU ***** ###" + $(VPP) -t $(TARGET) --platform $(XPLATFORM) -o $(BINARY_CONTAINERS_PKG) -p $(PACKAGE_FILES) $(VPP_PACKAGE) --package.out_dir $(SD_CARD) --package.emu_ps x86 endif -ifeq ($(vck190_dfx_hw), false) - $(VPP) -t $(TARGET) --platform $(XPLATFORM) -o $(BINARY_CONTAINERS_PKG) -p $(PACKAGE_FILES) $(VPP_PACKAGE) --package.out_dir $(SD_CARD) --package.rootfs $(SYSROOT)/../../rootfs.ext4 --package.kernel_image $(K_IMAGE) $(SD_FILES_WITH_PREFIX) $(SD_DIRS_WITH_PREFIX) +#3. General Embeded flow +ifeq ($(dfx_hw), off) +ifeq ($(ps_on_x86), off) + $(VPP) -t $(TARGET) --platform $(XPLATFORM) -o $(BINARY_CONTAINERS_PKG) -p $(PACKAGE_FILES) $(VPP_PACKAGE) --package.out_dir $(SD_CARD) --package.rootfs $(ROOTFS) --package.kernel_image $(K_IMAGE) $(SD_FILES_WITH_PREFIX) $(SD_DIRS_WITH_PREFIX) @echo "### ***** sd_card generation done! ***** ###" endif +endif .PHONY: sd_card sd_card: $(SD_CARD) @@ -336,7 +355,7 @@ ifeq ($(HOST_ARCH), x86) else @echo $(RUN_DEPS) - $(SD_CARD)/launch_$(TARGET).sh -no-reboot -run-app $(notdir $(RUN_SCRIPT)) + $(SD_CARD)/launch_$(TARGET).sh -no-reboot -run-app $(notdir $(RUN_SCRIPT)) 2>&1 | tee $(SD_CARD)/qemu_output.log grep "TEST PASSED, RC=0" $(SD_CARD)/qemu_output.log || exit 1 endif @@ -347,24 +366,32 @@ ifeq ($(HOST_ARCH), x86) LD_LIBRARY_PATH=$(LIBRARY_PATH):$$LD_LIBRARY_PATH \ XCL_EMULATION_MODE=$(TARGET) $(EXE_FILE) $(HOST_ARGS) +else +ifeq ($(ps_on_x86), on) + LD_LIBRARY_PATH=$(LIBRARY_PATH):$$LD_LIBRARY_PATH \ + XCL_EMULATION_MODE=$(TARGET) $(EXE_FILE) $(HOST_ARGS) + else @echo $(RUN_DEPS) - $(SD_CARD)/launch_$(TARGET).sh -no-reboot -run-app $(notdir $(RUN_SCRIPT)) + $(SD_CARD)/launch_$(TARGET).sh -no-reboot -run-app $(notdir $(RUN_SCRIPT)) 2>&1 | tee $(SD_CARD)/qemu_output.log grep "TEST PASSED, RC=0" $(SD_CARD)/qemu_output.log || exit 1 +endif endif endif #hw ifeq ($(TARGET), hw) ifneq (,$(findstring aws-vu9p-f1, $(PLATFORM_NAME))) -ifneq ($(JENKINS_INTERNAL_BUILD), 1) +ifeq (,$(wildcard $(BUILD_DIR)/cgSolver.awsxclbin)) $(ECHO) "This makefile does not directly support converting .xclbin to .awsxclbin, please refer https://github.com/aws/aws-fpga/blob/master/Vitis/README.md for next operations" else - $(ECHO) "Running inside Xilinx regression without converting to .awsxclbin" - $(EXE_FILE) $(HOST_ARGS) + $(ECHO) "Running HW using generated .awsxclbin" + LD_LIBRARY_PATH=$(LIBRARY_PATH):$$LD_LIBRARY_PATH \ + $(EXE_FILE) $(subst .xclbin,.awsxclbin,$(HOST_ARGS)) endif else ifeq ($(HOST_ARCH), x86) + LD_LIBRARY_PATH=$(LIBRARY_PATH):$$LD_LIBRARY_PATH \ $(EXE_FILE) $(HOST_ARGS) else @@ -398,12 +425,11 @@ cleanh: cleank: -$(RMDIR) $(BUILD_DIR)/*.xclbin _vimage *xclbin.run_summary qemu-memory-_* emulation/ _vimage/ pl*start_simulation. sh *.xclbin - -$(RMDIR) _x_temp.*/_x.* _x_temp.*/.Xil _x_temp.*/profile_summary.* xo_* _x* - -$(RMDIR) _x_temp.*/dltmp* _x_temp.*/kernel_info.dat _x_temp.*/*.log - -$(RMDIR) _x_temp.* + -$(RMDIR) _x_temp.* cleanall: cleanh cleank -$(RMDIR) $(BUILD_DIR) emconfig.json *.html $(TEMP_DIR) $(CUR_DIR)/reports *.csv *.run_summary $(CUR_DIR)/*.raw package_* $(BUILD_DIR)/run_script.sh .ipcache *.str -$(RMDIR) $(CUR_DIR)/Work $(CUR_DIR)/*.xpe $(CUR_DIR)/hw.o $(CUR_DIR)/*.xsa $(CUR_DIR)/xnwOut + -$(RMDIR) clean: cleanh \ No newline at end of file diff --git a/hpc/L2/tests/cgSolver/krnl_cgSolver_gemv_jacobi_1ch/description.json b/hpc/L2/tests/cgSolver/krnl_cgSolver_gemv_jacobi_1ch/description.json index b2bc9d8f17..93b633f34f 100644 --- a/hpc/L2/tests/cgSolver/krnl_cgSolver_gemv_jacobi_1ch/description.json +++ b/hpc/L2/tests/cgSolver/krnl_cgSolver_gemv_jacobi_1ch/description.json @@ -43,11 +43,6 @@ ] } }, - "pre_launch": [ - { - "launch_cmd": "make data_gen" - } - ], "launch": [ { "name": "generic launch for all flows", diff --git a/hpc/L2/tests/cgSolver/krnl_cgSolver_gemv_jacobi_1ch/tests/Makefile b/hpc/L2/tests/cgSolver/krnl_cgSolver_gemv_jacobi_1ch/tests/Makefile index 9910943b8a..b71bb53367 100644 --- a/hpc/L2/tests/cgSolver/krnl_cgSolver_gemv_jacobi_1ch/tests/Makefile +++ b/hpc/L2/tests/cgSolver/krnl_cgSolver_gemv_jacobi_1ch/tests/Makefile @@ -11,7 +11,7 @@ # 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. -# vitis makefile-generator v2.0.6 +# vitis makefile-generator v2.0.7 ############################## Help Section ############################## .PHONY: help @@ -34,9 +34,15 @@ help:: $(ECHO) " Command to build host application." $(ECHO) " By default, HOST_ARCH=x86. HOST_ARCH is required for SoC shells" $(ECHO) "" - $(ECHO) " NOTE: For embedded devices, e.g. zcu102/zcu104/vck190, env variable SYSROOT and EDGE_COMMON_SW need to be set first, and HOST_ARCH is either aarch32 or aarch64. For example," - $(ECHO) " export SYSROOT=< path-to-platform-sysroot >" - $(ECHO) " export EDGE_COMMON_SW=< path-to-rootfs-and-Image-files >" + $(ECHO) " NOTE: For embedded devices, e.g. zcu102/zcu104/vck190, HOST_ARCH is either aarch32 or aarch64." + $(ECHO) " a.IF Download the platform, and common-image from Xilinx Download Center(Suggested):" + $(ECHO) " Run the sdk.sh script from the common-image directory to install sysroot using the command : ./sdk.sh -y -d ./ -p " + $(ECHO) " Unzip the rootfs file : gunzip ./rootfs.ext4.gz" + $(ECHO) " export SYSROOT=< path-to-platform-sysroot >" + $(ECHO) " b. User could also define SYSROOT, K_IMAGE and ROOTFS by themselves: " + $(ECHO) " export SYSROOT=< path-to-platform-sysroot >" + $(ECHO) " export K_IMAGE=< path-to-Image-files >" + $(ECHO) " export ROOTFS=< path-to-rootfs >" $(ECHO) "" $(ECHO) " make clean " $(ECHO) " Command to remove the generated non-hardware files." @@ -61,7 +67,7 @@ ifeq ($(PLATFORM),) PLATFORM := $(DEVICE) endif ifeq ($(PLATFORM),) -PLATFORM := xilinx_u280_xdma_201920_3 +PLATFORM := xilinx_u280_gen3x16_xdma_1_202120_1 endif # #################### Checking if PLATFORM in whitelist ############################ @@ -87,12 +93,17 @@ RUN_DEPS := # get global setting ifeq ($(HOST_ARCH), x86) CXXFLAGS += -fmessage-length=0 -I$(CUR_DIR)/src/ -I$(XILINX_XRT)/include -I$(XILINX_HLS)/include -std=c++14 -O3 -Wall -Wno-unknown-pragmas -Wno-unused-label -LDFLAGS += -pthread -L$(XILINX_XRT)/lib -L$(XILINX_HLS)/lnx64/tools/fpo_v7_0 -Wl,--as-needed -lOpenCL -lxrt_coreutil -lgmp -lmpfr -lIp_floating_point_v7_0_bitacc_cmodel +LDFLAGS += -pthread -L$(XILINX_XRT)/lib -L$(XILINX_HLS)/lnx64/tools/fpo_v7_1 -Wl,--as-needed -lOpenCL -lxrt_coreutil -lgmp -lmpfr -lIp_floating_point_v7_1_bitacc_cmodel VPP_FLAGS += -t $(TARGET) --platform $(XPLATFORM) --save-temps VPP_LDFLAGS += --optimize 2 -R 2 else ifeq ($(HOST_ARCH), aarch64) +ifeq ($(ps_on_x86), true) +CXXFLAGS += -fmessage-length=0 -I$(CUR_DIR)/src/ -I$(XILINX_XRT)/include -I$(XILINX_HLS)/include -std=c++14 -O3 -Wall -Wno-unknown-pragmas -Wno-unused-label +LDFLAGS += -pthread -L$(XILINX_XRT)/lib -L$(XILINX_HLS)/lnx64/tools/fpo_v7_1 -Wl,--as-needed -lOpenCL -lxrt_coreutil -lgmp -lmpfr -lIp_floating_point_v7_1_bitacc_cmodel +else CXXFLAGS += -I$(CUR_DIR)/src/ -fmessage-length=0 --sysroot=$(SYSROOT) -I$(SYSROOT)/usr/include/xrt -I$(XILINX_HLS)/include -std=c++14 -O3 -Wall -Wno-unknown-pragmas -Wno-unused-label -LDFLAGS += -pthread -L$(SYSROOT)/usr/lib -L$(XILINX_VITIS_AIETOOLS)/lib/aarch64.o -Wl,--as-needed -lxilinxopencl -lxrt_coreutil +LDFLAGS += -pthread -L$(SYSROOT)/usr/lib -Wl,--as-needed -lxilinxopencl -lxrt_coreutil +endif VPP_FLAGS += -t $(TARGET) --platform $(XPLATFORM) --save-temps VPP_LDFLAGS += --optimize 2 -R 2 endif @@ -107,15 +118,23 @@ ifeq ($(TARGET),hw_emu) CXXFLAGS += -D HW_EMU_TEST endif -ifeq (,$(findstring opencv,$(CXXFLAGS))) -CXXFLAGS += $(XRT_CXXFLAGS) -endif - #Inclue Required Host Source Files +ifeq ($(ps_on_x86), true) HOST_SRCS += $(XFLIB_DIR)/L2/src/sw/cgSolver/test_cgSolver_gemv_jacobi.cpp $(XFLIB_DIR)/../blas/L2/src/xcl2/xcl2.cpp CXXFLAGS += -D HW_CLK=3e-9 -D CG_numTasks=1 -D CG_dataType=double -D CG_numChannels=1 -D CG_parEntries=4 -D CG_instrBytes=64 CXXFLAGS += -I $(XFLIB_DIR)/L1/include/ -I $(XFLIB_DIR)/L2/include/common/cgSolver -I $(XFLIB_DIR)/L2/include/sw/cgSolver -I $(XFLIB_DIR)/L2/include/sw/ -I $(XFLIB_DIR)/../blas/L1/tests/sw/include/ -I $(XFLIB_DIR)/../blas/L2/include/xcl2 CXXFLAGS += -O3 +else +HOST_SRCS += $(XFLIB_DIR)/L2/src/sw/cgSolver/test_cgSolver_gemv_jacobi.cpp $(XFLIB_DIR)/../blas/L2/src/xcl2/xcl2.cpp +CXXFLAGS += -D HW_CLK=3e-9 -D CG_numTasks=1 -D CG_dataType=double -D CG_numChannels=1 -D CG_parEntries=4 -D CG_instrBytes=64 +CXXFLAGS += -I $(XFLIB_DIR)/L1/include/ -I $(XFLIB_DIR)/L2/include/common/cgSolver -I $(XFLIB_DIR)/L2/include/sw/cgSolver -I $(XFLIB_DIR)/L2/include/sw/ -I $(XFLIB_DIR)/../blas/L1/tests/sw/include/ -I $(XFLIB_DIR)/../blas/L2/include/xcl2 +CXXFLAGS += -O3 +endif + +# workaround for opencv +ifeq (,$(findstring opencv,$(CXXFLAGS))) +CXXFLAGS += $(XRT_CXXFLAGS) +endif EXE_NAME := host.exe EXE_FILE := $(BUILD_DIR)/$(EXE_NAME) @@ -258,11 +277,6 @@ $(EMCONFIG): emconfigutil --platform $(XPLATFORM) --od $(BUILD_DIR) ############################## Preparing sdcard folder ############################## ifneq ($(HOST_ARCH), x86) -ifneq (,$(findstring zc706, $(PLATFORM_NAME))) -K_IMAGE := $(SYSROOT)/../../uImage -else -K_IMAGE := $(SYSROOT)/../../Image -endif RUN_SCRIPT := $(BUILD_DIR)/run_script.sh $(RUN_SCRIPT): rm -rf $(RUN_SCRIPT) @@ -278,7 +292,7 @@ endif @echo './$(EXE_NAME) $(PKG_HOST_ARGS)' >> $(RUN_SCRIPT) @echo 'return_code=$$?' >> $(RUN_SCRIPT) @echo 'if [ $$return_code -ne 0 ]; then' >> $(RUN_SCRIPT) - @echo ' echo "ERROR: Embedded host run failed, RC=$$return_code"' >> $(RUN_SCRIPT) + @echo ' echo "ERROR: TEST FAILED, RC=$$return_code"' >> $(RUN_SCRIPT) @echo 'else' >> $(RUN_SCRIPT) @echo ' echo "INFO: TEST PASSED, RC=0"' >> $(RUN_SCRIPT) @echo 'fi' >> $(RUN_SCRIPT) @@ -296,23 +310,28 @@ SD_DIRS_WITH_PREFIX = $(foreach sd_dir,$(DATA_DIR),--package.sd_dir $(sd_dir)) PACKAGE_FILES := $(BINARY_CONTAINERS) PACKAGE_FILES += $(AIE_CONTAINER) SD_CARD := $(CUR_DIR)/package_$(TARGET) -vck190_dfx_hw := false -$(SD_CARD): $(EXE_FILE) $(BINARY_CONTAINERS) $(RUN_SCRIPT) $(EMCONFIG) +$(SD_CARD): $(EXE_FILE) $(BINARY_CONTAINERS) $(RUN_SCRIPT) $(EMCONFIG) check_kimage check_rootfs @echo "Generating sd_card folder...." mkdir -p $(SD_CARD) chmod a+rx $(BUILD_DIR)/run_script.sh -ifneq (,$(findstring vck190_base_dfx, $(PLATFORM_NAME))) -ifeq ($(TARGET),hw) - $(VPP) -t $(TARGET) --platform $(XPLATFORM) -p $(PACKAGE_FILES) -o $(BINARY_CONTAINERS_PKG) - $(VPP) -t $(TARGET) --platform $(XPLATFORM) -p --package.out_dir $(SD_CARD) --package.rootfs $(SYSROOT)/../../rootfs.ext4 --package.kernel_image $(K_IMAGE) $(SD_FILES_WITH_PREFIX) $(SD_DIRS_WITH_PREFIX) --package.sd_file $(BINARY_CONTAINERS_PKG) +# 1. DFX HW Flow +ifeq ($(dfx_hw), true) + $(VPP) -t $(TARGET) --platform $(XPLATFORM) -p $(PACKAGE_FILES) $(VPP_PACKAGE) -o $(BINARY_CONTAINERS_PKG) + $(VPP) -t $(TARGET) --platform $(XPLATFORM) -p --package.out_dir $(SD_CARD) --package.rootfs $(ROOTFS) --package.kernel_image $(K_IMAGE) $(SD_FILES_WITH_PREFIX) $(SD_DIRS_WITH_PREFIX) --package.sd_file $(BINARY_CONTAINERS_PKG) @echo "### ***** sd_card generation done! ***** ###" -vck190_dfx_hw := true endif +# 2. PS_ON_X86 - From 2022.2, Target:sw_emu +ifeq ($(ps_on_x86), true) + @echo "### ***** running PS X86 SE_EMU ***** ###" + $(VPP) -t $(TARGET) --platform $(XPLATFORM) -o $(BINARY_CONTAINERS_PKG) -p $(PACKAGE_FILES) $(VPP_PACKAGE) --package.out_dir $(SD_CARD) --package.emu_ps x86 endif -ifeq ($(vck190_dfx_hw), false) - $(VPP) -t $(TARGET) --platform $(XPLATFORM) -o $(BINARY_CONTAINERS_PKG) -p $(PACKAGE_FILES) $(VPP_PACKAGE) --package.out_dir $(SD_CARD) --package.rootfs $(SYSROOT)/../../rootfs.ext4 --package.kernel_image $(K_IMAGE) $(SD_FILES_WITH_PREFIX) $(SD_DIRS_WITH_PREFIX) +#3. General Embeded flow +ifeq ($(dfx_hw), false) +ifeq ($(ps_on_x86), false) + $(VPP) -t $(TARGET) --platform $(XPLATFORM) -o $(BINARY_CONTAINERS_PKG) -p $(PACKAGE_FILES) $(VPP_PACKAGE) --package.out_dir $(SD_CARD) --package.rootfs $(ROOTFS) --package.kernel_image $(K_IMAGE) $(SD_FILES_WITH_PREFIX) $(SD_DIRS_WITH_PREFIX) @echo "### ***** sd_card generation done! ***** ###" endif +endif .PHONY: sd_card sd_card: $(SD_CARD) @@ -336,7 +355,7 @@ ifeq ($(HOST_ARCH), x86) else @echo $(RUN_DEPS) - $(SD_CARD)/launch_$(TARGET).sh -no-reboot -run-app $(notdir $(RUN_SCRIPT)) + $(SD_CARD)/launch_$(TARGET).sh -no-reboot -run-app $(notdir $(RUN_SCRIPT)) 2>&1 | tee $(SD_CARD)/qemu_output.log grep "TEST PASSED, RC=0" $(SD_CARD)/qemu_output.log || exit 1 endif @@ -347,24 +366,32 @@ ifeq ($(HOST_ARCH), x86) LD_LIBRARY_PATH=$(LIBRARY_PATH):$$LD_LIBRARY_PATH \ XCL_EMULATION_MODE=$(TARGET) $(EXE_FILE) $(HOST_ARGS) +else +ifeq ($(ps_on_x86), true) + LD_LIBRARY_PATH=$(LIBRARY_PATH):$$LD_LIBRARY_PATH \ + XCL_EMULATION_MODE=$(TARGET) $(EXE_FILE) $(HOST_ARGS) + else @echo $(RUN_DEPS) - $(SD_CARD)/launch_$(TARGET).sh -no-reboot -run-app $(notdir $(RUN_SCRIPT)) + $(SD_CARD)/launch_$(TARGET).sh -no-reboot -run-app $(notdir $(RUN_SCRIPT)) 2>&1 | tee $(SD_CARD)/qemu_output.log grep "TEST PASSED, RC=0" $(SD_CARD)/qemu_output.log || exit 1 +endif endif endif #hw ifeq ($(TARGET), hw) ifneq (,$(findstring aws-vu9p-f1, $(PLATFORM_NAME))) -ifneq ($(JENKINS_INTERNAL_BUILD), 1) +ifeq (,$(wildcard $(BUILD_DIR)/cgSolver.awsxclbin)) $(ECHO) "This makefile does not directly support converting .xclbin to .awsxclbin, please refer https://github.com/aws/aws-fpga/blob/master/Vitis/README.md for next operations" else - $(ECHO) "Running inside Xilinx regression without converting to .awsxclbin" - $(EXE_FILE) $(HOST_ARGS) + $(ECHO) "Running HW using generated .awsxclbin" + LD_LIBRARY_PATH=$(LIBRARY_PATH):$$LD_LIBRARY_PATH \ + $(EXE_FILE) $(subst .xclbin,.awsxclbin,$(HOST_ARGS)) endif else ifeq ($(HOST_ARCH), x86) + LD_LIBRARY_PATH=$(LIBRARY_PATH):$$LD_LIBRARY_PATH \ $(EXE_FILE) $(HOST_ARGS) else @@ -398,12 +425,11 @@ cleanh: cleank: -$(RMDIR) $(BUILD_DIR)/*.xclbin _vimage *xclbin.run_summary qemu-memory-_* emulation/ _vimage/ pl*start_simulation. sh *.xclbin - -$(RMDIR) _x_temp.*/_x.* _x_temp.*/.Xil _x_temp.*/profile_summary.* xo_* _x* - -$(RMDIR) _x_temp.*/dltmp* _x_temp.*/kernel_info.dat _x_temp.*/*.log - -$(RMDIR) _x_temp.* + -$(RMDIR) _x_temp.* cleanall: cleanh cleank -$(RMDIR) $(BUILD_DIR) emconfig.json *.html $(TEMP_DIR) $(CUR_DIR)/reports *.csv *.run_summary $(CUR_DIR)/*.raw package_* $(BUILD_DIR)/run_script.sh .ipcache *.str -$(RMDIR) $(CUR_DIR)/Work $(CUR_DIR)/*.xpe $(CUR_DIR)/hw.o $(CUR_DIR)/*.xsa $(CUR_DIR)/xnwOut + -$(RMDIR) clean: cleanh \ No newline at end of file diff --git a/hpc/L2/tests/cgSolver/krnl_cgSolver_gemv_jacobi_1ch/tests/utils.mk b/hpc/L2/tests/cgSolver/krnl_cgSolver_gemv_jacobi_1ch/tests/utils.mk index 9b889021fc..8965e30749 100644 --- a/hpc/L2/tests/cgSolver/krnl_cgSolver_gemv_jacobi_1ch/tests/utils.mk +++ b/hpc/L2/tests/cgSolver/krnl_cgSolver_gemv_jacobi_1ch/tests/utils.mk @@ -12,7 +12,7 @@ # 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. -# vitis makefile-generator v2.0.6 +# vitis makefile-generator v2.0.7 # #+------------------------------------------------------------------------------- # The following parameters are assigned with default values. These parameters can @@ -50,6 +50,7 @@ ifndef XILINX_XRT export XILINX_XRT endif +.PHONY: check_device check_device: @set -eu; \ inallowlist=False; \ @@ -82,8 +83,9 @@ endif endif -#get suffix of kernel by PLATFORM +# Special processing for tool version/platform type VITIS_VER = $(shell v++ --version | grep 'v++' | sed 's/^[[:space:]]*//' | sed -e 's/^[*]* v++ v//g' | cut -d " " -f1) +# 1) for versal flow from 2022.1 DEVICE_TYPE = $(shell platforminfo -p $(PLATFORM) | grep 'FPGA Family' | sed 's/.*://' | sed '/ai_engine/d' | sed 's/^[[:space:]]*//') ifeq ($(DEVICE_TYPE), versal) ifeq ($(shell expr $(VITIS_VER) \>= 2022.1), 1) @@ -94,6 +96,22 @@ endif else LINK_TARGET_FMT := xclbin endif +# 2) dfx flow +dfx_hw := false +ifeq ($(findstring _dfx_, $(PLATFORM_NAME)),_dfx_) +ifeq ($(TARGET),hw) +dfx_hw := true +endif +endif +# 3) for embeded sw_emu flow from 2022.2 +ps_on_x86 := false +ifneq ($(HOST_ARCH), x86) +ifeq ($(shell expr $(VITIS_VER) \>= 2022.2), 1) +ifeq ($(TARGET), sw_emu) +ps_on_x86 := true +endif +endif +endif #Checks for Device Family ifeq ($(HOST_ARCH), aarch32) @@ -107,6 +125,7 @@ ifneq ($(HOST_ARCH), $(filter $(HOST_ARCH),aarch64 aarch32 x86)) $(error HOST_ARCH variable not set, please set correctly and rerun) endif +.PHONY: check_version check_sysroot check_kimage check_rootfs check_version: ifneq (, $(shell which git)) ifneq (,$(wildcard $(XFLIB_DIR)/.git)) @@ -114,17 +133,46 @@ ifneq (,$(wildcard $(XFLIB_DIR)/.git)) endif endif -#Checks for SYSROOT +#Set/Check SYSROOT/K_IMAGE/ROOTFS +ifneq ($(HOST_ARCH), x86) +ifneq (,$(findstring zc706, $(PLATFORM_NAME))) +K_IMAGE ?= $(SYSROOT)/../../uImage +else +K_IMAGE ?= $(SYSROOT)/../../Image +endif +ROOTFS ?= $(SYSROOT)/../../rootfs.ext4 +endif + check_sysroot: ifneq ($(HOST_ARCH), x86) -ifndef SYSROOT +ifeq (,$(wildcard $(SYSROOT))) $(error SYSROOT ENV variable is not set, please set ENV variable correctly and rerun) endif endif +check_kimage: +ifneq ($(HOST_ARCH), x86) +ifeq (,$(wildcard $(K_IMAGE))) + $(error K_IMAGE ENV variable is not set, please set ENV variable correctly and rerun) +endif +endif +check_rootfs: +ifneq ($(HOST_ARCH), x86) +ifeq (,$(wildcard $(ROOTFS))) + $(error ROOTFS ENV variable is not set, please set ENV variable correctly and rerun) +endif +endif #Checks for g++ -CXX := g++ ifeq ($(HOST_ARCH), x86) +X86_CXX := true +else +ifeq ($(ps_on_x86), true) +X86_CXX := true +endif +endif + +CXX := g++ +ifeq ($(X86_CXX), true) ifeq ($(shell expr $(VITIS_VER) \>= 2022.1), 1) CXX_VER := 8.3.0 else @@ -144,11 +192,13 @@ endif $(warning [WARNING]: g++ version too old. Using g++ provided by the tool: $(CXX)) endif endif -else ifeq ($(HOST_ARCH), aarch64) +else +ifeq ($(HOST_ARCH), aarch64) CXX := $(XILINX_VITIS)/gnu/aarch64/lin/aarch64-linux/bin/aarch64-linux-gnu-g++ else ifeq ($(HOST_ARCH), aarch32) CXX := $(XILINX_VITIS)/gnu/aarch32/lin/gcc-arm-linux-gnueabi/bin/arm-linux-gnueabihf-g++ endif +endif #Check OS and setting env for xrt c++ api OSDIST = $(shell lsb_release -i |awk -F: '{print tolower($$2)}' | tr -d ' \t' ) @@ -268,9 +318,3 @@ RMDIR = rm -rf MV = mv -f CP = cp -rf ECHO:= @echo -ifneq (,$(shell echo $(XPLATFORM) | awk '/xilinx_u280_xdma_201920_3/')) -VPP_FLAGS += --advanced.param compiler.ignorePlatformCompatibilityCheck=true -ifeq ($(TARGET), hw) -VPP_LDFLAGS += --advanced.param compiler.userPreSysLinkOverlayTcl=preSysLink.tcl -endif -endif diff --git a/hpc/L2/tests/cgSolver/krnl_cgSolver_gemv_jacobi_1ch/utils.mk b/hpc/L2/tests/cgSolver/krnl_cgSolver_gemv_jacobi_1ch/utils.mk index 9b889021fc..2e9ea4d63a 100644 --- a/hpc/L2/tests/cgSolver/krnl_cgSolver_gemv_jacobi_1ch/utils.mk +++ b/hpc/L2/tests/cgSolver/krnl_cgSolver_gemv_jacobi_1ch/utils.mk @@ -12,7 +12,7 @@ # 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. -# vitis makefile-generator v2.0.6 +# vitis makefile-generator v2.0.7 # #+------------------------------------------------------------------------------- # The following parameters are assigned with default values. These parameters can @@ -50,6 +50,7 @@ ifndef XILINX_XRT export XILINX_XRT endif +.PHONY: check_device check_device: @set -eu; \ inallowlist=False; \ @@ -82,8 +83,9 @@ endif endif -#get suffix of kernel by PLATFORM +# Special processing for tool version/platform type VITIS_VER = $(shell v++ --version | grep 'v++' | sed 's/^[[:space:]]*//' | sed -e 's/^[*]* v++ v//g' | cut -d " " -f1) +# 1) for versal flow from 2022.1 DEVICE_TYPE = $(shell platforminfo -p $(PLATFORM) | grep 'FPGA Family' | sed 's/.*://' | sed '/ai_engine/d' | sed 's/^[[:space:]]*//') ifeq ($(DEVICE_TYPE), versal) ifeq ($(shell expr $(VITIS_VER) \>= 2022.1), 1) @@ -94,6 +96,22 @@ endif else LINK_TARGET_FMT := xclbin endif +# 2) dfx flow +dfx_hw := off +ifeq ($(findstring _dfx_, $(PLATFORM_NAME)),_dfx_) +ifeq ($(TARGET),hw) +dfx_hw := on +endif +endif +# 3) for embeded sw_emu flow from 2022.2 +ps_on_x86 := off +ifneq ($(HOST_ARCH), x86) +ifeq ($(shell expr $(VITIS_VER) \>= 2022.2), 1) +ifeq ($(TARGET), sw_emu) +ps_on_x86 := on +endif +endif +endif #Checks for Device Family ifeq ($(HOST_ARCH), aarch32) @@ -107,6 +125,7 @@ ifneq ($(HOST_ARCH), $(filter $(HOST_ARCH),aarch64 aarch32 x86)) $(error HOST_ARCH variable not set, please set correctly and rerun) endif +.PHONY: check_version check_sysroot check_kimage check_rootfs check_version: ifneq (, $(shell which git)) ifneq (,$(wildcard $(XFLIB_DIR)/.git)) @@ -114,17 +133,46 @@ ifneq (,$(wildcard $(XFLIB_DIR)/.git)) endif endif -#Checks for SYSROOT +#Set/Check SYSROOT/K_IMAGE/ROOTFS +ifneq ($(HOST_ARCH), x86) +ifneq (,$(findstring zc706, $(PLATFORM_NAME))) +K_IMAGE ?= $(SYSROOT)/../../uImage +else +K_IMAGE ?= $(SYSROOT)/../../Image +endif +ROOTFS ?= $(SYSROOT)/../../rootfs.ext4 +endif + check_sysroot: ifneq ($(HOST_ARCH), x86) -ifndef SYSROOT +ifeq (,$(wildcard $(SYSROOT))) $(error SYSROOT ENV variable is not set, please set ENV variable correctly and rerun) endif endif +check_kimage: +ifneq ($(HOST_ARCH), x86) +ifeq (,$(wildcard $(K_IMAGE))) + $(error K_IMAGE ENV variable is not set, please set ENV variable correctly and rerun) +endif +endif +check_rootfs: +ifneq ($(HOST_ARCH), x86) +ifeq (,$(wildcard $(ROOTFS))) + $(error ROOTFS ENV variable is not set, please set ENV variable correctly and rerun) +endif +endif #Checks for g++ -CXX := g++ ifeq ($(HOST_ARCH), x86) +X86_CXX := true +else +ifeq ($(ps_on_x86), true) +X86_CXX := true +endif +endif + +CXX := g++ +ifeq ($(X86_CXX), true) ifeq ($(shell expr $(VITIS_VER) \>= 2022.1), 1) CXX_VER := 8.3.0 else @@ -144,11 +192,13 @@ endif $(warning [WARNING]: g++ version too old. Using g++ provided by the tool: $(CXX)) endif endif -else ifeq ($(HOST_ARCH), aarch64) +else +ifeq ($(HOST_ARCH), aarch64) CXX := $(XILINX_VITIS)/gnu/aarch64/lin/aarch64-linux/bin/aarch64-linux-gnu-g++ else ifeq ($(HOST_ARCH), aarch32) CXX := $(XILINX_VITIS)/gnu/aarch32/lin/gcc-arm-linux-gnueabi/bin/arm-linux-gnueabihf-g++ endif +endif #Check OS and setting env for xrt c++ api OSDIST = $(shell lsb_release -i |awk -F: '{print tolower($$2)}' | tr -d ' \t' ) @@ -268,9 +318,3 @@ RMDIR = rm -rf MV = mv -f CP = cp -rf ECHO:= @echo -ifneq (,$(shell echo $(XPLATFORM) | awk '/xilinx_u280_xdma_201920_3/')) -VPP_FLAGS += --advanced.param compiler.ignorePlatformCompatibilityCheck=true -ifeq ($(TARGET), hw) -VPP_LDFLAGS += --advanced.param compiler.userPreSysLinkOverlayTcl=preSysLink.tcl -endif -endif diff --git a/hpc/L2/tests/cgSolver/krnl_cgSolver_gemv_jacobi_8ch/Makefile b/hpc/L2/tests/cgSolver/krnl_cgSolver_gemv_jacobi_8ch/Makefile index 91d721b666..1a20beb26f 100644 --- a/hpc/L2/tests/cgSolver/krnl_cgSolver_gemv_jacobi_8ch/Makefile +++ b/hpc/L2/tests/cgSolver/krnl_cgSolver_gemv_jacobi_8ch/Makefile @@ -11,7 +11,7 @@ # 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. -# vitis makefile-generator v2.0.6 +# vitis makefile-generator v2.0.7 ############################## Help Section ############################## .PHONY: help @@ -34,9 +34,15 @@ help:: $(ECHO) " Command to build host application." $(ECHO) " By default, HOST_ARCH=x86. HOST_ARCH is required for SoC shells" $(ECHO) "" - $(ECHO) " NOTE: For embedded devices, e.g. zcu102/zcu104/vck190, env variable SYSROOT and EDGE_COMMON_SW need to be set first, and HOST_ARCH is either aarch32 or aarch64. For example," - $(ECHO) " export SYSROOT=< path-to-platform-sysroot >" - $(ECHO) " export EDGE_COMMON_SW=< path-to-rootfs-and-Image-files >" + $(ECHO) " NOTE: For embedded devices, e.g. zcu102/zcu104/vck190, HOST_ARCH is either aarch32 or aarch64." + $(ECHO) " a.IF Download the platform, and common-image from Xilinx Download Center(Suggested):" + $(ECHO) " Run the sdk.sh script from the common-image directory to install sysroot using the command : ./sdk.sh -y -d ./ -p " + $(ECHO) " Unzip the rootfs file : gunzip ./rootfs.ext4.gz" + $(ECHO) " export SYSROOT=< path-to-platform-sysroot >" + $(ECHO) " b. User could also define SYSROOT, K_IMAGE and ROOTFS by themselves: " + $(ECHO) " export SYSROOT=< path-to-platform-sysroot >" + $(ECHO) " export K_IMAGE=< path-to-Image-files >" + $(ECHO) " export ROOTFS=< path-to-rootfs >" $(ECHO) "" $(ECHO) " make clean " $(ECHO) " Command to remove the generated non-hardware files." @@ -61,7 +67,7 @@ ifeq ($(PLATFORM),) PLATFORM := $(DEVICE) endif ifeq ($(PLATFORM),) -PLATFORM := xilinx_u280_xdma_201920_3 +PLATFORM := xilinx_u280_gen3x16_xdma_1_202120_1 endif # #################### Checking if PLATFORM in whitelist ############################ @@ -87,12 +93,17 @@ RUN_DEPS := # get global setting ifeq ($(HOST_ARCH), x86) CXXFLAGS += -fmessage-length=0 -I$(CUR_DIR)/src/ -I$(XILINX_XRT)/include -I$(XILINX_HLS)/include -std=c++14 -O3 -Wall -Wno-unknown-pragmas -Wno-unused-label -LDFLAGS += -pthread -L$(XILINX_XRT)/lib -L$(XILINX_HLS)/lnx64/tools/fpo_v7_0 -Wl,--as-needed -lOpenCL -lxrt_coreutil -lgmp -lmpfr -lIp_floating_point_v7_0_bitacc_cmodel +LDFLAGS += -pthread -L$(XILINX_XRT)/lib -L$(XILINX_HLS)/lnx64/tools/fpo_v7_1 -Wl,--as-needed -lOpenCL -lxrt_coreutil -lgmp -lmpfr -lIp_floating_point_v7_1_bitacc_cmodel VPP_FLAGS += -t $(TARGET) --platform $(XPLATFORM) --save-temps VPP_LDFLAGS += --optimize 2 -R 2 else ifeq ($(HOST_ARCH), aarch64) +ifeq ($(ps_on_x86), on) +CXXFLAGS += -fmessage-length=0 -I$(CUR_DIR)/src/ -I$(XILINX_XRT)/include -I$(XILINX_HLS)/include -std=c++14 -O3 -Wall -Wno-unknown-pragmas -Wno-unused-label +LDFLAGS += -pthread -L$(XILINX_XRT)/lib -L$(XILINX_HLS)/lnx64/tools/fpo_v7_1 -Wl,--as-needed -lOpenCL -lxrt_coreutil -lgmp -lmpfr -lIp_floating_point_v7_1_bitacc_cmodel +else CXXFLAGS += -I$(CUR_DIR)/src/ -fmessage-length=0 --sysroot=$(SYSROOT) -I$(SYSROOT)/usr/include/xrt -I$(XILINX_HLS)/include -std=c++14 -O3 -Wall -Wno-unknown-pragmas -Wno-unused-label -LDFLAGS += -pthread -L$(SYSROOT)/usr/lib -L$(XILINX_VITIS_AIETOOLS)/lib/aarch64.o -Wl,--as-needed -lxilinxopencl -lxrt_coreutil +LDFLAGS += -pthread -L$(SYSROOT)/usr/lib -Wl,--as-needed -lxilinxopencl -lxrt_coreutil +endif VPP_FLAGS += -t $(TARGET) --platform $(XPLATFORM) --save-temps VPP_LDFLAGS += --optimize 2 -R 2 endif @@ -107,15 +118,23 @@ ifeq ($(TARGET),hw_emu) CXXFLAGS += -D HW_EMU_TEST endif -ifeq (,$(findstring opencv,$(CXXFLAGS))) -CXXFLAGS += $(XRT_CXXFLAGS) -endif - #Inclue Required Host Source Files +ifeq ($(ps_on_x86), on) HOST_SRCS += $(XFLIB_DIR)/L2/src/sw/cgSolver/test_cgSolver_gemv_jacobi.cpp $(XFLIB_DIR)/../blas/L2/src/xcl2/xcl2.cpp CXXFLAGS += -D HW_CLK=3e-9 -D CG_numTasks=1 -D CG_dataType=double -D CG_numChannels=8 -D CG_parEntries=4 -D CG_instrBytes=64 CXXFLAGS += -I $(XFLIB_DIR)/L1/include/ -I $(XFLIB_DIR)/L2/include/sw/cgSolver -I $(XFLIB_DIR)/L2/include/sw/ -I $(XFLIB_DIR)/L2/include/common/cgSolver -I $(XFLIB_DIR)/../blas/L1/tests/sw/include/ -I $(XFLIB_DIR)/../blas/L2/include/xcl2 CXXFLAGS += -O3 +else +HOST_SRCS += $(XFLIB_DIR)/L2/src/sw/cgSolver/test_cgSolver_gemv_jacobi.cpp $(XFLIB_DIR)/../blas/L2/src/xcl2/xcl2.cpp +CXXFLAGS += -D HW_CLK=3e-9 -D CG_numTasks=1 -D CG_dataType=double -D CG_numChannels=8 -D CG_parEntries=4 -D CG_instrBytes=64 +CXXFLAGS += -I $(XFLIB_DIR)/L1/include/ -I $(XFLIB_DIR)/L2/include/sw/cgSolver -I $(XFLIB_DIR)/L2/include/sw/ -I $(XFLIB_DIR)/L2/include/common/cgSolver -I $(XFLIB_DIR)/../blas/L1/tests/sw/include/ -I $(XFLIB_DIR)/../blas/L2/include/xcl2 +CXXFLAGS += -O3 +endif + +# workaround for opencv +ifeq (,$(findstring opencv,$(CXXFLAGS))) +CXXFLAGS += $(XRT_CXXFLAGS) +endif EXE_NAME := host.exe EXE_FILE := $(BUILD_DIR)/$(EXE_NAME) @@ -258,11 +277,6 @@ $(EMCONFIG): emconfigutil --platform $(XPLATFORM) --od $(BUILD_DIR) ############################## Preparing sdcard folder ############################## ifneq ($(HOST_ARCH), x86) -ifneq (,$(findstring zc706, $(PLATFORM_NAME))) -K_IMAGE := $(SYSROOT)/../../uImage -else -K_IMAGE := $(SYSROOT)/../../Image -endif RUN_SCRIPT := $(BUILD_DIR)/run_script.sh $(RUN_SCRIPT): rm -rf $(RUN_SCRIPT) @@ -278,7 +292,7 @@ endif @echo './$(EXE_NAME) $(PKG_HOST_ARGS)' >> $(RUN_SCRIPT) @echo 'return_code=$$?' >> $(RUN_SCRIPT) @echo 'if [ $$return_code -ne 0 ]; then' >> $(RUN_SCRIPT) - @echo ' echo "ERROR: Embedded host run failed, RC=$$return_code"' >> $(RUN_SCRIPT) + @echo ' echo "ERROR: TEST FAILED, RC=$$return_code"' >> $(RUN_SCRIPT) @echo 'else' >> $(RUN_SCRIPT) @echo ' echo "INFO: TEST PASSED, RC=0"' >> $(RUN_SCRIPT) @echo 'fi' >> $(RUN_SCRIPT) @@ -296,23 +310,28 @@ SD_DIRS_WITH_PREFIX = $(foreach sd_dir,$(DATA_DIR),--package.sd_dir $(sd_dir)) PACKAGE_FILES := $(BINARY_CONTAINERS) PACKAGE_FILES += $(AIE_CONTAINER) SD_CARD := $(CUR_DIR)/package_$(TARGET) -vck190_dfx_hw := false -$(SD_CARD): $(EXE_FILE) $(BINARY_CONTAINERS) $(RUN_SCRIPT) $(EMCONFIG) +$(SD_CARD): $(EXE_FILE) $(BINARY_CONTAINERS) $(RUN_SCRIPT) $(EMCONFIG) check_kimage check_rootfs @echo "Generating sd_card folder...." mkdir -p $(SD_CARD) chmod a+rx $(BUILD_DIR)/run_script.sh -ifneq (,$(findstring vck190_base_dfx, $(PLATFORM_NAME))) -ifeq ($(TARGET),hw) - $(VPP) -t $(TARGET) --platform $(XPLATFORM) -p $(PACKAGE_FILES) -o $(BINARY_CONTAINERS_PKG) - $(VPP) -t $(TARGET) --platform $(XPLATFORM) -p --package.out_dir $(SD_CARD) --package.rootfs $(SYSROOT)/../../rootfs.ext4 --package.kernel_image $(K_IMAGE) $(SD_FILES_WITH_PREFIX) $(SD_DIRS_WITH_PREFIX) --package.sd_file $(BINARY_CONTAINERS_PKG) +# 1. DFX HW Flow +ifeq ($(dfx_hw), on) + $(VPP) -t $(TARGET) --platform $(XPLATFORM) -p $(PACKAGE_FILES) $(VPP_PACKAGE) -o $(BINARY_CONTAINERS_PKG) + $(VPP) -t $(TARGET) --platform $(XPLATFORM) -p --package.out_dir $(SD_CARD) --package.rootfs $(ROOTFS) --package.kernel_image $(K_IMAGE) $(SD_FILES_WITH_PREFIX) $(SD_DIRS_WITH_PREFIX) --package.sd_file $(BINARY_CONTAINERS_PKG) @echo "### ***** sd_card generation done! ***** ###" -vck190_dfx_hw := true endif +# 2. PS_ON_X86 - From 2022.2, Target:sw_emu +ifeq ($(ps_on_x86), on) + @echo "### ***** running PS X86 SE_EMU ***** ###" + $(VPP) -t $(TARGET) --platform $(XPLATFORM) -o $(BINARY_CONTAINERS_PKG) -p $(PACKAGE_FILES) $(VPP_PACKAGE) --package.out_dir $(SD_CARD) --package.emu_ps x86 endif -ifeq ($(vck190_dfx_hw), false) - $(VPP) -t $(TARGET) --platform $(XPLATFORM) -o $(BINARY_CONTAINERS_PKG) -p $(PACKAGE_FILES) $(VPP_PACKAGE) --package.out_dir $(SD_CARD) --package.rootfs $(SYSROOT)/../../rootfs.ext4 --package.kernel_image $(K_IMAGE) $(SD_FILES_WITH_PREFIX) $(SD_DIRS_WITH_PREFIX) +#3. General Embeded flow +ifeq ($(dfx_hw), off) +ifeq ($(ps_on_x86), off) + $(VPP) -t $(TARGET) --platform $(XPLATFORM) -o $(BINARY_CONTAINERS_PKG) -p $(PACKAGE_FILES) $(VPP_PACKAGE) --package.out_dir $(SD_CARD) --package.rootfs $(ROOTFS) --package.kernel_image $(K_IMAGE) $(SD_FILES_WITH_PREFIX) $(SD_DIRS_WITH_PREFIX) @echo "### ***** sd_card generation done! ***** ###" endif +endif .PHONY: sd_card sd_card: $(SD_CARD) @@ -336,7 +355,7 @@ ifeq ($(HOST_ARCH), x86) else @echo $(RUN_DEPS) - $(SD_CARD)/launch_$(TARGET).sh -no-reboot -run-app $(notdir $(RUN_SCRIPT)) + $(SD_CARD)/launch_$(TARGET).sh -no-reboot -run-app $(notdir $(RUN_SCRIPT)) 2>&1 | tee $(SD_CARD)/qemu_output.log grep "TEST PASSED, RC=0" $(SD_CARD)/qemu_output.log || exit 1 endif @@ -347,24 +366,32 @@ ifeq ($(HOST_ARCH), x86) LD_LIBRARY_PATH=$(LIBRARY_PATH):$$LD_LIBRARY_PATH \ XCL_EMULATION_MODE=$(TARGET) $(EXE_FILE) $(HOST_ARGS) +else +ifeq ($(ps_on_x86), on) + LD_LIBRARY_PATH=$(LIBRARY_PATH):$$LD_LIBRARY_PATH \ + XCL_EMULATION_MODE=$(TARGET) $(EXE_FILE) $(HOST_ARGS) + else @echo $(RUN_DEPS) - $(SD_CARD)/launch_$(TARGET).sh -no-reboot -run-app $(notdir $(RUN_SCRIPT)) + $(SD_CARD)/launch_$(TARGET).sh -no-reboot -run-app $(notdir $(RUN_SCRIPT)) 2>&1 | tee $(SD_CARD)/qemu_output.log grep "TEST PASSED, RC=0" $(SD_CARD)/qemu_output.log || exit 1 +endif endif endif #hw ifeq ($(TARGET), hw) ifneq (,$(findstring aws-vu9p-f1, $(PLATFORM_NAME))) -ifneq ($(JENKINS_INTERNAL_BUILD), 1) +ifeq (,$(wildcard $(BUILD_DIR)/cgSolver.awsxclbin)) $(ECHO) "This makefile does not directly support converting .xclbin to .awsxclbin, please refer https://github.com/aws/aws-fpga/blob/master/Vitis/README.md for next operations" else - $(ECHO) "Running inside Xilinx regression without converting to .awsxclbin" - $(EXE_FILE) $(HOST_ARGS) + $(ECHO) "Running HW using generated .awsxclbin" + LD_LIBRARY_PATH=$(LIBRARY_PATH):$$LD_LIBRARY_PATH \ + $(EXE_FILE) $(subst .xclbin,.awsxclbin,$(HOST_ARGS)) endif else ifeq ($(HOST_ARCH), x86) + LD_LIBRARY_PATH=$(LIBRARY_PATH):$$LD_LIBRARY_PATH \ $(EXE_FILE) $(HOST_ARGS) else @@ -398,12 +425,11 @@ cleanh: cleank: -$(RMDIR) $(BUILD_DIR)/*.xclbin _vimage *xclbin.run_summary qemu-memory-_* emulation/ _vimage/ pl*start_simulation. sh *.xclbin - -$(RMDIR) _x_temp.*/_x.* _x_temp.*/.Xil _x_temp.*/profile_summary.* xo_* _x* - -$(RMDIR) _x_temp.*/dltmp* _x_temp.*/kernel_info.dat _x_temp.*/*.log - -$(RMDIR) _x_temp.* + -$(RMDIR) _x_temp.* cleanall: cleanh cleank -$(RMDIR) $(BUILD_DIR) emconfig.json *.html $(TEMP_DIR) $(CUR_DIR)/reports *.csv *.run_summary $(CUR_DIR)/*.raw package_* $(BUILD_DIR)/run_script.sh .ipcache *.str -$(RMDIR) $(CUR_DIR)/Work $(CUR_DIR)/*.xpe $(CUR_DIR)/hw.o $(CUR_DIR)/*.xsa $(CUR_DIR)/xnwOut + -$(RMDIR) clean: cleanh \ No newline at end of file diff --git a/hpc/L2/tests/cgSolver/krnl_cgSolver_gemv_jacobi_8ch/description.json b/hpc/L2/tests/cgSolver/krnl_cgSolver_gemv_jacobi_8ch/description.json index af5a84de36..338cefbc54 100644 --- a/hpc/L2/tests/cgSolver/krnl_cgSolver_gemv_jacobi_8ch/description.json +++ b/hpc/L2/tests/cgSolver/krnl_cgSolver_gemv_jacobi_8ch/description.json @@ -43,11 +43,6 @@ ] } }, - "pre_launch": [ - { - "launch_cmd": "make data_gen" - } - ], "launch": [ { "name": "generic launch for all flows", diff --git a/hpc/L2/tests/cgSolver/krnl_cgSolver_gemv_jacobi_8ch/tests/Makefile b/hpc/L2/tests/cgSolver/krnl_cgSolver_gemv_jacobi_8ch/tests/Makefile index 05b8acd2be..9c5286fea2 100644 --- a/hpc/L2/tests/cgSolver/krnl_cgSolver_gemv_jacobi_8ch/tests/Makefile +++ b/hpc/L2/tests/cgSolver/krnl_cgSolver_gemv_jacobi_8ch/tests/Makefile @@ -11,7 +11,7 @@ # 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. -# vitis makefile-generator v2.0.6 +# vitis makefile-generator v2.0.7 ############################## Help Section ############################## .PHONY: help @@ -34,9 +34,15 @@ help:: $(ECHO) " Command to build host application." $(ECHO) " By default, HOST_ARCH=x86. HOST_ARCH is required for SoC shells" $(ECHO) "" - $(ECHO) " NOTE: For embedded devices, e.g. zcu102/zcu104/vck190, env variable SYSROOT and EDGE_COMMON_SW need to be set first, and HOST_ARCH is either aarch32 or aarch64. For example," - $(ECHO) " export SYSROOT=< path-to-platform-sysroot >" - $(ECHO) " export EDGE_COMMON_SW=< path-to-rootfs-and-Image-files >" + $(ECHO) " NOTE: For embedded devices, e.g. zcu102/zcu104/vck190, HOST_ARCH is either aarch32 or aarch64." + $(ECHO) " a.IF Download the platform, and common-image from Xilinx Download Center(Suggested):" + $(ECHO) " Run the sdk.sh script from the common-image directory to install sysroot using the command : ./sdk.sh -y -d ./ -p " + $(ECHO) " Unzip the rootfs file : gunzip ./rootfs.ext4.gz" + $(ECHO) " export SYSROOT=< path-to-platform-sysroot >" + $(ECHO) " b. User could also define SYSROOT, K_IMAGE and ROOTFS by themselves: " + $(ECHO) " export SYSROOT=< path-to-platform-sysroot >" + $(ECHO) " export K_IMAGE=< path-to-Image-files >" + $(ECHO) " export ROOTFS=< path-to-rootfs >" $(ECHO) "" $(ECHO) " make clean " $(ECHO) " Command to remove the generated non-hardware files." @@ -61,7 +67,7 @@ ifeq ($(PLATFORM),) PLATFORM := $(DEVICE) endif ifeq ($(PLATFORM),) -PLATFORM := xilinx_u280_xdma_201920_3 +PLATFORM := xilinx_u280_gen3x16_xdma_1_202120_1 endif # #################### Checking if PLATFORM in whitelist ############################ @@ -87,12 +93,17 @@ RUN_DEPS := # get global setting ifeq ($(HOST_ARCH), x86) CXXFLAGS += -fmessage-length=0 -I$(CUR_DIR)/src/ -I$(XILINX_XRT)/include -I$(XILINX_HLS)/include -std=c++14 -O3 -Wall -Wno-unknown-pragmas -Wno-unused-label -LDFLAGS += -pthread -L$(XILINX_XRT)/lib -L$(XILINX_HLS)/lnx64/tools/fpo_v7_0 -Wl,--as-needed -lOpenCL -lxrt_coreutil -lgmp -lmpfr -lIp_floating_point_v7_0_bitacc_cmodel +LDFLAGS += -pthread -L$(XILINX_XRT)/lib -L$(XILINX_HLS)/lnx64/tools/fpo_v7_1 -Wl,--as-needed -lOpenCL -lxrt_coreutil -lgmp -lmpfr -lIp_floating_point_v7_1_bitacc_cmodel VPP_FLAGS += -t $(TARGET) --platform $(XPLATFORM) --save-temps VPP_LDFLAGS += --optimize 2 -R 2 else ifeq ($(HOST_ARCH), aarch64) +ifeq ($(ps_on_x86), true) +CXXFLAGS += -fmessage-length=0 -I$(CUR_DIR)/src/ -I$(XILINX_XRT)/include -I$(XILINX_HLS)/include -std=c++14 -O3 -Wall -Wno-unknown-pragmas -Wno-unused-label +LDFLAGS += -pthread -L$(XILINX_XRT)/lib -L$(XILINX_HLS)/lnx64/tools/fpo_v7_1 -Wl,--as-needed -lOpenCL -lxrt_coreutil -lgmp -lmpfr -lIp_floating_point_v7_1_bitacc_cmodel +else CXXFLAGS += -I$(CUR_DIR)/src/ -fmessage-length=0 --sysroot=$(SYSROOT) -I$(SYSROOT)/usr/include/xrt -I$(XILINX_HLS)/include -std=c++14 -O3 -Wall -Wno-unknown-pragmas -Wno-unused-label -LDFLAGS += -pthread -L$(SYSROOT)/usr/lib -L$(XILINX_VITIS_AIETOOLS)/lib/aarch64.o -Wl,--as-needed -lxilinxopencl -lxrt_coreutil +LDFLAGS += -pthread -L$(SYSROOT)/usr/lib -Wl,--as-needed -lxilinxopencl -lxrt_coreutil +endif VPP_FLAGS += -t $(TARGET) --platform $(XPLATFORM) --save-temps VPP_LDFLAGS += --optimize 2 -R 2 endif @@ -107,15 +118,23 @@ ifeq ($(TARGET),hw_emu) CXXFLAGS += -D HW_EMU_TEST endif -ifeq (,$(findstring opencv,$(CXXFLAGS))) -CXXFLAGS += $(XRT_CXXFLAGS) -endif - #Inclue Required Host Source Files +ifeq ($(ps_on_x86), true) HOST_SRCS += $(XFLIB_DIR)/L2/src/sw/cgSolver/test_cgSolver_gemv_jacobi.cpp $(XFLIB_DIR)/../blas/L2/src/xcl2/xcl2.cpp CXXFLAGS += -D HW_CLK=3e-9 -D CG_numTasks=1 -D CG_dataType=double -D CG_numChannels=8 -D CG_parEntries=4 -D CG_instrBytes=64 CXXFLAGS += -I $(XFLIB_DIR)/L1/include/ -I $(XFLIB_DIR)/L2/include/sw/cgSolver -I $(XFLIB_DIR)/L2/include/sw/ -I $(XFLIB_DIR)/L2/include/common/cgSolver -I $(XFLIB_DIR)/../blas/L1/tests/sw/include/ -I $(XFLIB_DIR)/../blas/L2/include/xcl2 CXXFLAGS += -O3 +else +HOST_SRCS += $(XFLIB_DIR)/L2/src/sw/cgSolver/test_cgSolver_gemv_jacobi.cpp $(XFLIB_DIR)/../blas/L2/src/xcl2/xcl2.cpp +CXXFLAGS += -D HW_CLK=3e-9 -D CG_numTasks=1 -D CG_dataType=double -D CG_numChannels=8 -D CG_parEntries=4 -D CG_instrBytes=64 +CXXFLAGS += -I $(XFLIB_DIR)/L1/include/ -I $(XFLIB_DIR)/L2/include/sw/cgSolver -I $(XFLIB_DIR)/L2/include/sw/ -I $(XFLIB_DIR)/L2/include/common/cgSolver -I $(XFLIB_DIR)/../blas/L1/tests/sw/include/ -I $(XFLIB_DIR)/../blas/L2/include/xcl2 +CXXFLAGS += -O3 +endif + +# workaround for opencv +ifeq (,$(findstring opencv,$(CXXFLAGS))) +CXXFLAGS += $(XRT_CXXFLAGS) +endif EXE_NAME := host.exe EXE_FILE := $(BUILD_DIR)/$(EXE_NAME) @@ -258,11 +277,6 @@ $(EMCONFIG): emconfigutil --platform $(XPLATFORM) --od $(BUILD_DIR) ############################## Preparing sdcard folder ############################## ifneq ($(HOST_ARCH), x86) -ifneq (,$(findstring zc706, $(PLATFORM_NAME))) -K_IMAGE := $(SYSROOT)/../../uImage -else -K_IMAGE := $(SYSROOT)/../../Image -endif RUN_SCRIPT := $(BUILD_DIR)/run_script.sh $(RUN_SCRIPT): rm -rf $(RUN_SCRIPT) @@ -278,7 +292,7 @@ endif @echo './$(EXE_NAME) $(PKG_HOST_ARGS)' >> $(RUN_SCRIPT) @echo 'return_code=$$?' >> $(RUN_SCRIPT) @echo 'if [ $$return_code -ne 0 ]; then' >> $(RUN_SCRIPT) - @echo ' echo "ERROR: Embedded host run failed, RC=$$return_code"' >> $(RUN_SCRIPT) + @echo ' echo "ERROR: TEST FAILED, RC=$$return_code"' >> $(RUN_SCRIPT) @echo 'else' >> $(RUN_SCRIPT) @echo ' echo "INFO: TEST PASSED, RC=0"' >> $(RUN_SCRIPT) @echo 'fi' >> $(RUN_SCRIPT) @@ -296,23 +310,28 @@ SD_DIRS_WITH_PREFIX = $(foreach sd_dir,$(DATA_DIR),--package.sd_dir $(sd_dir)) PACKAGE_FILES := $(BINARY_CONTAINERS) PACKAGE_FILES += $(AIE_CONTAINER) SD_CARD := $(CUR_DIR)/package_$(TARGET) -vck190_dfx_hw := false -$(SD_CARD): $(EXE_FILE) $(BINARY_CONTAINERS) $(RUN_SCRIPT) $(EMCONFIG) +$(SD_CARD): $(EXE_FILE) $(BINARY_CONTAINERS) $(RUN_SCRIPT) $(EMCONFIG) check_kimage check_rootfs @echo "Generating sd_card folder...." mkdir -p $(SD_CARD) chmod a+rx $(BUILD_DIR)/run_script.sh -ifneq (,$(findstring vck190_base_dfx, $(PLATFORM_NAME))) -ifeq ($(TARGET),hw) - $(VPP) -t $(TARGET) --platform $(XPLATFORM) -p $(PACKAGE_FILES) -o $(BINARY_CONTAINERS_PKG) - $(VPP) -t $(TARGET) --platform $(XPLATFORM) -p --package.out_dir $(SD_CARD) --package.rootfs $(SYSROOT)/../../rootfs.ext4 --package.kernel_image $(K_IMAGE) $(SD_FILES_WITH_PREFIX) $(SD_DIRS_WITH_PREFIX) --package.sd_file $(BINARY_CONTAINERS_PKG) +# 1. DFX HW Flow +ifeq ($(dfx_hw), true) + $(VPP) -t $(TARGET) --platform $(XPLATFORM) -p $(PACKAGE_FILES) $(VPP_PACKAGE) -o $(BINARY_CONTAINERS_PKG) + $(VPP) -t $(TARGET) --platform $(XPLATFORM) -p --package.out_dir $(SD_CARD) --package.rootfs $(ROOTFS) --package.kernel_image $(K_IMAGE) $(SD_FILES_WITH_PREFIX) $(SD_DIRS_WITH_PREFIX) --package.sd_file $(BINARY_CONTAINERS_PKG) @echo "### ***** sd_card generation done! ***** ###" -vck190_dfx_hw := true endif +# 2. PS_ON_X86 - From 2022.2, Target:sw_emu +ifeq ($(ps_on_x86), true) + @echo "### ***** running PS X86 SE_EMU ***** ###" + $(VPP) -t $(TARGET) --platform $(XPLATFORM) -o $(BINARY_CONTAINERS_PKG) -p $(PACKAGE_FILES) $(VPP_PACKAGE) --package.out_dir $(SD_CARD) --package.emu_ps x86 endif -ifeq ($(vck190_dfx_hw), false) - $(VPP) -t $(TARGET) --platform $(XPLATFORM) -o $(BINARY_CONTAINERS_PKG) -p $(PACKAGE_FILES) $(VPP_PACKAGE) --package.out_dir $(SD_CARD) --package.rootfs $(SYSROOT)/../../rootfs.ext4 --package.kernel_image $(K_IMAGE) $(SD_FILES_WITH_PREFIX) $(SD_DIRS_WITH_PREFIX) +#3. General Embeded flow +ifeq ($(dfx_hw), false) +ifeq ($(ps_on_x86), false) + $(VPP) -t $(TARGET) --platform $(XPLATFORM) -o $(BINARY_CONTAINERS_PKG) -p $(PACKAGE_FILES) $(VPP_PACKAGE) --package.out_dir $(SD_CARD) --package.rootfs $(ROOTFS) --package.kernel_image $(K_IMAGE) $(SD_FILES_WITH_PREFIX) $(SD_DIRS_WITH_PREFIX) @echo "### ***** sd_card generation done! ***** ###" endif +endif .PHONY: sd_card sd_card: $(SD_CARD) @@ -336,7 +355,7 @@ ifeq ($(HOST_ARCH), x86) else @echo $(RUN_DEPS) - $(SD_CARD)/launch_$(TARGET).sh -no-reboot -run-app $(notdir $(RUN_SCRIPT)) + $(SD_CARD)/launch_$(TARGET).sh -no-reboot -run-app $(notdir $(RUN_SCRIPT)) 2>&1 | tee $(SD_CARD)/qemu_output.log grep "TEST PASSED, RC=0" $(SD_CARD)/qemu_output.log || exit 1 endif @@ -347,24 +366,32 @@ ifeq ($(HOST_ARCH), x86) LD_LIBRARY_PATH=$(LIBRARY_PATH):$$LD_LIBRARY_PATH \ XCL_EMULATION_MODE=$(TARGET) $(EXE_FILE) $(HOST_ARGS) +else +ifeq ($(ps_on_x86), true) + LD_LIBRARY_PATH=$(LIBRARY_PATH):$$LD_LIBRARY_PATH \ + XCL_EMULATION_MODE=$(TARGET) $(EXE_FILE) $(HOST_ARGS) + else @echo $(RUN_DEPS) - $(SD_CARD)/launch_$(TARGET).sh -no-reboot -run-app $(notdir $(RUN_SCRIPT)) + $(SD_CARD)/launch_$(TARGET).sh -no-reboot -run-app $(notdir $(RUN_SCRIPT)) 2>&1 | tee $(SD_CARD)/qemu_output.log grep "TEST PASSED, RC=0" $(SD_CARD)/qemu_output.log || exit 1 +endif endif endif #hw ifeq ($(TARGET), hw) ifneq (,$(findstring aws-vu9p-f1, $(PLATFORM_NAME))) -ifneq ($(JENKINS_INTERNAL_BUILD), 1) +ifeq (,$(wildcard $(BUILD_DIR)/cgSolver.awsxclbin)) $(ECHO) "This makefile does not directly support converting .xclbin to .awsxclbin, please refer https://github.com/aws/aws-fpga/blob/master/Vitis/README.md for next operations" else - $(ECHO) "Running inside Xilinx regression without converting to .awsxclbin" - $(EXE_FILE) $(HOST_ARGS) + $(ECHO) "Running HW using generated .awsxclbin" + LD_LIBRARY_PATH=$(LIBRARY_PATH):$$LD_LIBRARY_PATH \ + $(EXE_FILE) $(subst .xclbin,.awsxclbin,$(HOST_ARGS)) endif else ifeq ($(HOST_ARCH), x86) + LD_LIBRARY_PATH=$(LIBRARY_PATH):$$LD_LIBRARY_PATH \ $(EXE_FILE) $(HOST_ARGS) else @@ -398,12 +425,11 @@ cleanh: cleank: -$(RMDIR) $(BUILD_DIR)/*.xclbin _vimage *xclbin.run_summary qemu-memory-_* emulation/ _vimage/ pl*start_simulation. sh *.xclbin - -$(RMDIR) _x_temp.*/_x.* _x_temp.*/.Xil _x_temp.*/profile_summary.* xo_* _x* - -$(RMDIR) _x_temp.*/dltmp* _x_temp.*/kernel_info.dat _x_temp.*/*.log - -$(RMDIR) _x_temp.* + -$(RMDIR) _x_temp.* cleanall: cleanh cleank -$(RMDIR) $(BUILD_DIR) emconfig.json *.html $(TEMP_DIR) $(CUR_DIR)/reports *.csv *.run_summary $(CUR_DIR)/*.raw package_* $(BUILD_DIR)/run_script.sh .ipcache *.str -$(RMDIR) $(CUR_DIR)/Work $(CUR_DIR)/*.xpe $(CUR_DIR)/hw.o $(CUR_DIR)/*.xsa $(CUR_DIR)/xnwOut + -$(RMDIR) clean: cleanh \ No newline at end of file diff --git a/hpc/L2/tests/cgSolver/krnl_cgSolver_gemv_jacobi_8ch/tests/utils.mk b/hpc/L2/tests/cgSolver/krnl_cgSolver_gemv_jacobi_8ch/tests/utils.mk index 9b889021fc..8965e30749 100644 --- a/hpc/L2/tests/cgSolver/krnl_cgSolver_gemv_jacobi_8ch/tests/utils.mk +++ b/hpc/L2/tests/cgSolver/krnl_cgSolver_gemv_jacobi_8ch/tests/utils.mk @@ -12,7 +12,7 @@ # 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. -# vitis makefile-generator v2.0.6 +# vitis makefile-generator v2.0.7 # #+------------------------------------------------------------------------------- # The following parameters are assigned with default values. These parameters can @@ -50,6 +50,7 @@ ifndef XILINX_XRT export XILINX_XRT endif +.PHONY: check_device check_device: @set -eu; \ inallowlist=False; \ @@ -82,8 +83,9 @@ endif endif -#get suffix of kernel by PLATFORM +# Special processing for tool version/platform type VITIS_VER = $(shell v++ --version | grep 'v++' | sed 's/^[[:space:]]*//' | sed -e 's/^[*]* v++ v//g' | cut -d " " -f1) +# 1) for versal flow from 2022.1 DEVICE_TYPE = $(shell platforminfo -p $(PLATFORM) | grep 'FPGA Family' | sed 's/.*://' | sed '/ai_engine/d' | sed 's/^[[:space:]]*//') ifeq ($(DEVICE_TYPE), versal) ifeq ($(shell expr $(VITIS_VER) \>= 2022.1), 1) @@ -94,6 +96,22 @@ endif else LINK_TARGET_FMT := xclbin endif +# 2) dfx flow +dfx_hw := false +ifeq ($(findstring _dfx_, $(PLATFORM_NAME)),_dfx_) +ifeq ($(TARGET),hw) +dfx_hw := true +endif +endif +# 3) for embeded sw_emu flow from 2022.2 +ps_on_x86 := false +ifneq ($(HOST_ARCH), x86) +ifeq ($(shell expr $(VITIS_VER) \>= 2022.2), 1) +ifeq ($(TARGET), sw_emu) +ps_on_x86 := true +endif +endif +endif #Checks for Device Family ifeq ($(HOST_ARCH), aarch32) @@ -107,6 +125,7 @@ ifneq ($(HOST_ARCH), $(filter $(HOST_ARCH),aarch64 aarch32 x86)) $(error HOST_ARCH variable not set, please set correctly and rerun) endif +.PHONY: check_version check_sysroot check_kimage check_rootfs check_version: ifneq (, $(shell which git)) ifneq (,$(wildcard $(XFLIB_DIR)/.git)) @@ -114,17 +133,46 @@ ifneq (,$(wildcard $(XFLIB_DIR)/.git)) endif endif -#Checks for SYSROOT +#Set/Check SYSROOT/K_IMAGE/ROOTFS +ifneq ($(HOST_ARCH), x86) +ifneq (,$(findstring zc706, $(PLATFORM_NAME))) +K_IMAGE ?= $(SYSROOT)/../../uImage +else +K_IMAGE ?= $(SYSROOT)/../../Image +endif +ROOTFS ?= $(SYSROOT)/../../rootfs.ext4 +endif + check_sysroot: ifneq ($(HOST_ARCH), x86) -ifndef SYSROOT +ifeq (,$(wildcard $(SYSROOT))) $(error SYSROOT ENV variable is not set, please set ENV variable correctly and rerun) endif endif +check_kimage: +ifneq ($(HOST_ARCH), x86) +ifeq (,$(wildcard $(K_IMAGE))) + $(error K_IMAGE ENV variable is not set, please set ENV variable correctly and rerun) +endif +endif +check_rootfs: +ifneq ($(HOST_ARCH), x86) +ifeq (,$(wildcard $(ROOTFS))) + $(error ROOTFS ENV variable is not set, please set ENV variable correctly and rerun) +endif +endif #Checks for g++ -CXX := g++ ifeq ($(HOST_ARCH), x86) +X86_CXX := true +else +ifeq ($(ps_on_x86), true) +X86_CXX := true +endif +endif + +CXX := g++ +ifeq ($(X86_CXX), true) ifeq ($(shell expr $(VITIS_VER) \>= 2022.1), 1) CXX_VER := 8.3.0 else @@ -144,11 +192,13 @@ endif $(warning [WARNING]: g++ version too old. Using g++ provided by the tool: $(CXX)) endif endif -else ifeq ($(HOST_ARCH), aarch64) +else +ifeq ($(HOST_ARCH), aarch64) CXX := $(XILINX_VITIS)/gnu/aarch64/lin/aarch64-linux/bin/aarch64-linux-gnu-g++ else ifeq ($(HOST_ARCH), aarch32) CXX := $(XILINX_VITIS)/gnu/aarch32/lin/gcc-arm-linux-gnueabi/bin/arm-linux-gnueabihf-g++ endif +endif #Check OS and setting env for xrt c++ api OSDIST = $(shell lsb_release -i |awk -F: '{print tolower($$2)}' | tr -d ' \t' ) @@ -268,9 +318,3 @@ RMDIR = rm -rf MV = mv -f CP = cp -rf ECHO:= @echo -ifneq (,$(shell echo $(XPLATFORM) | awk '/xilinx_u280_xdma_201920_3/')) -VPP_FLAGS += --advanced.param compiler.ignorePlatformCompatibilityCheck=true -ifeq ($(TARGET), hw) -VPP_LDFLAGS += --advanced.param compiler.userPreSysLinkOverlayTcl=preSysLink.tcl -endif -endif diff --git a/hpc/L2/tests/cgSolver/krnl_cgSolver_gemv_jacobi_8ch/utils.mk b/hpc/L2/tests/cgSolver/krnl_cgSolver_gemv_jacobi_8ch/utils.mk index 9b889021fc..2e9ea4d63a 100644 --- a/hpc/L2/tests/cgSolver/krnl_cgSolver_gemv_jacobi_8ch/utils.mk +++ b/hpc/L2/tests/cgSolver/krnl_cgSolver_gemv_jacobi_8ch/utils.mk @@ -12,7 +12,7 @@ # 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. -# vitis makefile-generator v2.0.6 +# vitis makefile-generator v2.0.7 # #+------------------------------------------------------------------------------- # The following parameters are assigned with default values. These parameters can @@ -50,6 +50,7 @@ ifndef XILINX_XRT export XILINX_XRT endif +.PHONY: check_device check_device: @set -eu; \ inallowlist=False; \ @@ -82,8 +83,9 @@ endif endif -#get suffix of kernel by PLATFORM +# Special processing for tool version/platform type VITIS_VER = $(shell v++ --version | grep 'v++' | sed 's/^[[:space:]]*//' | sed -e 's/^[*]* v++ v//g' | cut -d " " -f1) +# 1) for versal flow from 2022.1 DEVICE_TYPE = $(shell platforminfo -p $(PLATFORM) | grep 'FPGA Family' | sed 's/.*://' | sed '/ai_engine/d' | sed 's/^[[:space:]]*//') ifeq ($(DEVICE_TYPE), versal) ifeq ($(shell expr $(VITIS_VER) \>= 2022.1), 1) @@ -94,6 +96,22 @@ endif else LINK_TARGET_FMT := xclbin endif +# 2) dfx flow +dfx_hw := off +ifeq ($(findstring _dfx_, $(PLATFORM_NAME)),_dfx_) +ifeq ($(TARGET),hw) +dfx_hw := on +endif +endif +# 3) for embeded sw_emu flow from 2022.2 +ps_on_x86 := off +ifneq ($(HOST_ARCH), x86) +ifeq ($(shell expr $(VITIS_VER) \>= 2022.2), 1) +ifeq ($(TARGET), sw_emu) +ps_on_x86 := on +endif +endif +endif #Checks for Device Family ifeq ($(HOST_ARCH), aarch32) @@ -107,6 +125,7 @@ ifneq ($(HOST_ARCH), $(filter $(HOST_ARCH),aarch64 aarch32 x86)) $(error HOST_ARCH variable not set, please set correctly and rerun) endif +.PHONY: check_version check_sysroot check_kimage check_rootfs check_version: ifneq (, $(shell which git)) ifneq (,$(wildcard $(XFLIB_DIR)/.git)) @@ -114,17 +133,46 @@ ifneq (,$(wildcard $(XFLIB_DIR)/.git)) endif endif -#Checks for SYSROOT +#Set/Check SYSROOT/K_IMAGE/ROOTFS +ifneq ($(HOST_ARCH), x86) +ifneq (,$(findstring zc706, $(PLATFORM_NAME))) +K_IMAGE ?= $(SYSROOT)/../../uImage +else +K_IMAGE ?= $(SYSROOT)/../../Image +endif +ROOTFS ?= $(SYSROOT)/../../rootfs.ext4 +endif + check_sysroot: ifneq ($(HOST_ARCH), x86) -ifndef SYSROOT +ifeq (,$(wildcard $(SYSROOT))) $(error SYSROOT ENV variable is not set, please set ENV variable correctly and rerun) endif endif +check_kimage: +ifneq ($(HOST_ARCH), x86) +ifeq (,$(wildcard $(K_IMAGE))) + $(error K_IMAGE ENV variable is not set, please set ENV variable correctly and rerun) +endif +endif +check_rootfs: +ifneq ($(HOST_ARCH), x86) +ifeq (,$(wildcard $(ROOTFS))) + $(error ROOTFS ENV variable is not set, please set ENV variable correctly and rerun) +endif +endif #Checks for g++ -CXX := g++ ifeq ($(HOST_ARCH), x86) +X86_CXX := true +else +ifeq ($(ps_on_x86), true) +X86_CXX := true +endif +endif + +CXX := g++ +ifeq ($(X86_CXX), true) ifeq ($(shell expr $(VITIS_VER) \>= 2022.1), 1) CXX_VER := 8.3.0 else @@ -144,11 +192,13 @@ endif $(warning [WARNING]: g++ version too old. Using g++ provided by the tool: $(CXX)) endif endif -else ifeq ($(HOST_ARCH), aarch64) +else +ifeq ($(HOST_ARCH), aarch64) CXX := $(XILINX_VITIS)/gnu/aarch64/lin/aarch64-linux/bin/aarch64-linux-gnu-g++ else ifeq ($(HOST_ARCH), aarch32) CXX := $(XILINX_VITIS)/gnu/aarch32/lin/gcc-arm-linux-gnueabi/bin/arm-linux-gnueabihf-g++ endif +endif #Check OS and setting env for xrt c++ api OSDIST = $(shell lsb_release -i |awk -F: '{print tolower($$2)}' | tr -d ' \t' ) @@ -268,9 +318,3 @@ RMDIR = rm -rf MV = mv -f CP = cp -rf ECHO:= @echo -ifneq (,$(shell echo $(XPLATFORM) | awk '/xilinx_u280_xdma_201920_3/')) -VPP_FLAGS += --advanced.param compiler.ignorePlatformCompatibilityCheck=true -ifeq ($(TARGET), hw) -VPP_LDFLAGS += --advanced.param compiler.userPreSysLinkOverlayTcl=preSysLink.tcl -endif -endif diff --git a/hpc/L2/tests/cgSolver/krnl_cgSolver_spmv_jacobi_16ch/Makefile b/hpc/L2/tests/cgSolver/krnl_cgSolver_spmv_jacobi_16ch/Makefile index b8683b3de5..85d5da7253 100644 --- a/hpc/L2/tests/cgSolver/krnl_cgSolver_spmv_jacobi_16ch/Makefile +++ b/hpc/L2/tests/cgSolver/krnl_cgSolver_spmv_jacobi_16ch/Makefile @@ -11,7 +11,7 @@ # 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. -# vitis makefile-generator v2.0.6 +# vitis makefile-generator v2.0.7 ############################## Help Section ############################## .PHONY: help @@ -34,9 +34,15 @@ help:: $(ECHO) " Command to build host application." $(ECHO) " By default, HOST_ARCH=x86. HOST_ARCH is required for SoC shells" $(ECHO) "" - $(ECHO) " NOTE: For embedded devices, e.g. zcu102/zcu104/vck190, env variable SYSROOT and EDGE_COMMON_SW need to be set first, and HOST_ARCH is either aarch32 or aarch64. For example," - $(ECHO) " export SYSROOT=< path-to-platform-sysroot >" - $(ECHO) " export EDGE_COMMON_SW=< path-to-rootfs-and-Image-files >" + $(ECHO) " NOTE: For embedded devices, e.g. zcu102/zcu104/vck190, HOST_ARCH is either aarch32 or aarch64." + $(ECHO) " a.IF Download the platform, and common-image from Xilinx Download Center(Suggested):" + $(ECHO) " Run the sdk.sh script from the common-image directory to install sysroot using the command : ./sdk.sh -y -d ./ -p " + $(ECHO) " Unzip the rootfs file : gunzip ./rootfs.ext4.gz" + $(ECHO) " export SYSROOT=< path-to-platform-sysroot >" + $(ECHO) " b. User could also define SYSROOT, K_IMAGE and ROOTFS by themselves: " + $(ECHO) " export SYSROOT=< path-to-platform-sysroot >" + $(ECHO) " export K_IMAGE=< path-to-Image-files >" + $(ECHO) " export ROOTFS=< path-to-rootfs >" $(ECHO) "" $(ECHO) " make clean " $(ECHO) " Command to remove the generated non-hardware files." @@ -61,7 +67,7 @@ ifeq ($(PLATFORM),) PLATFORM := $(DEVICE) endif ifeq ($(PLATFORM),) -PLATFORM := xilinx_u280_xdma_201920_3 +PLATFORM := xilinx_u280_gen3x16_xdma_1_202120_1 endif # #################### Checking if PLATFORM in whitelist ############################ @@ -87,12 +93,17 @@ RUN_DEPS := # get global setting ifeq ($(HOST_ARCH), x86) CXXFLAGS += -fmessage-length=0 -I$(CUR_DIR)/src/ -I$(XILINX_XRT)/include -I$(XILINX_HLS)/include -std=c++14 -O3 -Wall -Wno-unknown-pragmas -Wno-unused-label -LDFLAGS += -pthread -L$(XILINX_XRT)/lib -L$(XILINX_HLS)/lnx64/tools/fpo_v7_0 -Wl,--as-needed -lOpenCL -lxrt_coreutil -lgmp -lmpfr -lIp_floating_point_v7_0_bitacc_cmodel +LDFLAGS += -pthread -L$(XILINX_XRT)/lib -L$(XILINX_HLS)/lnx64/tools/fpo_v7_1 -Wl,--as-needed -lOpenCL -lxrt_coreutil -lgmp -lmpfr -lIp_floating_point_v7_1_bitacc_cmodel VPP_FLAGS += -t $(TARGET) --platform $(XPLATFORM) --save-temps VPP_LDFLAGS += --optimize 2 -R 2 else ifeq ($(HOST_ARCH), aarch64) +ifeq ($(ps_on_x86), true) +CXXFLAGS += -fmessage-length=0 -I$(CUR_DIR)/src/ -I$(XILINX_XRT)/include -I$(XILINX_HLS)/include -std=c++14 -O3 -Wall -Wno-unknown-pragmas -Wno-unused-label +LDFLAGS += -pthread -L$(XILINX_XRT)/lib -L$(XILINX_HLS)/lnx64/tools/fpo_v7_1 -Wl,--as-needed -lOpenCL -lxrt_coreutil -lgmp -lmpfr -lIp_floating_point_v7_1_bitacc_cmodel +else CXXFLAGS += -I$(CUR_DIR)/src/ -fmessage-length=0 --sysroot=$(SYSROOT) -I$(SYSROOT)/usr/include/xrt -I$(XILINX_HLS)/include -std=c++14 -O3 -Wall -Wno-unknown-pragmas -Wno-unused-label -LDFLAGS += -pthread -L$(SYSROOT)/usr/lib -L$(XILINX_VITIS_AIETOOLS)/lib/aarch64.o -Wl,--as-needed -lxilinxopencl -lxrt_coreutil +LDFLAGS += -pthread -L$(SYSROOT)/usr/lib -Wl,--as-needed -lxilinxopencl -lxrt_coreutil +endif VPP_FLAGS += -t $(TARGET) --platform $(XPLATFORM) --save-temps VPP_LDFLAGS += --optimize 2 -R 2 endif @@ -107,15 +118,23 @@ ifeq ($(TARGET),hw_emu) CXXFLAGS += -D HW_EMU_TEST endif -ifeq (,$(findstring opencv,$(CXXFLAGS))) -CXXFLAGS += $(XRT_CXXFLAGS) -endif - #Inclue Required Host Source Files +ifeq ($(ps_on_x86), true) HOST_SRCS += $(XFLIB_DIR)/L2/src/sw/cgSolver/test_cgSolver_spmv_jacobi.cpp $(XFLIB_DIR)/../blas/L2/src/xcl2/xcl2.cpp CXXFLAGS += -D HW_CLK=4e-9 -D CG_numTasks=1 -D CG_dataType=double -D CG_numChannels=16 -D CG_parEntries=4 -D CG_instrBytes=64 -D SPARSE_dataType=double -D SPARSE_indexType=uint16_t -D SPARSE_parEntries=4 -D SPARSE_hbmChannels=16 -D SPARSE_hbmMemBits=256 CXXFLAGS += -I $(XFLIB_DIR)/L1/include/ -I $(XFLIB_DIR)/L2/include/sw/cgSolver -I $(XFLIB_DIR)/L2/include/common/cgSolver -I $(XFLIB_DIR)/L2/include/sw/ -I $(XFLIB_DIR)/../blas/L1/tests/sw/include/ -I $(XFLIB_DIR)/../blas/L2/include/xcl2 -I $(XFLIB_DIR)/../sparse/L2/include/sw/fp64 -I $(XFLIB_DIR)/.. CXXFLAGS += -g -O0 +else +HOST_SRCS += $(XFLIB_DIR)/L2/src/sw/cgSolver/test_cgSolver_spmv_jacobi.cpp $(XFLIB_DIR)/../blas/L2/src/xcl2/xcl2.cpp +CXXFLAGS += -D HW_CLK=4e-9 -D CG_numTasks=1 -D CG_dataType=double -D CG_numChannels=16 -D CG_parEntries=4 -D CG_instrBytes=64 -D SPARSE_dataType=double -D SPARSE_indexType=uint16_t -D SPARSE_parEntries=4 -D SPARSE_hbmChannels=16 -D SPARSE_hbmMemBits=256 +CXXFLAGS += -I $(XFLIB_DIR)/L1/include/ -I $(XFLIB_DIR)/L2/include/sw/cgSolver -I $(XFLIB_DIR)/L2/include/common/cgSolver -I $(XFLIB_DIR)/L2/include/sw/ -I $(XFLIB_DIR)/../blas/L1/tests/sw/include/ -I $(XFLIB_DIR)/../blas/L2/include/xcl2 -I $(XFLIB_DIR)/../sparse/L2/include/sw/fp64 -I $(XFLIB_DIR)/.. +CXXFLAGS += -g -O0 +endif + +# workaround for opencv +ifeq (,$(findstring opencv,$(CXXFLAGS))) +CXXFLAGS += $(XRT_CXXFLAGS) +endif EXE_NAME := host.exe EXE_FILE := $(BUILD_DIR)/$(EXE_NAME) @@ -157,7 +176,7 @@ VPP_FLAGS_selMultXkernel += --hls.clock 333000000:selMultXkernel VPP_FLAGS_rowAccKernel += --hls.clock 333000000:rowAccKernel VPP_FLAGS_assembleYkernel += --hls.clock 333000000:assembleYkernel ifneq ($(HOST_ARCH), x86) -VPP_LDFLAGS_cgSolver += --clock.defaultFreqHz 333000000 +VPP_LDFLAGS_cgSolver += --clock.defaultFreqHz 300000000 else VPP_LDFLAGS_cgSolver += --kernel_frequency 300 endif @@ -295,11 +314,6 @@ $(EMCONFIG): emconfigutil --platform $(XPLATFORM) --od $(BUILD_DIR) ############################## Preparing sdcard folder ############################## ifneq ($(HOST_ARCH), x86) -ifneq (,$(findstring zc706, $(PLATFORM_NAME))) -K_IMAGE := $(SYSROOT)/../../uImage -else -K_IMAGE := $(SYSROOT)/../../Image -endif RUN_SCRIPT := $(BUILD_DIR)/run_script.sh $(RUN_SCRIPT): rm -rf $(RUN_SCRIPT) @@ -315,7 +329,7 @@ endif @echo './$(EXE_NAME) $(PKG_HOST_ARGS)' >> $(RUN_SCRIPT) @echo 'return_code=$$?' >> $(RUN_SCRIPT) @echo 'if [ $$return_code -ne 0 ]; then' >> $(RUN_SCRIPT) - @echo ' echo "ERROR: Embedded host run failed, RC=$$return_code"' >> $(RUN_SCRIPT) + @echo ' echo "ERROR: TEST FAILED, RC=$$return_code"' >> $(RUN_SCRIPT) @echo 'else' >> $(RUN_SCRIPT) @echo ' echo "INFO: TEST PASSED, RC=0"' >> $(RUN_SCRIPT) @echo 'fi' >> $(RUN_SCRIPT) @@ -333,23 +347,28 @@ SD_DIRS_WITH_PREFIX = $(foreach sd_dir,$(DATA_DIR),--package.sd_dir $(sd_dir)) PACKAGE_FILES := $(BINARY_CONTAINERS) PACKAGE_FILES += $(AIE_CONTAINER) SD_CARD := $(CUR_DIR)/package_$(TARGET) -vck190_dfx_hw := false -$(SD_CARD): $(EXE_FILE) $(BINARY_CONTAINERS) $(RUN_SCRIPT) $(EMCONFIG) +$(SD_CARD): $(EXE_FILE) $(BINARY_CONTAINERS) $(RUN_SCRIPT) $(EMCONFIG) check_kimage check_rootfs @echo "Generating sd_card folder...." mkdir -p $(SD_CARD) chmod a+rx $(BUILD_DIR)/run_script.sh -ifneq (,$(findstring vck190_base_dfx, $(PLATFORM_NAME))) -ifeq ($(TARGET),hw) - $(VPP) -t $(TARGET) --platform $(XPLATFORM) -p $(PACKAGE_FILES) -o $(BINARY_CONTAINERS_PKG) - $(VPP) -t $(TARGET) --platform $(XPLATFORM) -p --package.out_dir $(SD_CARD) --package.rootfs $(SYSROOT)/../../rootfs.ext4 --package.kernel_image $(K_IMAGE) $(SD_FILES_WITH_PREFIX) $(SD_DIRS_WITH_PREFIX) --package.sd_file $(BINARY_CONTAINERS_PKG) +# 1. DFX HW Flow +ifeq ($(dfx_hw), true) + $(VPP) -t $(TARGET) --platform $(XPLATFORM) -p $(PACKAGE_FILES) $(VPP_PACKAGE) -o $(BINARY_CONTAINERS_PKG) + $(VPP) -t $(TARGET) --platform $(XPLATFORM) -p --package.out_dir $(SD_CARD) --package.rootfs $(ROOTFS) --package.kernel_image $(K_IMAGE) $(SD_FILES_WITH_PREFIX) $(SD_DIRS_WITH_PREFIX) --package.sd_file $(BINARY_CONTAINERS_PKG) @echo "### ***** sd_card generation done! ***** ###" -vck190_dfx_hw := true endif +# 2. PS_ON_X86 - From 2022.2, Target:sw_emu +ifeq ($(ps_on_x86), true) + @echo "### ***** running PS X86 SE_EMU ***** ###" + $(VPP) -t $(TARGET) --platform $(XPLATFORM) -o $(BINARY_CONTAINERS_PKG) -p $(PACKAGE_FILES) $(VPP_PACKAGE) --package.out_dir $(SD_CARD) --package.emu_ps x86 endif -ifeq ($(vck190_dfx_hw), false) - $(VPP) -t $(TARGET) --platform $(XPLATFORM) -o $(BINARY_CONTAINERS_PKG) -p $(PACKAGE_FILES) $(VPP_PACKAGE) --package.out_dir $(SD_CARD) --package.rootfs $(SYSROOT)/../../rootfs.ext4 --package.kernel_image $(K_IMAGE) $(SD_FILES_WITH_PREFIX) $(SD_DIRS_WITH_PREFIX) +#3. General Embeded flow +ifeq ($(dfx_hw), false) +ifeq ($(ps_on_x86), false) + $(VPP) -t $(TARGET) --platform $(XPLATFORM) -o $(BINARY_CONTAINERS_PKG) -p $(PACKAGE_FILES) $(VPP_PACKAGE) --package.out_dir $(SD_CARD) --package.rootfs $(ROOTFS) --package.kernel_image $(K_IMAGE) $(SD_FILES_WITH_PREFIX) $(SD_DIRS_WITH_PREFIX) @echo "### ***** sd_card generation done! ***** ###" endif +endif .PHONY: sd_card sd_card: $(SD_CARD) @@ -373,7 +392,7 @@ ifeq ($(HOST_ARCH), x86) else @echo $(RUN_DEPS) - $(SD_CARD)/launch_$(TARGET).sh -no-reboot -run-app $(notdir $(RUN_SCRIPT)) + $(SD_CARD)/launch_$(TARGET).sh -no-reboot -run-app $(notdir $(RUN_SCRIPT)) 2>&1 | tee $(SD_CARD)/qemu_output.log grep "TEST PASSED, RC=0" $(SD_CARD)/qemu_output.log || exit 1 endif @@ -384,24 +403,32 @@ ifeq ($(HOST_ARCH), x86) LD_LIBRARY_PATH=$(LIBRARY_PATH):$$LD_LIBRARY_PATH \ XCL_EMULATION_MODE=$(TARGET) $(EXE_FILE) $(HOST_ARGS) +else +ifeq ($(ps_on_x86), true) + LD_LIBRARY_PATH=$(LIBRARY_PATH):$$LD_LIBRARY_PATH \ + XCL_EMULATION_MODE=$(TARGET) $(EXE_FILE) $(HOST_ARGS) + else @echo $(RUN_DEPS) - $(SD_CARD)/launch_$(TARGET).sh -no-reboot -run-app $(notdir $(RUN_SCRIPT)) + $(SD_CARD)/launch_$(TARGET).sh -no-reboot -run-app $(notdir $(RUN_SCRIPT)) 2>&1 | tee $(SD_CARD)/qemu_output.log grep "TEST PASSED, RC=0" $(SD_CARD)/qemu_output.log || exit 1 +endif endif endif #hw ifeq ($(TARGET), hw) ifneq (,$(findstring aws-vu9p-f1, $(PLATFORM_NAME))) -ifneq ($(JENKINS_INTERNAL_BUILD), 1) +ifeq (,$(wildcard $(BUILD_DIR)/cgSolver.awsxclbin)) $(ECHO) "This makefile does not directly support converting .xclbin to .awsxclbin, please refer https://github.com/aws/aws-fpga/blob/master/Vitis/README.md for next operations" else - $(ECHO) "Running inside Xilinx regression without converting to .awsxclbin" - $(EXE_FILE) $(HOST_ARGS) + $(ECHO) "Running HW using generated .awsxclbin" + LD_LIBRARY_PATH=$(LIBRARY_PATH):$$LD_LIBRARY_PATH \ + $(EXE_FILE) $(subst .xclbin,.awsxclbin,$(HOST_ARGS)) endif else ifeq ($(HOST_ARCH), x86) + LD_LIBRARY_PATH=$(LIBRARY_PATH):$$LD_LIBRARY_PATH \ $(EXE_FILE) $(HOST_ARGS) else @@ -435,12 +462,11 @@ cleanh: cleank: -$(RMDIR) $(BUILD_DIR)/*.xclbin _vimage *xclbin.run_summary qemu-memory-_* emulation/ _vimage/ pl*start_simulation. sh *.xclbin - -$(RMDIR) _x_temp.*/_x.* _x_temp.*/.Xil _x_temp.*/profile_summary.* xo_* _x* - -$(RMDIR) _x_temp.*/dltmp* _x_temp.*/kernel_info.dat _x_temp.*/*.log - -$(RMDIR) _x_temp.* + -$(RMDIR) _x_temp.* cleanall: cleanh cleank -$(RMDIR) $(BUILD_DIR) emconfig.json *.html $(TEMP_DIR) $(CUR_DIR)/reports *.csv *.run_summary $(CUR_DIR)/*.raw package_* $(BUILD_DIR)/run_script.sh .ipcache *.str -$(RMDIR) $(CUR_DIR)/Work $(CUR_DIR)/*.xpe $(CUR_DIR)/hw.o $(CUR_DIR)/*.xsa $(CUR_DIR)/xnwOut + -$(RMDIR) -clean: cleanh +clean: cleanh \ No newline at end of file diff --git a/hpc/L2/tests/cgSolver/krnl_cgSolver_spmv_jacobi_16ch/utils.mk b/hpc/L2/tests/cgSolver/krnl_cgSolver_spmv_jacobi_16ch/utils.mk index 9b889021fc..8965e30749 100644 --- a/hpc/L2/tests/cgSolver/krnl_cgSolver_spmv_jacobi_16ch/utils.mk +++ b/hpc/L2/tests/cgSolver/krnl_cgSolver_spmv_jacobi_16ch/utils.mk @@ -12,7 +12,7 @@ # 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. -# vitis makefile-generator v2.0.6 +# vitis makefile-generator v2.0.7 # #+------------------------------------------------------------------------------- # The following parameters are assigned with default values. These parameters can @@ -50,6 +50,7 @@ ifndef XILINX_XRT export XILINX_XRT endif +.PHONY: check_device check_device: @set -eu; \ inallowlist=False; \ @@ -82,8 +83,9 @@ endif endif -#get suffix of kernel by PLATFORM +# Special processing for tool version/platform type VITIS_VER = $(shell v++ --version | grep 'v++' | sed 's/^[[:space:]]*//' | sed -e 's/^[*]* v++ v//g' | cut -d " " -f1) +# 1) for versal flow from 2022.1 DEVICE_TYPE = $(shell platforminfo -p $(PLATFORM) | grep 'FPGA Family' | sed 's/.*://' | sed '/ai_engine/d' | sed 's/^[[:space:]]*//') ifeq ($(DEVICE_TYPE), versal) ifeq ($(shell expr $(VITIS_VER) \>= 2022.1), 1) @@ -94,6 +96,22 @@ endif else LINK_TARGET_FMT := xclbin endif +# 2) dfx flow +dfx_hw := false +ifeq ($(findstring _dfx_, $(PLATFORM_NAME)),_dfx_) +ifeq ($(TARGET),hw) +dfx_hw := true +endif +endif +# 3) for embeded sw_emu flow from 2022.2 +ps_on_x86 := false +ifneq ($(HOST_ARCH), x86) +ifeq ($(shell expr $(VITIS_VER) \>= 2022.2), 1) +ifeq ($(TARGET), sw_emu) +ps_on_x86 := true +endif +endif +endif #Checks for Device Family ifeq ($(HOST_ARCH), aarch32) @@ -107,6 +125,7 @@ ifneq ($(HOST_ARCH), $(filter $(HOST_ARCH),aarch64 aarch32 x86)) $(error HOST_ARCH variable not set, please set correctly and rerun) endif +.PHONY: check_version check_sysroot check_kimage check_rootfs check_version: ifneq (, $(shell which git)) ifneq (,$(wildcard $(XFLIB_DIR)/.git)) @@ -114,17 +133,46 @@ ifneq (,$(wildcard $(XFLIB_DIR)/.git)) endif endif -#Checks for SYSROOT +#Set/Check SYSROOT/K_IMAGE/ROOTFS +ifneq ($(HOST_ARCH), x86) +ifneq (,$(findstring zc706, $(PLATFORM_NAME))) +K_IMAGE ?= $(SYSROOT)/../../uImage +else +K_IMAGE ?= $(SYSROOT)/../../Image +endif +ROOTFS ?= $(SYSROOT)/../../rootfs.ext4 +endif + check_sysroot: ifneq ($(HOST_ARCH), x86) -ifndef SYSROOT +ifeq (,$(wildcard $(SYSROOT))) $(error SYSROOT ENV variable is not set, please set ENV variable correctly and rerun) endif endif +check_kimage: +ifneq ($(HOST_ARCH), x86) +ifeq (,$(wildcard $(K_IMAGE))) + $(error K_IMAGE ENV variable is not set, please set ENV variable correctly and rerun) +endif +endif +check_rootfs: +ifneq ($(HOST_ARCH), x86) +ifeq (,$(wildcard $(ROOTFS))) + $(error ROOTFS ENV variable is not set, please set ENV variable correctly and rerun) +endif +endif #Checks for g++ -CXX := g++ ifeq ($(HOST_ARCH), x86) +X86_CXX := true +else +ifeq ($(ps_on_x86), true) +X86_CXX := true +endif +endif + +CXX := g++ +ifeq ($(X86_CXX), true) ifeq ($(shell expr $(VITIS_VER) \>= 2022.1), 1) CXX_VER := 8.3.0 else @@ -144,11 +192,13 @@ endif $(warning [WARNING]: g++ version too old. Using g++ provided by the tool: $(CXX)) endif endif -else ifeq ($(HOST_ARCH), aarch64) +else +ifeq ($(HOST_ARCH), aarch64) CXX := $(XILINX_VITIS)/gnu/aarch64/lin/aarch64-linux/bin/aarch64-linux-gnu-g++ else ifeq ($(HOST_ARCH), aarch32) CXX := $(XILINX_VITIS)/gnu/aarch32/lin/gcc-arm-linux-gnueabi/bin/arm-linux-gnueabihf-g++ endif +endif #Check OS and setting env for xrt c++ api OSDIST = $(shell lsb_release -i |awk -F: '{print tolower($$2)}' | tr -d ' \t' ) @@ -268,9 +318,3 @@ RMDIR = rm -rf MV = mv -f CP = cp -rf ECHO:= @echo -ifneq (,$(shell echo $(XPLATFORM) | awk '/xilinx_u280_xdma_201920_3/')) -VPP_FLAGS += --advanced.param compiler.ignorePlatformCompatibilityCheck=true -ifeq ($(TARGET), hw) -VPP_LDFLAGS += --advanced.param compiler.userPreSysLinkOverlayTcl=preSysLink.tcl -endif -endif diff --git a/hpc/L2/tests/mlp/fcn_1CU/Makefile b/hpc/L2/tests/mlp/fcn_1CU/Makefile index 002b6ad61f..1597431be6 100644 --- a/hpc/L2/tests/mlp/fcn_1CU/Makefile +++ b/hpc/L2/tests/mlp/fcn_1CU/Makefile @@ -11,7 +11,7 @@ # 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. -# vitis makefile-generator v2.0.6 +# vitis makefile-generator v2.0.7 ############################## Help Section ############################## .PHONY: help @@ -34,9 +34,15 @@ help:: $(ECHO) " Command to build host application." $(ECHO) " By default, HOST_ARCH=x86. HOST_ARCH is required for SoC shells" $(ECHO) "" - $(ECHO) " NOTE: For embedded devices, e.g. zcu102/zcu104/vck190, env variable SYSROOT and EDGE_COMMON_SW need to be set first, and HOST_ARCH is either aarch32 or aarch64. For example," - $(ECHO) " export SYSROOT=< path-to-platform-sysroot >" - $(ECHO) " export EDGE_COMMON_SW=< path-to-rootfs-and-Image-files >" + $(ECHO) " NOTE: For embedded devices, e.g. zcu102/zcu104/vck190, HOST_ARCH is either aarch32 or aarch64." + $(ECHO) " a.IF Download the platform, and common-image from Xilinx Download Center(Suggested):" + $(ECHO) " Run the sdk.sh script from the common-image directory to install sysroot using the command : ./sdk.sh -y -d ./ -p " + $(ECHO) " Unzip the rootfs file : gunzip ./rootfs.ext4.gz" + $(ECHO) " export SYSROOT=< path-to-platform-sysroot >" + $(ECHO) " b. User could also define SYSROOT, K_IMAGE and ROOTFS by themselves: " + $(ECHO) " export SYSROOT=< path-to-platform-sysroot >" + $(ECHO) " export K_IMAGE=< path-to-Image-files >" + $(ECHO) " export ROOTFS=< path-to-rootfs >" $(ECHO) "" $(ECHO) " make clean " $(ECHO) " Command to remove the generated non-hardware files." @@ -88,12 +94,17 @@ RUN_DEPS := # get global setting ifeq ($(HOST_ARCH), x86) CXXFLAGS += -fmessage-length=0 -I$(CUR_DIR)/src/ -I$(XILINX_XRT)/include -I$(XILINX_HLS)/include -std=c++14 -O3 -Wall -Wno-unknown-pragmas -Wno-unused-label -LDFLAGS += -pthread -L$(XILINX_XRT)/lib -L$(XILINX_HLS)/lnx64/tools/fpo_v7_0 -Wl,--as-needed -lOpenCL -lxrt_coreutil -lgmp -lmpfr -lIp_floating_point_v7_0_bitacc_cmodel +LDFLAGS += -pthread -L$(XILINX_XRT)/lib -L$(XILINX_HLS)/lnx64/tools/fpo_v7_1 -Wl,--as-needed -lOpenCL -lxrt_coreutil -lgmp -lmpfr -lIp_floating_point_v7_1_bitacc_cmodel VPP_FLAGS += -t $(TARGET) --platform $(XPLATFORM) --save-temps VPP_LDFLAGS += --optimize 2 -R 2 else ifeq ($(HOST_ARCH), aarch64) +ifeq ($(ps_on_x86), on) +CXXFLAGS += -fmessage-length=0 -I$(CUR_DIR)/src/ -I$(XILINX_XRT)/include -I$(XILINX_HLS)/include -std=c++14 -O3 -Wall -Wno-unknown-pragmas -Wno-unused-label +LDFLAGS += -pthread -L$(XILINX_XRT)/lib -L$(XILINX_HLS)/lnx64/tools/fpo_v7_1 -Wl,--as-needed -lOpenCL -lxrt_coreutil -lgmp -lmpfr -lIp_floating_point_v7_1_bitacc_cmodel +else CXXFLAGS += -I$(CUR_DIR)/src/ -fmessage-length=0 --sysroot=$(SYSROOT) -I$(SYSROOT)/usr/include/xrt -I$(XILINX_HLS)/include -std=c++14 -O3 -Wall -Wno-unknown-pragmas -Wno-unused-label -LDFLAGS += -pthread -L$(SYSROOT)/usr/lib -L$(XILINX_VITIS_AIETOOLS)/lib/aarch64.o -Wl,--as-needed -lxilinxopencl -lxrt_coreutil +LDFLAGS += -pthread -L$(SYSROOT)/usr/lib -Wl,--as-needed -lxilinxopencl -lxrt_coreutil +endif VPP_FLAGS += -t $(TARGET) --platform $(XPLATFORM) --save-temps VPP_LDFLAGS += --optimize 2 -R 2 endif @@ -108,22 +119,27 @@ ifeq ($(TARGET),hw_emu) CXXFLAGS += -D HW_EMU_TEST endif -ifeq (,$(findstring opencv,$(CXXFLAGS))) -CXXFLAGS += $(XRT_CXXFLAGS) -endif - #Inclue Required Host Source Files ifneq (,$(shell echo $(XPLATFORM) | awk '/u250/')) HOST_SRCS += $(XFLIB_DIR)/L2/src/sw/mlp/api_fcn_multiInstr.cpp $(XFLIB_DIR)/../blas/L2/src/xcl2/xcl2.cpp CXXFLAGS += -I $(XFLIB_DIR)/L2/include/sw/mlp -I $(XFLIB_DIR)/../blas/L1/include/hw/xf_blas/helpers/utils -I $(XFLIB_DIR)/../blas/L2/include/xcl2 -I $(XFLIB_DIR)/../blas/L2/include/memKernel/sw -I $(XFLIB_DIR)/../blas/L2/include/memKernel CXXFLAGS += -O3 - else +ifeq ($(ps_on_x86), on) HOST_SRCS += $(XFLIB_DIR)/L2/src/sw/mlp/api_fcn_multiInstr.cpp $(XFLIB_DIR)/../blas/L2/src/xcl2/xcl2.cpp CXXFLAGS += -I $(XFLIB_DIR)/L2/include/sw/mlp -I $(XFLIB_DIR)/../blas/L1/include/hw/xf_blas/helpers/utils -I $(XFLIB_DIR)/../blas/L2/include/xcl2 -I $(XFLIB_DIR)/../blas/L2/include/memKernel/sw -I $(XFLIB_DIR)/../blas/L2/include/memKernel CXXFLAGS += -O3 - +else +HOST_SRCS += $(XFLIB_DIR)/L2/src/sw/mlp/api_fcn_multiInstr.cpp $(XFLIB_DIR)/../blas/L2/src/xcl2/xcl2.cpp +CXXFLAGS += -I $(XFLIB_DIR)/L2/include/sw/mlp -I $(XFLIB_DIR)/../blas/L1/include/hw/xf_blas/helpers/utils -I $(XFLIB_DIR)/../blas/L2/include/xcl2 -I $(XFLIB_DIR)/../blas/L2/include/memKernel/sw -I $(XFLIB_DIR)/../blas/L2/include/memKernel +CXXFLAGS += -O3 +endif endif +# workaround for opencv +ifeq (,$(findstring opencv,$(CXXFLAGS))) +CXXFLAGS += $(XRT_CXXFLAGS) +endif + EXE_NAME := host.exe EXE_FILE := $(BUILD_DIR)/$(EXE_NAME) EXE_FILE_DEPS := $(HOST_SRCS) $(EXE_FILE_DEPS) @@ -146,7 +162,7 @@ endif ######################### binary container global settings ########################## VPP_FLAGS_fcnKernel += --hls.clock 300000000:fcnKernel ifneq ($(HOST_ARCH), x86) -VPP_LDFLAGS_fcn += --clock.defaultFreqHz 300000000 +VPP_LDFLAGS_fcn += --clock.defaultFreqHz 200000000 else VPP_LDFLAGS_fcn += --kernel_frequency 200 endif @@ -188,11 +204,6 @@ $(EMCONFIG): emconfigutil --platform $(XPLATFORM) --od $(BUILD_DIR) ############################## Preparing sdcard folder ############################## ifneq ($(HOST_ARCH), x86) -ifneq (,$(findstring zc706, $(PLATFORM_NAME))) -K_IMAGE := $(SYSROOT)/../../uImage -else -K_IMAGE := $(SYSROOT)/../../Image -endif RUN_SCRIPT := $(BUILD_DIR)/run_script.sh $(RUN_SCRIPT): rm -rf $(RUN_SCRIPT) @@ -208,7 +219,7 @@ endif @echo './$(EXE_NAME) $(PKG_HOST_ARGS)' >> $(RUN_SCRIPT) @echo 'return_code=$$?' >> $(RUN_SCRIPT) @echo 'if [ $$return_code -ne 0 ]; then' >> $(RUN_SCRIPT) - @echo ' echo "ERROR: Embedded host run failed, RC=$$return_code"' >> $(RUN_SCRIPT) + @echo ' echo "ERROR: TEST FAILED, RC=$$return_code"' >> $(RUN_SCRIPT) @echo 'else' >> $(RUN_SCRIPT) @echo ' echo "INFO: TEST PASSED, RC=0"' >> $(RUN_SCRIPT) @echo 'fi' >> $(RUN_SCRIPT) @@ -226,23 +237,28 @@ SD_DIRS_WITH_PREFIX = $(foreach sd_dir,$(DATA_DIR),--package.sd_dir $(sd_dir)) PACKAGE_FILES := $(BINARY_CONTAINERS) PACKAGE_FILES += $(AIE_CONTAINER) SD_CARD := $(CUR_DIR)/package_$(TARGET) -vck190_dfx_hw := false -$(SD_CARD): $(EXE_FILE) $(BINARY_CONTAINERS) $(RUN_SCRIPT) $(EMCONFIG) +$(SD_CARD): $(EXE_FILE) $(BINARY_CONTAINERS) $(RUN_SCRIPT) $(EMCONFIG) check_kimage check_rootfs @echo "Generating sd_card folder...." mkdir -p $(SD_CARD) chmod a+rx $(BUILD_DIR)/run_script.sh -ifneq (,$(findstring vck190_base_dfx, $(PLATFORM_NAME))) -ifeq ($(TARGET),hw) - $(VPP) -t $(TARGET) --platform $(XPLATFORM) -p $(PACKAGE_FILES) -o $(BINARY_CONTAINERS_PKG) - $(VPP) -t $(TARGET) --platform $(XPLATFORM) -p --package.out_dir $(SD_CARD) --package.rootfs $(SYSROOT)/../../rootfs.ext4 --package.kernel_image $(K_IMAGE) $(SD_FILES_WITH_PREFIX) $(SD_DIRS_WITH_PREFIX) --package.sd_file $(BINARY_CONTAINERS_PKG) +# 1. DFX HW Flow +ifeq ($(dfx_hw), on) + $(VPP) -t $(TARGET) --platform $(XPLATFORM) -p $(PACKAGE_FILES) $(VPP_PACKAGE) -o $(BINARY_CONTAINERS_PKG) + $(VPP) -t $(TARGET) --platform $(XPLATFORM) -p --package.out_dir $(SD_CARD) --package.rootfs $(ROOTFS) --package.kernel_image $(K_IMAGE) $(SD_FILES_WITH_PREFIX) $(SD_DIRS_WITH_PREFIX) --package.sd_file $(BINARY_CONTAINERS_PKG) @echo "### ***** sd_card generation done! ***** ###" -vck190_dfx_hw := true endif +# 2. PS_ON_X86 - From 2022.2, Target:sw_emu +ifeq ($(ps_on_x86), on) + @echo "### ***** running PS X86 SE_EMU ***** ###" + $(VPP) -t $(TARGET) --platform $(XPLATFORM) -o $(BINARY_CONTAINERS_PKG) -p $(PACKAGE_FILES) $(VPP_PACKAGE) --package.out_dir $(SD_CARD) --package.emu_ps x86 endif -ifeq ($(vck190_dfx_hw), false) - $(VPP) -t $(TARGET) --platform $(XPLATFORM) -o $(BINARY_CONTAINERS_PKG) -p $(PACKAGE_FILES) $(VPP_PACKAGE) --package.out_dir $(SD_CARD) --package.rootfs $(SYSROOT)/../../rootfs.ext4 --package.kernel_image $(K_IMAGE) $(SD_FILES_WITH_PREFIX) $(SD_DIRS_WITH_PREFIX) +#3. General Embeded flow +ifeq ($(dfx_hw), off) +ifeq ($(ps_on_x86), off) + $(VPP) -t $(TARGET) --platform $(XPLATFORM) -o $(BINARY_CONTAINERS_PKG) -p $(PACKAGE_FILES) $(VPP_PACKAGE) --package.out_dir $(SD_CARD) --package.rootfs $(ROOTFS) --package.kernel_image $(K_IMAGE) $(SD_FILES_WITH_PREFIX) $(SD_DIRS_WITH_PREFIX) @echo "### ***** sd_card generation done! ***** ###" endif +endif .PHONY: sd_card sd_card: $(SD_CARD) @@ -266,7 +282,7 @@ ifeq ($(HOST_ARCH), x86) else @echo $(RUN_DEPS) - $(SD_CARD)/launch_$(TARGET).sh -no-reboot -run-app $(notdir $(RUN_SCRIPT)) + $(SD_CARD)/launch_$(TARGET).sh -no-reboot -run-app $(notdir $(RUN_SCRIPT)) 2>&1 | tee $(SD_CARD)/qemu_output.log grep "TEST PASSED, RC=0" $(SD_CARD)/qemu_output.log || exit 1 endif @@ -277,24 +293,32 @@ ifeq ($(HOST_ARCH), x86) LD_LIBRARY_PATH=$(LIBRARY_PATH):$$LD_LIBRARY_PATH \ XCL_EMULATION_MODE=$(TARGET) $(EXE_FILE) $(HOST_ARGS) +else +ifeq ($(ps_on_x86), on) + LD_LIBRARY_PATH=$(LIBRARY_PATH):$$LD_LIBRARY_PATH \ + XCL_EMULATION_MODE=$(TARGET) $(EXE_FILE) $(HOST_ARGS) + else @echo $(RUN_DEPS) - $(SD_CARD)/launch_$(TARGET).sh -no-reboot -run-app $(notdir $(RUN_SCRIPT)) + $(SD_CARD)/launch_$(TARGET).sh -no-reboot -run-app $(notdir $(RUN_SCRIPT)) 2>&1 | tee $(SD_CARD)/qemu_output.log grep "TEST PASSED, RC=0" $(SD_CARD)/qemu_output.log || exit 1 +endif endif endif #hw ifeq ($(TARGET), hw) ifneq (,$(findstring aws-vu9p-f1, $(PLATFORM_NAME))) -ifneq ($(JENKINS_INTERNAL_BUILD), 1) +ifeq (,$(wildcard $(BUILD_DIR)/fcn.awsxclbin)) $(ECHO) "This makefile does not directly support converting .xclbin to .awsxclbin, please refer https://github.com/aws/aws-fpga/blob/master/Vitis/README.md for next operations" else - $(ECHO) "Running inside Xilinx regression without converting to .awsxclbin" - $(EXE_FILE) $(HOST_ARGS) + $(ECHO) "Running HW using generated .awsxclbin" + LD_LIBRARY_PATH=$(LIBRARY_PATH):$$LD_LIBRARY_PATH \ + $(EXE_FILE) $(subst .xclbin,.awsxclbin,$(HOST_ARGS)) endif else ifeq ($(HOST_ARCH), x86) + LD_LIBRARY_PATH=$(LIBRARY_PATH):$$LD_LIBRARY_PATH \ $(EXE_FILE) $(HOST_ARGS) else @@ -328,12 +352,11 @@ cleanh: cleank: -$(RMDIR) $(BUILD_DIR)/*.xclbin _vimage *xclbin.run_summary qemu-memory-_* emulation/ _vimage/ pl*start_simulation. sh *.xclbin - -$(RMDIR) _x_temp.*/_x.* _x_temp.*/.Xil _x_temp.*/profile_summary.* xo_* _x* - -$(RMDIR) _x_temp.*/dltmp* _x_temp.*/kernel_info.dat _x_temp.*/*.log - -$(RMDIR) _x_temp.* + -$(RMDIR) _x_temp.* cleanall: cleanh cleank -$(RMDIR) $(BUILD_DIR) emconfig.json *.html $(TEMP_DIR) $(CUR_DIR)/reports *.csv *.run_summary $(CUR_DIR)/*.raw package_* $(BUILD_DIR)/run_script.sh .ipcache *.str -$(RMDIR) $(CUR_DIR)/Work $(CUR_DIR)/*.xpe $(CUR_DIR)/hw.o $(CUR_DIR)/*.xsa $(CUR_DIR)/xnwOut + -$(RMDIR) -clean: cleanh +clean: cleanh \ No newline at end of file diff --git a/hpc/L2/tests/mlp/fcn_1CU/description.json b/hpc/L2/tests/mlp/fcn_1CU/description.json index afade224af..167c509023 100644 --- a/hpc/L2/tests/mlp/fcn_1CU/description.json +++ b/hpc/L2/tests/mlp/fcn_1CU/description.json @@ -27,11 +27,6 @@ } } }, - "pre_launch": [ - { - "launch_cmd": "make dump_config" - } - ], "launch": [ { "name": "generic launch for all flows", @@ -93,7 +88,12 @@ "dependency": [], "env": "", "cmd": "", - "max_memory_MB": 32768, + "max_memory_MB": { + "vitis_hw_build": 40960, + "vitis_hw_emu": 32768, + "vitis_sw_emu": 32768, + "vitis_hw_run": 32768 + }, "max_time_min": { "vitis_hw_build": 2400, "vitis_hw_emu": 940, diff --git a/hpc/L2/tests/mlp/fcn_1CU/utils.mk b/hpc/L2/tests/mlp/fcn_1CU/utils.mk index 9b889021fc..2e9ea4d63a 100644 --- a/hpc/L2/tests/mlp/fcn_1CU/utils.mk +++ b/hpc/L2/tests/mlp/fcn_1CU/utils.mk @@ -12,7 +12,7 @@ # 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. -# vitis makefile-generator v2.0.6 +# vitis makefile-generator v2.0.7 # #+------------------------------------------------------------------------------- # The following parameters are assigned with default values. These parameters can @@ -50,6 +50,7 @@ ifndef XILINX_XRT export XILINX_XRT endif +.PHONY: check_device check_device: @set -eu; \ inallowlist=False; \ @@ -82,8 +83,9 @@ endif endif -#get suffix of kernel by PLATFORM +# Special processing for tool version/platform type VITIS_VER = $(shell v++ --version | grep 'v++' | sed 's/^[[:space:]]*//' | sed -e 's/^[*]* v++ v//g' | cut -d " " -f1) +# 1) for versal flow from 2022.1 DEVICE_TYPE = $(shell platforminfo -p $(PLATFORM) | grep 'FPGA Family' | sed 's/.*://' | sed '/ai_engine/d' | sed 's/^[[:space:]]*//') ifeq ($(DEVICE_TYPE), versal) ifeq ($(shell expr $(VITIS_VER) \>= 2022.1), 1) @@ -94,6 +96,22 @@ endif else LINK_TARGET_FMT := xclbin endif +# 2) dfx flow +dfx_hw := off +ifeq ($(findstring _dfx_, $(PLATFORM_NAME)),_dfx_) +ifeq ($(TARGET),hw) +dfx_hw := on +endif +endif +# 3) for embeded sw_emu flow from 2022.2 +ps_on_x86 := off +ifneq ($(HOST_ARCH), x86) +ifeq ($(shell expr $(VITIS_VER) \>= 2022.2), 1) +ifeq ($(TARGET), sw_emu) +ps_on_x86 := on +endif +endif +endif #Checks for Device Family ifeq ($(HOST_ARCH), aarch32) @@ -107,6 +125,7 @@ ifneq ($(HOST_ARCH), $(filter $(HOST_ARCH),aarch64 aarch32 x86)) $(error HOST_ARCH variable not set, please set correctly and rerun) endif +.PHONY: check_version check_sysroot check_kimage check_rootfs check_version: ifneq (, $(shell which git)) ifneq (,$(wildcard $(XFLIB_DIR)/.git)) @@ -114,17 +133,46 @@ ifneq (,$(wildcard $(XFLIB_DIR)/.git)) endif endif -#Checks for SYSROOT +#Set/Check SYSROOT/K_IMAGE/ROOTFS +ifneq ($(HOST_ARCH), x86) +ifneq (,$(findstring zc706, $(PLATFORM_NAME))) +K_IMAGE ?= $(SYSROOT)/../../uImage +else +K_IMAGE ?= $(SYSROOT)/../../Image +endif +ROOTFS ?= $(SYSROOT)/../../rootfs.ext4 +endif + check_sysroot: ifneq ($(HOST_ARCH), x86) -ifndef SYSROOT +ifeq (,$(wildcard $(SYSROOT))) $(error SYSROOT ENV variable is not set, please set ENV variable correctly and rerun) endif endif +check_kimage: +ifneq ($(HOST_ARCH), x86) +ifeq (,$(wildcard $(K_IMAGE))) + $(error K_IMAGE ENV variable is not set, please set ENV variable correctly and rerun) +endif +endif +check_rootfs: +ifneq ($(HOST_ARCH), x86) +ifeq (,$(wildcard $(ROOTFS))) + $(error ROOTFS ENV variable is not set, please set ENV variable correctly and rerun) +endif +endif #Checks for g++ -CXX := g++ ifeq ($(HOST_ARCH), x86) +X86_CXX := true +else +ifeq ($(ps_on_x86), true) +X86_CXX := true +endif +endif + +CXX := g++ +ifeq ($(X86_CXX), true) ifeq ($(shell expr $(VITIS_VER) \>= 2022.1), 1) CXX_VER := 8.3.0 else @@ -144,11 +192,13 @@ endif $(warning [WARNING]: g++ version too old. Using g++ provided by the tool: $(CXX)) endif endif -else ifeq ($(HOST_ARCH), aarch64) +else +ifeq ($(HOST_ARCH), aarch64) CXX := $(XILINX_VITIS)/gnu/aarch64/lin/aarch64-linux/bin/aarch64-linux-gnu-g++ else ifeq ($(HOST_ARCH), aarch32) CXX := $(XILINX_VITIS)/gnu/aarch32/lin/gcc-arm-linux-gnueabi/bin/arm-linux-gnueabihf-g++ endif +endif #Check OS and setting env for xrt c++ api OSDIST = $(shell lsb_release -i |awk -F: '{print tolower($$2)}' | tr -d ' \t' ) @@ -268,9 +318,3 @@ RMDIR = rm -rf MV = mv -f CP = cp -rf ECHO:= @echo -ifneq (,$(shell echo $(XPLATFORM) | awk '/xilinx_u280_xdma_201920_3/')) -VPP_FLAGS += --advanced.param compiler.ignorePlatformCompatibilityCheck=true -ifeq ($(TARGET), hw) -VPP_LDFLAGS += --advanced.param compiler.userPreSysLinkOverlayTcl=preSysLink.tcl -endif -endif diff --git a/hpc/L2/tests/rtm2d/rtm/Makefile b/hpc/L2/tests/rtm2d/rtm/Makefile index b3577da657..e4af6ab8ee 100644 --- a/hpc/L2/tests/rtm2d/rtm/Makefile +++ b/hpc/L2/tests/rtm2d/rtm/Makefile @@ -11,7 +11,7 @@ # 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. -# vitis makefile-generator v2.0.6 +# vitis makefile-generator v2.0.7 ############################## Help Section ############################## .PHONY: help @@ -34,9 +34,15 @@ help:: $(ECHO) " Command to build host application." $(ECHO) " By default, HOST_ARCH=x86. HOST_ARCH is required for SoC shells" $(ECHO) "" - $(ECHO) " NOTE: For embedded devices, e.g. zcu102/zcu104/vck190, env variable SYSROOT and EDGE_COMMON_SW need to be set first, and HOST_ARCH is either aarch32 or aarch64. For example," - $(ECHO) " export SYSROOT=< path-to-platform-sysroot >" - $(ECHO) " export EDGE_COMMON_SW=< path-to-rootfs-and-Image-files >" + $(ECHO) " NOTE: For embedded devices, e.g. zcu102/zcu104/vck190, HOST_ARCH is either aarch32 or aarch64." + $(ECHO) " a.IF Download the platform, and common-image from Xilinx Download Center(Suggested):" + $(ECHO) " Run the sdk.sh script from the common-image directory to install sysroot using the command : ./sdk.sh -y -d ./ -p " + $(ECHO) " Unzip the rootfs file : gunzip ./rootfs.ext4.gz" + $(ECHO) " export SYSROOT=< path-to-platform-sysroot >" + $(ECHO) " b. User could also define SYSROOT, K_IMAGE and ROOTFS by themselves: " + $(ECHO) " export SYSROOT=< path-to-platform-sysroot >" + $(ECHO) " export K_IMAGE=< path-to-Image-files >" + $(ECHO) " export ROOTFS=< path-to-rootfs >" $(ECHO) "" $(ECHO) " make clean " $(ECHO) " Command to remove the generated non-hardware files." @@ -61,7 +67,7 @@ ifeq ($(PLATFORM),) PLATFORM := $(DEVICE) endif ifeq ($(PLATFORM),) -PLATFORM := xilinx_u280_xdma_201920_3 +PLATFORM := xilinx_u280_gen3x16_xdma_1_202120_1 endif # #################### Checking if PLATFORM in whitelist ############################ @@ -87,12 +93,17 @@ RUN_DEPS := # get global setting ifeq ($(HOST_ARCH), x86) CXXFLAGS += -fmessage-length=0 -I$(CUR_DIR)/src/ -I$(XILINX_XRT)/include -I$(XILINX_HLS)/include -std=c++14 -O3 -Wall -Wno-unknown-pragmas -Wno-unused-label -LDFLAGS += -pthread -L$(XILINX_XRT)/lib -L$(XILINX_HLS)/lnx64/tools/fpo_v7_0 -Wl,--as-needed -lOpenCL -lxrt_coreutil -lgmp -lmpfr -lIp_floating_point_v7_0_bitacc_cmodel +LDFLAGS += -pthread -L$(XILINX_XRT)/lib -L$(XILINX_HLS)/lnx64/tools/fpo_v7_1 -Wl,--as-needed -lOpenCL -lxrt_coreutil -lgmp -lmpfr -lIp_floating_point_v7_1_bitacc_cmodel VPP_FLAGS += -t $(TARGET) --platform $(XPLATFORM) --save-temps VPP_LDFLAGS += --optimize 2 -R 2 else ifeq ($(HOST_ARCH), aarch64) +ifeq ($(ps_on_x86), on) +CXXFLAGS += -fmessage-length=0 -I$(CUR_DIR)/src/ -I$(XILINX_XRT)/include -I$(XILINX_HLS)/include -std=c++14 -O3 -Wall -Wno-unknown-pragmas -Wno-unused-label +LDFLAGS += -pthread -L$(XILINX_XRT)/lib -L$(XILINX_HLS)/lnx64/tools/fpo_v7_1 -Wl,--as-needed -lOpenCL -lxrt_coreutil -lgmp -lmpfr -lIp_floating_point_v7_1_bitacc_cmodel +else CXXFLAGS += -I$(CUR_DIR)/src/ -fmessage-length=0 --sysroot=$(SYSROOT) -I$(SYSROOT)/usr/include/xrt -I$(XILINX_HLS)/include -std=c++14 -O3 -Wall -Wno-unknown-pragmas -Wno-unused-label -LDFLAGS += -pthread -L$(SYSROOT)/usr/lib -L$(XILINX_VITIS_AIETOOLS)/lib/aarch64.o -Wl,--as-needed -lxilinxopencl -lxrt_coreutil +LDFLAGS += -pthread -L$(SYSROOT)/usr/lib -Wl,--as-needed -lxilinxopencl -lxrt_coreutil +endif VPP_FLAGS += -t $(TARGET) --platform $(XPLATFORM) --save-temps VPP_LDFLAGS += --optimize 2 -R 2 endif @@ -107,15 +118,23 @@ ifeq ($(TARGET),hw_emu) CXXFLAGS += -D HW_EMU_TEST endif -ifeq (,$(findstring opencv,$(CXXFLAGS))) -CXXFLAGS += $(XRT_CXXFLAGS) -endif - #Inclue Required Host Source Files +ifeq ($(ps_on_x86), on) HOST_SRCS += $(XFLIB_DIR)/L2/tests/rtm2d/rtm/main.cpp $(XFLIB_DIR)/../blas/L2/src/xcl2/xcl2.cpp CXXFLAGS += -D RTM_dataType=float -D RTM_numFSMs=10 -D RTM_numBSMs=5 -D RTM_maxDim=1280 -D RTM_MaxB=40 -D RTM_NXB=40 -D RTM_NZB=40 -D RTM_order=8 -D RTM_parEntries=8 -D RTM_verify=1 -D RTM_nPE=2 CXXFLAGS += -I $(XFLIB_DIR)/L1/include/hw -I $(XFLIB_DIR)/L2/include/sw/ -I $(XFLIB_DIR)/L2/include/sw/rtm2d -I $(XFLIB_DIR)/../blas/L1/tests/sw/include/ -I $(XFLIB_DIR)/../blas/L2/include/xcl2 CXXFLAGS += -O3 +else +HOST_SRCS += $(XFLIB_DIR)/L2/tests/rtm2d/rtm/main.cpp $(XFLIB_DIR)/../blas/L2/src/xcl2/xcl2.cpp +CXXFLAGS += -D RTM_dataType=float -D RTM_numFSMs=10 -D RTM_numBSMs=5 -D RTM_maxDim=1280 -D RTM_MaxB=40 -D RTM_NXB=40 -D RTM_NZB=40 -D RTM_order=8 -D RTM_parEntries=8 -D RTM_verify=1 -D RTM_nPE=2 +CXXFLAGS += -I $(XFLIB_DIR)/L1/include/hw -I $(XFLIB_DIR)/L2/include/sw/ -I $(XFLIB_DIR)/L2/include/sw/rtm2d -I $(XFLIB_DIR)/../blas/L1/tests/sw/include/ -I $(XFLIB_DIR)/../blas/L2/include/xcl2 +CXXFLAGS += -O3 +endif + +# workaround for opencv +ifeq (,$(findstring opencv,$(CXXFLAGS))) +CXXFLAGS += $(XRT_CXXFLAGS) +endif EXE_NAME := host.exe EXE_FILE := $(BUILD_DIR)/$(EXE_NAME) @@ -194,11 +213,6 @@ $(EMCONFIG): emconfigutil --platform $(XPLATFORM) --od $(BUILD_DIR) ############################## Preparing sdcard folder ############################## ifneq ($(HOST_ARCH), x86) -ifneq (,$(findstring zc706, $(PLATFORM_NAME))) -K_IMAGE := $(SYSROOT)/../../uImage -else -K_IMAGE := $(SYSROOT)/../../Image -endif RUN_SCRIPT := $(BUILD_DIR)/run_script.sh $(RUN_SCRIPT): rm -rf $(RUN_SCRIPT) @@ -214,7 +228,7 @@ endif @echo './$(EXE_NAME) $(PKG_HOST_ARGS)' >> $(RUN_SCRIPT) @echo 'return_code=$$?' >> $(RUN_SCRIPT) @echo 'if [ $$return_code -ne 0 ]; then' >> $(RUN_SCRIPT) - @echo ' echo "ERROR: Embedded host run failed, RC=$$return_code"' >> $(RUN_SCRIPT) + @echo ' echo "ERROR: TEST FAILED, RC=$$return_code"' >> $(RUN_SCRIPT) @echo 'else' >> $(RUN_SCRIPT) @echo ' echo "INFO: TEST PASSED, RC=0"' >> $(RUN_SCRIPT) @echo 'fi' >> $(RUN_SCRIPT) @@ -232,23 +246,28 @@ SD_DIRS_WITH_PREFIX = $(foreach sd_dir,$(DATA_DIR),--package.sd_dir $(sd_dir)) PACKAGE_FILES := $(BINARY_CONTAINERS) PACKAGE_FILES += $(AIE_CONTAINER) SD_CARD := $(CUR_DIR)/package_$(TARGET) -vck190_dfx_hw := false -$(SD_CARD): $(EXE_FILE) $(BINARY_CONTAINERS) $(RUN_SCRIPT) $(EMCONFIG) +$(SD_CARD): $(EXE_FILE) $(BINARY_CONTAINERS) $(RUN_SCRIPT) $(EMCONFIG) check_kimage check_rootfs @echo "Generating sd_card folder...." mkdir -p $(SD_CARD) chmod a+rx $(BUILD_DIR)/run_script.sh -ifneq (,$(findstring vck190_base_dfx, $(PLATFORM_NAME))) -ifeq ($(TARGET),hw) - $(VPP) -t $(TARGET) --platform $(XPLATFORM) -p $(PACKAGE_FILES) -o $(BINARY_CONTAINERS_PKG) - $(VPP) -t $(TARGET) --platform $(XPLATFORM) -p --package.out_dir $(SD_CARD) --package.rootfs $(SYSROOT)/../../rootfs.ext4 --package.kernel_image $(K_IMAGE) $(SD_FILES_WITH_PREFIX) $(SD_DIRS_WITH_PREFIX) --package.sd_file $(BINARY_CONTAINERS_PKG) +# 1. DFX HW Flow +ifeq ($(dfx_hw), on) + $(VPP) -t $(TARGET) --platform $(XPLATFORM) -p $(PACKAGE_FILES) $(VPP_PACKAGE) -o $(BINARY_CONTAINERS_PKG) + $(VPP) -t $(TARGET) --platform $(XPLATFORM) -p --package.out_dir $(SD_CARD) --package.rootfs $(ROOTFS) --package.kernel_image $(K_IMAGE) $(SD_FILES_WITH_PREFIX) $(SD_DIRS_WITH_PREFIX) --package.sd_file $(BINARY_CONTAINERS_PKG) @echo "### ***** sd_card generation done! ***** ###" -vck190_dfx_hw := true endif +# 2. PS_ON_X86 - From 2022.2, Target:sw_emu +ifeq ($(ps_on_x86), on) + @echo "### ***** running PS X86 SE_EMU ***** ###" + $(VPP) -t $(TARGET) --platform $(XPLATFORM) -o $(BINARY_CONTAINERS_PKG) -p $(PACKAGE_FILES) $(VPP_PACKAGE) --package.out_dir $(SD_CARD) --package.emu_ps x86 endif -ifeq ($(vck190_dfx_hw), false) - $(VPP) -t $(TARGET) --platform $(XPLATFORM) -o $(BINARY_CONTAINERS_PKG) -p $(PACKAGE_FILES) $(VPP_PACKAGE) --package.out_dir $(SD_CARD) --package.rootfs $(SYSROOT)/../../rootfs.ext4 --package.kernel_image $(K_IMAGE) $(SD_FILES_WITH_PREFIX) $(SD_DIRS_WITH_PREFIX) +#3. General Embeded flow +ifeq ($(dfx_hw), off) +ifeq ($(ps_on_x86), off) + $(VPP) -t $(TARGET) --platform $(XPLATFORM) -o $(BINARY_CONTAINERS_PKG) -p $(PACKAGE_FILES) $(VPP_PACKAGE) --package.out_dir $(SD_CARD) --package.rootfs $(ROOTFS) --package.kernel_image $(K_IMAGE) $(SD_FILES_WITH_PREFIX) $(SD_DIRS_WITH_PREFIX) @echo "### ***** sd_card generation done! ***** ###" endif +endif .PHONY: sd_card sd_card: $(SD_CARD) @@ -272,7 +291,7 @@ ifeq ($(HOST_ARCH), x86) else @echo $(RUN_DEPS) - $(SD_CARD)/launch_$(TARGET).sh -no-reboot -run-app $(notdir $(RUN_SCRIPT)) + $(SD_CARD)/launch_$(TARGET).sh -no-reboot -run-app $(notdir $(RUN_SCRIPT)) 2>&1 | tee $(SD_CARD)/qemu_output.log grep "TEST PASSED, RC=0" $(SD_CARD)/qemu_output.log || exit 1 endif @@ -283,24 +302,32 @@ ifeq ($(HOST_ARCH), x86) LD_LIBRARY_PATH=$(LIBRARY_PATH):$$LD_LIBRARY_PATH \ XCL_EMULATION_MODE=$(TARGET) $(EXE_FILE) $(HOST_ARGS) +else +ifeq ($(ps_on_x86), on) + LD_LIBRARY_PATH=$(LIBRARY_PATH):$$LD_LIBRARY_PATH \ + XCL_EMULATION_MODE=$(TARGET) $(EXE_FILE) $(HOST_ARGS) + else @echo $(RUN_DEPS) - $(SD_CARD)/launch_$(TARGET).sh -no-reboot -run-app $(notdir $(RUN_SCRIPT)) + $(SD_CARD)/launch_$(TARGET).sh -no-reboot -run-app $(notdir $(RUN_SCRIPT)) 2>&1 | tee $(SD_CARD)/qemu_output.log grep "TEST PASSED, RC=0" $(SD_CARD)/qemu_output.log || exit 1 +endif endif endif #hw ifeq ($(TARGET), hw) ifneq (,$(findstring aws-vu9p-f1, $(PLATFORM_NAME))) -ifneq ($(JENKINS_INTERNAL_BUILD), 1) +ifeq (,$(wildcard $(BUILD_DIR)/rtm.awsxclbin)) $(ECHO) "This makefile does not directly support converting .xclbin to .awsxclbin, please refer https://github.com/aws/aws-fpga/blob/master/Vitis/README.md for next operations" else - $(ECHO) "Running inside Xilinx regression without converting to .awsxclbin" - $(EXE_FILE) $(HOST_ARGS) + $(ECHO) "Running HW using generated .awsxclbin" + LD_LIBRARY_PATH=$(LIBRARY_PATH):$$LD_LIBRARY_PATH \ + $(EXE_FILE) $(subst .xclbin,.awsxclbin,$(HOST_ARGS)) endif else ifeq ($(HOST_ARCH), x86) + LD_LIBRARY_PATH=$(LIBRARY_PATH):$$LD_LIBRARY_PATH \ $(EXE_FILE) $(HOST_ARGS) else @@ -334,12 +361,11 @@ cleanh: cleank: -$(RMDIR) $(BUILD_DIR)/*.xclbin _vimage *xclbin.run_summary qemu-memory-_* emulation/ _vimage/ pl*start_simulation. sh *.xclbin - -$(RMDIR) _x_temp.*/_x.* _x_temp.*/.Xil _x_temp.*/profile_summary.* xo_* _x* - -$(RMDIR) _x_temp.*/dltmp* _x_temp.*/kernel_info.dat _x_temp.*/*.log - -$(RMDIR) _x_temp.* + -$(RMDIR) _x_temp.* cleanall: cleanh cleank -$(RMDIR) $(BUILD_DIR) emconfig.json *.html $(TEMP_DIR) $(CUR_DIR)/reports *.csv *.run_summary $(CUR_DIR)/*.raw package_* $(BUILD_DIR)/run_script.sh .ipcache *.str -$(RMDIR) $(CUR_DIR)/Work $(CUR_DIR)/*.xpe $(CUR_DIR)/hw.o $(CUR_DIR)/*.xsa $(CUR_DIR)/xnwOut + -$(RMDIR) clean: cleanh \ No newline at end of file diff --git a/hpc/L2/tests/rtm2d/rtm/description.json b/hpc/L2/tests/rtm2d/rtm/description.json index d5421c294f..c244e4d4a4 100644 --- a/hpc/L2/tests/rtm2d/rtm/description.json +++ b/hpc/L2/tests/rtm2d/rtm/description.json @@ -26,11 +26,6 @@ "cmd_args": "BUILD/rtm.xclbin BUILD/data/" } ], - "pre_launch": [ - { - "launch_cmd": "make data_gen" - } - ], "host": { "host_exe": "host.exe", "compiler": { diff --git a/hpc/L2/tests/rtm2d/rtm/tests/dataset_h128_w128_t10_s1/Makefile b/hpc/L2/tests/rtm2d/rtm/tests/dataset_h128_w128_t10_s1/Makefile index b14fa1265c..597141c9d8 100644 --- a/hpc/L2/tests/rtm2d/rtm/tests/dataset_h128_w128_t10_s1/Makefile +++ b/hpc/L2/tests/rtm2d/rtm/tests/dataset_h128_w128_t10_s1/Makefile @@ -11,7 +11,7 @@ # 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. -# vitis makefile-generator v2.0.6 +# vitis makefile-generator v2.0.7 ############################## Help Section ############################## .PHONY: help @@ -34,9 +34,15 @@ help:: $(ECHO) " Command to build host application." $(ECHO) " By default, HOST_ARCH=x86. HOST_ARCH is required for SoC shells" $(ECHO) "" - $(ECHO) " NOTE: For embedded devices, e.g. zcu102/zcu104/vck190, env variable SYSROOT and EDGE_COMMON_SW need to be set first, and HOST_ARCH is either aarch32 or aarch64. For example," - $(ECHO) " export SYSROOT=< path-to-platform-sysroot >" - $(ECHO) " export EDGE_COMMON_SW=< path-to-rootfs-and-Image-files >" + $(ECHO) " NOTE: For embedded devices, e.g. zcu102/zcu104/vck190, HOST_ARCH is either aarch32 or aarch64." + $(ECHO) " a.IF Download the platform, and common-image from Xilinx Download Center(Suggested):" + $(ECHO) " Run the sdk.sh script from the common-image directory to install sysroot using the command : ./sdk.sh -y -d ./ -p " + $(ECHO) " Unzip the rootfs file : gunzip ./rootfs.ext4.gz" + $(ECHO) " export SYSROOT=< path-to-platform-sysroot >" + $(ECHO) " b. User could also define SYSROOT, K_IMAGE and ROOTFS by themselves: " + $(ECHO) " export SYSROOT=< path-to-platform-sysroot >" + $(ECHO) " export K_IMAGE=< path-to-Image-files >" + $(ECHO) " export ROOTFS=< path-to-rootfs >" $(ECHO) "" $(ECHO) " make clean " $(ECHO) " Command to remove the generated non-hardware files." @@ -61,7 +67,7 @@ ifeq ($(PLATFORM),) PLATFORM := $(DEVICE) endif ifeq ($(PLATFORM),) -PLATFORM := xilinx_u280_xdma_201920_3 +PLATFORM := xilinx_u280_gen3x16_xdma_1_202120_1 endif # #################### Checking if PLATFORM in whitelist ############################ @@ -87,12 +93,17 @@ RUN_DEPS := # get global setting ifeq ($(HOST_ARCH), x86) CXXFLAGS += -fmessage-length=0 -I$(CUR_DIR)/src/ -I$(XILINX_XRT)/include -I$(XILINX_HLS)/include -std=c++14 -O3 -Wall -Wno-unknown-pragmas -Wno-unused-label -LDFLAGS += -pthread -L$(XILINX_XRT)/lib -L$(XILINX_HLS)/lnx64/tools/fpo_v7_0 -Wl,--as-needed -lOpenCL -lxrt_coreutil -lgmp -lmpfr -lIp_floating_point_v7_0_bitacc_cmodel +LDFLAGS += -pthread -L$(XILINX_XRT)/lib -L$(XILINX_HLS)/lnx64/tools/fpo_v7_1 -Wl,--as-needed -lOpenCL -lxrt_coreutil -lgmp -lmpfr -lIp_floating_point_v7_1_bitacc_cmodel VPP_FLAGS += -t $(TARGET) --platform $(XPLATFORM) --save-temps VPP_LDFLAGS += --optimize 2 -R 2 else ifeq ($(HOST_ARCH), aarch64) +ifeq ($(ps_on_x86), on) +CXXFLAGS += -fmessage-length=0 -I$(CUR_DIR)/src/ -I$(XILINX_XRT)/include -I$(XILINX_HLS)/include -std=c++14 -O3 -Wall -Wno-unknown-pragmas -Wno-unused-label +LDFLAGS += -pthread -L$(XILINX_XRT)/lib -L$(XILINX_HLS)/lnx64/tools/fpo_v7_1 -Wl,--as-needed -lOpenCL -lxrt_coreutil -lgmp -lmpfr -lIp_floating_point_v7_1_bitacc_cmodel +else CXXFLAGS += -I$(CUR_DIR)/src/ -fmessage-length=0 --sysroot=$(SYSROOT) -I$(SYSROOT)/usr/include/xrt -I$(XILINX_HLS)/include -std=c++14 -O3 -Wall -Wno-unknown-pragmas -Wno-unused-label -LDFLAGS += -pthread -L$(SYSROOT)/usr/lib -L$(XILINX_VITIS_AIETOOLS)/lib/aarch64.o -Wl,--as-needed -lxilinxopencl -lxrt_coreutil +LDFLAGS += -pthread -L$(SYSROOT)/usr/lib -Wl,--as-needed -lxilinxopencl -lxrt_coreutil +endif VPP_FLAGS += -t $(TARGET) --platform $(XPLATFORM) --save-temps VPP_LDFLAGS += --optimize 2 -R 2 endif @@ -107,15 +118,23 @@ ifeq ($(TARGET),hw_emu) CXXFLAGS += -D HW_EMU_TEST endif -ifeq (,$(findstring opencv,$(CXXFLAGS))) -CXXFLAGS += $(XRT_CXXFLAGS) -endif - #Inclue Required Host Source Files +ifeq ($(ps_on_x86), on) HOST_SRCS += $(XFLIB_DIR)/L2/tests/rtm2d/rtm/main.cpp $(XFLIB_DIR)/../blas/L2/src/xcl2/xcl2.cpp CXXFLAGS += -D RTM_dataType=float -D RTM_numFSMs=2 -D RTM_numBSMs=2 -D RTM_maxDim=256 -D RTM_MaxB=40 -D RTM_NXB=40 -D RTM_NZB=40 -D RTM_order=8 -D RTM_parEntries=8 -D RTM_verify=1 -D RTM_nPE=2 CXXFLAGS += -I $(XFLIB_DIR)/L2/include/sw/ -I $(XFLIB_DIR)/L2/include/sw/rtm2d/ -I $(XFLIB_DIR)/../blas/L1/tests/sw/include/ -I $(XFLIB_DIR)/../blas/L2/include/xcl2 CXXFLAGS += -O3 +else +HOST_SRCS += $(XFLIB_DIR)/L2/tests/rtm2d/rtm/main.cpp $(XFLIB_DIR)/../blas/L2/src/xcl2/xcl2.cpp +CXXFLAGS += -D RTM_dataType=float -D RTM_numFSMs=2 -D RTM_numBSMs=2 -D RTM_maxDim=256 -D RTM_MaxB=40 -D RTM_NXB=40 -D RTM_NZB=40 -D RTM_order=8 -D RTM_parEntries=8 -D RTM_verify=1 -D RTM_nPE=2 +CXXFLAGS += -I $(XFLIB_DIR)/L2/include/sw/ -I $(XFLIB_DIR)/L2/include/sw/rtm2d/ -I $(XFLIB_DIR)/../blas/L1/tests/sw/include/ -I $(XFLIB_DIR)/../blas/L2/include/xcl2 +CXXFLAGS += -O3 +endif + +# workaround for opencv +ifeq (,$(findstring opencv,$(CXXFLAGS))) +CXXFLAGS += $(XRT_CXXFLAGS) +endif EXE_NAME := host.exe EXE_FILE := $(BUILD_DIR)/$(EXE_NAME) @@ -194,11 +213,6 @@ $(EMCONFIG): emconfigutil --platform $(XPLATFORM) --od $(BUILD_DIR) ############################## Preparing sdcard folder ############################## ifneq ($(HOST_ARCH), x86) -ifneq (,$(findstring zc706, $(PLATFORM_NAME))) -K_IMAGE := $(SYSROOT)/../../uImage -else -K_IMAGE := $(SYSROOT)/../../Image -endif RUN_SCRIPT := $(BUILD_DIR)/run_script.sh $(RUN_SCRIPT): rm -rf $(RUN_SCRIPT) @@ -214,7 +228,7 @@ endif @echo './$(EXE_NAME) $(PKG_HOST_ARGS)' >> $(RUN_SCRIPT) @echo 'return_code=$$?' >> $(RUN_SCRIPT) @echo 'if [ $$return_code -ne 0 ]; then' >> $(RUN_SCRIPT) - @echo ' echo "ERROR: Embedded host run failed, RC=$$return_code"' >> $(RUN_SCRIPT) + @echo ' echo "ERROR: TEST FAILED, RC=$$return_code"' >> $(RUN_SCRIPT) @echo 'else' >> $(RUN_SCRIPT) @echo ' echo "INFO: TEST PASSED, RC=0"' >> $(RUN_SCRIPT) @echo 'fi' >> $(RUN_SCRIPT) @@ -232,23 +246,28 @@ SD_DIRS_WITH_PREFIX = $(foreach sd_dir,$(DATA_DIR),--package.sd_dir $(sd_dir)) PACKAGE_FILES := $(BINARY_CONTAINERS) PACKAGE_FILES += $(AIE_CONTAINER) SD_CARD := $(CUR_DIR)/package_$(TARGET) -vck190_dfx_hw := false -$(SD_CARD): $(EXE_FILE) $(BINARY_CONTAINERS) $(RUN_SCRIPT) $(EMCONFIG) +$(SD_CARD): $(EXE_FILE) $(BINARY_CONTAINERS) $(RUN_SCRIPT) $(EMCONFIG) check_kimage check_rootfs @echo "Generating sd_card folder...." mkdir -p $(SD_CARD) chmod a+rx $(BUILD_DIR)/run_script.sh -ifneq (,$(findstring vck190_base_dfx, $(PLATFORM_NAME))) -ifeq ($(TARGET),hw) - $(VPP) -t $(TARGET) --platform $(XPLATFORM) -p $(PACKAGE_FILES) -o $(BINARY_CONTAINERS_PKG) - $(VPP) -t $(TARGET) --platform $(XPLATFORM) -p --package.out_dir $(SD_CARD) --package.rootfs $(SYSROOT)/../../rootfs.ext4 --package.kernel_image $(K_IMAGE) $(SD_FILES_WITH_PREFIX) $(SD_DIRS_WITH_PREFIX) --package.sd_file $(BINARY_CONTAINERS_PKG) +# 1. DFX HW Flow +ifeq ($(dfx_hw), on) + $(VPP) -t $(TARGET) --platform $(XPLATFORM) -p $(PACKAGE_FILES) $(VPP_PACKAGE) -o $(BINARY_CONTAINERS_PKG) + $(VPP) -t $(TARGET) --platform $(XPLATFORM) -p --package.out_dir $(SD_CARD) --package.rootfs $(ROOTFS) --package.kernel_image $(K_IMAGE) $(SD_FILES_WITH_PREFIX) $(SD_DIRS_WITH_PREFIX) --package.sd_file $(BINARY_CONTAINERS_PKG) @echo "### ***** sd_card generation done! ***** ###" -vck190_dfx_hw := true endif +# 2. PS_ON_X86 - From 2022.2, Target:sw_emu +ifeq ($(ps_on_x86), on) + @echo "### ***** running PS X86 SE_EMU ***** ###" + $(VPP) -t $(TARGET) --platform $(XPLATFORM) -o $(BINARY_CONTAINERS_PKG) -p $(PACKAGE_FILES) $(VPP_PACKAGE) --package.out_dir $(SD_CARD) --package.emu_ps x86 endif -ifeq ($(vck190_dfx_hw), false) - $(VPP) -t $(TARGET) --platform $(XPLATFORM) -o $(BINARY_CONTAINERS_PKG) -p $(PACKAGE_FILES) $(VPP_PACKAGE) --package.out_dir $(SD_CARD) --package.rootfs $(SYSROOT)/../../rootfs.ext4 --package.kernel_image $(K_IMAGE) $(SD_FILES_WITH_PREFIX) $(SD_DIRS_WITH_PREFIX) +#3. General Embeded flow +ifeq ($(dfx_hw), off) +ifeq ($(ps_on_x86), off) + $(VPP) -t $(TARGET) --platform $(XPLATFORM) -o $(BINARY_CONTAINERS_PKG) -p $(PACKAGE_FILES) $(VPP_PACKAGE) --package.out_dir $(SD_CARD) --package.rootfs $(ROOTFS) --package.kernel_image $(K_IMAGE) $(SD_FILES_WITH_PREFIX) $(SD_DIRS_WITH_PREFIX) @echo "### ***** sd_card generation done! ***** ###" endif +endif .PHONY: sd_card sd_card: $(SD_CARD) @@ -272,7 +291,7 @@ ifeq ($(HOST_ARCH), x86) else @echo $(RUN_DEPS) - $(SD_CARD)/launch_$(TARGET).sh -no-reboot -run-app $(notdir $(RUN_SCRIPT)) + $(SD_CARD)/launch_$(TARGET).sh -no-reboot -run-app $(notdir $(RUN_SCRIPT)) 2>&1 | tee $(SD_CARD)/qemu_output.log grep "TEST PASSED, RC=0" $(SD_CARD)/qemu_output.log || exit 1 endif @@ -283,24 +302,32 @@ ifeq ($(HOST_ARCH), x86) LD_LIBRARY_PATH=$(LIBRARY_PATH):$$LD_LIBRARY_PATH \ XCL_EMULATION_MODE=$(TARGET) $(EXE_FILE) $(HOST_ARGS) +else +ifeq ($(ps_on_x86), on) + LD_LIBRARY_PATH=$(LIBRARY_PATH):$$LD_LIBRARY_PATH \ + XCL_EMULATION_MODE=$(TARGET) $(EXE_FILE) $(HOST_ARGS) + else @echo $(RUN_DEPS) - $(SD_CARD)/launch_$(TARGET).sh -no-reboot -run-app $(notdir $(RUN_SCRIPT)) + $(SD_CARD)/launch_$(TARGET).sh -no-reboot -run-app $(notdir $(RUN_SCRIPT)) 2>&1 | tee $(SD_CARD)/qemu_output.log grep "TEST PASSED, RC=0" $(SD_CARD)/qemu_output.log || exit 1 +endif endif endif #hw ifeq ($(TARGET), hw) ifneq (,$(findstring aws-vu9p-f1, $(PLATFORM_NAME))) -ifneq ($(JENKINS_INTERNAL_BUILD), 1) +ifeq (,$(wildcard $(BUILD_DIR)/rtm.awsxclbin)) $(ECHO) "This makefile does not directly support converting .xclbin to .awsxclbin, please refer https://github.com/aws/aws-fpga/blob/master/Vitis/README.md for next operations" else - $(ECHO) "Running inside Xilinx regression without converting to .awsxclbin" - $(EXE_FILE) $(HOST_ARGS) + $(ECHO) "Running HW using generated .awsxclbin" + LD_LIBRARY_PATH=$(LIBRARY_PATH):$$LD_LIBRARY_PATH \ + $(EXE_FILE) $(subst .xclbin,.awsxclbin,$(HOST_ARGS)) endif else ifeq ($(HOST_ARCH), x86) + LD_LIBRARY_PATH=$(LIBRARY_PATH):$$LD_LIBRARY_PATH \ $(EXE_FILE) $(HOST_ARGS) else @@ -334,12 +361,11 @@ cleanh: cleank: -$(RMDIR) $(BUILD_DIR)/*.xclbin _vimage *xclbin.run_summary qemu-memory-_* emulation/ _vimage/ pl*start_simulation. sh *.xclbin - -$(RMDIR) _x_temp.*/_x.* _x_temp.*/.Xil _x_temp.*/profile_summary.* xo_* _x* - -$(RMDIR) _x_temp.*/dltmp* _x_temp.*/kernel_info.dat _x_temp.*/*.log - -$(RMDIR) _x_temp.* + -$(RMDIR) _x_temp.* cleanall: cleanh cleank -$(RMDIR) $(BUILD_DIR) emconfig.json *.html $(TEMP_DIR) $(CUR_DIR)/reports *.csv *.run_summary $(CUR_DIR)/*.raw package_* $(BUILD_DIR)/run_script.sh .ipcache *.str -$(RMDIR) $(CUR_DIR)/Work $(CUR_DIR)/*.xpe $(CUR_DIR)/hw.o $(CUR_DIR)/*.xsa $(CUR_DIR)/xnwOut + -$(RMDIR) clean: cleanh \ No newline at end of file diff --git a/hpc/L2/tests/rtm2d/rtm/tests/dataset_h128_w128_t10_s1/description.json b/hpc/L2/tests/rtm2d/rtm/tests/dataset_h128_w128_t10_s1/description.json index 7e1cca05d6..2cf3ea0ea0 100644 --- a/hpc/L2/tests/rtm2d/rtm/tests/dataset_h128_w128_t10_s1/description.json +++ b/hpc/L2/tests/rtm2d/rtm/tests/dataset_h128_w128_t10_s1/description.json @@ -26,7 +26,6 @@ "cmd_args": "BUILD/rtm.xclbin PROJECT/data/ 128 128 10 1 1" } ], - "pre_launch": [], "host": { "host_exe": "host.exe", "compiler": { diff --git a/hpc/L2/tests/rtm2d/rtm/tests/dataset_h128_w128_t10_s1/utils.mk b/hpc/L2/tests/rtm2d/rtm/tests/dataset_h128_w128_t10_s1/utils.mk index 9b889021fc..2e9ea4d63a 100644 --- a/hpc/L2/tests/rtm2d/rtm/tests/dataset_h128_w128_t10_s1/utils.mk +++ b/hpc/L2/tests/rtm2d/rtm/tests/dataset_h128_w128_t10_s1/utils.mk @@ -12,7 +12,7 @@ # 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. -# vitis makefile-generator v2.0.6 +# vitis makefile-generator v2.0.7 # #+------------------------------------------------------------------------------- # The following parameters are assigned with default values. These parameters can @@ -50,6 +50,7 @@ ifndef XILINX_XRT export XILINX_XRT endif +.PHONY: check_device check_device: @set -eu; \ inallowlist=False; \ @@ -82,8 +83,9 @@ endif endif -#get suffix of kernel by PLATFORM +# Special processing for tool version/platform type VITIS_VER = $(shell v++ --version | grep 'v++' | sed 's/^[[:space:]]*//' | sed -e 's/^[*]* v++ v//g' | cut -d " " -f1) +# 1) for versal flow from 2022.1 DEVICE_TYPE = $(shell platforminfo -p $(PLATFORM) | grep 'FPGA Family' | sed 's/.*://' | sed '/ai_engine/d' | sed 's/^[[:space:]]*//') ifeq ($(DEVICE_TYPE), versal) ifeq ($(shell expr $(VITIS_VER) \>= 2022.1), 1) @@ -94,6 +96,22 @@ endif else LINK_TARGET_FMT := xclbin endif +# 2) dfx flow +dfx_hw := off +ifeq ($(findstring _dfx_, $(PLATFORM_NAME)),_dfx_) +ifeq ($(TARGET),hw) +dfx_hw := on +endif +endif +# 3) for embeded sw_emu flow from 2022.2 +ps_on_x86 := off +ifneq ($(HOST_ARCH), x86) +ifeq ($(shell expr $(VITIS_VER) \>= 2022.2), 1) +ifeq ($(TARGET), sw_emu) +ps_on_x86 := on +endif +endif +endif #Checks for Device Family ifeq ($(HOST_ARCH), aarch32) @@ -107,6 +125,7 @@ ifneq ($(HOST_ARCH), $(filter $(HOST_ARCH),aarch64 aarch32 x86)) $(error HOST_ARCH variable not set, please set correctly and rerun) endif +.PHONY: check_version check_sysroot check_kimage check_rootfs check_version: ifneq (, $(shell which git)) ifneq (,$(wildcard $(XFLIB_DIR)/.git)) @@ -114,17 +133,46 @@ ifneq (,$(wildcard $(XFLIB_DIR)/.git)) endif endif -#Checks for SYSROOT +#Set/Check SYSROOT/K_IMAGE/ROOTFS +ifneq ($(HOST_ARCH), x86) +ifneq (,$(findstring zc706, $(PLATFORM_NAME))) +K_IMAGE ?= $(SYSROOT)/../../uImage +else +K_IMAGE ?= $(SYSROOT)/../../Image +endif +ROOTFS ?= $(SYSROOT)/../../rootfs.ext4 +endif + check_sysroot: ifneq ($(HOST_ARCH), x86) -ifndef SYSROOT +ifeq (,$(wildcard $(SYSROOT))) $(error SYSROOT ENV variable is not set, please set ENV variable correctly and rerun) endif endif +check_kimage: +ifneq ($(HOST_ARCH), x86) +ifeq (,$(wildcard $(K_IMAGE))) + $(error K_IMAGE ENV variable is not set, please set ENV variable correctly and rerun) +endif +endif +check_rootfs: +ifneq ($(HOST_ARCH), x86) +ifeq (,$(wildcard $(ROOTFS))) + $(error ROOTFS ENV variable is not set, please set ENV variable correctly and rerun) +endif +endif #Checks for g++ -CXX := g++ ifeq ($(HOST_ARCH), x86) +X86_CXX := true +else +ifeq ($(ps_on_x86), true) +X86_CXX := true +endif +endif + +CXX := g++ +ifeq ($(X86_CXX), true) ifeq ($(shell expr $(VITIS_VER) \>= 2022.1), 1) CXX_VER := 8.3.0 else @@ -144,11 +192,13 @@ endif $(warning [WARNING]: g++ version too old. Using g++ provided by the tool: $(CXX)) endif endif -else ifeq ($(HOST_ARCH), aarch64) +else +ifeq ($(HOST_ARCH), aarch64) CXX := $(XILINX_VITIS)/gnu/aarch64/lin/aarch64-linux/bin/aarch64-linux-gnu-g++ else ifeq ($(HOST_ARCH), aarch32) CXX := $(XILINX_VITIS)/gnu/aarch32/lin/gcc-arm-linux-gnueabi/bin/arm-linux-gnueabihf-g++ endif +endif #Check OS and setting env for xrt c++ api OSDIST = $(shell lsb_release -i |awk -F: '{print tolower($$2)}' | tr -d ' \t' ) @@ -268,9 +318,3 @@ RMDIR = rm -rf MV = mv -f CP = cp -rf ECHO:= @echo -ifneq (,$(shell echo $(XPLATFORM) | awk '/xilinx_u280_xdma_201920_3/')) -VPP_FLAGS += --advanced.param compiler.ignorePlatformCompatibilityCheck=true -ifeq ($(TARGET), hw) -VPP_LDFLAGS += --advanced.param compiler.userPreSysLinkOverlayTcl=preSysLink.tcl -endif -endif diff --git a/hpc/L2/tests/rtm2d/rtm/utils.mk b/hpc/L2/tests/rtm2d/rtm/utils.mk index 9b889021fc..2e9ea4d63a 100644 --- a/hpc/L2/tests/rtm2d/rtm/utils.mk +++ b/hpc/L2/tests/rtm2d/rtm/utils.mk @@ -12,7 +12,7 @@ # 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. -# vitis makefile-generator v2.0.6 +# vitis makefile-generator v2.0.7 # #+------------------------------------------------------------------------------- # The following parameters are assigned with default values. These parameters can @@ -50,6 +50,7 @@ ifndef XILINX_XRT export XILINX_XRT endif +.PHONY: check_device check_device: @set -eu; \ inallowlist=False; \ @@ -82,8 +83,9 @@ endif endif -#get suffix of kernel by PLATFORM +# Special processing for tool version/platform type VITIS_VER = $(shell v++ --version | grep 'v++' | sed 's/^[[:space:]]*//' | sed -e 's/^[*]* v++ v//g' | cut -d " " -f1) +# 1) for versal flow from 2022.1 DEVICE_TYPE = $(shell platforminfo -p $(PLATFORM) | grep 'FPGA Family' | sed 's/.*://' | sed '/ai_engine/d' | sed 's/^[[:space:]]*//') ifeq ($(DEVICE_TYPE), versal) ifeq ($(shell expr $(VITIS_VER) \>= 2022.1), 1) @@ -94,6 +96,22 @@ endif else LINK_TARGET_FMT := xclbin endif +# 2) dfx flow +dfx_hw := off +ifeq ($(findstring _dfx_, $(PLATFORM_NAME)),_dfx_) +ifeq ($(TARGET),hw) +dfx_hw := on +endif +endif +# 3) for embeded sw_emu flow from 2022.2 +ps_on_x86 := off +ifneq ($(HOST_ARCH), x86) +ifeq ($(shell expr $(VITIS_VER) \>= 2022.2), 1) +ifeq ($(TARGET), sw_emu) +ps_on_x86 := on +endif +endif +endif #Checks for Device Family ifeq ($(HOST_ARCH), aarch32) @@ -107,6 +125,7 @@ ifneq ($(HOST_ARCH), $(filter $(HOST_ARCH),aarch64 aarch32 x86)) $(error HOST_ARCH variable not set, please set correctly and rerun) endif +.PHONY: check_version check_sysroot check_kimage check_rootfs check_version: ifneq (, $(shell which git)) ifneq (,$(wildcard $(XFLIB_DIR)/.git)) @@ -114,17 +133,46 @@ ifneq (,$(wildcard $(XFLIB_DIR)/.git)) endif endif -#Checks for SYSROOT +#Set/Check SYSROOT/K_IMAGE/ROOTFS +ifneq ($(HOST_ARCH), x86) +ifneq (,$(findstring zc706, $(PLATFORM_NAME))) +K_IMAGE ?= $(SYSROOT)/../../uImage +else +K_IMAGE ?= $(SYSROOT)/../../Image +endif +ROOTFS ?= $(SYSROOT)/../../rootfs.ext4 +endif + check_sysroot: ifneq ($(HOST_ARCH), x86) -ifndef SYSROOT +ifeq (,$(wildcard $(SYSROOT))) $(error SYSROOT ENV variable is not set, please set ENV variable correctly and rerun) endif endif +check_kimage: +ifneq ($(HOST_ARCH), x86) +ifeq (,$(wildcard $(K_IMAGE))) + $(error K_IMAGE ENV variable is not set, please set ENV variable correctly and rerun) +endif +endif +check_rootfs: +ifneq ($(HOST_ARCH), x86) +ifeq (,$(wildcard $(ROOTFS))) + $(error ROOTFS ENV variable is not set, please set ENV variable correctly and rerun) +endif +endif #Checks for g++ -CXX := g++ ifeq ($(HOST_ARCH), x86) +X86_CXX := true +else +ifeq ($(ps_on_x86), true) +X86_CXX := true +endif +endif + +CXX := g++ +ifeq ($(X86_CXX), true) ifeq ($(shell expr $(VITIS_VER) \>= 2022.1), 1) CXX_VER := 8.3.0 else @@ -144,11 +192,13 @@ endif $(warning [WARNING]: g++ version too old. Using g++ provided by the tool: $(CXX)) endif endif -else ifeq ($(HOST_ARCH), aarch64) +else +ifeq ($(HOST_ARCH), aarch64) CXX := $(XILINX_VITIS)/gnu/aarch64/lin/aarch64-linux/bin/aarch64-linux-gnu-g++ else ifeq ($(HOST_ARCH), aarch32) CXX := $(XILINX_VITIS)/gnu/aarch32/lin/gcc-arm-linux-gnueabi/bin/arm-linux-gnueabihf-g++ endif +endif #Check OS and setting env for xrt c++ api OSDIST = $(shell lsb_release -i |awk -F: '{print tolower($$2)}' | tr -d ' \t' ) @@ -268,9 +318,3 @@ RMDIR = rm -rf MV = mv -f CP = cp -rf ECHO:= @echo -ifneq (,$(shell echo $(XPLATFORM) | awk '/xilinx_u280_xdma_201920_3/')) -VPP_FLAGS += --advanced.param compiler.ignorePlatformCompatibilityCheck=true -ifeq ($(TARGET), hw) -VPP_LDFLAGS += --advanced.param compiler.userPreSysLinkOverlayTcl=preSysLink.tcl -endif -endif diff --git a/hpc/L2/tests/rtm2d/rtmbackward/Makefile b/hpc/L2/tests/rtm2d/rtmbackward/Makefile index 5ba7260ae2..3c85d0b8d2 100644 --- a/hpc/L2/tests/rtm2d/rtmbackward/Makefile +++ b/hpc/L2/tests/rtm2d/rtmbackward/Makefile @@ -11,7 +11,7 @@ # 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. -# vitis makefile-generator v2.0.6 +# vitis makefile-generator v2.0.7 ############################## Help Section ############################## .PHONY: help @@ -34,9 +34,15 @@ help:: $(ECHO) " Command to build host application." $(ECHO) " By default, HOST_ARCH=x86. HOST_ARCH is required for SoC shells" $(ECHO) "" - $(ECHO) " NOTE: For embedded devices, e.g. zcu102/zcu104/vck190, env variable SYSROOT and EDGE_COMMON_SW need to be set first, and HOST_ARCH is either aarch32 or aarch64. For example," - $(ECHO) " export SYSROOT=< path-to-platform-sysroot >" - $(ECHO) " export EDGE_COMMON_SW=< path-to-rootfs-and-Image-files >" + $(ECHO) " NOTE: For embedded devices, e.g. zcu102/zcu104/vck190, HOST_ARCH is either aarch32 or aarch64." + $(ECHO) " a.IF Download the platform, and common-image from Xilinx Download Center(Suggested):" + $(ECHO) " Run the sdk.sh script from the common-image directory to install sysroot using the command : ./sdk.sh -y -d ./ -p " + $(ECHO) " Unzip the rootfs file : gunzip ./rootfs.ext4.gz" + $(ECHO) " export SYSROOT=< path-to-platform-sysroot >" + $(ECHO) " b. User could also define SYSROOT, K_IMAGE and ROOTFS by themselves: " + $(ECHO) " export SYSROOT=< path-to-platform-sysroot >" + $(ECHO) " export K_IMAGE=< path-to-Image-files >" + $(ECHO) " export ROOTFS=< path-to-rootfs >" $(ECHO) "" $(ECHO) " make clean " $(ECHO) " Command to remove the generated non-hardware files." @@ -61,7 +67,7 @@ ifeq ($(PLATFORM),) PLATFORM := $(DEVICE) endif ifeq ($(PLATFORM),) -PLATFORM := xilinx_u280_xdma_201920_3 +PLATFORM := xilinx_u280_gen3x16_xdma_1_202120_1 endif # #################### Checking if PLATFORM in whitelist ############################ @@ -87,12 +93,17 @@ RUN_DEPS := # get global setting ifeq ($(HOST_ARCH), x86) CXXFLAGS += -fmessage-length=0 -I$(CUR_DIR)/src/ -I$(XILINX_XRT)/include -I$(XILINX_HLS)/include -std=c++14 -O3 -Wall -Wno-unknown-pragmas -Wno-unused-label -LDFLAGS += -pthread -L$(XILINX_XRT)/lib -L$(XILINX_HLS)/lnx64/tools/fpo_v7_0 -Wl,--as-needed -lOpenCL -lxrt_coreutil -lgmp -lmpfr -lIp_floating_point_v7_0_bitacc_cmodel +LDFLAGS += -pthread -L$(XILINX_XRT)/lib -L$(XILINX_HLS)/lnx64/tools/fpo_v7_1 -Wl,--as-needed -lOpenCL -lxrt_coreutil -lgmp -lmpfr -lIp_floating_point_v7_1_bitacc_cmodel VPP_FLAGS += -t $(TARGET) --platform $(XPLATFORM) --save-temps VPP_LDFLAGS += --optimize 2 -R 2 else ifeq ($(HOST_ARCH), aarch64) +ifeq ($(ps_on_x86), on) +CXXFLAGS += -fmessage-length=0 -I$(CUR_DIR)/src/ -I$(XILINX_XRT)/include -I$(XILINX_HLS)/include -std=c++14 -O3 -Wall -Wno-unknown-pragmas -Wno-unused-label +LDFLAGS += -pthread -L$(XILINX_XRT)/lib -L$(XILINX_HLS)/lnx64/tools/fpo_v7_1 -Wl,--as-needed -lOpenCL -lxrt_coreutil -lgmp -lmpfr -lIp_floating_point_v7_1_bitacc_cmodel +else CXXFLAGS += -I$(CUR_DIR)/src/ -fmessage-length=0 --sysroot=$(SYSROOT) -I$(SYSROOT)/usr/include/xrt -I$(XILINX_HLS)/include -std=c++14 -O3 -Wall -Wno-unknown-pragmas -Wno-unused-label -LDFLAGS += -pthread -L$(SYSROOT)/usr/lib -L$(XILINX_VITIS_AIETOOLS)/lib/aarch64.o -Wl,--as-needed -lxilinxopencl -lxrt_coreutil +LDFLAGS += -pthread -L$(SYSROOT)/usr/lib -Wl,--as-needed -lxilinxopencl -lxrt_coreutil +endif VPP_FLAGS += -t $(TARGET) --platform $(XPLATFORM) --save-temps VPP_LDFLAGS += --optimize 2 -R 2 endif @@ -107,15 +118,23 @@ ifeq ($(TARGET),hw_emu) CXXFLAGS += -D HW_EMU_TEST endif -ifeq (,$(findstring opencv,$(CXXFLAGS))) -CXXFLAGS += $(XRT_CXXFLAGS) -endif - #Inclue Required Host Source Files +ifeq ($(ps_on_x86), on) HOST_SRCS += $(XFLIB_DIR)/L2/tests/rtm2d/rtmbackward/main.cpp $(XFLIB_DIR)/../blas/L2/src/xcl2/xcl2.cpp CXXFLAGS += -D RTM_dataType=float -D RTM_numBSMs=5 -D RTM_maxDim=1280 -D RTM_MaxB=40 -D RTM_NXB=40 -D RTM_NZB=40 -D RTM_order=8 -D RTM_parEntries=8 -D RTM_verify=1 -D RTM_nPE=2 CXXFLAGS += -I $(XFLIB_DIR)/L1/include/hw -I $(XFLIB_DIR)/L2/include/sw/ -I $(XFLIB_DIR)/L2/include/sw/rtm2d -I $(XFLIB_DIR)/../blas/L1/tests/sw/include/ -I $(XFLIB_DIR)/../blas/L2/include/xcl2 CXXFLAGS += -O3 +else +HOST_SRCS += $(XFLIB_DIR)/L2/tests/rtm2d/rtmbackward/main.cpp $(XFLIB_DIR)/../blas/L2/src/xcl2/xcl2.cpp +CXXFLAGS += -D RTM_dataType=float -D RTM_numBSMs=5 -D RTM_maxDim=1280 -D RTM_MaxB=40 -D RTM_NXB=40 -D RTM_NZB=40 -D RTM_order=8 -D RTM_parEntries=8 -D RTM_verify=1 -D RTM_nPE=2 +CXXFLAGS += -I $(XFLIB_DIR)/L1/include/hw -I $(XFLIB_DIR)/L2/include/sw/ -I $(XFLIB_DIR)/L2/include/sw/rtm2d -I $(XFLIB_DIR)/../blas/L1/tests/sw/include/ -I $(XFLIB_DIR)/../blas/L2/include/xcl2 +CXXFLAGS += -O3 +endif + +# workaround for opencv +ifeq (,$(findstring opencv,$(CXXFLAGS))) +CXXFLAGS += $(XRT_CXXFLAGS) +endif EXE_NAME := host.exe EXE_FILE := $(BUILD_DIR)/$(EXE_NAME) @@ -175,11 +194,6 @@ $(EMCONFIG): emconfigutil --platform $(XPLATFORM) --od $(BUILD_DIR) ############################## Preparing sdcard folder ############################## ifneq ($(HOST_ARCH), x86) -ifneq (,$(findstring zc706, $(PLATFORM_NAME))) -K_IMAGE := $(SYSROOT)/../../uImage -else -K_IMAGE := $(SYSROOT)/../../Image -endif RUN_SCRIPT := $(BUILD_DIR)/run_script.sh $(RUN_SCRIPT): rm -rf $(RUN_SCRIPT) @@ -195,7 +209,7 @@ endif @echo './$(EXE_NAME) $(PKG_HOST_ARGS)' >> $(RUN_SCRIPT) @echo 'return_code=$$?' >> $(RUN_SCRIPT) @echo 'if [ $$return_code -ne 0 ]; then' >> $(RUN_SCRIPT) - @echo ' echo "ERROR: Embedded host run failed, RC=$$return_code"' >> $(RUN_SCRIPT) + @echo ' echo "ERROR: TEST FAILED, RC=$$return_code"' >> $(RUN_SCRIPT) @echo 'else' >> $(RUN_SCRIPT) @echo ' echo "INFO: TEST PASSED, RC=0"' >> $(RUN_SCRIPT) @echo 'fi' >> $(RUN_SCRIPT) @@ -213,23 +227,28 @@ SD_DIRS_WITH_PREFIX = $(foreach sd_dir,$(DATA_DIR),--package.sd_dir $(sd_dir)) PACKAGE_FILES := $(BINARY_CONTAINERS) PACKAGE_FILES += $(AIE_CONTAINER) SD_CARD := $(CUR_DIR)/package_$(TARGET) -vck190_dfx_hw := false -$(SD_CARD): $(EXE_FILE) $(BINARY_CONTAINERS) $(RUN_SCRIPT) $(EMCONFIG) +$(SD_CARD): $(EXE_FILE) $(BINARY_CONTAINERS) $(RUN_SCRIPT) $(EMCONFIG) check_kimage check_rootfs @echo "Generating sd_card folder...." mkdir -p $(SD_CARD) chmod a+rx $(BUILD_DIR)/run_script.sh -ifneq (,$(findstring vck190_base_dfx, $(PLATFORM_NAME))) -ifeq ($(TARGET),hw) - $(VPP) -t $(TARGET) --platform $(XPLATFORM) -p $(PACKAGE_FILES) -o $(BINARY_CONTAINERS_PKG) - $(VPP) -t $(TARGET) --platform $(XPLATFORM) -p --package.out_dir $(SD_CARD) --package.rootfs $(SYSROOT)/../../rootfs.ext4 --package.kernel_image $(K_IMAGE) $(SD_FILES_WITH_PREFIX) $(SD_DIRS_WITH_PREFIX) --package.sd_file $(BINARY_CONTAINERS_PKG) +# 1. DFX HW Flow +ifeq ($(dfx_hw), on) + $(VPP) -t $(TARGET) --platform $(XPLATFORM) -p $(PACKAGE_FILES) $(VPP_PACKAGE) -o $(BINARY_CONTAINERS_PKG) + $(VPP) -t $(TARGET) --platform $(XPLATFORM) -p --package.out_dir $(SD_CARD) --package.rootfs $(ROOTFS) --package.kernel_image $(K_IMAGE) $(SD_FILES_WITH_PREFIX) $(SD_DIRS_WITH_PREFIX) --package.sd_file $(BINARY_CONTAINERS_PKG) @echo "### ***** sd_card generation done! ***** ###" -vck190_dfx_hw := true endif +# 2. PS_ON_X86 - From 2022.2, Target:sw_emu +ifeq ($(ps_on_x86), on) + @echo "### ***** running PS X86 SE_EMU ***** ###" + $(VPP) -t $(TARGET) --platform $(XPLATFORM) -o $(BINARY_CONTAINERS_PKG) -p $(PACKAGE_FILES) $(VPP_PACKAGE) --package.out_dir $(SD_CARD) --package.emu_ps x86 endif -ifeq ($(vck190_dfx_hw), false) - $(VPP) -t $(TARGET) --platform $(XPLATFORM) -o $(BINARY_CONTAINERS_PKG) -p $(PACKAGE_FILES) $(VPP_PACKAGE) --package.out_dir $(SD_CARD) --package.rootfs $(SYSROOT)/../../rootfs.ext4 --package.kernel_image $(K_IMAGE) $(SD_FILES_WITH_PREFIX) $(SD_DIRS_WITH_PREFIX) +#3. General Embeded flow +ifeq ($(dfx_hw), off) +ifeq ($(ps_on_x86), off) + $(VPP) -t $(TARGET) --platform $(XPLATFORM) -o $(BINARY_CONTAINERS_PKG) -p $(PACKAGE_FILES) $(VPP_PACKAGE) --package.out_dir $(SD_CARD) --package.rootfs $(ROOTFS) --package.kernel_image $(K_IMAGE) $(SD_FILES_WITH_PREFIX) $(SD_DIRS_WITH_PREFIX) @echo "### ***** sd_card generation done! ***** ###" endif +endif .PHONY: sd_card sd_card: $(SD_CARD) @@ -253,7 +272,7 @@ ifeq ($(HOST_ARCH), x86) else @echo $(RUN_DEPS) - $(SD_CARD)/launch_$(TARGET).sh -no-reboot -run-app $(notdir $(RUN_SCRIPT)) + $(SD_CARD)/launch_$(TARGET).sh -no-reboot -run-app $(notdir $(RUN_SCRIPT)) 2>&1 | tee $(SD_CARD)/qemu_output.log grep "TEST PASSED, RC=0" $(SD_CARD)/qemu_output.log || exit 1 endif @@ -264,24 +283,32 @@ ifeq ($(HOST_ARCH), x86) LD_LIBRARY_PATH=$(LIBRARY_PATH):$$LD_LIBRARY_PATH \ XCL_EMULATION_MODE=$(TARGET) $(EXE_FILE) $(HOST_ARGS) +else +ifeq ($(ps_on_x86), on) + LD_LIBRARY_PATH=$(LIBRARY_PATH):$$LD_LIBRARY_PATH \ + XCL_EMULATION_MODE=$(TARGET) $(EXE_FILE) $(HOST_ARGS) + else @echo $(RUN_DEPS) - $(SD_CARD)/launch_$(TARGET).sh -no-reboot -run-app $(notdir $(RUN_SCRIPT)) + $(SD_CARD)/launch_$(TARGET).sh -no-reboot -run-app $(notdir $(RUN_SCRIPT)) 2>&1 | tee $(SD_CARD)/qemu_output.log grep "TEST PASSED, RC=0" $(SD_CARD)/qemu_output.log || exit 1 +endif endif endif #hw ifeq ($(TARGET), hw) ifneq (,$(findstring aws-vu9p-f1, $(PLATFORM_NAME))) -ifneq ($(JENKINS_INTERNAL_BUILD), 1) +ifeq (,$(wildcard $(BUILD_DIR)/rtmbackward.awsxclbin)) $(ECHO) "This makefile does not directly support converting .xclbin to .awsxclbin, please refer https://github.com/aws/aws-fpga/blob/master/Vitis/README.md for next operations" else - $(ECHO) "Running inside Xilinx regression without converting to .awsxclbin" - $(EXE_FILE) $(HOST_ARGS) + $(ECHO) "Running HW using generated .awsxclbin" + LD_LIBRARY_PATH=$(LIBRARY_PATH):$$LD_LIBRARY_PATH \ + $(EXE_FILE) $(subst .xclbin,.awsxclbin,$(HOST_ARGS)) endif else ifeq ($(HOST_ARCH), x86) + LD_LIBRARY_PATH=$(LIBRARY_PATH):$$LD_LIBRARY_PATH \ $(EXE_FILE) $(HOST_ARGS) else @@ -315,12 +342,11 @@ cleanh: cleank: -$(RMDIR) $(BUILD_DIR)/*.xclbin _vimage *xclbin.run_summary qemu-memory-_* emulation/ _vimage/ pl*start_simulation. sh *.xclbin - -$(RMDIR) _x_temp.*/_x.* _x_temp.*/.Xil _x_temp.*/profile_summary.* xo_* _x* - -$(RMDIR) _x_temp.*/dltmp* _x_temp.*/kernel_info.dat _x_temp.*/*.log - -$(RMDIR) _x_temp.* + -$(RMDIR) _x_temp.* cleanall: cleanh cleank -$(RMDIR) $(BUILD_DIR) emconfig.json *.html $(TEMP_DIR) $(CUR_DIR)/reports *.csv *.run_summary $(CUR_DIR)/*.raw package_* $(BUILD_DIR)/run_script.sh .ipcache *.str -$(RMDIR) $(CUR_DIR)/Work $(CUR_DIR)/*.xpe $(CUR_DIR)/hw.o $(CUR_DIR)/*.xsa $(CUR_DIR)/xnwOut + -$(RMDIR) clean: cleanh \ No newline at end of file diff --git a/hpc/L2/tests/rtm2d/rtmbackward/description.json b/hpc/L2/tests/rtm2d/rtmbackward/description.json index ddab088530..97e646bf4c 100644 --- a/hpc/L2/tests/rtm2d/rtmbackward/description.json +++ b/hpc/L2/tests/rtm2d/rtmbackward/description.json @@ -19,11 +19,6 @@ "cmd_args": "BUILD/rtm.xclbin BUILD/data/" } ], - "pre_launch": [ - { - "launch_cmd": "make data_gen" - } - ], "host": { "host_exe": "host.exe", "compiler": { diff --git a/hpc/L2/tests/rtm2d/rtmbackward/tests/dataset_h128_w128_t10/Makefile b/hpc/L2/tests/rtm2d/rtmbackward/tests/dataset_h128_w128_t10/Makefile index 8fba70a660..527d0df7cc 100644 --- a/hpc/L2/tests/rtm2d/rtmbackward/tests/dataset_h128_w128_t10/Makefile +++ b/hpc/L2/tests/rtm2d/rtmbackward/tests/dataset_h128_w128_t10/Makefile @@ -11,7 +11,7 @@ # 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. -# vitis makefile-generator v2.0.6 +# vitis makefile-generator v2.0.7 ############################## Help Section ############################## .PHONY: help @@ -34,9 +34,15 @@ help:: $(ECHO) " Command to build host application." $(ECHO) " By default, HOST_ARCH=x86. HOST_ARCH is required for SoC shells" $(ECHO) "" - $(ECHO) " NOTE: For embedded devices, e.g. zcu102/zcu104/vck190, env variable SYSROOT and EDGE_COMMON_SW need to be set first, and HOST_ARCH is either aarch32 or aarch64. For example," - $(ECHO) " export SYSROOT=< path-to-platform-sysroot >" - $(ECHO) " export EDGE_COMMON_SW=< path-to-rootfs-and-Image-files >" + $(ECHO) " NOTE: For embedded devices, e.g. zcu102/zcu104/vck190, HOST_ARCH is either aarch32 or aarch64." + $(ECHO) " a.IF Download the platform, and common-image from Xilinx Download Center(Suggested):" + $(ECHO) " Run the sdk.sh script from the common-image directory to install sysroot using the command : ./sdk.sh -y -d ./ -p " + $(ECHO) " Unzip the rootfs file : gunzip ./rootfs.ext4.gz" + $(ECHO) " export SYSROOT=< path-to-platform-sysroot >" + $(ECHO) " b. User could also define SYSROOT, K_IMAGE and ROOTFS by themselves: " + $(ECHO) " export SYSROOT=< path-to-platform-sysroot >" + $(ECHO) " export K_IMAGE=< path-to-Image-files >" + $(ECHO) " export ROOTFS=< path-to-rootfs >" $(ECHO) "" $(ECHO) " make clean " $(ECHO) " Command to remove the generated non-hardware files." @@ -61,7 +67,7 @@ ifeq ($(PLATFORM),) PLATFORM := $(DEVICE) endif ifeq ($(PLATFORM),) -PLATFORM := xilinx_u280_xdma_201920_3 +PLATFORM := xilinx_u280_gen3x16_xdma_1_202120_1 endif # #################### Checking if PLATFORM in whitelist ############################ @@ -87,12 +93,17 @@ RUN_DEPS := # get global setting ifeq ($(HOST_ARCH), x86) CXXFLAGS += -fmessage-length=0 -I$(CUR_DIR)/src/ -I$(XILINX_XRT)/include -I$(XILINX_HLS)/include -std=c++14 -O3 -Wall -Wno-unknown-pragmas -Wno-unused-label -LDFLAGS += -pthread -L$(XILINX_XRT)/lib -L$(XILINX_HLS)/lnx64/tools/fpo_v7_0 -Wl,--as-needed -lOpenCL -lxrt_coreutil -lgmp -lmpfr -lIp_floating_point_v7_0_bitacc_cmodel +LDFLAGS += -pthread -L$(XILINX_XRT)/lib -L$(XILINX_HLS)/lnx64/tools/fpo_v7_1 -Wl,--as-needed -lOpenCL -lxrt_coreutil -lgmp -lmpfr -lIp_floating_point_v7_1_bitacc_cmodel VPP_FLAGS += -t $(TARGET) --platform $(XPLATFORM) --save-temps VPP_LDFLAGS += --optimize 2 -R 2 else ifeq ($(HOST_ARCH), aarch64) +ifeq ($(ps_on_x86), on) +CXXFLAGS += -fmessage-length=0 -I$(CUR_DIR)/src/ -I$(XILINX_XRT)/include -I$(XILINX_HLS)/include -std=c++14 -O3 -Wall -Wno-unknown-pragmas -Wno-unused-label +LDFLAGS += -pthread -L$(XILINX_XRT)/lib -L$(XILINX_HLS)/lnx64/tools/fpo_v7_1 -Wl,--as-needed -lOpenCL -lxrt_coreutil -lgmp -lmpfr -lIp_floating_point_v7_1_bitacc_cmodel +else CXXFLAGS += -I$(CUR_DIR)/src/ -fmessage-length=0 --sysroot=$(SYSROOT) -I$(SYSROOT)/usr/include/xrt -I$(XILINX_HLS)/include -std=c++14 -O3 -Wall -Wno-unknown-pragmas -Wno-unused-label -LDFLAGS += -pthread -L$(SYSROOT)/usr/lib -L$(XILINX_VITIS_AIETOOLS)/lib/aarch64.o -Wl,--as-needed -lxilinxopencl -lxrt_coreutil +LDFLAGS += -pthread -L$(SYSROOT)/usr/lib -Wl,--as-needed -lxilinxopencl -lxrt_coreutil +endif VPP_FLAGS += -t $(TARGET) --platform $(XPLATFORM) --save-temps VPP_LDFLAGS += --optimize 2 -R 2 endif @@ -107,15 +118,23 @@ ifeq ($(TARGET),hw_emu) CXXFLAGS += -D HW_EMU_TEST endif -ifeq (,$(findstring opencv,$(CXXFLAGS))) -CXXFLAGS += $(XRT_CXXFLAGS) -endif - #Inclue Required Host Source Files +ifeq ($(ps_on_x86), on) HOST_SRCS += $(XFLIB_DIR)/L2/tests/rtm2d/rtmbackward/main.cpp $(XFLIB_DIR)/../blas/L2/src/xcl2/xcl2.cpp CXXFLAGS += -D RTM_dataType=float -D RTM_numBSMs=2 -D RTM_maxDim=256 -D RTM_MaxB=40 -D RTM_NXB=40 -D RTM_NZB=40 -D RTM_order=8 -D RTM_parEntries=8 -D RTM_verify=1 -D RTM_nPE=2 CXXFLAGS += -I $(XFLIB_DIR)/L2/include/sw/ -I $(XFLIB_DIR)/L2/include/sw/rtm2d/ -I $(XFLIB_DIR)/../blas/L1/tests/sw/include/ -I $(XFLIB_DIR)/../blas/L2/include/xcl2 CXXFLAGS += -O3 +else +HOST_SRCS += $(XFLIB_DIR)/L2/tests/rtm2d/rtmbackward/main.cpp $(XFLIB_DIR)/../blas/L2/src/xcl2/xcl2.cpp +CXXFLAGS += -D RTM_dataType=float -D RTM_numBSMs=2 -D RTM_maxDim=256 -D RTM_MaxB=40 -D RTM_NXB=40 -D RTM_NZB=40 -D RTM_order=8 -D RTM_parEntries=8 -D RTM_verify=1 -D RTM_nPE=2 +CXXFLAGS += -I $(XFLIB_DIR)/L2/include/sw/ -I $(XFLIB_DIR)/L2/include/sw/rtm2d/ -I $(XFLIB_DIR)/../blas/L1/tests/sw/include/ -I $(XFLIB_DIR)/../blas/L2/include/xcl2 +CXXFLAGS += -O3 +endif + +# workaround for opencv +ifeq (,$(findstring opencv,$(CXXFLAGS))) +CXXFLAGS += $(XRT_CXXFLAGS) +endif EXE_NAME := host.exe EXE_FILE := $(BUILD_DIR)/$(EXE_NAME) @@ -175,11 +194,6 @@ $(EMCONFIG): emconfigutil --platform $(XPLATFORM) --od $(BUILD_DIR) ############################## Preparing sdcard folder ############################## ifneq ($(HOST_ARCH), x86) -ifneq (,$(findstring zc706, $(PLATFORM_NAME))) -K_IMAGE := $(SYSROOT)/../../uImage -else -K_IMAGE := $(SYSROOT)/../../Image -endif RUN_SCRIPT := $(BUILD_DIR)/run_script.sh $(RUN_SCRIPT): rm -rf $(RUN_SCRIPT) @@ -195,7 +209,7 @@ endif @echo './$(EXE_NAME) $(PKG_HOST_ARGS)' >> $(RUN_SCRIPT) @echo 'return_code=$$?' >> $(RUN_SCRIPT) @echo 'if [ $$return_code -ne 0 ]; then' >> $(RUN_SCRIPT) - @echo ' echo "ERROR: Embedded host run failed, RC=$$return_code"' >> $(RUN_SCRIPT) + @echo ' echo "ERROR: TEST FAILED, RC=$$return_code"' >> $(RUN_SCRIPT) @echo 'else' >> $(RUN_SCRIPT) @echo ' echo "INFO: TEST PASSED, RC=0"' >> $(RUN_SCRIPT) @echo 'fi' >> $(RUN_SCRIPT) @@ -213,23 +227,28 @@ SD_DIRS_WITH_PREFIX = $(foreach sd_dir,$(DATA_DIR),--package.sd_dir $(sd_dir)) PACKAGE_FILES := $(BINARY_CONTAINERS) PACKAGE_FILES += $(AIE_CONTAINER) SD_CARD := $(CUR_DIR)/package_$(TARGET) -vck190_dfx_hw := false -$(SD_CARD): $(EXE_FILE) $(BINARY_CONTAINERS) $(RUN_SCRIPT) $(EMCONFIG) +$(SD_CARD): $(EXE_FILE) $(BINARY_CONTAINERS) $(RUN_SCRIPT) $(EMCONFIG) check_kimage check_rootfs @echo "Generating sd_card folder...." mkdir -p $(SD_CARD) chmod a+rx $(BUILD_DIR)/run_script.sh -ifneq (,$(findstring vck190_base_dfx, $(PLATFORM_NAME))) -ifeq ($(TARGET),hw) - $(VPP) -t $(TARGET) --platform $(XPLATFORM) -p $(PACKAGE_FILES) -o $(BINARY_CONTAINERS_PKG) - $(VPP) -t $(TARGET) --platform $(XPLATFORM) -p --package.out_dir $(SD_CARD) --package.rootfs $(SYSROOT)/../../rootfs.ext4 --package.kernel_image $(K_IMAGE) $(SD_FILES_WITH_PREFIX) $(SD_DIRS_WITH_PREFIX) --package.sd_file $(BINARY_CONTAINERS_PKG) +# 1. DFX HW Flow +ifeq ($(dfx_hw), on) + $(VPP) -t $(TARGET) --platform $(XPLATFORM) -p $(PACKAGE_FILES) $(VPP_PACKAGE) -o $(BINARY_CONTAINERS_PKG) + $(VPP) -t $(TARGET) --platform $(XPLATFORM) -p --package.out_dir $(SD_CARD) --package.rootfs $(ROOTFS) --package.kernel_image $(K_IMAGE) $(SD_FILES_WITH_PREFIX) $(SD_DIRS_WITH_PREFIX) --package.sd_file $(BINARY_CONTAINERS_PKG) @echo "### ***** sd_card generation done! ***** ###" -vck190_dfx_hw := true endif +# 2. PS_ON_X86 - From 2022.2, Target:sw_emu +ifeq ($(ps_on_x86), on) + @echo "### ***** running PS X86 SE_EMU ***** ###" + $(VPP) -t $(TARGET) --platform $(XPLATFORM) -o $(BINARY_CONTAINERS_PKG) -p $(PACKAGE_FILES) $(VPP_PACKAGE) --package.out_dir $(SD_CARD) --package.emu_ps x86 endif -ifeq ($(vck190_dfx_hw), false) - $(VPP) -t $(TARGET) --platform $(XPLATFORM) -o $(BINARY_CONTAINERS_PKG) -p $(PACKAGE_FILES) $(VPP_PACKAGE) --package.out_dir $(SD_CARD) --package.rootfs $(SYSROOT)/../../rootfs.ext4 --package.kernel_image $(K_IMAGE) $(SD_FILES_WITH_PREFIX) $(SD_DIRS_WITH_PREFIX) +#3. General Embeded flow +ifeq ($(dfx_hw), off) +ifeq ($(ps_on_x86), off) + $(VPP) -t $(TARGET) --platform $(XPLATFORM) -o $(BINARY_CONTAINERS_PKG) -p $(PACKAGE_FILES) $(VPP_PACKAGE) --package.out_dir $(SD_CARD) --package.rootfs $(ROOTFS) --package.kernel_image $(K_IMAGE) $(SD_FILES_WITH_PREFIX) $(SD_DIRS_WITH_PREFIX) @echo "### ***** sd_card generation done! ***** ###" endif +endif .PHONY: sd_card sd_card: $(SD_CARD) @@ -253,7 +272,7 @@ ifeq ($(HOST_ARCH), x86) else @echo $(RUN_DEPS) - $(SD_CARD)/launch_$(TARGET).sh -no-reboot -run-app $(notdir $(RUN_SCRIPT)) + $(SD_CARD)/launch_$(TARGET).sh -no-reboot -run-app $(notdir $(RUN_SCRIPT)) 2>&1 | tee $(SD_CARD)/qemu_output.log grep "TEST PASSED, RC=0" $(SD_CARD)/qemu_output.log || exit 1 endif @@ -264,24 +283,32 @@ ifeq ($(HOST_ARCH), x86) LD_LIBRARY_PATH=$(LIBRARY_PATH):$$LD_LIBRARY_PATH \ XCL_EMULATION_MODE=$(TARGET) $(EXE_FILE) $(HOST_ARGS) +else +ifeq ($(ps_on_x86), on) + LD_LIBRARY_PATH=$(LIBRARY_PATH):$$LD_LIBRARY_PATH \ + XCL_EMULATION_MODE=$(TARGET) $(EXE_FILE) $(HOST_ARGS) + else @echo $(RUN_DEPS) - $(SD_CARD)/launch_$(TARGET).sh -no-reboot -run-app $(notdir $(RUN_SCRIPT)) + $(SD_CARD)/launch_$(TARGET).sh -no-reboot -run-app $(notdir $(RUN_SCRIPT)) 2>&1 | tee $(SD_CARD)/qemu_output.log grep "TEST PASSED, RC=0" $(SD_CARD)/qemu_output.log || exit 1 +endif endif endif #hw ifeq ($(TARGET), hw) ifneq (,$(findstring aws-vu9p-f1, $(PLATFORM_NAME))) -ifneq ($(JENKINS_INTERNAL_BUILD), 1) +ifeq (,$(wildcard $(BUILD_DIR)/rtmbackward.awsxclbin)) $(ECHO) "This makefile does not directly support converting .xclbin to .awsxclbin, please refer https://github.com/aws/aws-fpga/blob/master/Vitis/README.md for next operations" else - $(ECHO) "Running inside Xilinx regression without converting to .awsxclbin" - $(EXE_FILE) $(HOST_ARGS) + $(ECHO) "Running HW using generated .awsxclbin" + LD_LIBRARY_PATH=$(LIBRARY_PATH):$$LD_LIBRARY_PATH \ + $(EXE_FILE) $(subst .xclbin,.awsxclbin,$(HOST_ARGS)) endif else ifeq ($(HOST_ARCH), x86) + LD_LIBRARY_PATH=$(LIBRARY_PATH):$$LD_LIBRARY_PATH \ $(EXE_FILE) $(HOST_ARGS) else @@ -315,12 +342,11 @@ cleanh: cleank: -$(RMDIR) $(BUILD_DIR)/*.xclbin _vimage *xclbin.run_summary qemu-memory-_* emulation/ _vimage/ pl*start_simulation. sh *.xclbin - -$(RMDIR) _x_temp.*/_x.* _x_temp.*/.Xil _x_temp.*/profile_summary.* xo_* _x* - -$(RMDIR) _x_temp.*/dltmp* _x_temp.*/kernel_info.dat _x_temp.*/*.log - -$(RMDIR) _x_temp.* + -$(RMDIR) _x_temp.* cleanall: cleanh cleank -$(RMDIR) $(BUILD_DIR) emconfig.json *.html $(TEMP_DIR) $(CUR_DIR)/reports *.csv *.run_summary $(CUR_DIR)/*.raw package_* $(BUILD_DIR)/run_script.sh .ipcache *.str -$(RMDIR) $(CUR_DIR)/Work $(CUR_DIR)/*.xpe $(CUR_DIR)/hw.o $(CUR_DIR)/*.xsa $(CUR_DIR)/xnwOut + -$(RMDIR) clean: cleanh \ No newline at end of file diff --git a/hpc/L2/tests/rtm2d/rtmbackward/tests/dataset_h128_w128_t10/description.json b/hpc/L2/tests/rtm2d/rtmbackward/tests/dataset_h128_w128_t10/description.json index 9e4014d2b0..041f9a25c2 100644 --- a/hpc/L2/tests/rtm2d/rtmbackward/tests/dataset_h128_w128_t10/description.json +++ b/hpc/L2/tests/rtm2d/rtmbackward/tests/dataset_h128_w128_t10/description.json @@ -19,7 +19,6 @@ "cmd_args": "BUILD/rtmbackward.xclbin PROJECT/data/ 128 128 10 1" } ], - "pre_launch": [], "host": { "host_exe": "host.exe", "compiler": { diff --git a/hpc/L2/tests/rtm2d/rtmbackward/tests/dataset_h128_w128_t10/utils.mk b/hpc/L2/tests/rtm2d/rtmbackward/tests/dataset_h128_w128_t10/utils.mk index 9b889021fc..2e9ea4d63a 100644 --- a/hpc/L2/tests/rtm2d/rtmbackward/tests/dataset_h128_w128_t10/utils.mk +++ b/hpc/L2/tests/rtm2d/rtmbackward/tests/dataset_h128_w128_t10/utils.mk @@ -12,7 +12,7 @@ # 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. -# vitis makefile-generator v2.0.6 +# vitis makefile-generator v2.0.7 # #+------------------------------------------------------------------------------- # The following parameters are assigned with default values. These parameters can @@ -50,6 +50,7 @@ ifndef XILINX_XRT export XILINX_XRT endif +.PHONY: check_device check_device: @set -eu; \ inallowlist=False; \ @@ -82,8 +83,9 @@ endif endif -#get suffix of kernel by PLATFORM +# Special processing for tool version/platform type VITIS_VER = $(shell v++ --version | grep 'v++' | sed 's/^[[:space:]]*//' | sed -e 's/^[*]* v++ v//g' | cut -d " " -f1) +# 1) for versal flow from 2022.1 DEVICE_TYPE = $(shell platforminfo -p $(PLATFORM) | grep 'FPGA Family' | sed 's/.*://' | sed '/ai_engine/d' | sed 's/^[[:space:]]*//') ifeq ($(DEVICE_TYPE), versal) ifeq ($(shell expr $(VITIS_VER) \>= 2022.1), 1) @@ -94,6 +96,22 @@ endif else LINK_TARGET_FMT := xclbin endif +# 2) dfx flow +dfx_hw := off +ifeq ($(findstring _dfx_, $(PLATFORM_NAME)),_dfx_) +ifeq ($(TARGET),hw) +dfx_hw := on +endif +endif +# 3) for embeded sw_emu flow from 2022.2 +ps_on_x86 := off +ifneq ($(HOST_ARCH), x86) +ifeq ($(shell expr $(VITIS_VER) \>= 2022.2), 1) +ifeq ($(TARGET), sw_emu) +ps_on_x86 := on +endif +endif +endif #Checks for Device Family ifeq ($(HOST_ARCH), aarch32) @@ -107,6 +125,7 @@ ifneq ($(HOST_ARCH), $(filter $(HOST_ARCH),aarch64 aarch32 x86)) $(error HOST_ARCH variable not set, please set correctly and rerun) endif +.PHONY: check_version check_sysroot check_kimage check_rootfs check_version: ifneq (, $(shell which git)) ifneq (,$(wildcard $(XFLIB_DIR)/.git)) @@ -114,17 +133,46 @@ ifneq (,$(wildcard $(XFLIB_DIR)/.git)) endif endif -#Checks for SYSROOT +#Set/Check SYSROOT/K_IMAGE/ROOTFS +ifneq ($(HOST_ARCH), x86) +ifneq (,$(findstring zc706, $(PLATFORM_NAME))) +K_IMAGE ?= $(SYSROOT)/../../uImage +else +K_IMAGE ?= $(SYSROOT)/../../Image +endif +ROOTFS ?= $(SYSROOT)/../../rootfs.ext4 +endif + check_sysroot: ifneq ($(HOST_ARCH), x86) -ifndef SYSROOT +ifeq (,$(wildcard $(SYSROOT))) $(error SYSROOT ENV variable is not set, please set ENV variable correctly and rerun) endif endif +check_kimage: +ifneq ($(HOST_ARCH), x86) +ifeq (,$(wildcard $(K_IMAGE))) + $(error K_IMAGE ENV variable is not set, please set ENV variable correctly and rerun) +endif +endif +check_rootfs: +ifneq ($(HOST_ARCH), x86) +ifeq (,$(wildcard $(ROOTFS))) + $(error ROOTFS ENV variable is not set, please set ENV variable correctly and rerun) +endif +endif #Checks for g++ -CXX := g++ ifeq ($(HOST_ARCH), x86) +X86_CXX := true +else +ifeq ($(ps_on_x86), true) +X86_CXX := true +endif +endif + +CXX := g++ +ifeq ($(X86_CXX), true) ifeq ($(shell expr $(VITIS_VER) \>= 2022.1), 1) CXX_VER := 8.3.0 else @@ -144,11 +192,13 @@ endif $(warning [WARNING]: g++ version too old. Using g++ provided by the tool: $(CXX)) endif endif -else ifeq ($(HOST_ARCH), aarch64) +else +ifeq ($(HOST_ARCH), aarch64) CXX := $(XILINX_VITIS)/gnu/aarch64/lin/aarch64-linux/bin/aarch64-linux-gnu-g++ else ifeq ($(HOST_ARCH), aarch32) CXX := $(XILINX_VITIS)/gnu/aarch32/lin/gcc-arm-linux-gnueabi/bin/arm-linux-gnueabihf-g++ endif +endif #Check OS and setting env for xrt c++ api OSDIST = $(shell lsb_release -i |awk -F: '{print tolower($$2)}' | tr -d ' \t' ) @@ -268,9 +318,3 @@ RMDIR = rm -rf MV = mv -f CP = cp -rf ECHO:= @echo -ifneq (,$(shell echo $(XPLATFORM) | awk '/xilinx_u280_xdma_201920_3/')) -VPP_FLAGS += --advanced.param compiler.ignorePlatformCompatibilityCheck=true -ifeq ($(TARGET), hw) -VPP_LDFLAGS += --advanced.param compiler.userPreSysLinkOverlayTcl=preSysLink.tcl -endif -endif diff --git a/hpc/L2/tests/rtm2d/rtmbackward/utils.mk b/hpc/L2/tests/rtm2d/rtmbackward/utils.mk index 9b889021fc..2e9ea4d63a 100644 --- a/hpc/L2/tests/rtm2d/rtmbackward/utils.mk +++ b/hpc/L2/tests/rtm2d/rtmbackward/utils.mk @@ -12,7 +12,7 @@ # 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. -# vitis makefile-generator v2.0.6 +# vitis makefile-generator v2.0.7 # #+------------------------------------------------------------------------------- # The following parameters are assigned with default values. These parameters can @@ -50,6 +50,7 @@ ifndef XILINX_XRT export XILINX_XRT endif +.PHONY: check_device check_device: @set -eu; \ inallowlist=False; \ @@ -82,8 +83,9 @@ endif endif -#get suffix of kernel by PLATFORM +# Special processing for tool version/platform type VITIS_VER = $(shell v++ --version | grep 'v++' | sed 's/^[[:space:]]*//' | sed -e 's/^[*]* v++ v//g' | cut -d " " -f1) +# 1) for versal flow from 2022.1 DEVICE_TYPE = $(shell platforminfo -p $(PLATFORM) | grep 'FPGA Family' | sed 's/.*://' | sed '/ai_engine/d' | sed 's/^[[:space:]]*//') ifeq ($(DEVICE_TYPE), versal) ifeq ($(shell expr $(VITIS_VER) \>= 2022.1), 1) @@ -94,6 +96,22 @@ endif else LINK_TARGET_FMT := xclbin endif +# 2) dfx flow +dfx_hw := off +ifeq ($(findstring _dfx_, $(PLATFORM_NAME)),_dfx_) +ifeq ($(TARGET),hw) +dfx_hw := on +endif +endif +# 3) for embeded sw_emu flow from 2022.2 +ps_on_x86 := off +ifneq ($(HOST_ARCH), x86) +ifeq ($(shell expr $(VITIS_VER) \>= 2022.2), 1) +ifeq ($(TARGET), sw_emu) +ps_on_x86 := on +endif +endif +endif #Checks for Device Family ifeq ($(HOST_ARCH), aarch32) @@ -107,6 +125,7 @@ ifneq ($(HOST_ARCH), $(filter $(HOST_ARCH),aarch64 aarch32 x86)) $(error HOST_ARCH variable not set, please set correctly and rerun) endif +.PHONY: check_version check_sysroot check_kimage check_rootfs check_version: ifneq (, $(shell which git)) ifneq (,$(wildcard $(XFLIB_DIR)/.git)) @@ -114,17 +133,46 @@ ifneq (,$(wildcard $(XFLIB_DIR)/.git)) endif endif -#Checks for SYSROOT +#Set/Check SYSROOT/K_IMAGE/ROOTFS +ifneq ($(HOST_ARCH), x86) +ifneq (,$(findstring zc706, $(PLATFORM_NAME))) +K_IMAGE ?= $(SYSROOT)/../../uImage +else +K_IMAGE ?= $(SYSROOT)/../../Image +endif +ROOTFS ?= $(SYSROOT)/../../rootfs.ext4 +endif + check_sysroot: ifneq ($(HOST_ARCH), x86) -ifndef SYSROOT +ifeq (,$(wildcard $(SYSROOT))) $(error SYSROOT ENV variable is not set, please set ENV variable correctly and rerun) endif endif +check_kimage: +ifneq ($(HOST_ARCH), x86) +ifeq (,$(wildcard $(K_IMAGE))) + $(error K_IMAGE ENV variable is not set, please set ENV variable correctly and rerun) +endif +endif +check_rootfs: +ifneq ($(HOST_ARCH), x86) +ifeq (,$(wildcard $(ROOTFS))) + $(error ROOTFS ENV variable is not set, please set ENV variable correctly and rerun) +endif +endif #Checks for g++ -CXX := g++ ifeq ($(HOST_ARCH), x86) +X86_CXX := true +else +ifeq ($(ps_on_x86), true) +X86_CXX := true +endif +endif + +CXX := g++ +ifeq ($(X86_CXX), true) ifeq ($(shell expr $(VITIS_VER) \>= 2022.1), 1) CXX_VER := 8.3.0 else @@ -144,11 +192,13 @@ endif $(warning [WARNING]: g++ version too old. Using g++ provided by the tool: $(CXX)) endif endif -else ifeq ($(HOST_ARCH), aarch64) +else +ifeq ($(HOST_ARCH), aarch64) CXX := $(XILINX_VITIS)/gnu/aarch64/lin/aarch64-linux/bin/aarch64-linux-gnu-g++ else ifeq ($(HOST_ARCH), aarch32) CXX := $(XILINX_VITIS)/gnu/aarch32/lin/gcc-arm-linux-gnueabi/bin/arm-linux-gnueabihf-g++ endif +endif #Check OS and setting env for xrt c++ api OSDIST = $(shell lsb_release -i |awk -F: '{print tolower($$2)}' | tr -d ' \t' ) @@ -268,9 +318,3 @@ RMDIR = rm -rf MV = mv -f CP = cp -rf ECHO:= @echo -ifneq (,$(shell echo $(XPLATFORM) | awk '/xilinx_u280_xdma_201920_3/')) -VPP_FLAGS += --advanced.param compiler.ignorePlatformCompatibilityCheck=true -ifeq ($(TARGET), hw) -VPP_LDFLAGS += --advanced.param compiler.userPreSysLinkOverlayTcl=preSysLink.tcl -endif -endif diff --git a/hpc/L2/tests/rtm2d/rtmforward/Makefile b/hpc/L2/tests/rtm2d/rtmforward/Makefile index 843f8e888a..51a382da40 100644 --- a/hpc/L2/tests/rtm2d/rtmforward/Makefile +++ b/hpc/L2/tests/rtm2d/rtmforward/Makefile @@ -11,7 +11,7 @@ # 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. -# vitis makefile-generator v2.0.6 +# vitis makefile-generator v2.0.7 ############################## Help Section ############################## .PHONY: help @@ -34,9 +34,15 @@ help:: $(ECHO) " Command to build host application." $(ECHO) " By default, HOST_ARCH=x86. HOST_ARCH is required for SoC shells" $(ECHO) "" - $(ECHO) " NOTE: For embedded devices, e.g. zcu102/zcu104/vck190, env variable SYSROOT and EDGE_COMMON_SW need to be set first, and HOST_ARCH is either aarch32 or aarch64. For example," - $(ECHO) " export SYSROOT=< path-to-platform-sysroot >" - $(ECHO) " export EDGE_COMMON_SW=< path-to-rootfs-and-Image-files >" + $(ECHO) " NOTE: For embedded devices, e.g. zcu102/zcu104/vck190, HOST_ARCH is either aarch32 or aarch64." + $(ECHO) " a.IF Download the platform, and common-image from Xilinx Download Center(Suggested):" + $(ECHO) " Run the sdk.sh script from the common-image directory to install sysroot using the command : ./sdk.sh -y -d ./ -p " + $(ECHO) " Unzip the rootfs file : gunzip ./rootfs.ext4.gz" + $(ECHO) " export SYSROOT=< path-to-platform-sysroot >" + $(ECHO) " b. User could also define SYSROOT, K_IMAGE and ROOTFS by themselves: " + $(ECHO) " export SYSROOT=< path-to-platform-sysroot >" + $(ECHO) " export K_IMAGE=< path-to-Image-files >" + $(ECHO) " export ROOTFS=< path-to-rootfs >" $(ECHO) "" $(ECHO) " make clean " $(ECHO) " Command to remove the generated non-hardware files." @@ -61,7 +67,7 @@ ifeq ($(PLATFORM),) PLATFORM := $(DEVICE) endif ifeq ($(PLATFORM),) -PLATFORM := xilinx_u280_xdma_201920_3 +PLATFORM := xilinx_u280_gen3x16_xdma_1_202120_1 endif # #################### Checking if PLATFORM in whitelist ############################ @@ -87,12 +93,17 @@ RUN_DEPS := # get global setting ifeq ($(HOST_ARCH), x86) CXXFLAGS += -fmessage-length=0 -I$(CUR_DIR)/src/ -I$(XILINX_XRT)/include -I$(XILINX_HLS)/include -std=c++14 -O3 -Wall -Wno-unknown-pragmas -Wno-unused-label -LDFLAGS += -pthread -L$(XILINX_XRT)/lib -L$(XILINX_HLS)/lnx64/tools/fpo_v7_0 -Wl,--as-needed -lOpenCL -lxrt_coreutil -lgmp -lmpfr -lIp_floating_point_v7_0_bitacc_cmodel +LDFLAGS += -pthread -L$(XILINX_XRT)/lib -L$(XILINX_HLS)/lnx64/tools/fpo_v7_1 -Wl,--as-needed -lOpenCL -lxrt_coreutil -lgmp -lmpfr -lIp_floating_point_v7_1_bitacc_cmodel VPP_FLAGS += -t $(TARGET) --platform $(XPLATFORM) --save-temps VPP_LDFLAGS += --optimize 2 -R 2 else ifeq ($(HOST_ARCH), aarch64) +ifeq ($(ps_on_x86), on) +CXXFLAGS += -fmessage-length=0 -I$(CUR_DIR)/src/ -I$(XILINX_XRT)/include -I$(XILINX_HLS)/include -std=c++14 -O3 -Wall -Wno-unknown-pragmas -Wno-unused-label +LDFLAGS += -pthread -L$(XILINX_XRT)/lib -L$(XILINX_HLS)/lnx64/tools/fpo_v7_1 -Wl,--as-needed -lOpenCL -lxrt_coreutil -lgmp -lmpfr -lIp_floating_point_v7_1_bitacc_cmodel +else CXXFLAGS += -I$(CUR_DIR)/src/ -fmessage-length=0 --sysroot=$(SYSROOT) -I$(SYSROOT)/usr/include/xrt -I$(XILINX_HLS)/include -std=c++14 -O3 -Wall -Wno-unknown-pragmas -Wno-unused-label -LDFLAGS += -pthread -L$(SYSROOT)/usr/lib -L$(XILINX_VITIS_AIETOOLS)/lib/aarch64.o -Wl,--as-needed -lxilinxopencl -lxrt_coreutil +LDFLAGS += -pthread -L$(SYSROOT)/usr/lib -Wl,--as-needed -lxilinxopencl -lxrt_coreutil +endif VPP_FLAGS += -t $(TARGET) --platform $(XPLATFORM) --save-temps VPP_LDFLAGS += --optimize 2 -R 2 endif @@ -107,15 +118,23 @@ ifeq ($(TARGET),hw_emu) CXXFLAGS += -D HW_EMU_TEST endif -ifeq (,$(findstring opencv,$(CXXFLAGS))) -CXXFLAGS += $(XRT_CXXFLAGS) -endif - #Inclue Required Host Source Files +ifeq ($(ps_on_x86), on) HOST_SRCS += $(XFLIB_DIR)/L2/tests/rtm2d/rtmforward/main.cpp $(XFLIB_DIR)/../blas/L2/src/xcl2/xcl2.cpp CXXFLAGS += -D RTM_dataType=float -D RTM_numFSMs=10 -D RTM_maxDim=1280 -D RTM_MaxB=40 -D RTM_NXB=40 -D RTM_NZB=40 -D RTM_order=8 -D RTM_parEntries=8 -D RTM_verify=1 -D RTM_nPE=2 CXXFLAGS += -I $(XFLIB_DIR)/L2/include/sw/ -I $(XFLIB_DIR)/L2/include/sw/rtm2d -I $(XFLIB_DIR)/../blas/L1/tests/sw/include/ -I $(XFLIB_DIR)/../blas/L2/include/xcl2 CXXFLAGS += -O3 +else +HOST_SRCS += $(XFLIB_DIR)/L2/tests/rtm2d/rtmforward/main.cpp $(XFLIB_DIR)/../blas/L2/src/xcl2/xcl2.cpp +CXXFLAGS += -D RTM_dataType=float -D RTM_numFSMs=10 -D RTM_maxDim=1280 -D RTM_MaxB=40 -D RTM_NXB=40 -D RTM_NZB=40 -D RTM_order=8 -D RTM_parEntries=8 -D RTM_verify=1 -D RTM_nPE=2 +CXXFLAGS += -I $(XFLIB_DIR)/L2/include/sw/ -I $(XFLIB_DIR)/L2/include/sw/rtm2d -I $(XFLIB_DIR)/../blas/L1/tests/sw/include/ -I $(XFLIB_DIR)/../blas/L2/include/xcl2 +CXXFLAGS += -O3 +endif + +# workaround for opencv +ifeq (,$(findstring opencv,$(CXXFLAGS))) +CXXFLAGS += $(XRT_CXXFLAGS) +endif EXE_NAME := host.exe EXE_FILE := $(BUILD_DIR)/$(EXE_NAME) @@ -175,11 +194,6 @@ $(EMCONFIG): emconfigutil --platform $(XPLATFORM) --od $(BUILD_DIR) ############################## Preparing sdcard folder ############################## ifneq ($(HOST_ARCH), x86) -ifneq (,$(findstring zc706, $(PLATFORM_NAME))) -K_IMAGE := $(SYSROOT)/../../uImage -else -K_IMAGE := $(SYSROOT)/../../Image -endif RUN_SCRIPT := $(BUILD_DIR)/run_script.sh $(RUN_SCRIPT): rm -rf $(RUN_SCRIPT) @@ -195,7 +209,7 @@ endif @echo './$(EXE_NAME) $(PKG_HOST_ARGS)' >> $(RUN_SCRIPT) @echo 'return_code=$$?' >> $(RUN_SCRIPT) @echo 'if [ $$return_code -ne 0 ]; then' >> $(RUN_SCRIPT) - @echo ' echo "ERROR: Embedded host run failed, RC=$$return_code"' >> $(RUN_SCRIPT) + @echo ' echo "ERROR: TEST FAILED, RC=$$return_code"' >> $(RUN_SCRIPT) @echo 'else' >> $(RUN_SCRIPT) @echo ' echo "INFO: TEST PASSED, RC=0"' >> $(RUN_SCRIPT) @echo 'fi' >> $(RUN_SCRIPT) @@ -213,23 +227,28 @@ SD_DIRS_WITH_PREFIX = $(foreach sd_dir,$(DATA_DIR),--package.sd_dir $(sd_dir)) PACKAGE_FILES := $(BINARY_CONTAINERS) PACKAGE_FILES += $(AIE_CONTAINER) SD_CARD := $(CUR_DIR)/package_$(TARGET) -vck190_dfx_hw := false -$(SD_CARD): $(EXE_FILE) $(BINARY_CONTAINERS) $(RUN_SCRIPT) $(EMCONFIG) +$(SD_CARD): $(EXE_FILE) $(BINARY_CONTAINERS) $(RUN_SCRIPT) $(EMCONFIG) check_kimage check_rootfs @echo "Generating sd_card folder...." mkdir -p $(SD_CARD) chmod a+rx $(BUILD_DIR)/run_script.sh -ifneq (,$(findstring vck190_base_dfx, $(PLATFORM_NAME))) -ifeq ($(TARGET),hw) - $(VPP) -t $(TARGET) --platform $(XPLATFORM) -p $(PACKAGE_FILES) -o $(BINARY_CONTAINERS_PKG) - $(VPP) -t $(TARGET) --platform $(XPLATFORM) -p --package.out_dir $(SD_CARD) --package.rootfs $(SYSROOT)/../../rootfs.ext4 --package.kernel_image $(K_IMAGE) $(SD_FILES_WITH_PREFIX) $(SD_DIRS_WITH_PREFIX) --package.sd_file $(BINARY_CONTAINERS_PKG) +# 1. DFX HW Flow +ifeq ($(dfx_hw), on) + $(VPP) -t $(TARGET) --platform $(XPLATFORM) -p $(PACKAGE_FILES) $(VPP_PACKAGE) -o $(BINARY_CONTAINERS_PKG) + $(VPP) -t $(TARGET) --platform $(XPLATFORM) -p --package.out_dir $(SD_CARD) --package.rootfs $(ROOTFS) --package.kernel_image $(K_IMAGE) $(SD_FILES_WITH_PREFIX) $(SD_DIRS_WITH_PREFIX) --package.sd_file $(BINARY_CONTAINERS_PKG) @echo "### ***** sd_card generation done! ***** ###" -vck190_dfx_hw := true endif +# 2. PS_ON_X86 - From 2022.2, Target:sw_emu +ifeq ($(ps_on_x86), on) + @echo "### ***** running PS X86 SE_EMU ***** ###" + $(VPP) -t $(TARGET) --platform $(XPLATFORM) -o $(BINARY_CONTAINERS_PKG) -p $(PACKAGE_FILES) $(VPP_PACKAGE) --package.out_dir $(SD_CARD) --package.emu_ps x86 endif -ifeq ($(vck190_dfx_hw), false) - $(VPP) -t $(TARGET) --platform $(XPLATFORM) -o $(BINARY_CONTAINERS_PKG) -p $(PACKAGE_FILES) $(VPP_PACKAGE) --package.out_dir $(SD_CARD) --package.rootfs $(SYSROOT)/../../rootfs.ext4 --package.kernel_image $(K_IMAGE) $(SD_FILES_WITH_PREFIX) $(SD_DIRS_WITH_PREFIX) +#3. General Embeded flow +ifeq ($(dfx_hw), off) +ifeq ($(ps_on_x86), off) + $(VPP) -t $(TARGET) --platform $(XPLATFORM) -o $(BINARY_CONTAINERS_PKG) -p $(PACKAGE_FILES) $(VPP_PACKAGE) --package.out_dir $(SD_CARD) --package.rootfs $(ROOTFS) --package.kernel_image $(K_IMAGE) $(SD_FILES_WITH_PREFIX) $(SD_DIRS_WITH_PREFIX) @echo "### ***** sd_card generation done! ***** ###" endif +endif .PHONY: sd_card sd_card: $(SD_CARD) @@ -253,7 +272,7 @@ ifeq ($(HOST_ARCH), x86) else @echo $(RUN_DEPS) - $(SD_CARD)/launch_$(TARGET).sh -no-reboot -run-app $(notdir $(RUN_SCRIPT)) + $(SD_CARD)/launch_$(TARGET).sh -no-reboot -run-app $(notdir $(RUN_SCRIPT)) 2>&1 | tee $(SD_CARD)/qemu_output.log grep "TEST PASSED, RC=0" $(SD_CARD)/qemu_output.log || exit 1 endif @@ -264,24 +283,32 @@ ifeq ($(HOST_ARCH), x86) LD_LIBRARY_PATH=$(LIBRARY_PATH):$$LD_LIBRARY_PATH \ XCL_EMULATION_MODE=$(TARGET) $(EXE_FILE) $(HOST_ARGS) +else +ifeq ($(ps_on_x86), on) + LD_LIBRARY_PATH=$(LIBRARY_PATH):$$LD_LIBRARY_PATH \ + XCL_EMULATION_MODE=$(TARGET) $(EXE_FILE) $(HOST_ARGS) + else @echo $(RUN_DEPS) - $(SD_CARD)/launch_$(TARGET).sh -no-reboot -run-app $(notdir $(RUN_SCRIPT)) + $(SD_CARD)/launch_$(TARGET).sh -no-reboot -run-app $(notdir $(RUN_SCRIPT)) 2>&1 | tee $(SD_CARD)/qemu_output.log grep "TEST PASSED, RC=0" $(SD_CARD)/qemu_output.log || exit 1 +endif endif endif #hw ifeq ($(TARGET), hw) ifneq (,$(findstring aws-vu9p-f1, $(PLATFORM_NAME))) -ifneq ($(JENKINS_INTERNAL_BUILD), 1) +ifeq (,$(wildcard $(BUILD_DIR)/rtmforward.awsxclbin)) $(ECHO) "This makefile does not directly support converting .xclbin to .awsxclbin, please refer https://github.com/aws/aws-fpga/blob/master/Vitis/README.md for next operations" else - $(ECHO) "Running inside Xilinx regression without converting to .awsxclbin" - $(EXE_FILE) $(HOST_ARGS) + $(ECHO) "Running HW using generated .awsxclbin" + LD_LIBRARY_PATH=$(LIBRARY_PATH):$$LD_LIBRARY_PATH \ + $(EXE_FILE) $(subst .xclbin,.awsxclbin,$(HOST_ARGS)) endif else ifeq ($(HOST_ARCH), x86) + LD_LIBRARY_PATH=$(LIBRARY_PATH):$$LD_LIBRARY_PATH \ $(EXE_FILE) $(HOST_ARGS) else @@ -315,12 +342,11 @@ cleanh: cleank: -$(RMDIR) $(BUILD_DIR)/*.xclbin _vimage *xclbin.run_summary qemu-memory-_* emulation/ _vimage/ pl*start_simulation. sh *.xclbin - -$(RMDIR) _x_temp.*/_x.* _x_temp.*/.Xil _x_temp.*/profile_summary.* xo_* _x* - -$(RMDIR) _x_temp.*/dltmp* _x_temp.*/kernel_info.dat _x_temp.*/*.log - -$(RMDIR) _x_temp.* + -$(RMDIR) _x_temp.* cleanall: cleanh cleank -$(RMDIR) $(BUILD_DIR) emconfig.json *.html $(TEMP_DIR) $(CUR_DIR)/reports *.csv *.run_summary $(CUR_DIR)/*.raw package_* $(BUILD_DIR)/run_script.sh .ipcache *.str -$(RMDIR) $(CUR_DIR)/Work $(CUR_DIR)/*.xpe $(CUR_DIR)/hw.o $(CUR_DIR)/*.xsa $(CUR_DIR)/xnwOut + -$(RMDIR) clean: cleanh \ No newline at end of file diff --git a/hpc/L2/tests/rtm2d/rtmforward/description.json b/hpc/L2/tests/rtm2d/rtmforward/description.json index b837e1f091..6d9324556f 100644 --- a/hpc/L2/tests/rtm2d/rtmforward/description.json +++ b/hpc/L2/tests/rtm2d/rtmforward/description.json @@ -19,11 +19,6 @@ "cmd_args": "BUILD/rtmforward.xclbin BUILD/data/" } ], - "pre_launch": [ - { - "launch_cmd": "make data_gen" - } - ], "host": { "host_exe": "host.exe", "compiler": { diff --git a/hpc/L2/tests/rtm2d/rtmforward/tests/dataset_h128_w128_t10/Makefile b/hpc/L2/tests/rtm2d/rtmforward/tests/dataset_h128_w128_t10/Makefile index 8a76ed9370..24647d5e49 100644 --- a/hpc/L2/tests/rtm2d/rtmforward/tests/dataset_h128_w128_t10/Makefile +++ b/hpc/L2/tests/rtm2d/rtmforward/tests/dataset_h128_w128_t10/Makefile @@ -11,7 +11,7 @@ # 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. -# vitis makefile-generator v2.0.6 +# vitis makefile-generator v2.0.7 ############################## Help Section ############################## .PHONY: help @@ -34,9 +34,15 @@ help:: $(ECHO) " Command to build host application." $(ECHO) " By default, HOST_ARCH=x86. HOST_ARCH is required for SoC shells" $(ECHO) "" - $(ECHO) " NOTE: For embedded devices, e.g. zcu102/zcu104/vck190, env variable SYSROOT and EDGE_COMMON_SW need to be set first, and HOST_ARCH is either aarch32 or aarch64. For example," - $(ECHO) " export SYSROOT=< path-to-platform-sysroot >" - $(ECHO) " export EDGE_COMMON_SW=< path-to-rootfs-and-Image-files >" + $(ECHO) " NOTE: For embedded devices, e.g. zcu102/zcu104/vck190, HOST_ARCH is either aarch32 or aarch64." + $(ECHO) " a.IF Download the platform, and common-image from Xilinx Download Center(Suggested):" + $(ECHO) " Run the sdk.sh script from the common-image directory to install sysroot using the command : ./sdk.sh -y -d ./ -p " + $(ECHO) " Unzip the rootfs file : gunzip ./rootfs.ext4.gz" + $(ECHO) " export SYSROOT=< path-to-platform-sysroot >" + $(ECHO) " b. User could also define SYSROOT, K_IMAGE and ROOTFS by themselves: " + $(ECHO) " export SYSROOT=< path-to-platform-sysroot >" + $(ECHO) " export K_IMAGE=< path-to-Image-files >" + $(ECHO) " export ROOTFS=< path-to-rootfs >" $(ECHO) "" $(ECHO) " make clean " $(ECHO) " Command to remove the generated non-hardware files." @@ -61,7 +67,7 @@ ifeq ($(PLATFORM),) PLATFORM := $(DEVICE) endif ifeq ($(PLATFORM),) -PLATFORM := xilinx_u280_xdma_201920_3 +PLATFORM := xilinx_u280_gen3x16_xdma_1_202120_1 endif # #################### Checking if PLATFORM in whitelist ############################ @@ -87,12 +93,17 @@ RUN_DEPS := # get global setting ifeq ($(HOST_ARCH), x86) CXXFLAGS += -fmessage-length=0 -I$(CUR_DIR)/src/ -I$(XILINX_XRT)/include -I$(XILINX_HLS)/include -std=c++14 -O3 -Wall -Wno-unknown-pragmas -Wno-unused-label -LDFLAGS += -pthread -L$(XILINX_XRT)/lib -L$(XILINX_HLS)/lnx64/tools/fpo_v7_0 -Wl,--as-needed -lOpenCL -lxrt_coreutil -lgmp -lmpfr -lIp_floating_point_v7_0_bitacc_cmodel +LDFLAGS += -pthread -L$(XILINX_XRT)/lib -L$(XILINX_HLS)/lnx64/tools/fpo_v7_1 -Wl,--as-needed -lOpenCL -lxrt_coreutil -lgmp -lmpfr -lIp_floating_point_v7_1_bitacc_cmodel VPP_FLAGS += -t $(TARGET) --platform $(XPLATFORM) --save-temps VPP_LDFLAGS += --optimize 2 -R 2 else ifeq ($(HOST_ARCH), aarch64) +ifeq ($(ps_on_x86), on) +CXXFLAGS += -fmessage-length=0 -I$(CUR_DIR)/src/ -I$(XILINX_XRT)/include -I$(XILINX_HLS)/include -std=c++14 -O3 -Wall -Wno-unknown-pragmas -Wno-unused-label +LDFLAGS += -pthread -L$(XILINX_XRT)/lib -L$(XILINX_HLS)/lnx64/tools/fpo_v7_1 -Wl,--as-needed -lOpenCL -lxrt_coreutil -lgmp -lmpfr -lIp_floating_point_v7_1_bitacc_cmodel +else CXXFLAGS += -I$(CUR_DIR)/src/ -fmessage-length=0 --sysroot=$(SYSROOT) -I$(SYSROOT)/usr/include/xrt -I$(XILINX_HLS)/include -std=c++14 -O3 -Wall -Wno-unknown-pragmas -Wno-unused-label -LDFLAGS += -pthread -L$(SYSROOT)/usr/lib -L$(XILINX_VITIS_AIETOOLS)/lib/aarch64.o -Wl,--as-needed -lxilinxopencl -lxrt_coreutil +LDFLAGS += -pthread -L$(SYSROOT)/usr/lib -Wl,--as-needed -lxilinxopencl -lxrt_coreutil +endif VPP_FLAGS += -t $(TARGET) --platform $(XPLATFORM) --save-temps VPP_LDFLAGS += --optimize 2 -R 2 endif @@ -107,15 +118,23 @@ ifeq ($(TARGET),hw_emu) CXXFLAGS += -D HW_EMU_TEST endif -ifeq (,$(findstring opencv,$(CXXFLAGS))) -CXXFLAGS += $(XRT_CXXFLAGS) -endif - #Inclue Required Host Source Files +ifeq ($(ps_on_x86), on) HOST_SRCS += $(XFLIB_DIR)/L2/tests/rtm2d/rtmforward/main.cpp $(XFLIB_DIR)/../blas/L2/src/xcl2/xcl2.cpp CXXFLAGS += -D RTM_dataType=float -D RTM_numFSMs=2 -D RTM_maxDim=256 -D RTM_MaxB=40 -D RTM_NXB=40 -D RTM_NZB=40 -D RTM_order=8 -D RTM_parEntries=8 -D RTM_verify=1 -D RTM_nPE=2 CXXFLAGS += -I $(XFLIB_DIR)/L2/include/sw -I $(XFLIB_DIR)/L2/include/sw/rtm2d -I $(XFLIB_DIR)/../blas/L1/tests/sw/include/ -I $(XFLIB_DIR)/../blas/L2/include/xcl2 CXXFLAGS += -O3 +else +HOST_SRCS += $(XFLIB_DIR)/L2/tests/rtm2d/rtmforward/main.cpp $(XFLIB_DIR)/../blas/L2/src/xcl2/xcl2.cpp +CXXFLAGS += -D RTM_dataType=float -D RTM_numFSMs=2 -D RTM_maxDim=256 -D RTM_MaxB=40 -D RTM_NXB=40 -D RTM_NZB=40 -D RTM_order=8 -D RTM_parEntries=8 -D RTM_verify=1 -D RTM_nPE=2 +CXXFLAGS += -I $(XFLIB_DIR)/L2/include/sw -I $(XFLIB_DIR)/L2/include/sw/rtm2d -I $(XFLIB_DIR)/../blas/L1/tests/sw/include/ -I $(XFLIB_DIR)/../blas/L2/include/xcl2 +CXXFLAGS += -O3 +endif + +# workaround for opencv +ifeq (,$(findstring opencv,$(CXXFLAGS))) +CXXFLAGS += $(XRT_CXXFLAGS) +endif EXE_NAME := host.exe EXE_FILE := $(BUILD_DIR)/$(EXE_NAME) @@ -175,11 +194,6 @@ $(EMCONFIG): emconfigutil --platform $(XPLATFORM) --od $(BUILD_DIR) ############################## Preparing sdcard folder ############################## ifneq ($(HOST_ARCH), x86) -ifneq (,$(findstring zc706, $(PLATFORM_NAME))) -K_IMAGE := $(SYSROOT)/../../uImage -else -K_IMAGE := $(SYSROOT)/../../Image -endif RUN_SCRIPT := $(BUILD_DIR)/run_script.sh $(RUN_SCRIPT): rm -rf $(RUN_SCRIPT) @@ -195,7 +209,7 @@ endif @echo './$(EXE_NAME) $(PKG_HOST_ARGS)' >> $(RUN_SCRIPT) @echo 'return_code=$$?' >> $(RUN_SCRIPT) @echo 'if [ $$return_code -ne 0 ]; then' >> $(RUN_SCRIPT) - @echo ' echo "ERROR: Embedded host run failed, RC=$$return_code"' >> $(RUN_SCRIPT) + @echo ' echo "ERROR: TEST FAILED, RC=$$return_code"' >> $(RUN_SCRIPT) @echo 'else' >> $(RUN_SCRIPT) @echo ' echo "INFO: TEST PASSED, RC=0"' >> $(RUN_SCRIPT) @echo 'fi' >> $(RUN_SCRIPT) @@ -213,23 +227,28 @@ SD_DIRS_WITH_PREFIX = $(foreach sd_dir,$(DATA_DIR),--package.sd_dir $(sd_dir)) PACKAGE_FILES := $(BINARY_CONTAINERS) PACKAGE_FILES += $(AIE_CONTAINER) SD_CARD := $(CUR_DIR)/package_$(TARGET) -vck190_dfx_hw := false -$(SD_CARD): $(EXE_FILE) $(BINARY_CONTAINERS) $(RUN_SCRIPT) $(EMCONFIG) +$(SD_CARD): $(EXE_FILE) $(BINARY_CONTAINERS) $(RUN_SCRIPT) $(EMCONFIG) check_kimage check_rootfs @echo "Generating sd_card folder...." mkdir -p $(SD_CARD) chmod a+rx $(BUILD_DIR)/run_script.sh -ifneq (,$(findstring vck190_base_dfx, $(PLATFORM_NAME))) -ifeq ($(TARGET),hw) - $(VPP) -t $(TARGET) --platform $(XPLATFORM) -p $(PACKAGE_FILES) -o $(BINARY_CONTAINERS_PKG) - $(VPP) -t $(TARGET) --platform $(XPLATFORM) -p --package.out_dir $(SD_CARD) --package.rootfs $(SYSROOT)/../../rootfs.ext4 --package.kernel_image $(K_IMAGE) $(SD_FILES_WITH_PREFIX) $(SD_DIRS_WITH_PREFIX) --package.sd_file $(BINARY_CONTAINERS_PKG) +# 1. DFX HW Flow +ifeq ($(dfx_hw), on) + $(VPP) -t $(TARGET) --platform $(XPLATFORM) -p $(PACKAGE_FILES) $(VPP_PACKAGE) -o $(BINARY_CONTAINERS_PKG) + $(VPP) -t $(TARGET) --platform $(XPLATFORM) -p --package.out_dir $(SD_CARD) --package.rootfs $(ROOTFS) --package.kernel_image $(K_IMAGE) $(SD_FILES_WITH_PREFIX) $(SD_DIRS_WITH_PREFIX) --package.sd_file $(BINARY_CONTAINERS_PKG) @echo "### ***** sd_card generation done! ***** ###" -vck190_dfx_hw := true endif +# 2. PS_ON_X86 - From 2022.2, Target:sw_emu +ifeq ($(ps_on_x86), on) + @echo "### ***** running PS X86 SE_EMU ***** ###" + $(VPP) -t $(TARGET) --platform $(XPLATFORM) -o $(BINARY_CONTAINERS_PKG) -p $(PACKAGE_FILES) $(VPP_PACKAGE) --package.out_dir $(SD_CARD) --package.emu_ps x86 endif -ifeq ($(vck190_dfx_hw), false) - $(VPP) -t $(TARGET) --platform $(XPLATFORM) -o $(BINARY_CONTAINERS_PKG) -p $(PACKAGE_FILES) $(VPP_PACKAGE) --package.out_dir $(SD_CARD) --package.rootfs $(SYSROOT)/../../rootfs.ext4 --package.kernel_image $(K_IMAGE) $(SD_FILES_WITH_PREFIX) $(SD_DIRS_WITH_PREFIX) +#3. General Embeded flow +ifeq ($(dfx_hw), off) +ifeq ($(ps_on_x86), off) + $(VPP) -t $(TARGET) --platform $(XPLATFORM) -o $(BINARY_CONTAINERS_PKG) -p $(PACKAGE_FILES) $(VPP_PACKAGE) --package.out_dir $(SD_CARD) --package.rootfs $(ROOTFS) --package.kernel_image $(K_IMAGE) $(SD_FILES_WITH_PREFIX) $(SD_DIRS_WITH_PREFIX) @echo "### ***** sd_card generation done! ***** ###" endif +endif .PHONY: sd_card sd_card: $(SD_CARD) @@ -253,7 +272,7 @@ ifeq ($(HOST_ARCH), x86) else @echo $(RUN_DEPS) - $(SD_CARD)/launch_$(TARGET).sh -no-reboot -run-app $(notdir $(RUN_SCRIPT)) + $(SD_CARD)/launch_$(TARGET).sh -no-reboot -run-app $(notdir $(RUN_SCRIPT)) 2>&1 | tee $(SD_CARD)/qemu_output.log grep "TEST PASSED, RC=0" $(SD_CARD)/qemu_output.log || exit 1 endif @@ -264,24 +283,32 @@ ifeq ($(HOST_ARCH), x86) LD_LIBRARY_PATH=$(LIBRARY_PATH):$$LD_LIBRARY_PATH \ XCL_EMULATION_MODE=$(TARGET) $(EXE_FILE) $(HOST_ARGS) +else +ifeq ($(ps_on_x86), on) + LD_LIBRARY_PATH=$(LIBRARY_PATH):$$LD_LIBRARY_PATH \ + XCL_EMULATION_MODE=$(TARGET) $(EXE_FILE) $(HOST_ARGS) + else @echo $(RUN_DEPS) - $(SD_CARD)/launch_$(TARGET).sh -no-reboot -run-app $(notdir $(RUN_SCRIPT)) + $(SD_CARD)/launch_$(TARGET).sh -no-reboot -run-app $(notdir $(RUN_SCRIPT)) 2>&1 | tee $(SD_CARD)/qemu_output.log grep "TEST PASSED, RC=0" $(SD_CARD)/qemu_output.log || exit 1 +endif endif endif #hw ifeq ($(TARGET), hw) ifneq (,$(findstring aws-vu9p-f1, $(PLATFORM_NAME))) -ifneq ($(JENKINS_INTERNAL_BUILD), 1) +ifeq (,$(wildcard $(BUILD_DIR)/rtmforward.awsxclbin)) $(ECHO) "This makefile does not directly support converting .xclbin to .awsxclbin, please refer https://github.com/aws/aws-fpga/blob/master/Vitis/README.md for next operations" else - $(ECHO) "Running inside Xilinx regression without converting to .awsxclbin" - $(EXE_FILE) $(HOST_ARGS) + $(ECHO) "Running HW using generated .awsxclbin" + LD_LIBRARY_PATH=$(LIBRARY_PATH):$$LD_LIBRARY_PATH \ + $(EXE_FILE) $(subst .xclbin,.awsxclbin,$(HOST_ARGS)) endif else ifeq ($(HOST_ARCH), x86) + LD_LIBRARY_PATH=$(LIBRARY_PATH):$$LD_LIBRARY_PATH \ $(EXE_FILE) $(HOST_ARGS) else @@ -315,12 +342,11 @@ cleanh: cleank: -$(RMDIR) $(BUILD_DIR)/*.xclbin _vimage *xclbin.run_summary qemu-memory-_* emulation/ _vimage/ pl*start_simulation. sh *.xclbin - -$(RMDIR) _x_temp.*/_x.* _x_temp.*/.Xil _x_temp.*/profile_summary.* xo_* _x* - -$(RMDIR) _x_temp.*/dltmp* _x_temp.*/kernel_info.dat _x_temp.*/*.log - -$(RMDIR) _x_temp.* + -$(RMDIR) _x_temp.* cleanall: cleanh cleank -$(RMDIR) $(BUILD_DIR) emconfig.json *.html $(TEMP_DIR) $(CUR_DIR)/reports *.csv *.run_summary $(CUR_DIR)/*.raw package_* $(BUILD_DIR)/run_script.sh .ipcache *.str -$(RMDIR) $(CUR_DIR)/Work $(CUR_DIR)/*.xpe $(CUR_DIR)/hw.o $(CUR_DIR)/*.xsa $(CUR_DIR)/xnwOut + -$(RMDIR) clean: cleanh \ No newline at end of file diff --git a/hpc/L2/tests/rtm2d/rtmforward/tests/dataset_h128_w128_t10/description.json b/hpc/L2/tests/rtm2d/rtmforward/tests/dataset_h128_w128_t10/description.json index 787b4ee30e..bad5d0644f 100644 --- a/hpc/L2/tests/rtm2d/rtmforward/tests/dataset_h128_w128_t10/description.json +++ b/hpc/L2/tests/rtm2d/rtmforward/tests/dataset_h128_w128_t10/description.json @@ -19,7 +19,6 @@ "cmd_args": "BUILD/rtmforward.xclbin PROJECT/data/ 128 128 10 1" } ], - "pre_launch": [], "host": { "host_exe": "host.exe", "compiler": { diff --git a/hpc/L2/tests/rtm2d/rtmforward/tests/dataset_h128_w128_t10/utils.mk b/hpc/L2/tests/rtm2d/rtmforward/tests/dataset_h128_w128_t10/utils.mk index 9b889021fc..2e9ea4d63a 100644 --- a/hpc/L2/tests/rtm2d/rtmforward/tests/dataset_h128_w128_t10/utils.mk +++ b/hpc/L2/tests/rtm2d/rtmforward/tests/dataset_h128_w128_t10/utils.mk @@ -12,7 +12,7 @@ # 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. -# vitis makefile-generator v2.0.6 +# vitis makefile-generator v2.0.7 # #+------------------------------------------------------------------------------- # The following parameters are assigned with default values. These parameters can @@ -50,6 +50,7 @@ ifndef XILINX_XRT export XILINX_XRT endif +.PHONY: check_device check_device: @set -eu; \ inallowlist=False; \ @@ -82,8 +83,9 @@ endif endif -#get suffix of kernel by PLATFORM +# Special processing for tool version/platform type VITIS_VER = $(shell v++ --version | grep 'v++' | sed 's/^[[:space:]]*//' | sed -e 's/^[*]* v++ v//g' | cut -d " " -f1) +# 1) for versal flow from 2022.1 DEVICE_TYPE = $(shell platforminfo -p $(PLATFORM) | grep 'FPGA Family' | sed 's/.*://' | sed '/ai_engine/d' | sed 's/^[[:space:]]*//') ifeq ($(DEVICE_TYPE), versal) ifeq ($(shell expr $(VITIS_VER) \>= 2022.1), 1) @@ -94,6 +96,22 @@ endif else LINK_TARGET_FMT := xclbin endif +# 2) dfx flow +dfx_hw := off +ifeq ($(findstring _dfx_, $(PLATFORM_NAME)),_dfx_) +ifeq ($(TARGET),hw) +dfx_hw := on +endif +endif +# 3) for embeded sw_emu flow from 2022.2 +ps_on_x86 := off +ifneq ($(HOST_ARCH), x86) +ifeq ($(shell expr $(VITIS_VER) \>= 2022.2), 1) +ifeq ($(TARGET), sw_emu) +ps_on_x86 := on +endif +endif +endif #Checks for Device Family ifeq ($(HOST_ARCH), aarch32) @@ -107,6 +125,7 @@ ifneq ($(HOST_ARCH), $(filter $(HOST_ARCH),aarch64 aarch32 x86)) $(error HOST_ARCH variable not set, please set correctly and rerun) endif +.PHONY: check_version check_sysroot check_kimage check_rootfs check_version: ifneq (, $(shell which git)) ifneq (,$(wildcard $(XFLIB_DIR)/.git)) @@ -114,17 +133,46 @@ ifneq (,$(wildcard $(XFLIB_DIR)/.git)) endif endif -#Checks for SYSROOT +#Set/Check SYSROOT/K_IMAGE/ROOTFS +ifneq ($(HOST_ARCH), x86) +ifneq (,$(findstring zc706, $(PLATFORM_NAME))) +K_IMAGE ?= $(SYSROOT)/../../uImage +else +K_IMAGE ?= $(SYSROOT)/../../Image +endif +ROOTFS ?= $(SYSROOT)/../../rootfs.ext4 +endif + check_sysroot: ifneq ($(HOST_ARCH), x86) -ifndef SYSROOT +ifeq (,$(wildcard $(SYSROOT))) $(error SYSROOT ENV variable is not set, please set ENV variable correctly and rerun) endif endif +check_kimage: +ifneq ($(HOST_ARCH), x86) +ifeq (,$(wildcard $(K_IMAGE))) + $(error K_IMAGE ENV variable is not set, please set ENV variable correctly and rerun) +endif +endif +check_rootfs: +ifneq ($(HOST_ARCH), x86) +ifeq (,$(wildcard $(ROOTFS))) + $(error ROOTFS ENV variable is not set, please set ENV variable correctly and rerun) +endif +endif #Checks for g++ -CXX := g++ ifeq ($(HOST_ARCH), x86) +X86_CXX := true +else +ifeq ($(ps_on_x86), true) +X86_CXX := true +endif +endif + +CXX := g++ +ifeq ($(X86_CXX), true) ifeq ($(shell expr $(VITIS_VER) \>= 2022.1), 1) CXX_VER := 8.3.0 else @@ -144,11 +192,13 @@ endif $(warning [WARNING]: g++ version too old. Using g++ provided by the tool: $(CXX)) endif endif -else ifeq ($(HOST_ARCH), aarch64) +else +ifeq ($(HOST_ARCH), aarch64) CXX := $(XILINX_VITIS)/gnu/aarch64/lin/aarch64-linux/bin/aarch64-linux-gnu-g++ else ifeq ($(HOST_ARCH), aarch32) CXX := $(XILINX_VITIS)/gnu/aarch32/lin/gcc-arm-linux-gnueabi/bin/arm-linux-gnueabihf-g++ endif +endif #Check OS and setting env for xrt c++ api OSDIST = $(shell lsb_release -i |awk -F: '{print tolower($$2)}' | tr -d ' \t' ) @@ -268,9 +318,3 @@ RMDIR = rm -rf MV = mv -f CP = cp -rf ECHO:= @echo -ifneq (,$(shell echo $(XPLATFORM) | awk '/xilinx_u280_xdma_201920_3/')) -VPP_FLAGS += --advanced.param compiler.ignorePlatformCompatibilityCheck=true -ifeq ($(TARGET), hw) -VPP_LDFLAGS += --advanced.param compiler.userPreSysLinkOverlayTcl=preSysLink.tcl -endif -endif diff --git a/hpc/L2/tests/rtm2d/rtmforward/utils.mk b/hpc/L2/tests/rtm2d/rtmforward/utils.mk index 9b889021fc..2e9ea4d63a 100644 --- a/hpc/L2/tests/rtm2d/rtmforward/utils.mk +++ b/hpc/L2/tests/rtm2d/rtmforward/utils.mk @@ -12,7 +12,7 @@ # 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. -# vitis makefile-generator v2.0.6 +# vitis makefile-generator v2.0.7 # #+------------------------------------------------------------------------------- # The following parameters are assigned with default values. These parameters can @@ -50,6 +50,7 @@ ifndef XILINX_XRT export XILINX_XRT endif +.PHONY: check_device check_device: @set -eu; \ inallowlist=False; \ @@ -82,8 +83,9 @@ endif endif -#get suffix of kernel by PLATFORM +# Special processing for tool version/platform type VITIS_VER = $(shell v++ --version | grep 'v++' | sed 's/^[[:space:]]*//' | sed -e 's/^[*]* v++ v//g' | cut -d " " -f1) +# 1) for versal flow from 2022.1 DEVICE_TYPE = $(shell platforminfo -p $(PLATFORM) | grep 'FPGA Family' | sed 's/.*://' | sed '/ai_engine/d' | sed 's/^[[:space:]]*//') ifeq ($(DEVICE_TYPE), versal) ifeq ($(shell expr $(VITIS_VER) \>= 2022.1), 1) @@ -94,6 +96,22 @@ endif else LINK_TARGET_FMT := xclbin endif +# 2) dfx flow +dfx_hw := off +ifeq ($(findstring _dfx_, $(PLATFORM_NAME)),_dfx_) +ifeq ($(TARGET),hw) +dfx_hw := on +endif +endif +# 3) for embeded sw_emu flow from 2022.2 +ps_on_x86 := off +ifneq ($(HOST_ARCH), x86) +ifeq ($(shell expr $(VITIS_VER) \>= 2022.2), 1) +ifeq ($(TARGET), sw_emu) +ps_on_x86 := on +endif +endif +endif #Checks for Device Family ifeq ($(HOST_ARCH), aarch32) @@ -107,6 +125,7 @@ ifneq ($(HOST_ARCH), $(filter $(HOST_ARCH),aarch64 aarch32 x86)) $(error HOST_ARCH variable not set, please set correctly and rerun) endif +.PHONY: check_version check_sysroot check_kimage check_rootfs check_version: ifneq (, $(shell which git)) ifneq (,$(wildcard $(XFLIB_DIR)/.git)) @@ -114,17 +133,46 @@ ifneq (,$(wildcard $(XFLIB_DIR)/.git)) endif endif -#Checks for SYSROOT +#Set/Check SYSROOT/K_IMAGE/ROOTFS +ifneq ($(HOST_ARCH), x86) +ifneq (,$(findstring zc706, $(PLATFORM_NAME))) +K_IMAGE ?= $(SYSROOT)/../../uImage +else +K_IMAGE ?= $(SYSROOT)/../../Image +endif +ROOTFS ?= $(SYSROOT)/../../rootfs.ext4 +endif + check_sysroot: ifneq ($(HOST_ARCH), x86) -ifndef SYSROOT +ifeq (,$(wildcard $(SYSROOT))) $(error SYSROOT ENV variable is not set, please set ENV variable correctly and rerun) endif endif +check_kimage: +ifneq ($(HOST_ARCH), x86) +ifeq (,$(wildcard $(K_IMAGE))) + $(error K_IMAGE ENV variable is not set, please set ENV variable correctly and rerun) +endif +endif +check_rootfs: +ifneq ($(HOST_ARCH), x86) +ifeq (,$(wildcard $(ROOTFS))) + $(error ROOTFS ENV variable is not set, please set ENV variable correctly and rerun) +endif +endif #Checks for g++ -CXX := g++ ifeq ($(HOST_ARCH), x86) +X86_CXX := true +else +ifeq ($(ps_on_x86), true) +X86_CXX := true +endif +endif + +CXX := g++ +ifeq ($(X86_CXX), true) ifeq ($(shell expr $(VITIS_VER) \>= 2022.1), 1) CXX_VER := 8.3.0 else @@ -144,11 +192,13 @@ endif $(warning [WARNING]: g++ version too old. Using g++ provided by the tool: $(CXX)) endif endif -else ifeq ($(HOST_ARCH), aarch64) +else +ifeq ($(HOST_ARCH), aarch64) CXX := $(XILINX_VITIS)/gnu/aarch64/lin/aarch64-linux/bin/aarch64-linux-gnu-g++ else ifeq ($(HOST_ARCH), aarch32) CXX := $(XILINX_VITIS)/gnu/aarch32/lin/gcc-arm-linux-gnueabi/bin/arm-linux-gnueabihf-g++ endif +endif #Check OS and setting env for xrt c++ api OSDIST = $(shell lsb_release -i |awk -F: '{print tolower($$2)}' | tr -d ' \t' ) @@ -268,9 +318,3 @@ RMDIR = rm -rf MV = mv -f CP = cp -rf ECHO:= @echo -ifneq (,$(shell echo $(XPLATFORM) | awk '/xilinx_u280_xdma_201920_3/')) -VPP_FLAGS += --advanced.param compiler.ignorePlatformCompatibilityCheck=true -ifeq ($(TARGET), hw) -VPP_LDFLAGS += --advanced.param compiler.userPreSysLinkOverlayTcl=preSysLink.tcl -endif -endif diff --git a/hpc/L2/tests/rtm3d/rtmforward_Domain_HBC/Makefile b/hpc/L2/tests/rtm3d/rtmforward_Domain_HBC/Makefile index 6df1fb2b05..dc9523babf 100755 --- a/hpc/L2/tests/rtm3d/rtmforward_Domain_HBC/Makefile +++ b/hpc/L2/tests/rtm3d/rtmforward_Domain_HBC/Makefile @@ -11,7 +11,7 @@ # 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. -# vitis makefile-generator v2.0.6 +# vitis makefile-generator v2.0.7 ############################## Help Section ############################## .PHONY: help @@ -34,9 +34,15 @@ help:: $(ECHO) " Command to build host application." $(ECHO) " By default, HOST_ARCH=x86. HOST_ARCH is required for SoC shells" $(ECHO) "" - $(ECHO) " NOTE: For embedded devices, e.g. zcu102/zcu104/vck190, env variable SYSROOT and EDGE_COMMON_SW need to be set first, and HOST_ARCH is either aarch32 or aarch64. For example," - $(ECHO) " export SYSROOT=< path-to-platform-sysroot >" - $(ECHO) " export EDGE_COMMON_SW=< path-to-rootfs-and-Image-files >" + $(ECHO) " NOTE: For embedded devices, e.g. zcu102/zcu104/vck190, HOST_ARCH is either aarch32 or aarch64." + $(ECHO) " a.IF Download the platform, and common-image from Xilinx Download Center(Suggested):" + $(ECHO) " Run the sdk.sh script from the common-image directory to install sysroot using the command : ./sdk.sh -y -d ./ -p " + $(ECHO) " Unzip the rootfs file : gunzip ./rootfs.ext4.gz" + $(ECHO) " export SYSROOT=< path-to-platform-sysroot >" + $(ECHO) " b. User could also define SYSROOT, K_IMAGE and ROOTFS by themselves: " + $(ECHO) " export SYSROOT=< path-to-platform-sysroot >" + $(ECHO) " export K_IMAGE=< path-to-Image-files >" + $(ECHO) " export ROOTFS=< path-to-rootfs >" $(ECHO) "" $(ECHO) " make clean " $(ECHO) " Command to remove the generated non-hardware files." @@ -61,7 +67,7 @@ ifeq ($(PLATFORM),) PLATFORM := $(DEVICE) endif ifeq ($(PLATFORM),) -PLATFORM := xilinx_u280_xdma_201920_3 +PLATFORM := xilinx_u280_gen3x16_xdma_1_202120_1 endif # #################### Checking if PLATFORM in whitelist ############################ @@ -87,12 +93,17 @@ RUN_DEPS := # get global setting ifeq ($(HOST_ARCH), x86) CXXFLAGS += -fmessage-length=0 -I$(CUR_DIR)/src/ -I$(XILINX_XRT)/include -I$(XILINX_HLS)/include -std=c++14 -O3 -Wall -Wno-unknown-pragmas -Wno-unused-label -LDFLAGS += -pthread -L$(XILINX_XRT)/lib -L$(XILINX_HLS)/lnx64/tools/fpo_v7_0 -Wl,--as-needed -lOpenCL -lxrt_coreutil -lgmp -lmpfr -lIp_floating_point_v7_0_bitacc_cmodel +LDFLAGS += -pthread -L$(XILINX_XRT)/lib -L$(XILINX_HLS)/lnx64/tools/fpo_v7_1 -Wl,--as-needed -lOpenCL -lxrt_coreutil -lgmp -lmpfr -lIp_floating_point_v7_1_bitacc_cmodel VPP_FLAGS += -t $(TARGET) --platform $(XPLATFORM) --save-temps VPP_LDFLAGS += --optimize 2 -R 2 else ifeq ($(HOST_ARCH), aarch64) +ifeq ($(ps_on_x86), on) +CXXFLAGS += -fmessage-length=0 -I$(CUR_DIR)/src/ -I$(XILINX_XRT)/include -I$(XILINX_HLS)/include -std=c++14 -O3 -Wall -Wno-unknown-pragmas -Wno-unused-label +LDFLAGS += -pthread -L$(XILINX_XRT)/lib -L$(XILINX_HLS)/lnx64/tools/fpo_v7_1 -Wl,--as-needed -lOpenCL -lxrt_coreutil -lgmp -lmpfr -lIp_floating_point_v7_1_bitacc_cmodel +else CXXFLAGS += -I$(CUR_DIR)/src/ -fmessage-length=0 --sysroot=$(SYSROOT) -I$(SYSROOT)/usr/include/xrt -I$(XILINX_HLS)/include -std=c++14 -O3 -Wall -Wno-unknown-pragmas -Wno-unused-label -LDFLAGS += -pthread -L$(SYSROOT)/usr/lib -L$(XILINX_VITIS_AIETOOLS)/lib/aarch64.o -Wl,--as-needed -lxilinxopencl -lxrt_coreutil +LDFLAGS += -pthread -L$(SYSROOT)/usr/lib -Wl,--as-needed -lxilinxopencl -lxrt_coreutil +endif VPP_FLAGS += -t $(TARGET) --platform $(XPLATFORM) --save-temps VPP_LDFLAGS += --optimize 2 -R 2 endif @@ -107,15 +118,23 @@ ifeq ($(TARGET),hw_emu) CXXFLAGS += -D HW_EMU_TEST endif -ifeq (,$(findstring opencv,$(CXXFLAGS))) -CXXFLAGS += $(XRT_CXXFLAGS) -endif - #Inclue Required Host Source Files +ifeq ($(ps_on_x86), on) HOST_SRCS += $(CUR_DIR)/main.cpp $(XFLIB_DIR)/../blas/L2/src/xcl2/xcl2.cpp CXXFLAGS += -D RTM_dataType=float -D RTM_numFSMs=2 -D RTM_maxZ=280 -D RTM_maxY=180 -D RTM_MaxB=20 -D RTM_NXB=20 -D RTM_NYB=20 -D RTM_NZB=20 -D RTM_order=8 -D RTM_nPEZ=2 -D RTM_nPEX=4 CXXFLAGS += -I $(XFLIB_DIR)/L2/include/sw/ -I $(XFLIB_DIR)/L2/include/sw/rtm3d/ -I $(XFLIB_DIR)/../blas/L2/include/xcl2 -I $(XFLIB_DIR)/../blas/L1/tests/sw/include/ CXXFLAGS += -g +else +HOST_SRCS += $(CUR_DIR)/main.cpp $(XFLIB_DIR)/../blas/L2/src/xcl2/xcl2.cpp +CXXFLAGS += -D RTM_dataType=float -D RTM_numFSMs=2 -D RTM_maxZ=280 -D RTM_maxY=180 -D RTM_MaxB=20 -D RTM_NXB=20 -D RTM_NYB=20 -D RTM_NZB=20 -D RTM_order=8 -D RTM_nPEZ=2 -D RTM_nPEX=4 +CXXFLAGS += -I $(XFLIB_DIR)/L2/include/sw/ -I $(XFLIB_DIR)/L2/include/sw/rtm3d/ -I $(XFLIB_DIR)/../blas/L2/include/xcl2 -I $(XFLIB_DIR)/../blas/L1/tests/sw/include/ +CXXFLAGS += -g +endif + +# workaround for opencv +ifeq (,$(findstring opencv,$(CXXFLAGS))) +CXXFLAGS += $(XRT_CXXFLAGS) +endif EXE_NAME := host.exe EXE_FILE := $(BUILD_DIR)/$(EXE_NAME) @@ -183,11 +202,6 @@ $(EMCONFIG): emconfigutil --platform $(XPLATFORM) --od $(BUILD_DIR) ############################## Preparing sdcard folder ############################## ifneq ($(HOST_ARCH), x86) -ifneq (,$(findstring zc706, $(PLATFORM_NAME))) -K_IMAGE := $(SYSROOT)/../../uImage -else -K_IMAGE := $(SYSROOT)/../../Image -endif RUN_SCRIPT := $(BUILD_DIR)/run_script.sh $(RUN_SCRIPT): rm -rf $(RUN_SCRIPT) @@ -203,7 +217,7 @@ endif @echo './$(EXE_NAME) $(PKG_HOST_ARGS)' >> $(RUN_SCRIPT) @echo 'return_code=$$?' >> $(RUN_SCRIPT) @echo 'if [ $$return_code -ne 0 ]; then' >> $(RUN_SCRIPT) - @echo ' echo "ERROR: Embedded host run failed, RC=$$return_code"' >> $(RUN_SCRIPT) + @echo ' echo "ERROR: TEST FAILED, RC=$$return_code"' >> $(RUN_SCRIPT) @echo 'else' >> $(RUN_SCRIPT) @echo ' echo "INFO: TEST PASSED, RC=0"' >> $(RUN_SCRIPT) @echo 'fi' >> $(RUN_SCRIPT) @@ -221,23 +235,28 @@ SD_DIRS_WITH_PREFIX = $(foreach sd_dir,$(DATA_DIR),--package.sd_dir $(sd_dir)) PACKAGE_FILES := $(BINARY_CONTAINERS) PACKAGE_FILES += $(AIE_CONTAINER) SD_CARD := $(CUR_DIR)/package_$(TARGET) -vck190_dfx_hw := false -$(SD_CARD): $(EXE_FILE) $(BINARY_CONTAINERS) $(RUN_SCRIPT) $(EMCONFIG) +$(SD_CARD): $(EXE_FILE) $(BINARY_CONTAINERS) $(RUN_SCRIPT) $(EMCONFIG) check_kimage check_rootfs @echo "Generating sd_card folder...." mkdir -p $(SD_CARD) chmod a+rx $(BUILD_DIR)/run_script.sh -ifneq (,$(findstring vck190_base_dfx, $(PLATFORM_NAME))) -ifeq ($(TARGET),hw) - $(VPP) -t $(TARGET) --platform $(XPLATFORM) -p $(PACKAGE_FILES) -o $(BINARY_CONTAINERS_PKG) - $(VPP) -t $(TARGET) --platform $(XPLATFORM) -p --package.out_dir $(SD_CARD) --package.rootfs $(SYSROOT)/../../rootfs.ext4 --package.kernel_image $(K_IMAGE) $(SD_FILES_WITH_PREFIX) $(SD_DIRS_WITH_PREFIX) --package.sd_file $(BINARY_CONTAINERS_PKG) +# 1. DFX HW Flow +ifeq ($(dfx_hw), on) + $(VPP) -t $(TARGET) --platform $(XPLATFORM) -p $(PACKAGE_FILES) $(VPP_PACKAGE) -o $(BINARY_CONTAINERS_PKG) + $(VPP) -t $(TARGET) --platform $(XPLATFORM) -p --package.out_dir $(SD_CARD) --package.rootfs $(ROOTFS) --package.kernel_image $(K_IMAGE) $(SD_FILES_WITH_PREFIX) $(SD_DIRS_WITH_PREFIX) --package.sd_file $(BINARY_CONTAINERS_PKG) @echo "### ***** sd_card generation done! ***** ###" -vck190_dfx_hw := true endif +# 2. PS_ON_X86 - From 2022.2, Target:sw_emu +ifeq ($(ps_on_x86), on) + @echo "### ***** running PS X86 SE_EMU ***** ###" + $(VPP) -t $(TARGET) --platform $(XPLATFORM) -o $(BINARY_CONTAINERS_PKG) -p $(PACKAGE_FILES) $(VPP_PACKAGE) --package.out_dir $(SD_CARD) --package.emu_ps x86 endif -ifeq ($(vck190_dfx_hw), false) - $(VPP) -t $(TARGET) --platform $(XPLATFORM) -o $(BINARY_CONTAINERS_PKG) -p $(PACKAGE_FILES) $(VPP_PACKAGE) --package.out_dir $(SD_CARD) --package.rootfs $(SYSROOT)/../../rootfs.ext4 --package.kernel_image $(K_IMAGE) $(SD_FILES_WITH_PREFIX) $(SD_DIRS_WITH_PREFIX) +#3. General Embeded flow +ifeq ($(dfx_hw), off) +ifeq ($(ps_on_x86), off) + $(VPP) -t $(TARGET) --platform $(XPLATFORM) -o $(BINARY_CONTAINERS_PKG) -p $(PACKAGE_FILES) $(VPP_PACKAGE) --package.out_dir $(SD_CARD) --package.rootfs $(ROOTFS) --package.kernel_image $(K_IMAGE) $(SD_FILES_WITH_PREFIX) $(SD_DIRS_WITH_PREFIX) @echo "### ***** sd_card generation done! ***** ###" endif +endif .PHONY: sd_card sd_card: $(SD_CARD) @@ -261,7 +280,7 @@ ifeq ($(HOST_ARCH), x86) else @echo $(RUN_DEPS) - $(SD_CARD)/launch_$(TARGET).sh -no-reboot -run-app $(notdir $(RUN_SCRIPT)) + $(SD_CARD)/launch_$(TARGET).sh -no-reboot -run-app $(notdir $(RUN_SCRIPT)) 2>&1 | tee $(SD_CARD)/qemu_output.log grep "TEST PASSED, RC=0" $(SD_CARD)/qemu_output.log || exit 1 endif @@ -272,24 +291,32 @@ ifeq ($(HOST_ARCH), x86) LD_LIBRARY_PATH=$(LIBRARY_PATH):$$LD_LIBRARY_PATH \ XCL_EMULATION_MODE=$(TARGET) $(EXE_FILE) $(HOST_ARGS) +else +ifeq ($(ps_on_x86), on) + LD_LIBRARY_PATH=$(LIBRARY_PATH):$$LD_LIBRARY_PATH \ + XCL_EMULATION_MODE=$(TARGET) $(EXE_FILE) $(HOST_ARGS) + else @echo $(RUN_DEPS) - $(SD_CARD)/launch_$(TARGET).sh -no-reboot -run-app $(notdir $(RUN_SCRIPT)) + $(SD_CARD)/launch_$(TARGET).sh -no-reboot -run-app $(notdir $(RUN_SCRIPT)) 2>&1 | tee $(SD_CARD)/qemu_output.log grep "TEST PASSED, RC=0" $(SD_CARD)/qemu_output.log || exit 1 +endif endif endif #hw ifeq ($(TARGET), hw) ifneq (,$(findstring aws-vu9p-f1, $(PLATFORM_NAME))) -ifneq ($(JENKINS_INTERNAL_BUILD), 1) +ifeq (,$(wildcard $(BUILD_DIR)/rtmforward.awsxclbin)) $(ECHO) "This makefile does not directly support converting .xclbin to .awsxclbin, please refer https://github.com/aws/aws-fpga/blob/master/Vitis/README.md for next operations" else - $(ECHO) "Running inside Xilinx regression without converting to .awsxclbin" - $(EXE_FILE) $(HOST_ARGS) + $(ECHO) "Running HW using generated .awsxclbin" + LD_LIBRARY_PATH=$(LIBRARY_PATH):$$LD_LIBRARY_PATH \ + $(EXE_FILE) $(subst .xclbin,.awsxclbin,$(HOST_ARGS)) endif else ifeq ($(HOST_ARCH), x86) + LD_LIBRARY_PATH=$(LIBRARY_PATH):$$LD_LIBRARY_PATH \ $(EXE_FILE) $(HOST_ARGS) else @@ -323,12 +350,11 @@ cleanh: cleank: -$(RMDIR) $(BUILD_DIR)/*.xclbin _vimage *xclbin.run_summary qemu-memory-_* emulation/ _vimage/ pl*start_simulation. sh *.xclbin - -$(RMDIR) _x_temp.*/_x.* _x_temp.*/.Xil _x_temp.*/profile_summary.* xo_* _x* - -$(RMDIR) _x_temp.*/dltmp* _x_temp.*/kernel_info.dat _x_temp.*/*.log - -$(RMDIR) _x_temp.* + -$(RMDIR) _x_temp.* cleanall: cleanh cleank -$(RMDIR) $(BUILD_DIR) emconfig.json *.html $(TEMP_DIR) $(CUR_DIR)/reports *.csv *.run_summary $(CUR_DIR)/*.raw package_* $(BUILD_DIR)/run_script.sh .ipcache *.str -$(RMDIR) $(CUR_DIR)/Work $(CUR_DIR)/*.xpe $(CUR_DIR)/hw.o $(CUR_DIR)/*.xsa $(CUR_DIR)/xnwOut + -$(RMDIR) clean: cleanh \ No newline at end of file diff --git a/hpc/L2/tests/rtm3d/rtmforward_Domain_HBC/description.json b/hpc/L2/tests/rtm3d/rtmforward_Domain_HBC/description.json index bc508a18e9..cb7b13f9e5 100644 --- a/hpc/L2/tests/rtm3d/rtmforward_Domain_HBC/description.json +++ b/hpc/L2/tests/rtm3d/rtmforward_Domain_HBC/description.json @@ -27,11 +27,6 @@ "cmd_args": "" } ], - "pre_launch": [ - { - "launch_cmd": "make data_gen" - } - ], "host": { "host_exe": "host.exe", "compiler": { diff --git a/hpc/L2/tests/rtm3d/rtmforward_Domain_HBC/tests/dataset_z70_y60_x80_t4/Makefile b/hpc/L2/tests/rtm3d/rtmforward_Domain_HBC/tests/dataset_z70_y60_x80_t4/Makefile index edf51929c2..1b4a3b61ba 100755 --- a/hpc/L2/tests/rtm3d/rtmforward_Domain_HBC/tests/dataset_z70_y60_x80_t4/Makefile +++ b/hpc/L2/tests/rtm3d/rtmforward_Domain_HBC/tests/dataset_z70_y60_x80_t4/Makefile @@ -11,7 +11,7 @@ # 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. -# vitis makefile-generator v2.0.6 +# vitis makefile-generator v2.0.7 ############################## Help Section ############################## .PHONY: help @@ -34,9 +34,15 @@ help:: $(ECHO) " Command to build host application." $(ECHO) " By default, HOST_ARCH=x86. HOST_ARCH is required for SoC shells" $(ECHO) "" - $(ECHO) " NOTE: For embedded devices, e.g. zcu102/zcu104/vck190, env variable SYSROOT and EDGE_COMMON_SW need to be set first, and HOST_ARCH is either aarch32 or aarch64. For example," - $(ECHO) " export SYSROOT=< path-to-platform-sysroot >" - $(ECHO) " export EDGE_COMMON_SW=< path-to-rootfs-and-Image-files >" + $(ECHO) " NOTE: For embedded devices, e.g. zcu102/zcu104/vck190, HOST_ARCH is either aarch32 or aarch64." + $(ECHO) " a.IF Download the platform, and common-image from Xilinx Download Center(Suggested):" + $(ECHO) " Run the sdk.sh script from the common-image directory to install sysroot using the command : ./sdk.sh -y -d ./ -p " + $(ECHO) " Unzip the rootfs file : gunzip ./rootfs.ext4.gz" + $(ECHO) " export SYSROOT=< path-to-platform-sysroot >" + $(ECHO) " b. User could also define SYSROOT, K_IMAGE and ROOTFS by themselves: " + $(ECHO) " export SYSROOT=< path-to-platform-sysroot >" + $(ECHO) " export K_IMAGE=< path-to-Image-files >" + $(ECHO) " export ROOTFS=< path-to-rootfs >" $(ECHO) "" $(ECHO) " make clean " $(ECHO) " Command to remove the generated non-hardware files." @@ -61,7 +67,7 @@ ifeq ($(PLATFORM),) PLATFORM := $(DEVICE) endif ifeq ($(PLATFORM),) -PLATFORM := xilinx_u280_xdma_201920_3 +PLATFORM := xilinx_u280_gen3x16_xdma_1_202120_1 endif # #################### Checking if PLATFORM in whitelist ############################ @@ -87,12 +93,17 @@ RUN_DEPS := # get global setting ifeq ($(HOST_ARCH), x86) CXXFLAGS += -fmessage-length=0 -I$(CUR_DIR)/src/ -I$(XILINX_XRT)/include -I$(XILINX_HLS)/include -std=c++14 -O3 -Wall -Wno-unknown-pragmas -Wno-unused-label -LDFLAGS += -pthread -L$(XILINX_XRT)/lib -L$(XILINX_HLS)/lnx64/tools/fpo_v7_0 -Wl,--as-needed -lOpenCL -lxrt_coreutil -lgmp -lmpfr -lIp_floating_point_v7_0_bitacc_cmodel +LDFLAGS += -pthread -L$(XILINX_XRT)/lib -L$(XILINX_HLS)/lnx64/tools/fpo_v7_1 -Wl,--as-needed -lOpenCL -lxrt_coreutil -lgmp -lmpfr -lIp_floating_point_v7_1_bitacc_cmodel VPP_FLAGS += -t $(TARGET) --platform $(XPLATFORM) --save-temps VPP_LDFLAGS += --optimize 2 -R 2 else ifeq ($(HOST_ARCH), aarch64) +ifeq ($(ps_on_x86), on) +CXXFLAGS += -fmessage-length=0 -I$(CUR_DIR)/src/ -I$(XILINX_XRT)/include -I$(XILINX_HLS)/include -std=c++14 -O3 -Wall -Wno-unknown-pragmas -Wno-unused-label +LDFLAGS += -pthread -L$(XILINX_XRT)/lib -L$(XILINX_HLS)/lnx64/tools/fpo_v7_1 -Wl,--as-needed -lOpenCL -lxrt_coreutil -lgmp -lmpfr -lIp_floating_point_v7_1_bitacc_cmodel +else CXXFLAGS += -I$(CUR_DIR)/src/ -fmessage-length=0 --sysroot=$(SYSROOT) -I$(SYSROOT)/usr/include/xrt -I$(XILINX_HLS)/include -std=c++14 -O3 -Wall -Wno-unknown-pragmas -Wno-unused-label -LDFLAGS += -pthread -L$(SYSROOT)/usr/lib -L$(XILINX_VITIS_AIETOOLS)/lib/aarch64.o -Wl,--as-needed -lxilinxopencl -lxrt_coreutil +LDFLAGS += -pthread -L$(SYSROOT)/usr/lib -Wl,--as-needed -lxilinxopencl -lxrt_coreutil +endif VPP_FLAGS += -t $(TARGET) --platform $(XPLATFORM) --save-temps VPP_LDFLAGS += --optimize 2 -R 2 endif @@ -107,15 +118,23 @@ ifeq ($(TARGET),hw_emu) CXXFLAGS += -D HW_EMU_TEST endif -ifeq (,$(findstring opencv,$(CXXFLAGS))) -CXXFLAGS += $(XRT_CXXFLAGS) -endif - #Inclue Required Host Source Files +ifeq ($(ps_on_x86), on) HOST_SRCS += $(XFLIB_DIR)/L2/tests/rtm3d/rtmforward_Domain_HBC/main.cpp $(XFLIB_DIR)/../blas/L2/src/xcl2/xcl2.cpp CXXFLAGS += -D RTM_dataType=float -D RTM_numFSMs=2 -D RTM_maxZ=256 -D RTM_maxY=128 -D RTM_MaxB=20 -D RTM_NXB=20 -D RTM_NYB=20 -D RTM_NZB=20 -D RTM_order=8 -D RTM_nPEZ=2 -D RTM_nPEX=2 CXXFLAGS += -I $(XFLIB_DIR)/L2/include/sw/rtm3d/ -I $(XFLIB_DIR)/L2/include/sw/ -I $(XFLIB_DIR)/../blas/L2/include/xcl2 -I $(XFLIB_DIR)/../blas/L1/tests/sw/include/ CXXFLAGS += -g +else +HOST_SRCS += $(XFLIB_DIR)/L2/tests/rtm3d/rtmforward_Domain_HBC/main.cpp $(XFLIB_DIR)/../blas/L2/src/xcl2/xcl2.cpp +CXXFLAGS += -D RTM_dataType=float -D RTM_numFSMs=2 -D RTM_maxZ=256 -D RTM_maxY=128 -D RTM_MaxB=20 -D RTM_NXB=20 -D RTM_NYB=20 -D RTM_NZB=20 -D RTM_order=8 -D RTM_nPEZ=2 -D RTM_nPEX=2 +CXXFLAGS += -I $(XFLIB_DIR)/L2/include/sw/rtm3d/ -I $(XFLIB_DIR)/L2/include/sw/ -I $(XFLIB_DIR)/../blas/L2/include/xcl2 -I $(XFLIB_DIR)/../blas/L1/tests/sw/include/ +CXXFLAGS += -g +endif + +# workaround for opencv +ifeq (,$(findstring opencv,$(CXXFLAGS))) +CXXFLAGS += $(XRT_CXXFLAGS) +endif EXE_NAME := host.exe EXE_FILE := $(BUILD_DIR)/$(EXE_NAME) @@ -175,11 +194,6 @@ $(EMCONFIG): emconfigutil --platform $(XPLATFORM) --od $(BUILD_DIR) ############################## Preparing sdcard folder ############################## ifneq ($(HOST_ARCH), x86) -ifneq (,$(findstring zc706, $(PLATFORM_NAME))) -K_IMAGE := $(SYSROOT)/../../uImage -else -K_IMAGE := $(SYSROOT)/../../Image -endif RUN_SCRIPT := $(BUILD_DIR)/run_script.sh $(RUN_SCRIPT): rm -rf $(RUN_SCRIPT) @@ -195,7 +209,7 @@ endif @echo './$(EXE_NAME) $(PKG_HOST_ARGS)' >> $(RUN_SCRIPT) @echo 'return_code=$$?' >> $(RUN_SCRIPT) @echo 'if [ $$return_code -ne 0 ]; then' >> $(RUN_SCRIPT) - @echo ' echo "ERROR: Embedded host run failed, RC=$$return_code"' >> $(RUN_SCRIPT) + @echo ' echo "ERROR: TEST FAILED, RC=$$return_code"' >> $(RUN_SCRIPT) @echo 'else' >> $(RUN_SCRIPT) @echo ' echo "INFO: TEST PASSED, RC=0"' >> $(RUN_SCRIPT) @echo 'fi' >> $(RUN_SCRIPT) @@ -213,23 +227,28 @@ SD_DIRS_WITH_PREFIX = $(foreach sd_dir,$(DATA_DIR),--package.sd_dir $(sd_dir)) PACKAGE_FILES := $(BINARY_CONTAINERS) PACKAGE_FILES += $(AIE_CONTAINER) SD_CARD := $(CUR_DIR)/package_$(TARGET) -vck190_dfx_hw := false -$(SD_CARD): $(EXE_FILE) $(BINARY_CONTAINERS) $(RUN_SCRIPT) $(EMCONFIG) +$(SD_CARD): $(EXE_FILE) $(BINARY_CONTAINERS) $(RUN_SCRIPT) $(EMCONFIG) check_kimage check_rootfs @echo "Generating sd_card folder...." mkdir -p $(SD_CARD) chmod a+rx $(BUILD_DIR)/run_script.sh -ifneq (,$(findstring vck190_base_dfx, $(PLATFORM_NAME))) -ifeq ($(TARGET),hw) - $(VPP) -t $(TARGET) --platform $(XPLATFORM) -p $(PACKAGE_FILES) -o $(BINARY_CONTAINERS_PKG) - $(VPP) -t $(TARGET) --platform $(XPLATFORM) -p --package.out_dir $(SD_CARD) --package.rootfs $(SYSROOT)/../../rootfs.ext4 --package.kernel_image $(K_IMAGE) $(SD_FILES_WITH_PREFIX) $(SD_DIRS_WITH_PREFIX) --package.sd_file $(BINARY_CONTAINERS_PKG) +# 1. DFX HW Flow +ifeq ($(dfx_hw), on) + $(VPP) -t $(TARGET) --platform $(XPLATFORM) -p $(PACKAGE_FILES) $(VPP_PACKAGE) -o $(BINARY_CONTAINERS_PKG) + $(VPP) -t $(TARGET) --platform $(XPLATFORM) -p --package.out_dir $(SD_CARD) --package.rootfs $(ROOTFS) --package.kernel_image $(K_IMAGE) $(SD_FILES_WITH_PREFIX) $(SD_DIRS_WITH_PREFIX) --package.sd_file $(BINARY_CONTAINERS_PKG) @echo "### ***** sd_card generation done! ***** ###" -vck190_dfx_hw := true endif +# 2. PS_ON_X86 - From 2022.2, Target:sw_emu +ifeq ($(ps_on_x86), on) + @echo "### ***** running PS X86 SE_EMU ***** ###" + $(VPP) -t $(TARGET) --platform $(XPLATFORM) -o $(BINARY_CONTAINERS_PKG) -p $(PACKAGE_FILES) $(VPP_PACKAGE) --package.out_dir $(SD_CARD) --package.emu_ps x86 endif -ifeq ($(vck190_dfx_hw), false) - $(VPP) -t $(TARGET) --platform $(XPLATFORM) -o $(BINARY_CONTAINERS_PKG) -p $(PACKAGE_FILES) $(VPP_PACKAGE) --package.out_dir $(SD_CARD) --package.rootfs $(SYSROOT)/../../rootfs.ext4 --package.kernel_image $(K_IMAGE) $(SD_FILES_WITH_PREFIX) $(SD_DIRS_WITH_PREFIX) +#3. General Embeded flow +ifeq ($(dfx_hw), off) +ifeq ($(ps_on_x86), off) + $(VPP) -t $(TARGET) --platform $(XPLATFORM) -o $(BINARY_CONTAINERS_PKG) -p $(PACKAGE_FILES) $(VPP_PACKAGE) --package.out_dir $(SD_CARD) --package.rootfs $(ROOTFS) --package.kernel_image $(K_IMAGE) $(SD_FILES_WITH_PREFIX) $(SD_DIRS_WITH_PREFIX) @echo "### ***** sd_card generation done! ***** ###" endif +endif .PHONY: sd_card sd_card: $(SD_CARD) @@ -253,7 +272,7 @@ ifeq ($(HOST_ARCH), x86) else @echo $(RUN_DEPS) - $(SD_CARD)/launch_$(TARGET).sh -no-reboot -run-app $(notdir $(RUN_SCRIPT)) + $(SD_CARD)/launch_$(TARGET).sh -no-reboot -run-app $(notdir $(RUN_SCRIPT)) 2>&1 | tee $(SD_CARD)/qemu_output.log grep "TEST PASSED, RC=0" $(SD_CARD)/qemu_output.log || exit 1 endif @@ -264,24 +283,32 @@ ifeq ($(HOST_ARCH), x86) LD_LIBRARY_PATH=$(LIBRARY_PATH):$$LD_LIBRARY_PATH \ XCL_EMULATION_MODE=$(TARGET) $(EXE_FILE) $(HOST_ARGS) +else +ifeq ($(ps_on_x86), on) + LD_LIBRARY_PATH=$(LIBRARY_PATH):$$LD_LIBRARY_PATH \ + XCL_EMULATION_MODE=$(TARGET) $(EXE_FILE) $(HOST_ARGS) + else @echo $(RUN_DEPS) - $(SD_CARD)/launch_$(TARGET).sh -no-reboot -run-app $(notdir $(RUN_SCRIPT)) + $(SD_CARD)/launch_$(TARGET).sh -no-reboot -run-app $(notdir $(RUN_SCRIPT)) 2>&1 | tee $(SD_CARD)/qemu_output.log grep "TEST PASSED, RC=0" $(SD_CARD)/qemu_output.log || exit 1 +endif endif endif #hw ifeq ($(TARGET), hw) ifneq (,$(findstring aws-vu9p-f1, $(PLATFORM_NAME))) -ifneq ($(JENKINS_INTERNAL_BUILD), 1) +ifeq (,$(wildcard $(BUILD_DIR)/rtmforward.awsxclbin)) $(ECHO) "This makefile does not directly support converting .xclbin to .awsxclbin, please refer https://github.com/aws/aws-fpga/blob/master/Vitis/README.md for next operations" else - $(ECHO) "Running inside Xilinx regression without converting to .awsxclbin" - $(EXE_FILE) $(HOST_ARGS) + $(ECHO) "Running HW using generated .awsxclbin" + LD_LIBRARY_PATH=$(LIBRARY_PATH):$$LD_LIBRARY_PATH \ + $(EXE_FILE) $(subst .xclbin,.awsxclbin,$(HOST_ARGS)) endif else ifeq ($(HOST_ARCH), x86) + LD_LIBRARY_PATH=$(LIBRARY_PATH):$$LD_LIBRARY_PATH \ $(EXE_FILE) $(HOST_ARGS) else @@ -315,12 +342,11 @@ cleanh: cleank: -$(RMDIR) $(BUILD_DIR)/*.xclbin _vimage *xclbin.run_summary qemu-memory-_* emulation/ _vimage/ pl*start_simulation. sh *.xclbin - -$(RMDIR) _x_temp.*/_x.* _x_temp.*/.Xil _x_temp.*/profile_summary.* xo_* _x* - -$(RMDIR) _x_temp.*/dltmp* _x_temp.*/kernel_info.dat _x_temp.*/*.log - -$(RMDIR) _x_temp.* + -$(RMDIR) _x_temp.* cleanall: cleanh cleank -$(RMDIR) $(BUILD_DIR) emconfig.json *.html $(TEMP_DIR) $(CUR_DIR)/reports *.csv *.run_summary $(CUR_DIR)/*.raw package_* $(BUILD_DIR)/run_script.sh .ipcache *.str -$(RMDIR) $(CUR_DIR)/Work $(CUR_DIR)/*.xpe $(CUR_DIR)/hw.o $(CUR_DIR)/*.xsa $(CUR_DIR)/xnwOut + -$(RMDIR) clean: cleanh \ No newline at end of file diff --git a/hpc/L2/tests/rtm3d/rtmforward_Domain_HBC/tests/dataset_z70_y60_x80_t4/description.json b/hpc/L2/tests/rtm3d/rtmforward_Domain_HBC/tests/dataset_z70_y60_x80_t4/description.json index e6fc2741d2..b2710a8220 100644 --- a/hpc/L2/tests/rtm3d/rtmforward_Domain_HBC/tests/dataset_z70_y60_x80_t4/description.json +++ b/hpc/L2/tests/rtm3d/rtmforward_Domain_HBC/tests/dataset_z70_y60_x80_t4/description.json @@ -19,7 +19,6 @@ "cmd_args": "BUILD/rtmforward.xclbin PROJECT/data/ 70 60 80 4 1" } ], - "pre_launch": [], "host": { "host_exe": "host.exe", "compiler": { diff --git a/hpc/L2/tests/rtm3d/rtmforward_Domain_HBC/tests/dataset_z70_y60_x80_t4/utils.mk b/hpc/L2/tests/rtm3d/rtmforward_Domain_HBC/tests/dataset_z70_y60_x80_t4/utils.mk index 9b889021fc..2e9ea4d63a 100644 --- a/hpc/L2/tests/rtm3d/rtmforward_Domain_HBC/tests/dataset_z70_y60_x80_t4/utils.mk +++ b/hpc/L2/tests/rtm3d/rtmforward_Domain_HBC/tests/dataset_z70_y60_x80_t4/utils.mk @@ -12,7 +12,7 @@ # 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. -# vitis makefile-generator v2.0.6 +# vitis makefile-generator v2.0.7 # #+------------------------------------------------------------------------------- # The following parameters are assigned with default values. These parameters can @@ -50,6 +50,7 @@ ifndef XILINX_XRT export XILINX_XRT endif +.PHONY: check_device check_device: @set -eu; \ inallowlist=False; \ @@ -82,8 +83,9 @@ endif endif -#get suffix of kernel by PLATFORM +# Special processing for tool version/platform type VITIS_VER = $(shell v++ --version | grep 'v++' | sed 's/^[[:space:]]*//' | sed -e 's/^[*]* v++ v//g' | cut -d " " -f1) +# 1) for versal flow from 2022.1 DEVICE_TYPE = $(shell platforminfo -p $(PLATFORM) | grep 'FPGA Family' | sed 's/.*://' | sed '/ai_engine/d' | sed 's/^[[:space:]]*//') ifeq ($(DEVICE_TYPE), versal) ifeq ($(shell expr $(VITIS_VER) \>= 2022.1), 1) @@ -94,6 +96,22 @@ endif else LINK_TARGET_FMT := xclbin endif +# 2) dfx flow +dfx_hw := off +ifeq ($(findstring _dfx_, $(PLATFORM_NAME)),_dfx_) +ifeq ($(TARGET),hw) +dfx_hw := on +endif +endif +# 3) for embeded sw_emu flow from 2022.2 +ps_on_x86 := off +ifneq ($(HOST_ARCH), x86) +ifeq ($(shell expr $(VITIS_VER) \>= 2022.2), 1) +ifeq ($(TARGET), sw_emu) +ps_on_x86 := on +endif +endif +endif #Checks for Device Family ifeq ($(HOST_ARCH), aarch32) @@ -107,6 +125,7 @@ ifneq ($(HOST_ARCH), $(filter $(HOST_ARCH),aarch64 aarch32 x86)) $(error HOST_ARCH variable not set, please set correctly and rerun) endif +.PHONY: check_version check_sysroot check_kimage check_rootfs check_version: ifneq (, $(shell which git)) ifneq (,$(wildcard $(XFLIB_DIR)/.git)) @@ -114,17 +133,46 @@ ifneq (,$(wildcard $(XFLIB_DIR)/.git)) endif endif -#Checks for SYSROOT +#Set/Check SYSROOT/K_IMAGE/ROOTFS +ifneq ($(HOST_ARCH), x86) +ifneq (,$(findstring zc706, $(PLATFORM_NAME))) +K_IMAGE ?= $(SYSROOT)/../../uImage +else +K_IMAGE ?= $(SYSROOT)/../../Image +endif +ROOTFS ?= $(SYSROOT)/../../rootfs.ext4 +endif + check_sysroot: ifneq ($(HOST_ARCH), x86) -ifndef SYSROOT +ifeq (,$(wildcard $(SYSROOT))) $(error SYSROOT ENV variable is not set, please set ENV variable correctly and rerun) endif endif +check_kimage: +ifneq ($(HOST_ARCH), x86) +ifeq (,$(wildcard $(K_IMAGE))) + $(error K_IMAGE ENV variable is not set, please set ENV variable correctly and rerun) +endif +endif +check_rootfs: +ifneq ($(HOST_ARCH), x86) +ifeq (,$(wildcard $(ROOTFS))) + $(error ROOTFS ENV variable is not set, please set ENV variable correctly and rerun) +endif +endif #Checks for g++ -CXX := g++ ifeq ($(HOST_ARCH), x86) +X86_CXX := true +else +ifeq ($(ps_on_x86), true) +X86_CXX := true +endif +endif + +CXX := g++ +ifeq ($(X86_CXX), true) ifeq ($(shell expr $(VITIS_VER) \>= 2022.1), 1) CXX_VER := 8.3.0 else @@ -144,11 +192,13 @@ endif $(warning [WARNING]: g++ version too old. Using g++ provided by the tool: $(CXX)) endif endif -else ifeq ($(HOST_ARCH), aarch64) +else +ifeq ($(HOST_ARCH), aarch64) CXX := $(XILINX_VITIS)/gnu/aarch64/lin/aarch64-linux/bin/aarch64-linux-gnu-g++ else ifeq ($(HOST_ARCH), aarch32) CXX := $(XILINX_VITIS)/gnu/aarch32/lin/gcc-arm-linux-gnueabi/bin/arm-linux-gnueabihf-g++ endif +endif #Check OS and setting env for xrt c++ api OSDIST = $(shell lsb_release -i |awk -F: '{print tolower($$2)}' | tr -d ' \t' ) @@ -268,9 +318,3 @@ RMDIR = rm -rf MV = mv -f CP = cp -rf ECHO:= @echo -ifneq (,$(shell echo $(XPLATFORM) | awk '/xilinx_u280_xdma_201920_3/')) -VPP_FLAGS += --advanced.param compiler.ignorePlatformCompatibilityCheck=true -ifeq ($(TARGET), hw) -VPP_LDFLAGS += --advanced.param compiler.userPreSysLinkOverlayTcl=preSysLink.tcl -endif -endif diff --git a/hpc/L2/tests/rtm3d/rtmforward_Domain_HBC/utils.mk b/hpc/L2/tests/rtm3d/rtmforward_Domain_HBC/utils.mk index 9b889021fc..2e9ea4d63a 100644 --- a/hpc/L2/tests/rtm3d/rtmforward_Domain_HBC/utils.mk +++ b/hpc/L2/tests/rtm3d/rtmforward_Domain_HBC/utils.mk @@ -12,7 +12,7 @@ # 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. -# vitis makefile-generator v2.0.6 +# vitis makefile-generator v2.0.7 # #+------------------------------------------------------------------------------- # The following parameters are assigned with default values. These parameters can @@ -50,6 +50,7 @@ ifndef XILINX_XRT export XILINX_XRT endif +.PHONY: check_device check_device: @set -eu; \ inallowlist=False; \ @@ -82,8 +83,9 @@ endif endif -#get suffix of kernel by PLATFORM +# Special processing for tool version/platform type VITIS_VER = $(shell v++ --version | grep 'v++' | sed 's/^[[:space:]]*//' | sed -e 's/^[*]* v++ v//g' | cut -d " " -f1) +# 1) for versal flow from 2022.1 DEVICE_TYPE = $(shell platforminfo -p $(PLATFORM) | grep 'FPGA Family' | sed 's/.*://' | sed '/ai_engine/d' | sed 's/^[[:space:]]*//') ifeq ($(DEVICE_TYPE), versal) ifeq ($(shell expr $(VITIS_VER) \>= 2022.1), 1) @@ -94,6 +96,22 @@ endif else LINK_TARGET_FMT := xclbin endif +# 2) dfx flow +dfx_hw := off +ifeq ($(findstring _dfx_, $(PLATFORM_NAME)),_dfx_) +ifeq ($(TARGET),hw) +dfx_hw := on +endif +endif +# 3) for embeded sw_emu flow from 2022.2 +ps_on_x86 := off +ifneq ($(HOST_ARCH), x86) +ifeq ($(shell expr $(VITIS_VER) \>= 2022.2), 1) +ifeq ($(TARGET), sw_emu) +ps_on_x86 := on +endif +endif +endif #Checks for Device Family ifeq ($(HOST_ARCH), aarch32) @@ -107,6 +125,7 @@ ifneq ($(HOST_ARCH), $(filter $(HOST_ARCH),aarch64 aarch32 x86)) $(error HOST_ARCH variable not set, please set correctly and rerun) endif +.PHONY: check_version check_sysroot check_kimage check_rootfs check_version: ifneq (, $(shell which git)) ifneq (,$(wildcard $(XFLIB_DIR)/.git)) @@ -114,17 +133,46 @@ ifneq (,$(wildcard $(XFLIB_DIR)/.git)) endif endif -#Checks for SYSROOT +#Set/Check SYSROOT/K_IMAGE/ROOTFS +ifneq ($(HOST_ARCH), x86) +ifneq (,$(findstring zc706, $(PLATFORM_NAME))) +K_IMAGE ?= $(SYSROOT)/../../uImage +else +K_IMAGE ?= $(SYSROOT)/../../Image +endif +ROOTFS ?= $(SYSROOT)/../../rootfs.ext4 +endif + check_sysroot: ifneq ($(HOST_ARCH), x86) -ifndef SYSROOT +ifeq (,$(wildcard $(SYSROOT))) $(error SYSROOT ENV variable is not set, please set ENV variable correctly and rerun) endif endif +check_kimage: +ifneq ($(HOST_ARCH), x86) +ifeq (,$(wildcard $(K_IMAGE))) + $(error K_IMAGE ENV variable is not set, please set ENV variable correctly and rerun) +endif +endif +check_rootfs: +ifneq ($(HOST_ARCH), x86) +ifeq (,$(wildcard $(ROOTFS))) + $(error ROOTFS ENV variable is not set, please set ENV variable correctly and rerun) +endif +endif #Checks for g++ -CXX := g++ ifeq ($(HOST_ARCH), x86) +X86_CXX := true +else +ifeq ($(ps_on_x86), true) +X86_CXX := true +endif +endif + +CXX := g++ +ifeq ($(X86_CXX), true) ifeq ($(shell expr $(VITIS_VER) \>= 2022.1), 1) CXX_VER := 8.3.0 else @@ -144,11 +192,13 @@ endif $(warning [WARNING]: g++ version too old. Using g++ provided by the tool: $(CXX)) endif endif -else ifeq ($(HOST_ARCH), aarch64) +else +ifeq ($(HOST_ARCH), aarch64) CXX := $(XILINX_VITIS)/gnu/aarch64/lin/aarch64-linux/bin/aarch64-linux-gnu-g++ else ifeq ($(HOST_ARCH), aarch32) CXX := $(XILINX_VITIS)/gnu/aarch32/lin/gcc-arm-linux-gnueabi/bin/arm-linux-gnueabihf-g++ endif +endif #Check OS and setting env for xrt c++ api OSDIST = $(shell lsb_release -i |awk -F: '{print tolower($$2)}' | tr -d ' \t' ) @@ -268,9 +318,3 @@ RMDIR = rm -rf MV = mv -f CP = cp -rf ECHO:= @echo -ifneq (,$(shell echo $(XPLATFORM) | awk '/xilinx_u280_xdma_201920_3/')) -VPP_FLAGS += --advanced.param compiler.ignorePlatformCompatibilityCheck=true -ifeq ($(TARGET), hw) -VPP_LDFLAGS += --advanced.param compiler.userPreSysLinkOverlayTcl=preSysLink.tcl -endif -endif diff --git a/hpc/L2/tests/rtm3d/rtmforward_Domain_RBC/Makefile b/hpc/L2/tests/rtm3d/rtmforward_Domain_RBC/Makefile index 4600f708e9..53450b2c1b 100755 --- a/hpc/L2/tests/rtm3d/rtmforward_Domain_RBC/Makefile +++ b/hpc/L2/tests/rtm3d/rtmforward_Domain_RBC/Makefile @@ -11,7 +11,7 @@ # 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. -# vitis makefile-generator v2.0.6 +# vitis makefile-generator v2.0.7 ############################## Help Section ############################## .PHONY: help @@ -34,9 +34,15 @@ help:: $(ECHO) " Command to build host application." $(ECHO) " By default, HOST_ARCH=x86. HOST_ARCH is required for SoC shells" $(ECHO) "" - $(ECHO) " NOTE: For embedded devices, e.g. zcu102/zcu104/vck190, env variable SYSROOT and EDGE_COMMON_SW need to be set first, and HOST_ARCH is either aarch32 or aarch64. For example," - $(ECHO) " export SYSROOT=< path-to-platform-sysroot >" - $(ECHO) " export EDGE_COMMON_SW=< path-to-rootfs-and-Image-files >" + $(ECHO) " NOTE: For embedded devices, e.g. zcu102/zcu104/vck190, HOST_ARCH is either aarch32 or aarch64." + $(ECHO) " a.IF Download the platform, and common-image from Xilinx Download Center(Suggested):" + $(ECHO) " Run the sdk.sh script from the common-image directory to install sysroot using the command : ./sdk.sh -y -d ./ -p " + $(ECHO) " Unzip the rootfs file : gunzip ./rootfs.ext4.gz" + $(ECHO) " export SYSROOT=< path-to-platform-sysroot >" + $(ECHO) " b. User could also define SYSROOT, K_IMAGE and ROOTFS by themselves: " + $(ECHO) " export SYSROOT=< path-to-platform-sysroot >" + $(ECHO) " export K_IMAGE=< path-to-Image-files >" + $(ECHO) " export ROOTFS=< path-to-rootfs >" $(ECHO) "" $(ECHO) " make clean " $(ECHO) " Command to remove the generated non-hardware files." @@ -61,7 +67,7 @@ ifeq ($(PLATFORM),) PLATFORM := $(DEVICE) endif ifeq ($(PLATFORM),) -PLATFORM := xilinx_u280_xdma_201920_3 +PLATFORM := xilinx_u280_gen3x16_xdma_1_202120_1 endif # #################### Checking if PLATFORM in whitelist ############################ @@ -87,12 +93,17 @@ RUN_DEPS := # get global setting ifeq ($(HOST_ARCH), x86) CXXFLAGS += -fmessage-length=0 -I$(CUR_DIR)/src/ -I$(XILINX_XRT)/include -I$(XILINX_HLS)/include -std=c++14 -O3 -Wall -Wno-unknown-pragmas -Wno-unused-label -LDFLAGS += -pthread -L$(XILINX_XRT)/lib -L$(XILINX_HLS)/lnx64/tools/fpo_v7_0 -Wl,--as-needed -lOpenCL -lxrt_coreutil -lgmp -lmpfr -lIp_floating_point_v7_0_bitacc_cmodel +LDFLAGS += -pthread -L$(XILINX_XRT)/lib -L$(XILINX_HLS)/lnx64/tools/fpo_v7_1 -Wl,--as-needed -lOpenCL -lxrt_coreutil -lgmp -lmpfr -lIp_floating_point_v7_1_bitacc_cmodel VPP_FLAGS += -t $(TARGET) --platform $(XPLATFORM) --save-temps VPP_LDFLAGS += --optimize 2 -R 2 else ifeq ($(HOST_ARCH), aarch64) +ifeq ($(ps_on_x86), on) +CXXFLAGS += -fmessage-length=0 -I$(CUR_DIR)/src/ -I$(XILINX_XRT)/include -I$(XILINX_HLS)/include -std=c++14 -O3 -Wall -Wno-unknown-pragmas -Wno-unused-label +LDFLAGS += -pthread -L$(XILINX_XRT)/lib -L$(XILINX_HLS)/lnx64/tools/fpo_v7_1 -Wl,--as-needed -lOpenCL -lxrt_coreutil -lgmp -lmpfr -lIp_floating_point_v7_1_bitacc_cmodel +else CXXFLAGS += -I$(CUR_DIR)/src/ -fmessage-length=0 --sysroot=$(SYSROOT) -I$(SYSROOT)/usr/include/xrt -I$(XILINX_HLS)/include -std=c++14 -O3 -Wall -Wno-unknown-pragmas -Wno-unused-label -LDFLAGS += -pthread -L$(SYSROOT)/usr/lib -L$(XILINX_VITIS_AIETOOLS)/lib/aarch64.o -Wl,--as-needed -lxilinxopencl -lxrt_coreutil +LDFLAGS += -pthread -L$(SYSROOT)/usr/lib -Wl,--as-needed -lxilinxopencl -lxrt_coreutil +endif VPP_FLAGS += -t $(TARGET) --platform $(XPLATFORM) --save-temps VPP_LDFLAGS += --optimize 2 -R 2 endif @@ -107,15 +118,23 @@ ifeq ($(TARGET),hw_emu) CXXFLAGS += -D HW_EMU_TEST endif -ifeq (,$(findstring opencv,$(CXXFLAGS))) -CXXFLAGS += $(XRT_CXXFLAGS) -endif - #Inclue Required Host Source Files +ifeq ($(ps_on_x86), on) HOST_SRCS += $(CUR_DIR)/main.cpp $(XFLIB_DIR)/../blas/L2/src/xcl2/xcl2.cpp CXXFLAGS += -D RTM_dataType=float -D RTM_numFSMs=2 -D RTM_maxZ=280 -D RTM_maxY=180 -D RTM_MaxB=20 -D RTM_NXB=20 -D RTM_NYB=20 -D RTM_NZB=20 -D RTM_order=8 -D RTM_nPEZ=2 -D RTM_nPEX=4 CXXFLAGS += -I $(XFLIB_DIR)/L2/include/sw/ -I $(XFLIB_DIR)/L2/include/sw/rtm3d -I $(XFLIB_DIR)/../blas/L2/include/xcl2 -I $(XFLIB_DIR)/../blas/L1/tests/sw/include/ CXXFLAGS += -g +else +HOST_SRCS += $(CUR_DIR)/main.cpp $(XFLIB_DIR)/../blas/L2/src/xcl2/xcl2.cpp +CXXFLAGS += -D RTM_dataType=float -D RTM_numFSMs=2 -D RTM_maxZ=280 -D RTM_maxY=180 -D RTM_MaxB=20 -D RTM_NXB=20 -D RTM_NYB=20 -D RTM_NZB=20 -D RTM_order=8 -D RTM_nPEZ=2 -D RTM_nPEX=4 +CXXFLAGS += -I $(XFLIB_DIR)/L2/include/sw/ -I $(XFLIB_DIR)/L2/include/sw/rtm3d -I $(XFLIB_DIR)/../blas/L2/include/xcl2 -I $(XFLIB_DIR)/../blas/L1/tests/sw/include/ +CXXFLAGS += -g +endif + +# workaround for opencv +ifeq (,$(findstring opencv,$(CXXFLAGS))) +CXXFLAGS += $(XRT_CXXFLAGS) +endif EXE_NAME := host.exe EXE_FILE := $(BUILD_DIR)/$(EXE_NAME) @@ -183,11 +202,6 @@ $(EMCONFIG): emconfigutil --platform $(XPLATFORM) --od $(BUILD_DIR) ############################## Preparing sdcard folder ############################## ifneq ($(HOST_ARCH), x86) -ifneq (,$(findstring zc706, $(PLATFORM_NAME))) -K_IMAGE := $(SYSROOT)/../../uImage -else -K_IMAGE := $(SYSROOT)/../../Image -endif RUN_SCRIPT := $(BUILD_DIR)/run_script.sh $(RUN_SCRIPT): rm -rf $(RUN_SCRIPT) @@ -203,7 +217,7 @@ endif @echo './$(EXE_NAME) $(PKG_HOST_ARGS)' >> $(RUN_SCRIPT) @echo 'return_code=$$?' >> $(RUN_SCRIPT) @echo 'if [ $$return_code -ne 0 ]; then' >> $(RUN_SCRIPT) - @echo ' echo "ERROR: Embedded host run failed, RC=$$return_code"' >> $(RUN_SCRIPT) + @echo ' echo "ERROR: TEST FAILED, RC=$$return_code"' >> $(RUN_SCRIPT) @echo 'else' >> $(RUN_SCRIPT) @echo ' echo "INFO: TEST PASSED, RC=0"' >> $(RUN_SCRIPT) @echo 'fi' >> $(RUN_SCRIPT) @@ -221,23 +235,28 @@ SD_DIRS_WITH_PREFIX = $(foreach sd_dir,$(DATA_DIR),--package.sd_dir $(sd_dir)) PACKAGE_FILES := $(BINARY_CONTAINERS) PACKAGE_FILES += $(AIE_CONTAINER) SD_CARD := $(CUR_DIR)/package_$(TARGET) -vck190_dfx_hw := false -$(SD_CARD): $(EXE_FILE) $(BINARY_CONTAINERS) $(RUN_SCRIPT) $(EMCONFIG) +$(SD_CARD): $(EXE_FILE) $(BINARY_CONTAINERS) $(RUN_SCRIPT) $(EMCONFIG) check_kimage check_rootfs @echo "Generating sd_card folder...." mkdir -p $(SD_CARD) chmod a+rx $(BUILD_DIR)/run_script.sh -ifneq (,$(findstring vck190_base_dfx, $(PLATFORM_NAME))) -ifeq ($(TARGET),hw) - $(VPP) -t $(TARGET) --platform $(XPLATFORM) -p $(PACKAGE_FILES) -o $(BINARY_CONTAINERS_PKG) - $(VPP) -t $(TARGET) --platform $(XPLATFORM) -p --package.out_dir $(SD_CARD) --package.rootfs $(SYSROOT)/../../rootfs.ext4 --package.kernel_image $(K_IMAGE) $(SD_FILES_WITH_PREFIX) $(SD_DIRS_WITH_PREFIX) --package.sd_file $(BINARY_CONTAINERS_PKG) +# 1. DFX HW Flow +ifeq ($(dfx_hw), on) + $(VPP) -t $(TARGET) --platform $(XPLATFORM) -p $(PACKAGE_FILES) $(VPP_PACKAGE) -o $(BINARY_CONTAINERS_PKG) + $(VPP) -t $(TARGET) --platform $(XPLATFORM) -p --package.out_dir $(SD_CARD) --package.rootfs $(ROOTFS) --package.kernel_image $(K_IMAGE) $(SD_FILES_WITH_PREFIX) $(SD_DIRS_WITH_PREFIX) --package.sd_file $(BINARY_CONTAINERS_PKG) @echo "### ***** sd_card generation done! ***** ###" -vck190_dfx_hw := true endif +# 2. PS_ON_X86 - From 2022.2, Target:sw_emu +ifeq ($(ps_on_x86), on) + @echo "### ***** running PS X86 SE_EMU ***** ###" + $(VPP) -t $(TARGET) --platform $(XPLATFORM) -o $(BINARY_CONTAINERS_PKG) -p $(PACKAGE_FILES) $(VPP_PACKAGE) --package.out_dir $(SD_CARD) --package.emu_ps x86 endif -ifeq ($(vck190_dfx_hw), false) - $(VPP) -t $(TARGET) --platform $(XPLATFORM) -o $(BINARY_CONTAINERS_PKG) -p $(PACKAGE_FILES) $(VPP_PACKAGE) --package.out_dir $(SD_CARD) --package.rootfs $(SYSROOT)/../../rootfs.ext4 --package.kernel_image $(K_IMAGE) $(SD_FILES_WITH_PREFIX) $(SD_DIRS_WITH_PREFIX) +#3. General Embeded flow +ifeq ($(dfx_hw), off) +ifeq ($(ps_on_x86), off) + $(VPP) -t $(TARGET) --platform $(XPLATFORM) -o $(BINARY_CONTAINERS_PKG) -p $(PACKAGE_FILES) $(VPP_PACKAGE) --package.out_dir $(SD_CARD) --package.rootfs $(ROOTFS) --package.kernel_image $(K_IMAGE) $(SD_FILES_WITH_PREFIX) $(SD_DIRS_WITH_PREFIX) @echo "### ***** sd_card generation done! ***** ###" endif +endif .PHONY: sd_card sd_card: $(SD_CARD) @@ -261,7 +280,7 @@ ifeq ($(HOST_ARCH), x86) else @echo $(RUN_DEPS) - $(SD_CARD)/launch_$(TARGET).sh -no-reboot -run-app $(notdir $(RUN_SCRIPT)) + $(SD_CARD)/launch_$(TARGET).sh -no-reboot -run-app $(notdir $(RUN_SCRIPT)) 2>&1 | tee $(SD_CARD)/qemu_output.log grep "TEST PASSED, RC=0" $(SD_CARD)/qemu_output.log || exit 1 endif @@ -272,24 +291,32 @@ ifeq ($(HOST_ARCH), x86) LD_LIBRARY_PATH=$(LIBRARY_PATH):$$LD_LIBRARY_PATH \ XCL_EMULATION_MODE=$(TARGET) $(EXE_FILE) $(HOST_ARGS) +else +ifeq ($(ps_on_x86), on) + LD_LIBRARY_PATH=$(LIBRARY_PATH):$$LD_LIBRARY_PATH \ + XCL_EMULATION_MODE=$(TARGET) $(EXE_FILE) $(HOST_ARGS) + else @echo $(RUN_DEPS) - $(SD_CARD)/launch_$(TARGET).sh -no-reboot -run-app $(notdir $(RUN_SCRIPT)) + $(SD_CARD)/launch_$(TARGET).sh -no-reboot -run-app $(notdir $(RUN_SCRIPT)) 2>&1 | tee $(SD_CARD)/qemu_output.log grep "TEST PASSED, RC=0" $(SD_CARD)/qemu_output.log || exit 1 +endif endif endif #hw ifeq ($(TARGET), hw) ifneq (,$(findstring aws-vu9p-f1, $(PLATFORM_NAME))) -ifneq ($(JENKINS_INTERNAL_BUILD), 1) +ifeq (,$(wildcard $(BUILD_DIR)/rtmforward.awsxclbin)) $(ECHO) "This makefile does not directly support converting .xclbin to .awsxclbin, please refer https://github.com/aws/aws-fpga/blob/master/Vitis/README.md for next operations" else - $(ECHO) "Running inside Xilinx regression without converting to .awsxclbin" - $(EXE_FILE) $(HOST_ARGS) + $(ECHO) "Running HW using generated .awsxclbin" + LD_LIBRARY_PATH=$(LIBRARY_PATH):$$LD_LIBRARY_PATH \ + $(EXE_FILE) $(subst .xclbin,.awsxclbin,$(HOST_ARGS)) endif else ifeq ($(HOST_ARCH), x86) + LD_LIBRARY_PATH=$(LIBRARY_PATH):$$LD_LIBRARY_PATH \ $(EXE_FILE) $(HOST_ARGS) else @@ -323,12 +350,11 @@ cleanh: cleank: -$(RMDIR) $(BUILD_DIR)/*.xclbin _vimage *xclbin.run_summary qemu-memory-_* emulation/ _vimage/ pl*start_simulation. sh *.xclbin - -$(RMDIR) _x_temp.*/_x.* _x_temp.*/.Xil _x_temp.*/profile_summary.* xo_* _x* - -$(RMDIR) _x_temp.*/dltmp* _x_temp.*/kernel_info.dat _x_temp.*/*.log - -$(RMDIR) _x_temp.* + -$(RMDIR) _x_temp.* cleanall: cleanh cleank -$(RMDIR) $(BUILD_DIR) emconfig.json *.html $(TEMP_DIR) $(CUR_DIR)/reports *.csv *.run_summary $(CUR_DIR)/*.raw package_* $(BUILD_DIR)/run_script.sh .ipcache *.str -$(RMDIR) $(CUR_DIR)/Work $(CUR_DIR)/*.xpe $(CUR_DIR)/hw.o $(CUR_DIR)/*.xsa $(CUR_DIR)/xnwOut + -$(RMDIR) clean: cleanh \ No newline at end of file diff --git a/hpc/L2/tests/rtm3d/rtmforward_Domain_RBC/description.json b/hpc/L2/tests/rtm3d/rtmforward_Domain_RBC/description.json index 14b06bf9d3..fac6201cbb 100644 --- a/hpc/L2/tests/rtm3d/rtmforward_Domain_RBC/description.json +++ b/hpc/L2/tests/rtm3d/rtmforward_Domain_RBC/description.json @@ -27,11 +27,6 @@ "cmd_args": "" } ], - "pre_launch": [ - { - "launch_cmd": "make data_gen" - } - ], "host": { "host_exe": "host.exe", "compiler": { diff --git a/hpc/L2/tests/rtm3d/rtmforward_Domain_RBC/tests/dataset_z90_y60_x80_t4/Makefile b/hpc/L2/tests/rtm3d/rtmforward_Domain_RBC/tests/dataset_z90_y60_x80_t4/Makefile index 02e243630c..9da89bdfe6 100755 --- a/hpc/L2/tests/rtm3d/rtmforward_Domain_RBC/tests/dataset_z90_y60_x80_t4/Makefile +++ b/hpc/L2/tests/rtm3d/rtmforward_Domain_RBC/tests/dataset_z90_y60_x80_t4/Makefile @@ -11,7 +11,7 @@ # 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. -# vitis makefile-generator v2.0.6 +# vitis makefile-generator v2.0.7 ############################## Help Section ############################## .PHONY: help @@ -34,9 +34,15 @@ help:: $(ECHO) " Command to build host application." $(ECHO) " By default, HOST_ARCH=x86. HOST_ARCH is required for SoC shells" $(ECHO) "" - $(ECHO) " NOTE: For embedded devices, e.g. zcu102/zcu104/vck190, env variable SYSROOT and EDGE_COMMON_SW need to be set first, and HOST_ARCH is either aarch32 or aarch64. For example," - $(ECHO) " export SYSROOT=< path-to-platform-sysroot >" - $(ECHO) " export EDGE_COMMON_SW=< path-to-rootfs-and-Image-files >" + $(ECHO) " NOTE: For embedded devices, e.g. zcu102/zcu104/vck190, HOST_ARCH is either aarch32 or aarch64." + $(ECHO) " a.IF Download the platform, and common-image from Xilinx Download Center(Suggested):" + $(ECHO) " Run the sdk.sh script from the common-image directory to install sysroot using the command : ./sdk.sh -y -d ./ -p " + $(ECHO) " Unzip the rootfs file : gunzip ./rootfs.ext4.gz" + $(ECHO) " export SYSROOT=< path-to-platform-sysroot >" + $(ECHO) " b. User could also define SYSROOT, K_IMAGE and ROOTFS by themselves: " + $(ECHO) " export SYSROOT=< path-to-platform-sysroot >" + $(ECHO) " export K_IMAGE=< path-to-Image-files >" + $(ECHO) " export ROOTFS=< path-to-rootfs >" $(ECHO) "" $(ECHO) " make clean " $(ECHO) " Command to remove the generated non-hardware files." @@ -61,7 +67,7 @@ ifeq ($(PLATFORM),) PLATFORM := $(DEVICE) endif ifeq ($(PLATFORM),) -PLATFORM := xilinx_u280_xdma_201920_3 +PLATFORM := xilinx_u280_gen3x16_xdma_1_202120_1 endif # #################### Checking if PLATFORM in whitelist ############################ @@ -87,12 +93,17 @@ RUN_DEPS := # get global setting ifeq ($(HOST_ARCH), x86) CXXFLAGS += -fmessage-length=0 -I$(CUR_DIR)/src/ -I$(XILINX_XRT)/include -I$(XILINX_HLS)/include -std=c++14 -O3 -Wall -Wno-unknown-pragmas -Wno-unused-label -LDFLAGS += -pthread -L$(XILINX_XRT)/lib -L$(XILINX_HLS)/lnx64/tools/fpo_v7_0 -Wl,--as-needed -lOpenCL -lxrt_coreutil -lgmp -lmpfr -lIp_floating_point_v7_0_bitacc_cmodel +LDFLAGS += -pthread -L$(XILINX_XRT)/lib -L$(XILINX_HLS)/lnx64/tools/fpo_v7_1 -Wl,--as-needed -lOpenCL -lxrt_coreutil -lgmp -lmpfr -lIp_floating_point_v7_1_bitacc_cmodel VPP_FLAGS += -t $(TARGET) --platform $(XPLATFORM) --save-temps VPP_LDFLAGS += --optimize 2 -R 2 else ifeq ($(HOST_ARCH), aarch64) +ifeq ($(ps_on_x86), on) +CXXFLAGS += -fmessage-length=0 -I$(CUR_DIR)/src/ -I$(XILINX_XRT)/include -I$(XILINX_HLS)/include -std=c++14 -O3 -Wall -Wno-unknown-pragmas -Wno-unused-label +LDFLAGS += -pthread -L$(XILINX_XRT)/lib -L$(XILINX_HLS)/lnx64/tools/fpo_v7_1 -Wl,--as-needed -lOpenCL -lxrt_coreutil -lgmp -lmpfr -lIp_floating_point_v7_1_bitacc_cmodel +else CXXFLAGS += -I$(CUR_DIR)/src/ -fmessage-length=0 --sysroot=$(SYSROOT) -I$(SYSROOT)/usr/include/xrt -I$(XILINX_HLS)/include -std=c++14 -O3 -Wall -Wno-unknown-pragmas -Wno-unused-label -LDFLAGS += -pthread -L$(SYSROOT)/usr/lib -L$(XILINX_VITIS_AIETOOLS)/lib/aarch64.o -Wl,--as-needed -lxilinxopencl -lxrt_coreutil +LDFLAGS += -pthread -L$(SYSROOT)/usr/lib -Wl,--as-needed -lxilinxopencl -lxrt_coreutil +endif VPP_FLAGS += -t $(TARGET) --platform $(XPLATFORM) --save-temps VPP_LDFLAGS += --optimize 2 -R 2 endif @@ -107,15 +118,23 @@ ifeq ($(TARGET),hw_emu) CXXFLAGS += -D HW_EMU_TEST endif -ifeq (,$(findstring opencv,$(CXXFLAGS))) -CXXFLAGS += $(XRT_CXXFLAGS) -endif - #Inclue Required Host Source Files +ifeq ($(ps_on_x86), on) HOST_SRCS += $(XFLIB_DIR)/L2/tests/rtm3d/rtmforward_Domain_RBC/main.cpp $(XFLIB_DIR)/../blas/L2/src/xcl2/xcl2.cpp CXXFLAGS += -D RTM_dataType=float -D RTM_numFSMs=2 -D RTM_maxZ=280 -D RTM_maxY=180 -D RTM_MaxB=20 -D RTM_NXB=20 -D RTM_NYB=20 -D RTM_NZB=20 -D RTM_order=8 -D RTM_nPEZ=2 -D RTM_nPEX=4 CXXFLAGS += -I $(XFLIB_DIR)/L2/include/sw/ -I $(XFLIB_DIR)/L2/include/sw/rtm3d -I $(XFLIB_DIR)/../blas/L2/include/xcl2 -I $(XFLIB_DIR)/../blas/L1/tests/sw/include/ CXXFLAGS += -g +else +HOST_SRCS += $(XFLIB_DIR)/L2/tests/rtm3d/rtmforward_Domain_RBC/main.cpp $(XFLIB_DIR)/../blas/L2/src/xcl2/xcl2.cpp +CXXFLAGS += -D RTM_dataType=float -D RTM_numFSMs=2 -D RTM_maxZ=280 -D RTM_maxY=180 -D RTM_MaxB=20 -D RTM_NXB=20 -D RTM_NYB=20 -D RTM_NZB=20 -D RTM_order=8 -D RTM_nPEZ=2 -D RTM_nPEX=4 +CXXFLAGS += -I $(XFLIB_DIR)/L2/include/sw/ -I $(XFLIB_DIR)/L2/include/sw/rtm3d -I $(XFLIB_DIR)/../blas/L2/include/xcl2 -I $(XFLIB_DIR)/../blas/L1/tests/sw/include/ +CXXFLAGS += -g +endif + +# workaround for opencv +ifeq (,$(findstring opencv,$(CXXFLAGS))) +CXXFLAGS += $(XRT_CXXFLAGS) +endif EXE_NAME := host.exe EXE_FILE := $(BUILD_DIR)/$(EXE_NAME) @@ -141,7 +160,7 @@ endif ######################### binary container global settings ########################## VPP_FLAGS_rtmforward += --hls.clock 300000000:rtmforward ifneq ($(HOST_ARCH), x86) -VPP_LDFLAGS_rtmforward += --clock.defaultFreqHz 250000000 +VPP_LDFLAGS_rtmforward += --clock.defaultFreqHz 200000000 else VPP_LDFLAGS_rtmforward += --kernel_frequency 200 endif @@ -183,11 +202,6 @@ $(EMCONFIG): emconfigutil --platform $(XPLATFORM) --od $(BUILD_DIR) ############################## Preparing sdcard folder ############################## ifneq ($(HOST_ARCH), x86) -ifneq (,$(findstring zc706, $(PLATFORM_NAME))) -K_IMAGE := $(SYSROOT)/../../uImage -else -K_IMAGE := $(SYSROOT)/../../Image -endif RUN_SCRIPT := $(BUILD_DIR)/run_script.sh $(RUN_SCRIPT): rm -rf $(RUN_SCRIPT) @@ -203,7 +217,7 @@ endif @echo './$(EXE_NAME) $(PKG_HOST_ARGS)' >> $(RUN_SCRIPT) @echo 'return_code=$$?' >> $(RUN_SCRIPT) @echo 'if [ $$return_code -ne 0 ]; then' >> $(RUN_SCRIPT) - @echo ' echo "ERROR: Embedded host run failed, RC=$$return_code"' >> $(RUN_SCRIPT) + @echo ' echo "ERROR: TEST FAILED, RC=$$return_code"' >> $(RUN_SCRIPT) @echo 'else' >> $(RUN_SCRIPT) @echo ' echo "INFO: TEST PASSED, RC=0"' >> $(RUN_SCRIPT) @echo 'fi' >> $(RUN_SCRIPT) @@ -221,23 +235,28 @@ SD_DIRS_WITH_PREFIX = $(foreach sd_dir,$(DATA_DIR),--package.sd_dir $(sd_dir)) PACKAGE_FILES := $(BINARY_CONTAINERS) PACKAGE_FILES += $(AIE_CONTAINER) SD_CARD := $(CUR_DIR)/package_$(TARGET) -vck190_dfx_hw := false -$(SD_CARD): $(EXE_FILE) $(BINARY_CONTAINERS) $(RUN_SCRIPT) $(EMCONFIG) +$(SD_CARD): $(EXE_FILE) $(BINARY_CONTAINERS) $(RUN_SCRIPT) $(EMCONFIG) check_kimage check_rootfs @echo "Generating sd_card folder...." mkdir -p $(SD_CARD) chmod a+rx $(BUILD_DIR)/run_script.sh -ifneq (,$(findstring vck190_base_dfx, $(PLATFORM_NAME))) -ifeq ($(TARGET),hw) - $(VPP) -t $(TARGET) --platform $(XPLATFORM) -p $(PACKAGE_FILES) -o $(BINARY_CONTAINERS_PKG) - $(VPP) -t $(TARGET) --platform $(XPLATFORM) -p --package.out_dir $(SD_CARD) --package.rootfs $(SYSROOT)/../../rootfs.ext4 --package.kernel_image $(K_IMAGE) $(SD_FILES_WITH_PREFIX) $(SD_DIRS_WITH_PREFIX) --package.sd_file $(BINARY_CONTAINERS_PKG) +# 1. DFX HW Flow +ifeq ($(dfx_hw), on) + $(VPP) -t $(TARGET) --platform $(XPLATFORM) -p $(PACKAGE_FILES) $(VPP_PACKAGE) -o $(BINARY_CONTAINERS_PKG) + $(VPP) -t $(TARGET) --platform $(XPLATFORM) -p --package.out_dir $(SD_CARD) --package.rootfs $(ROOTFS) --package.kernel_image $(K_IMAGE) $(SD_FILES_WITH_PREFIX) $(SD_DIRS_WITH_PREFIX) --package.sd_file $(BINARY_CONTAINERS_PKG) @echo "### ***** sd_card generation done! ***** ###" -vck190_dfx_hw := true endif +# 2. PS_ON_X86 - From 2022.2, Target:sw_emu +ifeq ($(ps_on_x86), on) + @echo "### ***** running PS X86 SE_EMU ***** ###" + $(VPP) -t $(TARGET) --platform $(XPLATFORM) -o $(BINARY_CONTAINERS_PKG) -p $(PACKAGE_FILES) $(VPP_PACKAGE) --package.out_dir $(SD_CARD) --package.emu_ps x86 endif -ifeq ($(vck190_dfx_hw), false) - $(VPP) -t $(TARGET) --platform $(XPLATFORM) -o $(BINARY_CONTAINERS_PKG) -p $(PACKAGE_FILES) $(VPP_PACKAGE) --package.out_dir $(SD_CARD) --package.rootfs $(SYSROOT)/../../rootfs.ext4 --package.kernel_image $(K_IMAGE) $(SD_FILES_WITH_PREFIX) $(SD_DIRS_WITH_PREFIX) +#3. General Embeded flow +ifeq ($(dfx_hw), off) +ifeq ($(ps_on_x86), off) + $(VPP) -t $(TARGET) --platform $(XPLATFORM) -o $(BINARY_CONTAINERS_PKG) -p $(PACKAGE_FILES) $(VPP_PACKAGE) --package.out_dir $(SD_CARD) --package.rootfs $(ROOTFS) --package.kernel_image $(K_IMAGE) $(SD_FILES_WITH_PREFIX) $(SD_DIRS_WITH_PREFIX) @echo "### ***** sd_card generation done! ***** ###" endif +endif .PHONY: sd_card sd_card: $(SD_CARD) @@ -261,7 +280,7 @@ ifeq ($(HOST_ARCH), x86) else @echo $(RUN_DEPS) - $(SD_CARD)/launch_$(TARGET).sh -no-reboot -run-app $(notdir $(RUN_SCRIPT)) + $(SD_CARD)/launch_$(TARGET).sh -no-reboot -run-app $(notdir $(RUN_SCRIPT)) 2>&1 | tee $(SD_CARD)/qemu_output.log grep "TEST PASSED, RC=0" $(SD_CARD)/qemu_output.log || exit 1 endif @@ -272,24 +291,32 @@ ifeq ($(HOST_ARCH), x86) LD_LIBRARY_PATH=$(LIBRARY_PATH):$$LD_LIBRARY_PATH \ XCL_EMULATION_MODE=$(TARGET) $(EXE_FILE) $(HOST_ARGS) +else +ifeq ($(ps_on_x86), on) + LD_LIBRARY_PATH=$(LIBRARY_PATH):$$LD_LIBRARY_PATH \ + XCL_EMULATION_MODE=$(TARGET) $(EXE_FILE) $(HOST_ARGS) + else @echo $(RUN_DEPS) - $(SD_CARD)/launch_$(TARGET).sh -no-reboot -run-app $(notdir $(RUN_SCRIPT)) + $(SD_CARD)/launch_$(TARGET).sh -no-reboot -run-app $(notdir $(RUN_SCRIPT)) 2>&1 | tee $(SD_CARD)/qemu_output.log grep "TEST PASSED, RC=0" $(SD_CARD)/qemu_output.log || exit 1 +endif endif endif #hw ifeq ($(TARGET), hw) ifneq (,$(findstring aws-vu9p-f1, $(PLATFORM_NAME))) -ifneq ($(JENKINS_INTERNAL_BUILD), 1) +ifeq (,$(wildcard $(BUILD_DIR)/rtmforward.awsxclbin)) $(ECHO) "This makefile does not directly support converting .xclbin to .awsxclbin, please refer https://github.com/aws/aws-fpga/blob/master/Vitis/README.md for next operations" else - $(ECHO) "Running inside Xilinx regression without converting to .awsxclbin" - $(EXE_FILE) $(HOST_ARGS) + $(ECHO) "Running HW using generated .awsxclbin" + LD_LIBRARY_PATH=$(LIBRARY_PATH):$$LD_LIBRARY_PATH \ + $(EXE_FILE) $(subst .xclbin,.awsxclbin,$(HOST_ARGS)) endif else ifeq ($(HOST_ARCH), x86) + LD_LIBRARY_PATH=$(LIBRARY_PATH):$$LD_LIBRARY_PATH \ $(EXE_FILE) $(HOST_ARGS) else @@ -323,12 +350,11 @@ cleanh: cleank: -$(RMDIR) $(BUILD_DIR)/*.xclbin _vimage *xclbin.run_summary qemu-memory-_* emulation/ _vimage/ pl*start_simulation. sh *.xclbin - -$(RMDIR) _x_temp.*/_x.* _x_temp.*/.Xil _x_temp.*/profile_summary.* xo_* _x* - -$(RMDIR) _x_temp.*/dltmp* _x_temp.*/kernel_info.dat _x_temp.*/*.log - -$(RMDIR) _x_temp.* + -$(RMDIR) _x_temp.* cleanall: cleanh cleank -$(RMDIR) $(BUILD_DIR) emconfig.json *.html $(TEMP_DIR) $(CUR_DIR)/reports *.csv *.run_summary $(CUR_DIR)/*.raw package_* $(BUILD_DIR)/run_script.sh .ipcache *.str -$(RMDIR) $(CUR_DIR)/Work $(CUR_DIR)/*.xpe $(CUR_DIR)/hw.o $(CUR_DIR)/*.xsa $(CUR_DIR)/xnwOut + -$(RMDIR) -clean: cleanh +clean: cleanh \ No newline at end of file diff --git a/hpc/L2/tests/rtm3d/rtmforward_Domain_RBC/tests/dataset_z90_y60_x80_t4/description.json b/hpc/L2/tests/rtm3d/rtmforward_Domain_RBC/tests/dataset_z90_y60_x80_t4/description.json index 32ab7bd774..d5fce8a003 100644 --- a/hpc/L2/tests/rtm3d/rtmforward_Domain_RBC/tests/dataset_z90_y60_x80_t4/description.json +++ b/hpc/L2/tests/rtm3d/rtmforward_Domain_RBC/tests/dataset_z90_y60_x80_t4/description.json @@ -27,7 +27,6 @@ "cmd_args": "BUILD/rtmforward.xclbin PROJECT/data/ 90 60 80 4 1" } ], - "pre_launch": [], "host": { "host_exe": "host.exe", "compiler": { diff --git a/hpc/L2/tests/rtm3d/rtmforward_Domain_RBC/tests/dataset_z90_y60_x80_t4/utils.mk b/hpc/L2/tests/rtm3d/rtmforward_Domain_RBC/tests/dataset_z90_y60_x80_t4/utils.mk index 9b889021fc..2e9ea4d63a 100644 --- a/hpc/L2/tests/rtm3d/rtmforward_Domain_RBC/tests/dataset_z90_y60_x80_t4/utils.mk +++ b/hpc/L2/tests/rtm3d/rtmforward_Domain_RBC/tests/dataset_z90_y60_x80_t4/utils.mk @@ -12,7 +12,7 @@ # 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. -# vitis makefile-generator v2.0.6 +# vitis makefile-generator v2.0.7 # #+------------------------------------------------------------------------------- # The following parameters are assigned with default values. These parameters can @@ -50,6 +50,7 @@ ifndef XILINX_XRT export XILINX_XRT endif +.PHONY: check_device check_device: @set -eu; \ inallowlist=False; \ @@ -82,8 +83,9 @@ endif endif -#get suffix of kernel by PLATFORM +# Special processing for tool version/platform type VITIS_VER = $(shell v++ --version | grep 'v++' | sed 's/^[[:space:]]*//' | sed -e 's/^[*]* v++ v//g' | cut -d " " -f1) +# 1) for versal flow from 2022.1 DEVICE_TYPE = $(shell platforminfo -p $(PLATFORM) | grep 'FPGA Family' | sed 's/.*://' | sed '/ai_engine/d' | sed 's/^[[:space:]]*//') ifeq ($(DEVICE_TYPE), versal) ifeq ($(shell expr $(VITIS_VER) \>= 2022.1), 1) @@ -94,6 +96,22 @@ endif else LINK_TARGET_FMT := xclbin endif +# 2) dfx flow +dfx_hw := off +ifeq ($(findstring _dfx_, $(PLATFORM_NAME)),_dfx_) +ifeq ($(TARGET),hw) +dfx_hw := on +endif +endif +# 3) for embeded sw_emu flow from 2022.2 +ps_on_x86 := off +ifneq ($(HOST_ARCH), x86) +ifeq ($(shell expr $(VITIS_VER) \>= 2022.2), 1) +ifeq ($(TARGET), sw_emu) +ps_on_x86 := on +endif +endif +endif #Checks for Device Family ifeq ($(HOST_ARCH), aarch32) @@ -107,6 +125,7 @@ ifneq ($(HOST_ARCH), $(filter $(HOST_ARCH),aarch64 aarch32 x86)) $(error HOST_ARCH variable not set, please set correctly and rerun) endif +.PHONY: check_version check_sysroot check_kimage check_rootfs check_version: ifneq (, $(shell which git)) ifneq (,$(wildcard $(XFLIB_DIR)/.git)) @@ -114,17 +133,46 @@ ifneq (,$(wildcard $(XFLIB_DIR)/.git)) endif endif -#Checks for SYSROOT +#Set/Check SYSROOT/K_IMAGE/ROOTFS +ifneq ($(HOST_ARCH), x86) +ifneq (,$(findstring zc706, $(PLATFORM_NAME))) +K_IMAGE ?= $(SYSROOT)/../../uImage +else +K_IMAGE ?= $(SYSROOT)/../../Image +endif +ROOTFS ?= $(SYSROOT)/../../rootfs.ext4 +endif + check_sysroot: ifneq ($(HOST_ARCH), x86) -ifndef SYSROOT +ifeq (,$(wildcard $(SYSROOT))) $(error SYSROOT ENV variable is not set, please set ENV variable correctly and rerun) endif endif +check_kimage: +ifneq ($(HOST_ARCH), x86) +ifeq (,$(wildcard $(K_IMAGE))) + $(error K_IMAGE ENV variable is not set, please set ENV variable correctly and rerun) +endif +endif +check_rootfs: +ifneq ($(HOST_ARCH), x86) +ifeq (,$(wildcard $(ROOTFS))) + $(error ROOTFS ENV variable is not set, please set ENV variable correctly and rerun) +endif +endif #Checks for g++ -CXX := g++ ifeq ($(HOST_ARCH), x86) +X86_CXX := true +else +ifeq ($(ps_on_x86), true) +X86_CXX := true +endif +endif + +CXX := g++ +ifeq ($(X86_CXX), true) ifeq ($(shell expr $(VITIS_VER) \>= 2022.1), 1) CXX_VER := 8.3.0 else @@ -144,11 +192,13 @@ endif $(warning [WARNING]: g++ version too old. Using g++ provided by the tool: $(CXX)) endif endif -else ifeq ($(HOST_ARCH), aarch64) +else +ifeq ($(HOST_ARCH), aarch64) CXX := $(XILINX_VITIS)/gnu/aarch64/lin/aarch64-linux/bin/aarch64-linux-gnu-g++ else ifeq ($(HOST_ARCH), aarch32) CXX := $(XILINX_VITIS)/gnu/aarch32/lin/gcc-arm-linux-gnueabi/bin/arm-linux-gnueabihf-g++ endif +endif #Check OS and setting env for xrt c++ api OSDIST = $(shell lsb_release -i |awk -F: '{print tolower($$2)}' | tr -d ' \t' ) @@ -268,9 +318,3 @@ RMDIR = rm -rf MV = mv -f CP = cp -rf ECHO:= @echo -ifneq (,$(shell echo $(XPLATFORM) | awk '/xilinx_u280_xdma_201920_3/')) -VPP_FLAGS += --advanced.param compiler.ignorePlatformCompatibilityCheck=true -ifeq ($(TARGET), hw) -VPP_LDFLAGS += --advanced.param compiler.userPreSysLinkOverlayTcl=preSysLink.tcl -endif -endif diff --git a/hpc/L2/tests/rtm3d/rtmforward_Domain_RBC/utils.mk b/hpc/L2/tests/rtm3d/rtmforward_Domain_RBC/utils.mk index 9b889021fc..2e9ea4d63a 100644 --- a/hpc/L2/tests/rtm3d/rtmforward_Domain_RBC/utils.mk +++ b/hpc/L2/tests/rtm3d/rtmforward_Domain_RBC/utils.mk @@ -12,7 +12,7 @@ # 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. -# vitis makefile-generator v2.0.6 +# vitis makefile-generator v2.0.7 # #+------------------------------------------------------------------------------- # The following parameters are assigned with default values. These parameters can @@ -50,6 +50,7 @@ ifndef XILINX_XRT export XILINX_XRT endif +.PHONY: check_device check_device: @set -eu; \ inallowlist=False; \ @@ -82,8 +83,9 @@ endif endif -#get suffix of kernel by PLATFORM +# Special processing for tool version/platform type VITIS_VER = $(shell v++ --version | grep 'v++' | sed 's/^[[:space:]]*//' | sed -e 's/^[*]* v++ v//g' | cut -d " " -f1) +# 1) for versal flow from 2022.1 DEVICE_TYPE = $(shell platforminfo -p $(PLATFORM) | grep 'FPGA Family' | sed 's/.*://' | sed '/ai_engine/d' | sed 's/^[[:space:]]*//') ifeq ($(DEVICE_TYPE), versal) ifeq ($(shell expr $(VITIS_VER) \>= 2022.1), 1) @@ -94,6 +96,22 @@ endif else LINK_TARGET_FMT := xclbin endif +# 2) dfx flow +dfx_hw := off +ifeq ($(findstring _dfx_, $(PLATFORM_NAME)),_dfx_) +ifeq ($(TARGET),hw) +dfx_hw := on +endif +endif +# 3) for embeded sw_emu flow from 2022.2 +ps_on_x86 := off +ifneq ($(HOST_ARCH), x86) +ifeq ($(shell expr $(VITIS_VER) \>= 2022.2), 1) +ifeq ($(TARGET), sw_emu) +ps_on_x86 := on +endif +endif +endif #Checks for Device Family ifeq ($(HOST_ARCH), aarch32) @@ -107,6 +125,7 @@ ifneq ($(HOST_ARCH), $(filter $(HOST_ARCH),aarch64 aarch32 x86)) $(error HOST_ARCH variable not set, please set correctly and rerun) endif +.PHONY: check_version check_sysroot check_kimage check_rootfs check_version: ifneq (, $(shell which git)) ifneq (,$(wildcard $(XFLIB_DIR)/.git)) @@ -114,17 +133,46 @@ ifneq (,$(wildcard $(XFLIB_DIR)/.git)) endif endif -#Checks for SYSROOT +#Set/Check SYSROOT/K_IMAGE/ROOTFS +ifneq ($(HOST_ARCH), x86) +ifneq (,$(findstring zc706, $(PLATFORM_NAME))) +K_IMAGE ?= $(SYSROOT)/../../uImage +else +K_IMAGE ?= $(SYSROOT)/../../Image +endif +ROOTFS ?= $(SYSROOT)/../../rootfs.ext4 +endif + check_sysroot: ifneq ($(HOST_ARCH), x86) -ifndef SYSROOT +ifeq (,$(wildcard $(SYSROOT))) $(error SYSROOT ENV variable is not set, please set ENV variable correctly and rerun) endif endif +check_kimage: +ifneq ($(HOST_ARCH), x86) +ifeq (,$(wildcard $(K_IMAGE))) + $(error K_IMAGE ENV variable is not set, please set ENV variable correctly and rerun) +endif +endif +check_rootfs: +ifneq ($(HOST_ARCH), x86) +ifeq (,$(wildcard $(ROOTFS))) + $(error ROOTFS ENV variable is not set, please set ENV variable correctly and rerun) +endif +endif #Checks for g++ -CXX := g++ ifeq ($(HOST_ARCH), x86) +X86_CXX := true +else +ifeq ($(ps_on_x86), true) +X86_CXX := true +endif +endif + +CXX := g++ +ifeq ($(X86_CXX), true) ifeq ($(shell expr $(VITIS_VER) \>= 2022.1), 1) CXX_VER := 8.3.0 else @@ -144,11 +192,13 @@ endif $(warning [WARNING]: g++ version too old. Using g++ provided by the tool: $(CXX)) endif endif -else ifeq ($(HOST_ARCH), aarch64) +else +ifeq ($(HOST_ARCH), aarch64) CXX := $(XILINX_VITIS)/gnu/aarch64/lin/aarch64-linux/bin/aarch64-linux-gnu-g++ else ifeq ($(HOST_ARCH), aarch32) CXX := $(XILINX_VITIS)/gnu/aarch32/lin/gcc-arm-linux-gnueabi/bin/arm-linux-gnueabihf-g++ endif +endif #Check OS and setting env for xrt c++ api OSDIST = $(shell lsb_release -i |awk -F: '{print tolower($$2)}' | tr -d ' \t' ) @@ -268,9 +318,3 @@ RMDIR = rm -rf MV = mv -f CP = cp -rf ECHO:= @echo -ifneq (,$(shell echo $(XPLATFORM) | awk '/xilinx_u280_xdma_201920_3/')) -VPP_FLAGS += --advanced.param compiler.ignorePlatformCompatibilityCheck=true -ifeq ($(TARGET), hw) -VPP_LDFLAGS += --advanced.param compiler.userPreSysLinkOverlayTcl=preSysLink.tcl -endif -endif diff --git a/hpc/L3/examples/mlp/Makefile b/hpc/L3/examples/mlp/Makefile index 221d8f9513..536183eb2d 100644 --- a/hpc/L3/examples/mlp/Makefile +++ b/hpc/L3/examples/mlp/Makefile @@ -11,7 +11,7 @@ # 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. -# vitis makefile-generator v2.0.6 +# vitis makefile-generator v2.0.7 ############################## Help Section ############################## .PHONY: help @@ -34,9 +34,15 @@ help:: $(ECHO) " Command to build host application." $(ECHO) " By default, HOST_ARCH=x86. HOST_ARCH is required for SoC shells" $(ECHO) "" - $(ECHO) " NOTE: For embedded devices, e.g. zcu102/zcu104/vck190, env variable SYSROOT and EDGE_COMMON_SW need to be set first, and HOST_ARCH is either aarch32 or aarch64. For example," - $(ECHO) " export SYSROOT=< path-to-platform-sysroot >" - $(ECHO) " export EDGE_COMMON_SW=< path-to-rootfs-and-Image-files >" + $(ECHO) " NOTE: For embedded devices, e.g. zcu102/zcu104/vck190, HOST_ARCH is either aarch32 or aarch64." + $(ECHO) " a.IF Download the platform, and common-image from Xilinx Download Center(Suggested):" + $(ECHO) " Run the sdk.sh script from the common-image directory to install sysroot using the command : ./sdk.sh -y -d ./ -p " + $(ECHO) " Unzip the rootfs file : gunzip ./rootfs.ext4.gz" + $(ECHO) " export SYSROOT=< path-to-platform-sysroot >" + $(ECHO) " b. User could also define SYSROOT, K_IMAGE and ROOTFS by themselves: " + $(ECHO) " export SYSROOT=< path-to-platform-sysroot >" + $(ECHO) " export K_IMAGE=< path-to-Image-files >" + $(ECHO) " export ROOTFS=< path-to-rootfs >" $(ECHO) "" $(ECHO) " make clean " $(ECHO) " Command to remove the generated non-hardware files." @@ -88,12 +94,17 @@ RUN_DEPS := # get global setting ifeq ($(HOST_ARCH), x86) CXXFLAGS += -fmessage-length=0 -I$(CUR_DIR)/src/ -I$(XILINX_XRT)/include -I$(XILINX_HLS)/include -std=c++14 -O3 -Wall -Wno-unknown-pragmas -Wno-unused-label -LDFLAGS += -pthread -L$(XILINX_XRT)/lib -L$(XILINX_HLS)/lnx64/tools/fpo_v7_0 -Wl,--as-needed -lOpenCL -lxrt_coreutil -lgmp -lmpfr -lIp_floating_point_v7_0_bitacc_cmodel +LDFLAGS += -pthread -L$(XILINX_XRT)/lib -L$(XILINX_HLS)/lnx64/tools/fpo_v7_1 -Wl,--as-needed -lOpenCL -lxrt_coreutil -lgmp -lmpfr -lIp_floating_point_v7_1_bitacc_cmodel VPP_FLAGS += -t $(TARGET) --platform $(XPLATFORM) --save-temps VPP_LDFLAGS += --optimize 2 -R 2 else ifeq ($(HOST_ARCH), aarch64) +ifeq ($(ps_on_x86), true) +CXXFLAGS += -fmessage-length=0 -I$(CUR_DIR)/src/ -I$(XILINX_XRT)/include -I$(XILINX_HLS)/include -std=c++14 -O3 -Wall -Wno-unknown-pragmas -Wno-unused-label +LDFLAGS += -pthread -L$(XILINX_XRT)/lib -L$(XILINX_HLS)/lnx64/tools/fpo_v7_1 -Wl,--as-needed -lOpenCL -lxrt_coreutil -lgmp -lmpfr -lIp_floating_point_v7_1_bitacc_cmodel +else CXXFLAGS += -I$(CUR_DIR)/src/ -fmessage-length=0 --sysroot=$(SYSROOT) -I$(SYSROOT)/usr/include/xrt -I$(XILINX_HLS)/include -std=c++14 -O3 -Wall -Wno-unknown-pragmas -Wno-unused-label -LDFLAGS += -pthread -L$(SYSROOT)/usr/lib -L$(XILINX_VITIS_AIETOOLS)/lib/aarch64.o -Wl,--as-needed -lxilinxopencl -lxrt_coreutil +LDFLAGS += -pthread -L$(SYSROOT)/usr/lib -Wl,--as-needed -lxilinxopencl -lxrt_coreutil +endif VPP_FLAGS += -t $(TARGET) --platform $(XPLATFORM) --save-temps VPP_LDFLAGS += --optimize 2 -R 2 endif @@ -108,22 +119,27 @@ ifeq ($(TARGET),hw_emu) CXXFLAGS += -D HW_EMU_TEST endif -ifeq (,$(findstring opencv,$(CXXFLAGS))) -CXXFLAGS += $(XRT_CXXFLAGS) -endif - #Inclue Required Host Source Files ifneq (,$(shell echo $(XPLATFORM) | awk '/u250/')) HOST_SRCS += $(XFLIB_DIR)/L3/examples/mlp/fcn_example.cpp CXXFLAGS += -I $(XFLIB_DIR)/L3/include/sw/mlp -I $(XFLIB_DIR)/../blas/L3/include/sw/xf_blas LDFLAGS += -luuid -lxrt_coreutil - else +ifeq ($(ps_on_x86), true) HOST_SRCS += $(XFLIB_DIR)/L3/examples/mlp/fcn_example.cpp CXXFLAGS += -I $(XFLIB_DIR)/L3/include/sw/mlp -I $(XFLIB_DIR)/../blas/L3/include/sw/xf_blas LDFLAGS += -luuid -lxrt_coreutil - +else +HOST_SRCS += $(XFLIB_DIR)/L3/examples/mlp/fcn_example.cpp +CXXFLAGS += -I $(XFLIB_DIR)/L3/include/sw/mlp -I $(XFLIB_DIR)/../blas/L3/include/sw/xf_blas +LDFLAGS += -luuid -lxrt_coreutil +endif endif +# workaround for opencv +ifeq (,$(findstring opencv,$(CXXFLAGS))) +CXXFLAGS += $(XRT_CXXFLAGS) +endif + EXE_NAME := fcn_example.exe EXE_FILE := $(BUILD_DIR)/$(EXE_NAME) EXE_FILE_DEPS := $(HOST_SRCS) $(EXE_FILE_DEPS) @@ -188,11 +204,6 @@ $(EMCONFIG): emconfigutil --platform $(XPLATFORM) --od $(BUILD_DIR) ############################## Preparing sdcard folder ############################## ifneq ($(HOST_ARCH), x86) -ifneq (,$(findstring zc706, $(PLATFORM_NAME))) -K_IMAGE := $(SYSROOT)/../../uImage -else -K_IMAGE := $(SYSROOT)/../../Image -endif RUN_SCRIPT := $(BUILD_DIR)/run_script.sh $(RUN_SCRIPT): rm -rf $(RUN_SCRIPT) @@ -208,7 +219,7 @@ endif @echo './$(EXE_NAME) $(PKG_HOST_ARGS)' >> $(RUN_SCRIPT) @echo 'return_code=$$?' >> $(RUN_SCRIPT) @echo 'if [ $$return_code -ne 0 ]; then' >> $(RUN_SCRIPT) - @echo ' echo "ERROR: Embedded host run failed, RC=$$return_code"' >> $(RUN_SCRIPT) + @echo ' echo "ERROR: TEST FAILED, RC=$$return_code"' >> $(RUN_SCRIPT) @echo 'else' >> $(RUN_SCRIPT) @echo ' echo "INFO: TEST PASSED, RC=0"' >> $(RUN_SCRIPT) @echo 'fi' >> $(RUN_SCRIPT) @@ -226,23 +237,28 @@ SD_DIRS_WITH_PREFIX = $(foreach sd_dir,$(DATA_DIR),--package.sd_dir $(sd_dir)) PACKAGE_FILES := $(BINARY_CONTAINERS) PACKAGE_FILES += $(AIE_CONTAINER) SD_CARD := $(CUR_DIR)/package_$(TARGET) -vck190_dfx_hw := false -$(SD_CARD): $(EXE_FILE) $(BINARY_CONTAINERS) $(RUN_SCRIPT) $(EMCONFIG) +$(SD_CARD): $(EXE_FILE) $(BINARY_CONTAINERS) $(RUN_SCRIPT) $(EMCONFIG) check_kimage check_rootfs @echo "Generating sd_card folder...." mkdir -p $(SD_CARD) chmod a+rx $(BUILD_DIR)/run_script.sh -ifneq (,$(findstring vck190_base_dfx, $(PLATFORM_NAME))) -ifeq ($(TARGET),hw) - $(VPP) -t $(TARGET) --platform $(XPLATFORM) -p $(PACKAGE_FILES) -o $(BINARY_CONTAINERS_PKG) - $(VPP) -t $(TARGET) --platform $(XPLATFORM) -p --package.out_dir $(SD_CARD) --package.rootfs $(SYSROOT)/../../rootfs.ext4 --package.kernel_image $(K_IMAGE) $(SD_FILES_WITH_PREFIX) $(SD_DIRS_WITH_PREFIX) --package.sd_file $(BINARY_CONTAINERS_PKG) +# 1. DFX HW Flow +ifeq ($(dfx_hw), true) + $(VPP) -t $(TARGET) --platform $(XPLATFORM) -p $(PACKAGE_FILES) $(VPP_PACKAGE) -o $(BINARY_CONTAINERS_PKG) + $(VPP) -t $(TARGET) --platform $(XPLATFORM) -p --package.out_dir $(SD_CARD) --package.rootfs $(ROOTFS) --package.kernel_image $(K_IMAGE) $(SD_FILES_WITH_PREFIX) $(SD_DIRS_WITH_PREFIX) --package.sd_file $(BINARY_CONTAINERS_PKG) @echo "### ***** sd_card generation done! ***** ###" -vck190_dfx_hw := true endif +# 2. PS_ON_X86 - From 2022.2, Target:sw_emu +ifeq ($(ps_on_x86), true) + @echo "### ***** running PS X86 SE_EMU ***** ###" + $(VPP) -t $(TARGET) --platform $(XPLATFORM) -o $(BINARY_CONTAINERS_PKG) -p $(PACKAGE_FILES) $(VPP_PACKAGE) --package.out_dir $(SD_CARD) --package.emu_ps x86 endif -ifeq ($(vck190_dfx_hw), false) - $(VPP) -t $(TARGET) --platform $(XPLATFORM) -o $(BINARY_CONTAINERS_PKG) -p $(PACKAGE_FILES) $(VPP_PACKAGE) --package.out_dir $(SD_CARD) --package.rootfs $(SYSROOT)/../../rootfs.ext4 --package.kernel_image $(K_IMAGE) $(SD_FILES_WITH_PREFIX) $(SD_DIRS_WITH_PREFIX) +#3. General Embeded flow +ifeq ($(dfx_hw), false) +ifeq ($(ps_on_x86), false) + $(VPP) -t $(TARGET) --platform $(XPLATFORM) -o $(BINARY_CONTAINERS_PKG) -p $(PACKAGE_FILES) $(VPP_PACKAGE) --package.out_dir $(SD_CARD) --package.rootfs $(ROOTFS) --package.kernel_image $(K_IMAGE) $(SD_FILES_WITH_PREFIX) $(SD_DIRS_WITH_PREFIX) @echo "### ***** sd_card generation done! ***** ###" endif +endif .PHONY: sd_card sd_card: $(SD_CARD) @@ -266,7 +282,7 @@ ifeq ($(HOST_ARCH), x86) make dump_config else @echo $(RUN_DEPS) - $(SD_CARD)/launch_$(TARGET).sh -no-reboot -run-app $(notdir $(RUN_SCRIPT)) + $(SD_CARD)/launch_$(TARGET).sh -no-reboot -run-app $(notdir $(RUN_SCRIPT)) 2>&1 | tee $(SD_CARD)/qemu_output.log grep "TEST PASSED, RC=0" $(SD_CARD)/qemu_output.log || exit 1 make dump_config endif @@ -277,24 +293,32 @@ ifeq ($(HOST_ARCH), x86) LD_LIBRARY_PATH=$(LIBRARY_PATH):$$LD_LIBRARY_PATH \ XCL_EMULATION_MODE=$(TARGET) $(EXE_FILE) $(HOST_ARGS) make dump_config +else +ifeq ($(ps_on_x86), true) + LD_LIBRARY_PATH=$(LIBRARY_PATH):$$LD_LIBRARY_PATH \ + XCL_EMULATION_MODE=$(TARGET) $(EXE_FILE) $(HOST_ARGS) + make dump_config else @echo $(RUN_DEPS) - $(SD_CARD)/launch_$(TARGET).sh -no-reboot -run-app $(notdir $(RUN_SCRIPT)) + $(SD_CARD)/launch_$(TARGET).sh -no-reboot -run-app $(notdir $(RUN_SCRIPT)) 2>&1 | tee $(SD_CARD)/qemu_output.log grep "TEST PASSED, RC=0" $(SD_CARD)/qemu_output.log || exit 1 make dump_config endif endif +endif #hw ifeq ($(TARGET), hw) ifneq (,$(findstring aws-vu9p-f1, $(PLATFORM_NAME))) -ifneq ($(JENKINS_INTERNAL_BUILD), 1) +ifeq (,$(wildcard $(BUILD_DIR)/fcn.awsxclbin)) $(ECHO) "This makefile does not directly support converting .xclbin to .awsxclbin, please refer https://github.com/aws/aws-fpga/blob/master/Vitis/README.md for next operations" else - $(ECHO) "Running inside Xilinx regression without converting to .awsxclbin" - $(EXE_FILE) $(HOST_ARGS) + $(ECHO) "Running HW using generated .awsxclbin" + LD_LIBRARY_PATH=$(LIBRARY_PATH):$$LD_LIBRARY_PATH \ + $(EXE_FILE) $(subst .xclbin,.awsxclbin,$(HOST_ARGS)) make dump_config endif else ifeq ($(HOST_ARCH), x86) + LD_LIBRARY_PATH=$(LIBRARY_PATH):$$LD_LIBRARY_PATH \ $(EXE_FILE) $(HOST_ARGS) make dump_config else @@ -328,12 +352,11 @@ cleanh: cleank: -$(RMDIR) $(BUILD_DIR)/*.xclbin _vimage *xclbin.run_summary qemu-memory-_* emulation/ _vimage/ pl*start_simulation. sh *.xclbin - -$(RMDIR) _x_temp.*/_x.* _x_temp.*/.Xil _x_temp.*/profile_summary.* xo_* _x* - -$(RMDIR) _x_temp.*/dltmp* _x_temp.*/kernel_info.dat _x_temp.*/*.log - -$(RMDIR) _x_temp.* + -$(RMDIR) _x_temp.* cleanall: cleanh cleank -$(RMDIR) $(BUILD_DIR) emconfig.json *.html $(TEMP_DIR) $(CUR_DIR)/reports *.csv *.run_summary $(CUR_DIR)/*.raw package_* $(BUILD_DIR)/run_script.sh .ipcache *.str -$(RMDIR) $(CUR_DIR)/Work $(CUR_DIR)/*.xpe $(CUR_DIR)/hw.o $(CUR_DIR)/*.xsa $(CUR_DIR)/xnwOut + -$(RMDIR) clean: cleanh \ No newline at end of file diff --git a/hpc/L3/examples/mlp/utils.mk b/hpc/L3/examples/mlp/utils.mk index 9b889021fc..8965e30749 100644 --- a/hpc/L3/examples/mlp/utils.mk +++ b/hpc/L3/examples/mlp/utils.mk @@ -12,7 +12,7 @@ # 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. -# vitis makefile-generator v2.0.6 +# vitis makefile-generator v2.0.7 # #+------------------------------------------------------------------------------- # The following parameters are assigned with default values. These parameters can @@ -50,6 +50,7 @@ ifndef XILINX_XRT export XILINX_XRT endif +.PHONY: check_device check_device: @set -eu; \ inallowlist=False; \ @@ -82,8 +83,9 @@ endif endif -#get suffix of kernel by PLATFORM +# Special processing for tool version/platform type VITIS_VER = $(shell v++ --version | grep 'v++' | sed 's/^[[:space:]]*//' | sed -e 's/^[*]* v++ v//g' | cut -d " " -f1) +# 1) for versal flow from 2022.1 DEVICE_TYPE = $(shell platforminfo -p $(PLATFORM) | grep 'FPGA Family' | sed 's/.*://' | sed '/ai_engine/d' | sed 's/^[[:space:]]*//') ifeq ($(DEVICE_TYPE), versal) ifeq ($(shell expr $(VITIS_VER) \>= 2022.1), 1) @@ -94,6 +96,22 @@ endif else LINK_TARGET_FMT := xclbin endif +# 2) dfx flow +dfx_hw := false +ifeq ($(findstring _dfx_, $(PLATFORM_NAME)),_dfx_) +ifeq ($(TARGET),hw) +dfx_hw := true +endif +endif +# 3) for embeded sw_emu flow from 2022.2 +ps_on_x86 := false +ifneq ($(HOST_ARCH), x86) +ifeq ($(shell expr $(VITIS_VER) \>= 2022.2), 1) +ifeq ($(TARGET), sw_emu) +ps_on_x86 := true +endif +endif +endif #Checks for Device Family ifeq ($(HOST_ARCH), aarch32) @@ -107,6 +125,7 @@ ifneq ($(HOST_ARCH), $(filter $(HOST_ARCH),aarch64 aarch32 x86)) $(error HOST_ARCH variable not set, please set correctly and rerun) endif +.PHONY: check_version check_sysroot check_kimage check_rootfs check_version: ifneq (, $(shell which git)) ifneq (,$(wildcard $(XFLIB_DIR)/.git)) @@ -114,17 +133,46 @@ ifneq (,$(wildcard $(XFLIB_DIR)/.git)) endif endif -#Checks for SYSROOT +#Set/Check SYSROOT/K_IMAGE/ROOTFS +ifneq ($(HOST_ARCH), x86) +ifneq (,$(findstring zc706, $(PLATFORM_NAME))) +K_IMAGE ?= $(SYSROOT)/../../uImage +else +K_IMAGE ?= $(SYSROOT)/../../Image +endif +ROOTFS ?= $(SYSROOT)/../../rootfs.ext4 +endif + check_sysroot: ifneq ($(HOST_ARCH), x86) -ifndef SYSROOT +ifeq (,$(wildcard $(SYSROOT))) $(error SYSROOT ENV variable is not set, please set ENV variable correctly and rerun) endif endif +check_kimage: +ifneq ($(HOST_ARCH), x86) +ifeq (,$(wildcard $(K_IMAGE))) + $(error K_IMAGE ENV variable is not set, please set ENV variable correctly and rerun) +endif +endif +check_rootfs: +ifneq ($(HOST_ARCH), x86) +ifeq (,$(wildcard $(ROOTFS))) + $(error ROOTFS ENV variable is not set, please set ENV variable correctly and rerun) +endif +endif #Checks for g++ -CXX := g++ ifeq ($(HOST_ARCH), x86) +X86_CXX := true +else +ifeq ($(ps_on_x86), true) +X86_CXX := true +endif +endif + +CXX := g++ +ifeq ($(X86_CXX), true) ifeq ($(shell expr $(VITIS_VER) \>= 2022.1), 1) CXX_VER := 8.3.0 else @@ -144,11 +192,13 @@ endif $(warning [WARNING]: g++ version too old. Using g++ provided by the tool: $(CXX)) endif endif -else ifeq ($(HOST_ARCH), aarch64) +else +ifeq ($(HOST_ARCH), aarch64) CXX := $(XILINX_VITIS)/gnu/aarch64/lin/aarch64-linux/bin/aarch64-linux-gnu-g++ else ifeq ($(HOST_ARCH), aarch32) CXX := $(XILINX_VITIS)/gnu/aarch32/lin/gcc-arm-linux-gnueabi/bin/arm-linux-gnueabihf-g++ endif +endif #Check OS and setting env for xrt c++ api OSDIST = $(shell lsb_release -i |awk -F: '{print tolower($$2)}' | tr -d ' \t' ) @@ -268,9 +318,3 @@ RMDIR = rm -rf MV = mv -f CP = cp -rf ECHO:= @echo -ifneq (,$(shell echo $(XPLATFORM) | awk '/xilinx_u280_xdma_201920_3/')) -VPP_FLAGS += --advanced.param compiler.ignorePlatformCompatibilityCheck=true -ifeq ($(TARGET), hw) -VPP_LDFLAGS += --advanced.param compiler.userPreSysLinkOverlayTcl=preSysLink.tcl -endif -endif diff --git a/hpc/L3/include/sw/fpga_xrt.hpp b/hpc/L3/include/sw/fpga_xrt.hpp index 29ad98315d..652cc983db 100644 --- a/hpc/L3/include/sw/fpga_xrt.hpp +++ b/hpc/L3/include/sw/fpga_xrt.hpp @@ -23,6 +23,8 @@ #include "experimental/xrt_kernel.h" #include "experimental/xrt_device.h" #include "experimental/xrt_bo.h" +#include +#include using namespace std; diff --git a/hpc/L3/tests/rtm2d/Makefile b/hpc/L3/tests/rtm2d/Makefile index 287e407d52..32532efbeb 100644 --- a/hpc/L3/tests/rtm2d/Makefile +++ b/hpc/L3/tests/rtm2d/Makefile @@ -11,32 +11,34 @@ # 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. -# vitis makefile-generator v2.0.6 +# vitis makefile-generator v2.0.8 ############################## Help Section ############################## .PHONY: help help:: $(ECHO) "Makefile Usage:" - $(ECHO) " make all TARGET= PLATFORM= HOST_ARCH=" + $(ECHO) " make all TARGET= PLATFORM=" $(ECHO) " Command to generate the design for specified Target and Shell." - $(ECHO) " By default, HOST_ARCH=x86. HOST_ARCH is required for SoC shells" $(ECHO) "" - $(ECHO) " make run TARGET= PLATFORM= HOST_ARCH=" + $(ECHO) " make run TARGET= PLATFORM=" $(ECHO) " Command to run application in emulation." - $(ECHO) " By default, HOST_ARCH=x86. HOST_ARCH required for SoC shells" $(ECHO) "" - $(ECHO) " make xclbin TARGET= PLATFORM= HOST_ARCH=" + $(ECHO) " make xclbin TARGET= PLATFORM=" $(ECHO) " Command to build xclbin application." - $(ECHO) " By default, HOST_ARCH=x86. HOST_ARCH is required for SoC shells" $(ECHO) "" $(ECHO) " make host TARGET=" $(ECHO) " Command to build host application." - $(ECHO) " By default, HOST_ARCH=x86. HOST_ARCH is required for SoC shells" $(ECHO) "" - $(ECHO) " NOTE: For embedded devices, e.g. zcu102/zcu104/vck190, env variable SYSROOT and EDGE_COMMON_SW need to be set first, and HOST_ARCH is either aarch32 or aarch64. For example," - $(ECHO) " export SYSROOT=< path-to-platform-sysroot >" - $(ECHO) " export EDGE_COMMON_SW=< path-to-rootfs-and-Image-files >" + $(ECHO) " NOTE: For embedded devices, e.g. zcu102/zcu104/vck190, HOST_ARCH is either aarch32 or aarch64." + $(ECHO) " a.IF Download the platform, and common-image from Xilinx Download Center(Suggested):" + $(ECHO) " Run the sdk.sh script from the common-image directory to install sysroot using the command : ./sdk.sh -y -d ./ -p " + $(ECHO) " Unzip the rootfs file : gunzip ./rootfs.ext4.gz" + $(ECHO) " export SYSROOT=< path-to-platform-sysroot >" + $(ECHO) " b. User could also define SYSROOT, K_IMAGE and ROOTFS by themselves: " + $(ECHO) " export SYSROOT=< path-to-platform-sysroot >" + $(ECHO) " export K_IMAGE=< path-to-Image-files >" + $(ECHO) " export ROOTFS=< path-to-rootfs >" $(ECHO) "" $(ECHO) " make clean " $(ECHO) " Command to remove the generated non-hardware files." @@ -61,7 +63,7 @@ ifeq ($(PLATFORM),) PLATFORM := $(DEVICE) endif ifeq ($(PLATFORM),) -PLATFORM := xilinx_u280_xdma_201920_3 +PLATFORM := xilinx_u280_gen3x16_xdma_1_202120_1 endif # #################### Checking if PLATFORM in whitelist ############################ @@ -88,12 +90,12 @@ RUN_DEPS := # get global setting ifeq ($(HOST_ARCH), x86) CXXFLAGS += -fmessage-length=0 -I$(CUR_DIR)/src/ -I$(XILINX_XRT)/include -I$(XILINX_HLS)/include -std=c++14 -O3 -Wall -Wno-unknown-pragmas -Wno-unused-label -LDFLAGS += -pthread -L$(XILINX_XRT)/lib -L$(XILINX_HLS)/lnx64/tools/fpo_v7_0 -Wl,--as-needed -lOpenCL -lxrt_coreutil -lgmp -lmpfr -lIp_floating_point_v7_0_bitacc_cmodel +LDFLAGS += -pthread -L$(XILINX_XRT)/lib -L$(XILINX_HLS)/lnx64/tools/fpo_v7_1 -Wl,--as-needed -lOpenCL -lxrt_coreutil -lgmp -lmpfr -lIp_floating_point_v7_1_bitacc_cmodel VPP_FLAGS += -t $(TARGET) --platform $(XPLATFORM) --save-temps VPP_LDFLAGS += --optimize 2 -R 2 else ifeq ($(HOST_ARCH), aarch64) CXXFLAGS += -I$(CUR_DIR)/src/ -fmessage-length=0 --sysroot=$(SYSROOT) -I$(SYSROOT)/usr/include/xrt -I$(XILINX_HLS)/include -std=c++14 -O3 -Wall -Wno-unknown-pragmas -Wno-unused-label -LDFLAGS += -pthread -L$(SYSROOT)/usr/lib -L$(XILINX_VITIS_AIETOOLS)/lib/aarch64.o -Wl,--as-needed -lxilinxopencl -lxrt_coreutil +LDFLAGS += -pthread -L$(SYSROOT)/usr/lib -Wl,--as-needed -lxilinxopencl -lxrt_coreutil VPP_FLAGS += -t $(TARGET) --platform $(XPLATFORM) --save-temps VPP_LDFLAGS += --optimize 2 -R 2 endif @@ -108,14 +110,21 @@ ifeq ($(TARGET),hw_emu) CXXFLAGS += -D HW_EMU_TEST endif -ifeq (,$(findstring opencv,$(CXXFLAGS))) -CXXFLAGS += $(XRT_CXXFLAGS) -endif - #Inclue Required Host Source Files +ifeq ($(ps_on_x86), on) +HOST_SRCS += $(CUR_DIR)/main.cpp +CXXFLAGS += -I $(XFLIB_DIR)/L3/include/sw -I $(XFLIB_DIR)/L2/include/hw/rtm2d -I $(XFLIB_DIR)/L2/include/sw/rtm2d -I $(XFLIB_DIR)/L3/include/sw/rtm2d -I $(XFLIB_DIR)/../blas/L1/tests/sw/include/ -I $(XFLIB_DIR)/../blas/L2/include/xcl2/ +LDFLAGS += -luuid -lxrt_coreutil +else HOST_SRCS += $(CUR_DIR)/main.cpp CXXFLAGS += -I $(XFLIB_DIR)/L3/include/sw -I $(XFLIB_DIR)/L2/include/hw/rtm2d -I $(XFLIB_DIR)/L2/include/sw/rtm2d -I $(XFLIB_DIR)/L3/include/sw/rtm2d -I $(XFLIB_DIR)/../blas/L1/tests/sw/include/ -I $(XFLIB_DIR)/../blas/L2/include/xcl2/ LDFLAGS += -luuid -lxrt_coreutil +endif + +# workaround for opencv +ifeq (,$(findstring opencv,$(CXXFLAGS))) +CXXFLAGS += $(XRT_CXXFLAGS) +endif EXE_NAME := host.exe EXE_FILE := $(BUILD_DIR)/$(EXE_NAME) @@ -131,29 +140,29 @@ VPP_FLAGS += -I $(XFLIB_DIR)/L1/include/hw -I $(XFLIB_DIR)/L2/include/hw/rtm2d ######################### binary container global settings ########################## ifneq (,$(shell echo $(XPLATFORM) | awk '/u280/')) -VPP_FLAGS_rtmforward += --hls.clock 250000000:rtmforward -VPP_FLAGS_rtmbackward += --hls.clock 250000000:rtmbackward -ifneq ($(HOST_ARCH), x86) -VPP_LDFLAGS_rtm += --clock.defaultFreqHz 250000000 +VPP_FLAGS_rtmforward += --hls.clock 120000000:rtmforward +VPP_FLAGS_rtmbackward += --hls.clock 120000000:rtmbackward +ifneq ($(HOST_ARCH_temp), x86) +VPP_LDFLAGS_rtm += --clock.defaultFreqHz 120000000 else -VPP_LDFLAGS_rtm += --kernel_frequency 150 +VPP_LDFLAGS_rtm += --kernel_frequency 120 endif VPP_LDFLAGS_rtm_temp := --config $(CUR_DIR)/conn_u280.cfg VPP_LDFLAGS_rtm += $(VPP_LDFLAGS_rtm_temp) else -VPP_FLAGS_rtmforward += --hls.clock 250000000:rtmforward -VPP_FLAGS_rtmbackward += --hls.clock 250000000:rtmbackward -ifneq ($(HOST_ARCH), x86) -VPP_LDFLAGS_rtm += --clock.defaultFreqHz 250000000 +VPP_FLAGS_rtmforward += --hls.clock 120000000:rtmforward +VPP_FLAGS_rtmbackward += --hls.clock 120000000:rtmbackward +ifneq ($(HOST_ARCH_temp), x86) +VPP_LDFLAGS_rtm += --clock.defaultFreqHz 120000000 else -VPP_LDFLAGS_rtm += --kernel_frequency 150 +VPP_LDFLAGS_rtm += --kernel_frequency 120 endif VPP_LDFLAGS_rtm_temp := --config opts.cfg VPP_LDFLAGS_rtm += $(VPP_LDFLAGS_rtm_temp) endif -ifeq ($(HOST_ARCH), x86) +ifneq ($(SD_CARD_NEEDED), on) BINARY_CONTAINERS += $(BUILD_DIR)/rtm.xclbin else BINARY_CONTAINERS += $(BUILD_DIR)/rtm_pkg.$(LINK_TARGET_FMT) @@ -177,27 +186,15 @@ $(BINARY_CONTAINERS): $(BINARY_CONTAINERS_DEPS) $(VPP) -l $(VPP_FLAGS) --temp_dir $(TEMP_DIR) --report_dir $(BUILD_REPORT_DIR)/rtm $(VPP_LDFLAGS) $(VPP_LDFLAGS_rtm) $(AIE_LDFLAGS) -o $@ $^ ############################## Setting Rules for Host (Building Host Executable) ############################## -ifeq ($(HOST_ARCH), x86) -$(EXE_FILE): $(EXE_FILE_DEPS) | check_xrt - mkdir -p $(BUILD_DIR) - $(CXX) -o $@ $^ $(CXXFLAGS) $(LDFLAGS) - -else -$(EXE_FILE): $(EXE_FILE_DEPS) | check_sysroot +$(EXE_FILE): $(EXE_FILE_DEPS) mkdir -p $(BUILD_DIR) $(CXX) -o $@ $^ $(CXXFLAGS) $(LDFLAGS) -endif - $(EMCONFIG): emconfigutil --platform $(XPLATFORM) --od $(BUILD_DIR) + ############################## Preparing sdcard folder ############################## -ifneq ($(HOST_ARCH), x86) -ifneq (,$(findstring zc706, $(PLATFORM_NAME))) -K_IMAGE := $(SYSROOT)/../../uImage -else -K_IMAGE := $(SYSROOT)/../../Image -endif +ifeq ($(SD_CARD_NEEDED), on) RUN_SCRIPT := $(BUILD_DIR)/run_script.sh $(RUN_SCRIPT): rm -rf $(RUN_SCRIPT) @@ -213,7 +210,7 @@ endif @echo './$(EXE_NAME) $(PKG_HOST_ARGS)' >> $(RUN_SCRIPT) @echo 'return_code=$$?' >> $(RUN_SCRIPT) @echo 'if [ $$return_code -ne 0 ]; then' >> $(RUN_SCRIPT) - @echo ' echo "ERROR: Embedded host run failed, RC=$$return_code"' >> $(RUN_SCRIPT) + @echo ' echo "ERROR: TEST FAILED, RC=$$return_code"' >> $(RUN_SCRIPT) @echo 'else' >> $(RUN_SCRIPT) @echo ' echo "INFO: TEST PASSED, RC=0"' >> $(RUN_SCRIPT) @echo 'fi' >> $(RUN_SCRIPT) @@ -231,29 +228,34 @@ SD_DIRS_WITH_PREFIX = $(foreach sd_dir,$(DATA_DIR),--package.sd_dir $(sd_dir)) PACKAGE_FILES := $(BINARY_CONTAINERS) PACKAGE_FILES += $(AIE_CONTAINER) SD_CARD := $(CUR_DIR)/package_$(TARGET) -vck190_dfx_hw := false -$(SD_CARD): $(EXE_FILE) $(BINARY_CONTAINERS) $(RUN_SCRIPT) $(EMCONFIG) +$(SD_CARD): host xclbin $(RUN_SCRIPT) $(EMCONFIG) check_kimage check_rootfs @echo "Generating sd_card folder...." mkdir -p $(SD_CARD) chmod a+rx $(BUILD_DIR)/run_script.sh -ifneq (,$(findstring vck190_base_dfx, $(PLATFORM_NAME))) -ifeq ($(TARGET),hw) - $(VPP) -t $(TARGET) --platform $(XPLATFORM) -p $(PACKAGE_FILES) -o $(BINARY_CONTAINERS_PKG) - $(VPP) -t $(TARGET) --platform $(XPLATFORM) -p --package.out_dir $(SD_CARD) --package.rootfs $(SYSROOT)/../../rootfs.ext4 --package.kernel_image $(K_IMAGE) $(SD_FILES_WITH_PREFIX) $(SD_DIRS_WITH_PREFIX) --package.sd_file $(BINARY_CONTAINERS_PKG) +# 1. DFX HW Flow +ifeq ($(dfx_hw), on) + $(VPP) -t $(TARGET) --platform $(XPLATFORM) -p $(PACKAGE_FILES) $(VPP_PACKAGE) -o $(BINARY_CONTAINERS_PKG) + $(VPP) -t $(TARGET) --platform $(XPLATFORM) -p --package.out_dir $(SD_CARD) --package.rootfs $(ROOTFS) --package.kernel_image $(K_IMAGE) $(SD_FILES_WITH_PREFIX) $(SD_DIRS_WITH_PREFIX) --package.sd_file $(BINARY_CONTAINERS_PKG) @echo "### ***** sd_card generation done! ***** ###" -vck190_dfx_hw := true endif +# 2. PS_ON_X86 - From 2022.2, Target:sw_emu +ifeq ($(ps_on_x86), on) + @echo "### ***** running PS X86 SE_EMU ***** ###" + $(VPP) -t $(TARGET) --platform $(XPLATFORM) -o $(BINARY_CONTAINERS_PKG) -p $(PACKAGE_FILES) $(VPP_PACKAGE) --package.out_dir $(SD_CARD) --package.emu_ps x86 endif -ifeq ($(vck190_dfx_hw), false) - $(VPP) -t $(TARGET) --platform $(XPLATFORM) -o $(BINARY_CONTAINERS_PKG) -p $(PACKAGE_FILES) $(VPP_PACKAGE) --package.out_dir $(SD_CARD) --package.rootfs $(SYSROOT)/../../rootfs.ext4 --package.kernel_image $(K_IMAGE) $(SD_FILES_WITH_PREFIX) $(SD_DIRS_WITH_PREFIX) +#3. General Embeded flow +ifeq ($(dfx_hw), off) +ifeq ($(ps_on_x86), off) + $(VPP) -t $(TARGET) --platform $(XPLATFORM) -o $(BINARY_CONTAINERS_PKG) -p $(PACKAGE_FILES) $(VPP_PACKAGE) --package.out_dir $(SD_CARD) --package.rootfs $(ROOTFS) --package.kernel_image $(K_IMAGE) $(SD_FILES_WITH_PREFIX) $(SD_DIRS_WITH_PREFIX) @echo "### ***** sd_card generation done! ***** ###" endif +endif .PHONY: sd_card sd_card: $(SD_CARD) endif ############################## Setting Essential Checks and Building Rules ############################## -RUN_DEPS += $(EXE_FILE) $(BINARY_CONTAINERS) $(EMCONFIG) +RUN_DEPS += host xclbin $(EMCONFIG) RUN_DEPS += $(SD_CARD) .PHONY: mkflag all run @@ -261,7 +263,7 @@ mkflag: mkdir -p $(BUILD_DIR) rm -rf $(BUILD_DIR)/makefile_args.txt @for var in $(MAKEFLAGS); do echo $$var >> $(BUILD_DIR)/makefile_args.txt; done -all: check_device check_vpp check_platform mkflag $(RUN_DEPS) +all: check_device check_vpp check_platform mkflag $(RUN_DEPS) run: all #hw_emu ifneq (,$(filter hw_emu, $(TARGET))) @@ -271,8 +273,8 @@ ifeq ($(HOST_ARCH), x86) else @echo $(RUN_DEPS) - $(SD_CARD)/launch_$(TARGET).sh -no-reboot -run-app $(notdir $(RUN_SCRIPT)) - grep "TEST PASSED, RC=0" $(SD_CARD)/qemu_output.log || exit 1 + $(SD_CARD)/launch_$(TARGET).sh -no-reboot -run-app $(notdir $(RUN_SCRIPT)) 2>&1 | tee $(SD_CARD)/qemu_stdout.log + grep "TEST PASSED, RC=0" $(SD_CARD)/qemu_stdout.log || exit 1 endif endif @@ -284,22 +286,24 @@ ifeq ($(HOST_ARCH), x86) else @echo $(RUN_DEPS) - $(SD_CARD)/launch_$(TARGET).sh -no-reboot -run-app $(notdir $(RUN_SCRIPT)) - grep "TEST PASSED, RC=0" $(SD_CARD)/qemu_output.log || exit 1 + $(SD_CARD)/launch_$(TARGET).sh -no-reboot -run-app $(notdir $(RUN_SCRIPT)) 2>&1 | tee $(SD_CARD)/qemu_stdout.log + grep "TEST PASSED, RC=0" $(SD_CARD)/qemu_stdout.log || exit 1 endif endif #hw ifeq ($(TARGET), hw) ifneq (,$(findstring aws-vu9p-f1, $(PLATFORM_NAME))) -ifneq ($(JENKINS_INTERNAL_BUILD), 1) +ifeq (,$(wildcard $(BUILD_DIR)/rtm.awsxclbin)) $(ECHO) "This makefile does not directly support converting .xclbin to .awsxclbin, please refer https://github.com/aws/aws-fpga/blob/master/Vitis/README.md for next operations" else - $(ECHO) "Running inside Xilinx regression without converting to .awsxclbin" - $(EXE_FILE) $(HOST_ARGS) + $(ECHO) "Running HW using generated .awsxclbin" + LD_LIBRARY_PATH=$(LIBRARY_PATH):$$LD_LIBRARY_PATH \ + $(EXE_FILE) $(subst .xclbin,.awsxclbin,$(HOST_ARGS)) endif else ifeq ($(HOST_ARCH), x86) + LD_LIBRARY_PATH=$(LIBRARY_PATH):$$LD_LIBRARY_PATH \ $(EXE_FILE) $(HOST_ARGS) else @@ -314,16 +318,16 @@ emconfig: $(EMCONFIG) .PHONY: host ifeq ($(HOST_ARCH), x86) -host: check_xrt $(EXE_FILE) +host: check_xrt $(EXE_FILE) else -host: check_sysroot $(EXE_FILE) +host: check_sysroot $(EXE_FILE) endif .PHONY: xclbin ifeq ($(HOST_ARCH), x86) -xclbin: check_vpp check_xrt $(BINARY_CONTAINERS) +xclbin: check_vpp check_xrt $(BINARY_CONTAINERS) else -xclbin: check_vpp check_sysroot $(BINARY_CONTAINERS) +xclbin: check_vpp check_sysroot $(BINARY_CONTAINERS) endif ############################## Cleaning Rules ############################## @@ -333,12 +337,11 @@ cleanh: cleank: -$(RMDIR) $(BUILD_DIR)/*.xclbin _vimage *xclbin.run_summary qemu-memory-_* emulation/ _vimage/ pl*start_simulation. sh *.xclbin - -$(RMDIR) _x_temp.*/_x.* _x_temp.*/.Xil _x_temp.*/profile_summary.* xo_* _x* - -$(RMDIR) _x_temp.*/dltmp* _x_temp.*/kernel_info.dat _x_temp.*/*.log - -$(RMDIR) _x_temp.* + -$(RMDIR) _x_temp.* cleanall: cleanh cleank -$(RMDIR) $(BUILD_DIR) emconfig.json *.html $(TEMP_DIR) $(CUR_DIR)/reports *.csv *.run_summary $(CUR_DIR)/*.raw package_* $(BUILD_DIR)/run_script.sh .ipcache *.str -$(RMDIR) $(CUR_DIR)/Work $(CUR_DIR)/*.xpe $(CUR_DIR)/hw.o $(CUR_DIR)/*.xsa $(CUR_DIR)/xnwOut + -$(RMDIR) -clean: cleanh +clean: cleanh \ No newline at end of file diff --git a/hpc/L3/tests/rtm2d/description.json b/hpc/L3/tests/rtm2d/description.json index 2106670396..7a1ede9e4b 100644 --- a/hpc/L3/tests/rtm2d/description.json +++ b/hpc/L3/tests/rtm2d/description.json @@ -3,7 +3,6 @@ "name": "Xilinx RTM Test", "description": "Xilinx RTM Test", "flow": "vitis", - "runtime": "XRT", "platform_type": "pcie", "platform_allowlist": [ "u280" @@ -27,11 +26,6 @@ "cmd_args": "BUILD/rtm.xclbin BUILD/data/" } ], - "pre_launch": [ - { - "launch_cmd": "make data_gen" - } - ], "host": { "host_exe": "host.exe", "compiler": { @@ -67,17 +61,17 @@ { "name": "rtm", "ldclflags": "--config opts.cfg", - "frequency": 150, + "frequency": 120, "accelerators": [ { "name": "rtmforward", "location": "LIB_DIR/L2/src/hw/rtm2d/rtmforward.cpp", - "frequency": 250 + "frequency": 120 }, { "name": "rtmbackward", "location": "LIB_DIR/L2/src/hw/rtm2d/rtmbackward.cpp", - "frequency": 250 + "frequency": 120 } ] } diff --git a/hpc/L3/tests/rtm2d/utils.mk b/hpc/L3/tests/rtm2d/utils.mk index 9b889021fc..ffd1d938e9 100644 --- a/hpc/L3/tests/rtm2d/utils.mk +++ b/hpc/L3/tests/rtm2d/utils.mk @@ -12,7 +12,7 @@ # 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. -# vitis makefile-generator v2.0.6 +# vitis makefile-generator v2.0.7 # #+------------------------------------------------------------------------------- # The following parameters are assigned with default values. These parameters can @@ -40,16 +40,13 @@ ifeq ($(DEBUG), yes) VPP_LDFLAGS += --dk protocol:all:all:all endif -#Check environment setup +#Check vitis setup ifndef XILINX_VITIS XILINX_VITIS = /opt/xilinx/Vitis/$(TOOL_VERSION) export XILINX_VITIS endif -ifndef XILINX_XRT - XILINX_XRT = /opt/xilinx/xrt - export XILINX_XRT -endif +.PHONY: check_device check_device: @set -eu; \ inallowlist=False; \ @@ -82,8 +79,10 @@ endif endif -#get suffix of kernel by PLATFORM + +# Special processing for tool version/platform type VITIS_VER = $(shell v++ --version | grep 'v++' | sed 's/^[[:space:]]*//' | sed -e 's/^[*]* v++ v//g' | cut -d " " -f1) +# 1) for versal flow from 2022.1 DEVICE_TYPE = $(shell platforminfo -p $(PLATFORM) | grep 'FPGA Family' | sed 's/.*://' | sed '/ai_engine/d' | sed 's/^[[:space:]]*//') ifeq ($(DEVICE_TYPE), versal) ifeq ($(shell expr $(VITIS_VER) \>= 2022.1), 1) @@ -94,6 +93,42 @@ endif else LINK_TARGET_FMT := xclbin endif +# 2) dfx flow +dfx_hw := off +ifeq ($(findstring _dfx_, $(PLATFORM_NAME)),_dfx_) +ifeq ($(TARGET),hw) +dfx_hw := on +endif +endif +# 3) for embeded sw_emu flow from 2022.2 +ps_on_x86 := off +ifneq ($(HOST_ARCH), x86) +ifeq ($(shell expr $(VITIS_VER) \>= 2022.2), 1) +ifeq ($(TARGET), sw_emu) +ps_on_x86 := on +HOST_ARCH := x86 +endif +endif +endif + +#when x86 arch, check XRT setup +ifeq ($(HOST_ARCH), x86) +ifndef XILINX_XRT + XILINX_XRT = /opt/xilinx/xrt + export XILINX_XRT +endif +endif + +#check if need sd_card +ifeq ($(HOST_ARCH), aarch32) +SD_CARD_NEEDED := on +endif +ifeq ($(HOST_ARCH), aarch64) +SD_CARD_NEEDED := on +endif +ifeq ($(ps_on_x86), on) +SD_CARD_NEEDED := on +endif #Checks for Device Family ifeq ($(HOST_ARCH), aarch32) @@ -107,6 +142,7 @@ ifneq ($(HOST_ARCH), $(filter $(HOST_ARCH),aarch64 aarch32 x86)) $(error HOST_ARCH variable not set, please set correctly and rerun) endif +.PHONY: check_version check_sysroot check_kimage check_rootfs check_version: ifneq (, $(shell which git)) ifneq (,$(wildcard $(XFLIB_DIR)/.git)) @@ -114,15 +150,35 @@ ifneq (,$(wildcard $(XFLIB_DIR)/.git)) endif endif -#Checks for SYSROOT +#Set/Check SYSROOT/K_IMAGE/ROOTFS +ifneq ($(HOST_ARCH), x86) +ifneq (,$(findstring zc706, $(PLATFORM_NAME))) +K_IMAGE ?= $(SYSROOT)/../../uImage +else +K_IMAGE ?= $(SYSROOT)/../../Image +endif +ROOTFS ?= $(SYSROOT)/../../rootfs.ext4 +endif + check_sysroot: ifneq ($(HOST_ARCH), x86) -ifndef SYSROOT +ifeq (,$(wildcard $(SYSROOT))) $(error SYSROOT ENV variable is not set, please set ENV variable correctly and rerun) endif endif +check_kimage: +ifneq ($(HOST_ARCH), x86) +ifeq (,$(wildcard $(K_IMAGE))) + $(error K_IMAGE ENV variable is not set, please set ENV variable correctly and rerun) +endif +endif +check_rootfs: +ifneq ($(HOST_ARCH), x86) +ifeq (,$(wildcard $(ROOTFS))) + $(error ROOTFS ENV variable is not set, please set ENV variable correctly and rerun) +endif +endif -#Checks for g++ CXX := g++ ifeq ($(HOST_ARCH), x86) ifeq ($(shell expr $(VITIS_VER) \>= 2022.1), 1) @@ -144,11 +200,13 @@ endif $(warning [WARNING]: g++ version too old. Using g++ provided by the tool: $(CXX)) endif endif -else ifeq ($(HOST_ARCH), aarch64) +else +ifeq ($(HOST_ARCH), aarch64) CXX := $(XILINX_VITIS)/gnu/aarch64/lin/aarch64-linux/bin/aarch64-linux-gnu-g++ else ifeq ($(HOST_ARCH), aarch32) CXX := $(XILINX_VITIS)/gnu/aarch32/lin/gcc-arm-linux-gnueabi/bin/arm-linux-gnueabihf-g++ endif +endif #Check OS and setting env for xrt c++ api OSDIST = $(shell lsb_release -i |awk -F: '{print tolower($$2)}' | tr -d ' \t' ) @@ -268,9 +326,3 @@ RMDIR = rm -rf MV = mv -f CP = cp -rf ECHO:= @echo -ifneq (,$(shell echo $(XPLATFORM) | awk '/xilinx_u280_xdma_201920_3/')) -VPP_FLAGS += --advanced.param compiler.ignorePlatformCompatibilityCheck=true -ifeq ($(TARGET), hw) -VPP_LDFLAGS += --advanced.param compiler.userPreSysLinkOverlayTcl=preSysLink.tcl -endif -endif diff --git a/hpc/docs/Makefile b/hpc/docs/Makefile index 550384ead0..a23d137fa3 100644 --- a/hpc/docs/Makefile +++ b/hpc/docs/Makefile @@ -29,25 +29,25 @@ endif .PHONY: all install clean cleanhtml cleanall -all: install +all: .stamp/sphinx install: .stamp/sphinx rsync -av --delete --exclude .git --exclude .nojekyll --exclude .buildinfo \ - _build/html/ $(HTML_DEST_DIR) 1>/dev/null + build/html/ $(HTML_DEST_DIR) 1>/dev/null DOXYREST_FRAME = $(dir $(shell which doxyrest))/../doxyrest_frame -rsts := $(patsubst Doxyfile_%, rst_%, $(wildcard Doxyfile_*)) +rsts := $(patsubst Doxyfile_%, src/rst_%, $(wildcard Doxyfile_*)) -rst_%: Doxyfile_% +src/rst_%: Doxyfile_% doxygen $^ - rm -rf rst_$* - mkdir -p rst_$* - doxyrest xml_$*/index.xml -o rst_$*/index.rst \ + rm -rf src/rst_$* + mkdir -p src/rst_$* + doxyrest xml_$*/index.xml -o src/rst_$*/index.rst \ -F $(DOXYREST_FRAME) -f c_index.rst.in -Dg_verbatimToCodeBlock .stamp/sphinx: $(rsts) Makefile.sphinx mkdir -p $(HTML_DEST_DIR) - mkdir -p _build + mkdir -p build mkdir -p src/_static mkdir -p .stamp make -f Makefile.sphinx html @@ -57,8 +57,8 @@ clean: rm -rf .stamp cleanhtml: - rm -rf .stamp/sphinx _build/html _build/doctrees + rm -rf .stamp/sphinx build/html build/doctrees cleanall: - rm -rf .stamp src/_static _build $(HTML_DEST_DIR) - rm -rf xml_* rst_* + rm -rf .stamp src/_static build $(HTML_DEST_DIR) + rm -rf xml_* src/rst_* diff --git a/hpc/docs/src/benchmark.rst b/hpc/docs/src/benchmark.rst index e1cf87b6fb..1b0ab8d253 100644 --- a/hpc/docs/src/benchmark.rst +++ b/hpc/docs/src/benchmark.rst @@ -126,8 +126,8 @@ These are details for benchmark result and usage steps. .. toctree:: :maxdepth: 1 - user_guide/L2/benchmark/cg_gemv_jacobi.rst - user_guide/L2/benchmark/cg_spmv_jacobi.rst + GEMV-based Conjugate Gradient Solver with Jacobi Preconditioner + SPMV-based Conjugate Gradient Solver with Jacobi Preconditioner Benchmark Overview ################### diff --git a/hpc/docs/src/index.rst b/hpc/docs/src/index.rst index 92f11e7a17..5d324ad7c5 100644 --- a/hpc/docs/src/index.rst +++ b/hpc/docs/src/index.rst @@ -60,26 +60,26 @@ Demos and usage examples of different implementation level are also provided for reference. .. toctree:: - :caption: Library Overview + :caption: Introduction :maxdepth: 1 - overview.rst - release.rst + Overview + Release Note .. toctree:: :caption: User Guide :maxdepth: 2 - pyenvguide.rst - user_guide/L1/L1.rst - user_guide/L2/L2.rst - user_guide/L3/L3.rst + Python Environment Setup Guide + L1 Primitives User Guide + L2 Kernels User Guide + L3 RTM API User Guide .. toctree:: :caption: Benchmark :maxdepth: 1 - benchmark.rst + Benchmark Index diff --git a/hpc/docs/src/user_guide/L1/L1.rst b/hpc/docs/src/user_guide/L1/L1.rst index ec2902ba3f..a728428ad5 100644 --- a/hpc/docs/src/user_guide/L1/L1.rst +++ b/hpc/docs/src/user_guide/L1/L1.rst @@ -26,6 +26,6 @@ directory of the Vitis hpc library. .. toctree:: :maxdepth: 2 - L1_overview.rst - L1_apis.rst - L1_test.rst + Introduction of L1 Primitives + L1 APIs + L1 Test diff --git a/hpc/docs/src/user_guide/L1/L1_overview.rst b/hpc/docs/src/user_guide/L1/L1_overview.rst index 5bf8740f8f..db98a93a22 100644 --- a/hpc/docs/src/user_guide/L1/L1_overview.rst +++ b/hpc/docs/src/user_guide/L1/L1_overview.rst @@ -22,6 +22,6 @@ Introduction of L1 Primitives .. toctree:: :maxdepth: 3 - rtm_intr.rst - cg_intr.rst - mlp_intr.rst + RTM Introduction + Conjugate Gradient Solver Introduction + MLP Introduction diff --git a/hpc/docs/src/user_guide/L2/L2.rst b/hpc/docs/src/user_guide/L2/L2.rst index bae3383730..947651f9f4 100644 --- a/hpc/docs/src/user_guide/L2/L2.rst +++ b/hpc/docs/src/user_guide/L2/L2.rst @@ -27,7 +27,7 @@ the software executable can be found in the ``L2/src/hw`` and ``L2/src/sw``. .. toctree:: :maxdepth: 2 - L2_overview.rst - L2_apis.rst - L2_test.rst + Introduction of L2 Kernels + L2 Kernel APIs + L2 Kernels Tests Guide diff --git a/hpc/docs/src/user_guide/L2/L2_cg.rst b/hpc/docs/src/user_guide/L2/L2_cg.rst index 3c701a33e4..4827e3a42d 100644 --- a/hpc/docs/src/user_guide/L2/L2_cg.rst +++ b/hpc/docs/src/user_guide/L2/L2_cg.rst @@ -31,6 +31,6 @@ Usage and Benchmark .. toctree:: :maxdepth: 2 - benchmark/cg_gemv_jacobi.rst - benchmark/cg_spmv_jacobi.rst + GEMV-based Conjugate Gradient Solver with Jacobi Preconditioner + SPMV-based Conjugate Gradient Solver with Jacobi Preconditioner diff --git a/hpc/docs/src/user_guide/L2/L2_overview.rst b/hpc/docs/src/user_guide/L2/L2_overview.rst index 10508b3067..34b2a48238 100644 --- a/hpc/docs/src/user_guide/L2/L2_overview.rst +++ b/hpc/docs/src/user_guide/L2/L2_overview.rst @@ -22,7 +22,7 @@ Introduction of L2 Kernels .. toctree:: :maxdepth: 2 - L2_rtm.rst - L2_mlp.rst - L2_cg.rst + RTM Kernels + MLP Kernels + CG Kernels diff --git a/hpc/docs/src/user_guide/L2/L2_test.rst b/hpc/docs/src/user_guide/L2/L2_test.rst index c25e67b5ef..0997378b61 100644 --- a/hpc/docs/src/user_guide/L2/L2_test.rst +++ b/hpc/docs/src/user_guide/L2/L2_test.rst @@ -22,6 +22,6 @@ L2 Kernels Tests Guide .. toctree:: :maxdepth: 1 - L2_test_rtm.rst - L2_test_cg.rst - L2_test_fcn.rst + RTM Kernel Test + CG Kernel Test + FCN Kernel Test diff --git a/hpc/docs/src/user_guide/L3/L3.rst b/hpc/docs/src/user_guide/L3/L3.rst index 4ec3435711..fd95ef1ac3 100644 --- a/hpc/docs/src/user_guide/L3/L3.rst +++ b/hpc/docs/src/user_guide/L3/L3.rst @@ -22,6 +22,6 @@ L3 RTM API User Guide .. toctree:: :maxdepth: 2 - L3_overview.rst - L3_api.rst - L3_test.rst + Introduction of L3 APIs + L3 APIs + L3 test