Skip to content

Commit

Permalink
Squashed 'hpc' changes from 0dcda94..99206d5 (#728)
Browse files Browse the repository at this point in the history
99206d5 Merge pull request #155 from RepoOps/update_readme_5
82bd621 update README
b5ef682 update README
7b500f9 Merge pull request #154 from liyuanz/next
037e51a update description.json
5872eb0 Merge pull request #153 from tuol/cr_1143013_3
aa45dfe lower freq
42b28e6 Merge pull request #152 from RepoOps/update_doc_url_3
7b44d6c fix urk
42d5a75 Merge pull request #147 from RepoOps/update_doc_url_3
862bb40 Merge pull request #151 from tuol/cr_1143013
1f81ca6 fix frequency
a38e08c Merge pull request #150 from liyuanz/next
76cded4 add memory
4e4d7e4 Merge pull request #149 from tuol/cr_1140566
b212735 remove broken sym link
3896c56 Merge pull request #148 from tuol/cr_1142096
0ec8716 fix hw_build of L3/tests/rtm2d
48dee48 update url and branch in doc
13991c5 Merge pull request #146 from tuol/fix_version
79a503b update version to 2022.2
e44f356 Merge pull request #143 from RepoOps/update_makefile_20220908-212141
e2ab4a4 Merge branch 'next' into update_makefile_20220908-212141
327cbd9 update Makefile with 2.0.8 version

Co-authored-by: sdausr <[email protected]>
  • Loading branch information
2 people authored and GitHub Enterprise committed Oct 21, 2022
1 parent 8dfc103 commit f3b2773
Show file tree
Hide file tree
Showing 84 changed files with 1,148 additions and 1,475 deletions.
4 changes: 2 additions & 2 deletions hpc/L1/tests/hw/cgSolver/test_gemv/description.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"env": "",
"index": 0,
"max_memory_MB": {
"vivado_syn": 16384,
"vivado_syn": 32768,
"hls_csim": 10240,
"hls_cosim": 16384,
"vivado_impl": 16384,
Expand All @@ -56,4 +56,4 @@
"vivado_impl"
]
}
}
}
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"
}
}
10 changes: 5 additions & 5 deletions hpc/L2/benchmarks/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,20 @@ several FPGA and CPU platforms. It supports software and hardware emulation as w
- Vitis BLAS library is required to build any projects in Vitis HPC library
- According to the benchmark application, Alveo U250, U280 or U50 need to be installed and correctly configured.
- Xilinx runtime (XRT) installed
- Xilinx Vitis 2021.2 installed and configured
- Xilinx Vitis 2022.2 installed and configured

## Building

Here is an example to indicate how to build the application and kernel with the command line Makefile flow.

### Download code

These benchmarks can be downloaded from [vitis libraries](https://github.com/Xilinx/Vitis_Libraries.git) ``master`` branch.
These benchmarks can be downloaded from [vitis libraries](https://github.com/Xilinx/Vitis_Libraries.git) ``main`` branch.

```
git clone https://github.com/Xilinx/Vitis_Libraries.git
cd Vitis_Libraries
git checkout master
git checkout main
cd hpc
```

Expand All @@ -32,13 +32,13 @@ These benchmarks can be downloaded from [vitis libraries](https://github.com/Xil
Specifying the corresponding Vitis, XRT, and path to the platform repository by running following commands.

```
source <intstall_path>/installs/lin64/Vitis/2020.2/settings64.sh
source <intstall_path>/installs/lin64/Vitis/2022.2/settings64.sh
source /opt/xilinx/xrt/setup.sh
export PLATFORM_REPO_PATHS=/opt/xilinx/platforms
```

### Python 3.6+
Follow the steps as per https://xilinx.github.io/Vitis_Libraries/blas/2021.2/user_guide/L1/pyenvguide.html to set up Python3 environment.
Follow the steps as per https://docs.xilinx.com/r/en-US/Vitis_Libraries/blas/user_guide/L1/pyenvguide.html to set up Python3 environment.

### Datasets
- For dense matrix conjugate gradient solver, data are randomly generated during benchmark
Expand Down
64 changes: 21 additions & 43 deletions hpc/L2/benchmarks/cg_gemv_jacobi/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,28 +11,24 @@
# 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.7
# vitis makefile-generator v2.0.8

############################## Help Section ##############################
.PHONY: help

help::
$(ECHO) "Makefile Usage:"
$(ECHO) " make all TARGET=<hw/> PLATFORM=<FPGA platform> HOST_ARCH=<x86>"
$(ECHO) " make all TARGET=<hw/> PLATFORM=<FPGA 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=<hw/> PLATFORM=<FPGA platform> HOST_ARCH=<x86>"
$(ECHO) " make run TARGET=<hw/> PLATFORM=<FPGA 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=<hw/> PLATFORM=<FPGA platform> HOST_ARCH=<x86>"
$(ECHO) " make xclbin TARGET=<hw/> PLATFORM=<FPGA 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=<hw/>"
$(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, HOST_ARCH is either aarch32 or aarch64."
$(ECHO) " a.IF Download the platform, and common-image from Xilinx Download Center(Suggested):"
Expand Down Expand Up @@ -97,13 +93,8 @@ LDFLAGS += -pthread -L$(XILINX_XRT)/lib -L$(XILINX_HLS)/lnx64/tools/fpo_v7_1 -Wl
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 -Wl,--as-needed -lxilinxopencl -lxrt_coreutil
endif
VPP_FLAGS += -t $(TARGET) --platform $(XPLATFORM) --save-temps
VPP_LDFLAGS += --optimize 2 -R 2
endif
Expand Down Expand Up @@ -169,7 +160,7 @@ VPP_FLAGS_krnl_update_xk += --hls.clock 333000000:krnl_update_xk
VPP_FLAGS_krnl_update_rk_jacobi += --hls.clock 333000000:krnl_update_rk_jacobi
VPP_FLAGS_krnl_update_pk += --hls.clock 333000000:krnl_update_pk
VPP_FLAGS_krnl_control += --hls.clock 333000000:krnl_control
ifneq ($(HOST_ARCH), x86)
ifneq ($(HOST_ARCH_temp), x86)
VPP_LDFLAGS_cgSolver += --clock.defaultFreqHz 333000000
else
VPP_LDFLAGS_cgSolver += --kernel_frequency 333
Expand All @@ -185,7 +176,7 @@ VPP_FLAGS_krnl_update_xk += --hls.clock 333000000:krnl_update_xk
VPP_FLAGS_krnl_update_rk_jacobi += --hls.clock 333000000:krnl_update_rk_jacobi
VPP_FLAGS_krnl_update_pk += --hls.clock 333000000:krnl_update_pk
VPP_FLAGS_krnl_control += --hls.clock 333000000:krnl_control
ifneq ($(HOST_ARCH), x86)
ifneq ($(HOST_ARCH_temp), x86)
VPP_LDFLAGS_cgSolver += --clock.defaultFreqHz 333000000
else
VPP_LDFLAGS_cgSolver += --kernel_frequency 333
Expand All @@ -205,7 +196,7 @@ VPP_LDFLAGS_cgSolver_temp := --config $(CUR_DIR)/opts.cfg
VPP_LDFLAGS_cgSolver += $(VPP_LDFLAGS_cgSolver_temp)

endif
ifeq ($(HOST_ARCH), x86)
ifneq ($(SD_CARD_NEEDED), on)
BINARY_CONTAINERS += $(BUILD_DIR)/cgSolver.xclbin
else
BINARY_CONTAINERS += $(BUILD_DIR)/cgSolver_pkg.$(LINK_TARGET_FMT)
Expand Down Expand Up @@ -254,22 +245,15 @@ $(BINARY_CONTAINERS): $(BINARY_CONTAINERS_DEPS)
$(VPP) -l $(VPP_FLAGS) --temp_dir $(TEMP_DIR) --report_dir $(BUILD_REPORT_DIR)/cgSolver $(VPP_LDFLAGS) $(VPP_LDFLAGS_cgSolver) $(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)
ifeq ($(SD_CARD_NEEDED), on)
RUN_SCRIPT := $(BUILD_DIR)/run_script.sh
$(RUN_SCRIPT):
rm -rf $(RUN_SCRIPT)
Expand Down Expand Up @@ -303,7 +287,7 @@ 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)
$(SD_CARD): $(EXE_FILE) $(BINARY_CONTAINERS) $(RUN_SCRIPT) $(EMCONFIG) check_kimage check_rootfs
$(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
Expand All @@ -330,15 +314,15 @@ endif
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
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)))
Expand All @@ -348,8 +332,8 @@ ifeq ($(HOST_ARCH), x86)

else
@echo $(RUN_DEPS)
$(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
$(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
Expand All @@ -359,17 +343,11 @@ 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)) 2>&1 | tee $(SD_CARD)/qemu_output.log
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
endif
#hw
Expand Down Expand Up @@ -399,16 +377,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 ##############################
Expand Down
38 changes: 23 additions & 15 deletions hpc/L2/benchmarks/cg_gemv_jacobi/utils.mk
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,11 @@ 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:
Expand Down Expand Up @@ -83,6 +79,7 @@ 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)
# 1) for versal flow from 2022.1
Expand All @@ -109,8 +106,28 @@ 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
Expand Down Expand Up @@ -162,17 +179,8 @@ ifeq (,$(wildcard $(ROOTFS)))
endif
endif

#Checks for 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 ($(HOST_ARCH), x86)
ifeq ($(shell expr $(VITIS_VER) \>= 2022.1), 1)
CXX_VER := 8.3.0
else
Expand Down
Loading

0 comments on commit f3b2773

Please sign in to comment.