Skip to content

Commit

Permalink
Squashed 'codec' changes from 86f185a..b3d4037 (#829)
Browse files Browse the repository at this point in the history
b3d4037 Merge pull request Xilinx#311 from congt/next
dc73a7c [CR-1160335]fix hw routing problem, add pragma to limit the width of ddr to 32bit
c5a7fc2 Merge pull request Xilinx#310 from liyuanz/update_makefile_hls
edc270d update
d20734d Merge pull request Xilinx#309 from liyuanz/add_m
5989c86 add memory
8def976 Merge pull request Xilinx#308 from liyuanz/next
4aa1616 update
c4572ec update makefile
47b4446 Merge pull request Xilinx#307 from changg/copyright
3b926c2 update copytight
88d2efb update readme

Co-authored-by: sdausr <sdausr@xilinx.com>
  • Loading branch information
2 people authored and GitHub Enterprise committed Apr 26, 2023
1 parent f693673 commit 42d7d0c
Show file tree
Hide file tree
Showing 45 changed files with 1,233 additions and 932 deletions.
21 changes: 15 additions & 6 deletions codec/L1/tests/jpegdec/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright 2019-2020 Xilinx, Inc.
# Copyright (C) 2019-2022, Xilinx, Inc.
# Copyright (C) 2022-2023, Advanced Micro Devices, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -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 hls makefile-generator v2.0.0

MK_PATH := $(abspath $(lastword $(MAKEFILE_LIST)))
CUR_DIR := $(patsubst %/,%,$(dir $(MK_PATH)))
Expand Down Expand Up @@ -61,7 +61,7 @@ export PATH := $(XILINX_VIVADO)/bin:$(PATH)

# MK_INC_END vivado.mk

DEVICE ?= u200
PLATFORM ?= xilinx_u200_gen3x16_xdma_2_202110_1

# MK_INC_BEGIN vitis_set_part.mk

Expand Down Expand Up @@ -116,12 +116,21 @@ endif # 1.2
endif # 1
# 2. search Vitis installation
ifeq (,$(XPLATFORM))
# 2.1 as exact name
# 2.1 as exact name vitis < 2022.2
XPLATFORM := $(strip $(wildcard $(XILINX_VITIS)/platforms/$(DEVICE_L)/$(DEVICE_L).xpfm))
# 2.2 as a pattern
ifeq (,$(XPLATFORM))
# 2.2 as exact name vitis >= 2022.2
XPLATFORM := $(strip $(wildcard $(XILINX_VITIS)/base_platforms/$(DEVICE_L)/$(DEVICE_L).xpfm))
# 2.3 as a pattern vitis < 2022.2
ifeq (,$(XPLATFORM))
XPLATFORMS := $(wildcard $(XILINX_VITIS)/platforms/*/*.xpfm)
XPLATFORM := $(strip $(foreach p, $(XPLATFORMS), $(shell echo $(p) | awk '$$1 ~ /$(DEVICE_L)/')))
# 2.4 as a pattern vitis > 2022.2
ifeq (,$(XPLATFORM))
XPLATFORMS := $(wildcard $(XILINX_VITIS)/base_platforms/*/*.xpfm)
XPLATFORM := $(strip $(foreach p, $(XPLATFORMS), $(shell echo $(p) | awk '$$1 ~ /$(DEVICE_L)/')))
endif # 2.4
endif # 2.3
endif # 2.2
endif # 2
# 3. search default locations
Expand Down
12 changes: 5 additions & 7 deletions codec/L1/tests/jpegdec/run_hls.tcl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright 2019-2021 Xilinx, Inc.
# Copyright (C) 2019-2022, Xilinx, Inc.
# Copyright (C) 2022-2023, Advanced Micro Devices, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -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 hls makefile-generator v2.0.0

source settings.tcl

Expand All @@ -25,16 +25,14 @@ if {![info exists CLKP]} {

open_project -reset $PROJ

add_files "test_decoder.cpp ${XF_PROJ_ROOT}/L1/src/XAcc_jfifparser.cpp ${XF_PROJ_ROOT}/L1/src/XAcc_jpegdecoder.cpp" -cflags "-I${XF_PROJ_ROOT}/L1/include -std=c++0x -g -O0"
add_files "test_decoder.cpp ${XF_PROJ_ROOT}/L1/src/XAcc_jfifparser.cpp ${XF_PROJ_ROOT}/L1/src/XAcc_jpegdecoder.cpp" -cflags "-I${XF_PROJ_ROOT}/L1/include -std=c++0x"
add_files -tb "test_decoder.cpp" -cflags "-I${XF_PROJ_ROOT}/L1/include -std=c++0x"
set_top kernel_parser_decoder
#set_top Huffman_decoder

open_solution -reset $SOLN




set_part $XPART
create_clock -period $CLKP

Expand All @@ -58,4 +56,4 @@ if {$VIVADO_IMPL == 1} {
export_design -flow impl -rtl verilog
}

exit
exit
21 changes: 15 additions & 6 deletions codec/L1/tests/jxlEnc/order_tokenize/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright 2019-2020 Xilinx, Inc.
# Copyright (C) 2019-2022, Xilinx, Inc.
# Copyright (C) 2022-2023, Advanced Micro Devices, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -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 hls makefile-generator v2.0.0

MK_PATH := $(abspath $(lastword $(MAKEFILE_LIST)))
CUR_DIR := $(patsubst %/,%,$(dir $(MK_PATH)))
Expand Down Expand Up @@ -61,7 +61,7 @@ export PATH := $(XILINX_VIVADO)/bin:$(PATH)

# MK_INC_END vivado.mk

DEVICE ?= u200
PLATFORM ?= xilinx_u200_gen3x16_xdma_2_202110_1

# MK_INC_BEGIN vitis_set_part.mk

Expand Down Expand Up @@ -116,12 +116,21 @@ endif # 1.2
endif # 1
# 2. search Vitis installation
ifeq (,$(XPLATFORM))
# 2.1 as exact name
# 2.1 as exact name vitis < 2022.2
XPLATFORM := $(strip $(wildcard $(XILINX_VITIS)/platforms/$(DEVICE_L)/$(DEVICE_L).xpfm))
# 2.2 as a pattern
ifeq (,$(XPLATFORM))
# 2.2 as exact name vitis >= 2022.2
XPLATFORM := $(strip $(wildcard $(XILINX_VITIS)/base_platforms/$(DEVICE_L)/$(DEVICE_L).xpfm))
# 2.3 as a pattern vitis < 2022.2
ifeq (,$(XPLATFORM))
XPLATFORMS := $(wildcard $(XILINX_VITIS)/platforms/*/*.xpfm)
XPLATFORM := $(strip $(foreach p, $(XPLATFORMS), $(shell echo $(p) | awk '$$1 ~ /$(DEVICE_L)/')))
# 2.4 as a pattern vitis > 2022.2
ifeq (,$(XPLATFORM))
XPLATFORMS := $(wildcard $(XILINX_VITIS)/base_platforms/*/*.xpfm)
XPLATFORM := $(strip $(foreach p, $(XPLATFORMS), $(shell echo $(p) | awk '$$1 ~ /$(DEVICE_L)/')))
endif # 2.4
endif # 2.3
endif # 2.2
endif # 2
# 3. search default locations
Expand Down
7 changes: 3 additions & 4 deletions codec/L1/tests/jxlEnc/order_tokenize/run_hls.tcl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright 2019-2021 Xilinx, Inc.
# Copyright (C) 2019-2022, Xilinx, Inc.
# Copyright (C) 2022-2023, Advanced Micro Devices, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -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 hls makefile-generator v2.0.0

source settings.tcl

Expand All @@ -33,7 +33,6 @@ open_solution -reset $SOLN




set_part $XPART
create_clock -period $CLKP

Expand Down
4 changes: 2 additions & 2 deletions codec/L2/demos/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ Specifying the corresponding Vitis, XRT, and path to the platform repository by

Licensed using the [Apache 2.0 license](https://www.apache.org/licenses/LICENSE-2.0).

Copyright 2022 Xilinx, Inc.
Copyright (C) 2019-2022, Xilinx, Inc.
Copyright (C) 2022-2023, Advanced Micro Devices, Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand All @@ -66,4 +67,3 @@ Licensed using the [Apache 2.0 license](https://www.apache.org/licenses/LICENSE-
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.
Copyright 2022 Xilinx, Inc.
75 changes: 42 additions & 33 deletions codec/L2/demos/jpegDec/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright 2019-2022 Xilinx, Inc.
# Copyright (C) 2019-2022, Xilinx, Inc.
# Copyright (C) 2022-2023, Advanced Micro Devices, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -11,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.8
# vitis makefile-generator v2.0.9

############################## Help Section ##############################
.PHONY: help
Expand All @@ -35,15 +36,15 @@ help::
$(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) " 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."
$(ECHO) ""
$(ECHO) " make cleanall"
$(ECHO) " make cleanall TARGET=<hw/hw_emu/sw_emu/>"
$(ECHO) " Command to remove all the generated files."
$(ECHO) ""

Expand All @@ -67,7 +68,7 @@ PLATFORM := xilinx_u200_gen3x16_xdma_2_202110_1
endif

# #################### Checking if PLATFORM in whitelist ############################
PLATFORM_ALLOWLIST += u200 u50 u280
PLATFORM_ALLOWLIST += u200 u280
PLATFORM_BLOCKLIST += zc

include ./utils.mk
Expand Down Expand Up @@ -102,20 +103,9 @@ CXXFLAGS += $(EXTRA_CXXFLAGS)
VPP_FLAGS += $(EXTRA_VPP_FLAGS)

########################## Setting up Host Variables ##########################
ifeq ($(TARGET),sw_emu)
CXXFLAGS += -D SW_EMU_TEST
endif
ifeq ($(TARGET),hw_emu)
CXXFLAGS += -D HW_EMU_TEST
endif

#Inclue Required Host Source Files
ifneq (,$(shell echo $(XPLATFORM) | awk '/u50/'))
HOST_SRCS += $(XFLIB_DIR)/L2/demos/jpegDec/host/test_decoder.cpp $(XFLIB_DIR)/ext/xcl2/xcl2.cpp
CXXFLAGS += -D USE_HBM
CXXFLAGS += -I $(XFLIB_DIR)/L2/include/hw/jpegDec -I $(XFLIB_DIR)/L2/demos/jpegDec/host -I $(XFLIB_DIR)/L2/demos/jpegDec/kernel -I $(XFLIB_DIR)/../utils/L1/include -I $(XFLIB_DIR)/ext/xcl2
CXXFLAGS += -O3
else ifneq (,$(shell echo $(XPLATFORM) | awk '/u280/'))
ifneq (,$(shell echo $(XPLATFORM) | awk '/u280/'))
HOST_SRCS += $(XFLIB_DIR)/L2/demos/jpegDec/host/test_decoder.cpp $(XFLIB_DIR)/ext/xcl2/xcl2.cpp
CXXFLAGS += -D USE_HBM
CXXFLAGS += -I $(XFLIB_DIR)/L2/include/hw/jpegDec -I $(XFLIB_DIR)/L2/demos/jpegDec/host -I $(XFLIB_DIR)/L2/demos/jpegDec/kernel -I $(XFLIB_DIR)/../utils/L1/include -I $(XFLIB_DIR)/ext/xcl2
Expand All @@ -138,7 +128,7 @@ endif

EXE_NAME := host.exe
EXE_FILE := $(BUILD_DIR)/$(EXE_NAME)
EXE_FILE_DEPS := $(HOST_SRCS) $(EXE_FILE_DEPS)
EXE_FILE_DEPS := $(HOST_SRCS) $(INSTANCE_FILES) $(EXE_FILE_DEPS)

HOST_ARGS := -xclbin $(BUILD_DIR)/kernelJpegDecoder.xclbin -JPEGFile $(CUR_DIR)/images/t0.jpg
ifneq ($(HOST_ARCH), x86)
Expand All @@ -151,10 +141,6 @@ ifneq (,$(shell echo $(XPLATFORM) | awk '/u200/'))
VPP_FLAGS += --config $(CUR_DIR)/conn_u200.cfg
VPP_FLAGS += -I $(XFLIB_DIR)/L2/include/hw/jpegDec -I $(XFLIB_DIR)/../utils/L1/include -I $(XFLIB_DIR)/L2/demos/jpegDec/kernel

else ifneq (,$(shell echo $(XPLATFORM) | awk '/u50/'))
VPP_FLAGS += --config $(CUR_DIR)/conn_u50_u280.cfg
VPP_FLAGS += -I $(XFLIB_DIR)/L2/include/hw/jpegDec -I $(XFLIB_DIR)/../utils/L1/include -I $(XFLIB_DIR)/L2/demos/jpegDec/kernel

else ifneq (,$(shell echo $(XPLATFORM) | awk '/u280/'))
VPP_FLAGS += --config $(CUR_DIR)/conn_u50_u280.cfg
VPP_FLAGS += -I $(XFLIB_DIR)/L2/include/hw/jpegDec -I $(XFLIB_DIR)/../utils/L1/include -I $(XFLIB_DIR)/L2/demos/jpegDec/kernel
Expand Down Expand Up @@ -222,8 +208,8 @@ endif
@echo 'fi' >> $(RUN_SCRIPT)
@echo 'echo "INFO: Embedded host run completed."' >> $(RUN_SCRIPT)
@echo 'exit $$return_code' >> $(RUN_SCRIPT)
DATA_FILE :=
DATA_DIR :=
DATA_FILE := $(custom_data_file)
DATA_DIR := images $(custom_data_dir)
SD_FILES += $(RUN_SCRIPT)
SD_FILES += $(EXE_FILE)
SD_FILES += $(EMCONFIG)
Expand All @@ -249,13 +235,21 @@ 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
#3. General Embeded flow
# 3. AIE_ON_X86 Flow
ifeq ($(pcie_aie), on)
@echo "### ***** running AIE ON_X86 ***** ###"
${VPP} -p $(VPP_PACKAGE) -t ${TARGET} -f ${XPLATFORM} ${AIE_CONTAINER} ${BINARY_CONTAINERS} -o $(BINARY_CONTAINERS_PKG) --package.boot_mode ospi
@echo "### ***** sd_card generation done! ***** ###"
endif
# 4. General Embeded flow
ifeq ($(dfx_hw), off)
ifeq ($(ps_on_x86), off)
ifeq ($(pcie_aie), 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
endif

.PHONY: sd_card
sd_card: $(SD_CARD)
Expand All @@ -269,17 +263,26 @@ 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)

run: all
#hw_emu
ifneq (,$(filter hw_emu, $(TARGET)))
ifeq ($(HOST_ARCH), x86)
ifeq ($(pcie_aie), on)
cp $(AIE_WORK_DIR)/reports/dma_lock_report.json ./
cp $(AIE_WORK_DIR)/ps/c_rts/aie_control_config.json ./
LD_LIBRARY_PATH=$(LIBRARY_PATH):$$LD_LIBRARY_PATH \
XCL_EMULATION_MODE=$(TARGET) $(EXE_FILE) $(HOST_ARGS) $(BINARY_CONTAINERS_PKG)

endif
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))
grep "TEST PASSED, RC=0" $(SD_CARD)/qemu_output.log || exit 1

endif
Expand All @@ -292,7 +295,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))
grep "TEST PASSED, RC=0" $(SD_CARD)/qemu_output.log || exit 1

endif
Expand All @@ -319,7 +322,7 @@ endif

############################## Setting Targets ##############################

.PHONY: clean cleanall emconfig
.PHONY: clean cleanall emconfig gen_instances valid_params
emconfig: $(EMCONFIG)

.PHONY: host
Expand All @@ -336,18 +339,24 @@ else
xclbin: check_vpp check_sysroot $(BINARY_CONTAINERS)
endif

gen_instances: $(INSTANCE_FILES)
@echo "Nothing to generate."

valid_params:
@echo "Nothing to validate."

############################## Cleaning Rules ##############################
cleanh:
-$(RMDIR) $(EXE_FILE) vitis_* TempConfig system_estimate.xtxt *.rpt .run/
-$(RMDIR) src/*.ll _xocc_* .Xil dltmp* xmltmp* *.log *.jou *.wcfg *.wdb sample_link.ini sample_compile.ini obj* bin* *.csv *.jpg *.jpeg *.png
-$(RMDIR) $(EXE_FILE) vitis_* TempConfig system_estimate.xtxt *.rpt .run/ $(INST_TB_FILES)
-$(RMDIR) src/*.ll _xocc_* .Xil dltmp* xmltmp* *.log *.jou *.wcfg *.wdb sample_link.ini sample_compile.ini obj* bin* *.csv *.jpg *.jpeg *.png *.db

cleank:
-$(RMDIR) $(BUILD_DIR)/*.xclbin _vimage *xclbin.run_summary qemu-memory-_* emulation/ _vimage/ pl*start_simulation. sh *.xclbin
-$(RMDIR) _x_temp.*
-$(RMDIR) _x_temp.* _x* $(INST_FILES)

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)
-$(RMDIR) $(AIE_WORK_DIR) $(AIE_PKG_DIR) $(CUR_DIR)/*.xpe $(CUR_DIR)/hw.o $(CUR_DIR)/*.xsa $(CUR_DIR)/xnwOut
-$(RMDIR) *.html $(INSTANCE_FILES)

clean: cleanh
4 changes: 2 additions & 2 deletions codec/L2/demos/jpegDec/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ Table 1 : Jpeg Decoder profiling

Licensed using the [Apache 2.0 license](https://www.apache.org/licenses/LICENSE-2.0).

Copyright 2022 Xilinx, Inc.
Copyright (C) 2019-2022, Xilinx, Inc.
Copyright (C) 2022-2023, Advanced Micro Devices, Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand All @@ -120,4 +121,3 @@ Licensed using the [Apache 2.0 license](https://www.apache.org/licenses/LICENSE-
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.
Copyright 2022 Xilinx, Inc.
Loading

0 comments on commit 42d7d0c

Please sign in to comment.