Skip to content

Commit

Permalink
Squashed 'hpc' changes from 843c1ba..0dcda94 (#701)
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
2 people authored and GitHub Enterprise committed Sep 16, 2022
1 parent 525851d commit 5788af7
Show file tree
Hide file tree
Showing 83 changed files with 2,878 additions and 1,278 deletions.
2 changes: 1 addition & 1 deletion hpc/Jenkinsfile
Original file line number Diff line number Diff line change
@@ -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')
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -59,4 +59,4 @@
]
},
"topfunction": "top"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -59,4 +59,4 @@
]
},
"topfunction": "top"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -59,4 +59,4 @@
]
},
"topfunction": "top"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
94 changes: 60 additions & 34 deletions hpc/L2/benchmarks/cg_gemv_jacobi/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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."
Expand All @@ -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 ############################
Expand All @@ -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
Expand All @@ -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)
Expand Down Expand Up @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
7 changes: 1 addition & 6 deletions hpc/L2/benchmarks/cg_gemv_jacobi/description.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,6 @@
]
}
},
"pre_launch": [
{
"launch_cmd": "make data_gen"
}
],
"launch": [
{
"name": "generic launch for all flows",
Expand Down Expand Up @@ -147,7 +142,7 @@
}
],
"testinfo": {
"disable": false,
"disable": true,
"jobs": [
{
"index": 0,
Expand Down
Loading

0 comments on commit 5788af7

Please sign in to comment.