Skip to content

Commit

Permalink
Squashed 'ultrasound' changes from b0ee140..bf03a6b (#838)
Browse files Browse the repository at this point in the history
bf03a6b Merge pull request Xilinx#96 from tianminr/next
1e4c5b5 modify for os selection
6acfd73 Merge pull request Xilinx#94 from liyuanz/next
f123e12 update
d8dfe53 update
6af59f4 update
8679e83 Merge pull request Xilinx#93 from liyuanz/add_memory2
5f3f2fa update

Co-authored-by: sdausr <[email protected]>
  • Loading branch information
2 people authored and GitHub Enterprise committed Apr 26, 2023
1 parent 42d7d0c commit 312129d
Show file tree
Hide file tree
Showing 75 changed files with 2,831 additions and 2,544 deletions.
19 changes: 11 additions & 8 deletions ultrasound/L2/tests/absV/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 Down Expand Up @@ -56,14 +57,14 @@ XFLIB_DIR = $(XF_PROJ_ROOT)

# setting devault value
TARGET ?= aiesim
HOST_ARCH ?=
HOST_ARCH ?= aarch64

#setting PLATFORM
ifeq ($(PLATFORM),)
PLATFORM := $(DEVICE)
endif
ifeq ($(PLATFORM),)
PLATFORM :=
PLATFORM := xilinx_vck190_base_202310_1
endif

# #################### Checking if PLATFORM in whitelist ############################
Expand Down Expand Up @@ -130,7 +131,9 @@ AIE_CXXFLAGS += $(AIE_CXXFLAGS_INC)
AIE_CONTAINER = $(TEMP_DIR)/libadf.a
AIE_WORK_DIR = $(CUR_DIR)/Work
AIE_PKG_DIR = $(AIE_WORK_DIR)

AIE_CXXFLAGS += -I $(XFLIB_DIR)/L1/include/

$(AIE_WORK_DIR)/ps/c_rts/aie_control_xrt.cpp: $(AIE_CONTAINER)

EXE_FILE_DEPS += $(AIE_CONTAINER)
Expand Down Expand Up @@ -159,7 +162,7 @@ endif
######################### binary container global settings ##########################

############################## Setting Rules for AIE (Building Kernels) ##################
$(AIE_CONTAINER): $(XFLIB_DIR)/L2/tests/absV/test.cpp $(INST_FILES)
$(AIE_CONTAINER): $(XFLIB_DIR)/L2/tests/absV/test.cpp
$(ECHO) "Compiling: libadf.a"
mkdir -p $(dir $@)
$(AIECXX) $(AIE_CXXFLAGS) $^
Expand Down Expand Up @@ -284,7 +287,7 @@ endif

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 @@ -297,7 +300,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 @@ -315,7 +318,7 @@ endif

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

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

.PHONY: host
Expand Down
126 changes: 65 additions & 61 deletions ultrasound/L2/tests/absV/utils.mk
Original file line number Diff line number Diff line change
@@ -1,5 +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 @@ -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.8
# vitis makefile-generator v2.0.9
#
#+-------------------------------------------------------------------------------
# The following parameters are assigned with default values. These parameters can
Expand Down Expand Up @@ -69,23 +69,79 @@ check_device:
then echo "[ERROR]: The device $(PLATFORM_NAME) in blocklist."; exit 1;\
fi;

ifneq (,$(wildcard $(PLATFORM)))
# Use PLATFORM as a file path
XPLATFORM := $(PLATFORM)
else
# Use PLATFORM as a file name pattern
# 1. search paths specified by variable
ifneq (,$(PLATFORM_REPO_PATHS))
# 1.1 as exact name
XPLATFORM := $(strip $(foreach p, $(subst :, ,$(PLATFORM_REPO_PATHS)), $(wildcard $(p)/$(PLATFORM)/$(PLATFORM).xpfm)))
# 1.2 as a pattern
ifeq (,$(XPLATFORM))
XPLATFORMS := $(foreach p, $(subst :, ,$(PLATFORM_REPO_PATHS)), $(wildcard $(p)/*/*.xpfm))
XPLATFORM := $(strip $(foreach p, $(XPLATFORMS), $(shell echo $(p) | awk '$$1 ~ /$(PLATFORM)/')))
endif # 1.2
endif # 1
# 2. search Vitis installation
ifeq (,$(XPLATFORM))
# 2.1 as exact name vitis < 2022.2
XPLATFORM := $(strip $(wildcard $(XILINX_VITIS)/platforms/$(PLATFORM)/$(PLATFORM).xpfm))
ifeq (,$(XPLATFORM))
# 2.2 as exact name vitis >= 2022.2
XPLATFORM := $(strip $(wildcard $(XILINX_VITIS)/base_platforms/$(PLATFORM)/$(PLATFORM).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 ~ /$(PLATFORM)/')))
# 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 ~ /$(PLATFORM)/')))
endif # 2.4
endif # 2.3
endif # 2.2
endif # 2
# 3. search default locations
ifeq (,$(XPLATFORM))
# 3.1 as exact name
XPLATFORM := $(strip $(wildcard /opt/xilinx/platforms/$(PLATFORM)/$(PLATFORM).xpfm))
# 3.2 as a pattern
ifeq (,$(XPLATFORM))
XPLATFORMS := $(wildcard /opt/xilinx/platforms/*/*.xpfm)
XPLATFORM := $(strip $(foreach p, $(XPLATFORMS), $(shell echo $(p) | awk '$$1 ~ /$(PLATFORM)/')))
endif # 3.2
endif # 3
endif

define MSG_PLATFORM
No platform matched pattern '$(PLATFORM)'.
Available platforms are: $(XPLATFORMS)
To add more platform directories, set the PLATFORM_REPO_PATHS variable or point PLATFORM variable to the full path of platform .xpfm file.
endef
export MSG_PLATFORM

.PHONY: check_platform
check_platform:
ifeq (,$(XPLATFORM))
@echo "$${MSG_PLATFORM}" && false
endif
#Check ends

#get HOST_ARCH by PLATFORM
ifneq (,$(PLATFORM))
HOST_ARCH_temp = $(shell platforminfo -p $(PLATFORM) | grep 'CPU Type' | sed 's/.*://' | sed '/ai_engine/d' | sed 's/^[[:space:]]*//')
HOST_ARCH_temp = $(shell platforminfo -p $(XPLATFORM) | grep 'CPU Type' | sed 's/.*://' | sed '/ai_engine/d' | sed 's/^[[:space:]]*//')
ifeq ($(HOST_ARCH_temp), x86)
HOST_ARCH := x86
else ifeq ($(HOST_ARCH_temp), cortex-a9)
HOST_ARCH := aarch32
else ifneq (,$(findstring cortex-a, $(HOST_ARCH_temp)))
HOST_ARCH := aarch64
endif
endif



# 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)
AIE_TYPE := $(shell platforminfo $(PLATFORM) -f -j | grep "arch.:" | sed 's|"arch":||g' | sed 's|["|,]||g')
AIE_TYPE := $(shell platforminfo $(XPLATFORM) -f -j | grep "arch.:" | sed 's|"arch":||g' | sed 's|["|,]||g')
ifeq (AIE ,$(findstring AIE, $(AIE_TYPE)))
HAS_AIE := on
else
Expand Down Expand Up @@ -280,58 +336,6 @@ LD_LIBRARY_PATH := $(XILINX_XRT)/lib:$(LD_LIBRARY_PATH)
endif
endif

ifneq (,$(wildcard $(PLATFORM)))
# Use PLATFORM as a file path
XPLATFORM := $(PLATFORM)
else
# Use PLATFORM as a file name pattern
# 1. search paths specified by variable
ifneq (,$(PLATFORM_REPO_PATHS))
# 1.1 as exact name
XPLATFORM := $(strip $(foreach p, $(subst :, ,$(PLATFORM_REPO_PATHS)), $(wildcard $(p)/$(PLATFORM)/$(PLATFORM).xpfm)))
# 1.2 as a pattern
ifeq (,$(XPLATFORM))
XPLATFORMS := $(foreach p, $(subst :, ,$(PLATFORM_REPO_PATHS)), $(wildcard $(p)/*/*.xpfm))
XPLATFORM := $(strip $(foreach p, $(XPLATFORMS), $(shell echo $(p) | awk '$$1 ~ /$(PLATFORM)/')))
endif # 1.2
endif # 1
# 2. search Vitis installation
ifeq (,$(XPLATFORM))
# 2.1 as exact name
XPLATFORM := $(strip $(wildcard $(XILINX_VITIS)/platforms/$(PLATFORM)/$(PLATFORM).xpfm))
# 2.2 as a pattern
ifeq (,$(XPLATFORM))
XPLATFORMS := $(wildcard $(XILINX_VITIS)/platforms/*/*.xpfm)
XPLATFORM := $(strip $(foreach p, $(XPLATFORMS), $(shell echo $(p) | awk '$$1 ~ /$(PLATFORM)/')))
endif # 2.2
endif # 2
# 3. search default locations
ifeq (,$(XPLATFORM))
# 3.1 as exact name
XPLATFORM := $(strip $(wildcard /opt/xilinx/platforms/$(PLATFORM)/$(PLATFORM).xpfm))
# 3.2 as a pattern
ifeq (,$(XPLATFORM))
XPLATFORMS := $(wildcard /opt/xilinx/platforms/*/*.xpfm)
XPLATFORM := $(strip $(foreach p, $(XPLATFORMS), $(shell echo $(p) | awk '$$1 ~ /$(PLATFORM)/')))
endif # 3.2
endif # 3
endif

define MSG_PLATFORM
No platform matched pattern '$(PLATFORM)'.
Available platforms are: $(XPLATFORMS)
To add more platform directories, set the PLATFORM_REPO_PATHS variable or point PLATFORM variable to the full path of platform .xpfm file.
endef
export MSG_PLATFORM


.PHONY: check_platform
check_platform:
ifeq (,$(XPLATFORM))
@echo "$${MSG_PLATFORM}" && false
endif
#Check ends

# Cleaning stuff
RM = rm -f
RMDIR = rm -rf
Expand Down
24 changes: 13 additions & 11 deletions ultrasound/L2/tests/apodization/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 Down Expand Up @@ -130,8 +131,9 @@ AIE_CXXFLAGS += $(AIE_CXXFLAGS_INC)
AIE_CONTAINER = $(TEMP_DIR)/libadf.a
AIE_WORK_DIR = $(CUR_DIR)/Work
AIE_PKG_DIR = $(AIE_WORK_DIR)
AIE_CXXFLAGS += -I $(XFLIB_DIR)/L1/include/
AIE_CXXFLAGS += -I $(XFLIB_DIR)/L2/include/

AIE_CXXFLAGS += -I $(XFLIB_DIR)/L1/include/ -I $(XFLIB_DIR)/L2/include/

$(AIE_WORK_DIR)/ps/c_rts/aie_control_xrt.cpp: $(AIE_CONTAINER)

EXE_FILE_DEPS += $(AIE_CONTAINER)
Expand All @@ -145,12 +147,12 @@ ifeq ($(ps_on_x86), on)
HOST_SRCS += $(XFLIB_DIR)/L2/tests/apodization/PS_host/host.cpp $(CUR_DIR)/Work/ps/c_rts/aie_control_xrt.cpp
CXXFLAGS += -D __PS_ENABLE_AIE__
CXXFLAGS += -I $(XFLIB_DIR)/L1/include -I $(XFLIB_DIR)/L2/include -I $(XFLIB_DIR)/L2/tests/apodization/aie_graph
CXXFLAGS += -include $(XFLIB_DIR)/L1/include/kernels.hpp
CXXFLAGS += -include $(XFLIB_DIR)/L1/include/kernels.hpp
else
HOST_SRCS += $(XFLIB_DIR)/L2/tests/apodization/PS_host/host.cpp $(CUR_DIR)/Work/ps/c_rts/aie_control_xrt.cpp
CXXFLAGS += -D __PS_ENABLE_AIE__
CXXFLAGS += -I $(XFLIB_DIR)/L1/include -I $(XFLIB_DIR)/L2/include -I $(XFLIB_DIR)/L2/tests/apodization/aie_graph
CXXFLAGS += -include $(XFLIB_DIR)/L1/include/kernels.hpp
CXXFLAGS += -include $(XFLIB_DIR)/L1/include/kernels.hpp
endif

# workaround for opencv
Expand Down Expand Up @@ -234,7 +236,7 @@ $(BINARY_CONTAINERS): $(BINARY_CONTAINERS_DEPS)
$(VPP) -l $(VPP_FLAGS) --temp_dir $(TEMP_DIR) --report_dir $(BUILD_REPORT_DIR)/apodization $(VPP_LDFLAGS) $(VPP_LDFLAGS_apodization) $(AIE_LDFLAGS) -o $@ $^

############################## Setting Rules for AIE (Building Kernels) ##################
$(AIE_CONTAINER): $(XFLIB_DIR)/L2/tests/apodization/aie_graph/graph.cpp $(INST_FILES)
$(AIE_CONTAINER): $(XFLIB_DIR)/L2/tests/apodization/aie_graph/graph.cpp
$(ECHO) "Compiling: libadf.a"
mkdir -p $(dir $@)
$(AIECXX) $(AIE_CXXFLAGS) $^
Expand Down Expand Up @@ -272,7 +274,7 @@ endif
@echo 'echo "INFO: Embedded host run completed."' >> $(RUN_SCRIPT)
@echo 'exit $$return_code' >> $(RUN_SCRIPT)
DATA_FILE := $(custom_data_file)
DATA_DIR := $(CUR_DIR)//data $(custom_data_dir)
DATA_DIR := $(CUR_DIR)/data $(custom_data_dir)
SD_FILES += $(RUN_SCRIPT)
SD_FILES += $(EXE_FILE)
SD_FILES += $(EMCONFIG)
Expand Down Expand Up @@ -359,7 +361,7 @@ endif

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 @@ -372,7 +374,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 @@ -399,7 +401,7 @@ endif

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

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

.PHONY: host
Expand Down
Loading

0 comments on commit 312129d

Please sign in to comment.