├── .gitmodules ├── xilinx ├── latency │ ├── run │ ├── xrt.ini │ ├── utils.mk │ └── Makefile ├── bucket_bica64 │ ├── run │ ├── xrt.ini │ └── utils.mk ├── dfs_baseline │ ├── run │ ├── xrt.ini │ ├── utils.mk │ └── Makefile ├── dfs_bipa8 │ ├── run │ ├── xrt.ini │ ├── utils.mk │ └── Makefile ├── mv_pc28_u280 │ ├── run │ └── utils.mk ├── radix_bica64 │ ├── run │ └── utils.mk ├── seq_u280_ch30 │ ├── run │ ├── utils.mk │ └── Makefile ├── bsearch_baseline │ ├── run │ ├── utils.mk │ └── Makefile ├── bsearch_bipa16 │ ├── run │ ├── xrt.ini │ ├── utils.mk │ └── Makefile ├── bucket_baseline │ ├── run │ ├── xrt.ini │ └── utils.mk ├── multiunicast8x8 │ ├── run │ ├── xrt.ini │ └── utils.mk ├── mv_pc24_u50 │ ├── run │ └── utils.mk ├── radix_baseline │ ├── run │ └── utils.mk ├── seq_u280_ch30_64b │ ├── run │ ├── utils.mk │ └── Makefile ├── strided_u280_ch30 │ ├── run │ ├── utils.mk │ └── Makefile ├── seq_u50_ch24 │ ├── run │ ├── utils.mk │ └── Makefile └── common │ ├── includes │ ├── xcl2 │ │ ├── xcl2.mk │ │ ├── xcl2.cpp │ │ └── xcl2.hpp │ ├── bitmap │ │ ├── bitmap.mk │ │ ├── bitmap.h │ │ └── bitmap.cpp │ ├── logger │ │ ├── logger.mk │ │ ├── logger.h │ │ └── logger.cpp │ ├── lodepng │ │ └── lodepng.mk │ ├── simplebmp │ │ ├── simplebmp.mk │ │ ├── simplebmp.h │ │ └── simplebmp.cpp │ ├── cmdparser │ │ ├── cmdparser.mk │ │ └── cmdlineparser.h │ ├── oclHelper │ │ ├── oclHelper.mk │ │ ├── oclHelper.h │ │ └── oclErrorCodes.cpp │ └── opencl │ │ └── opencl.mk │ └── utility │ ├── readme_gen │ ├── gs_summary.py │ ├── gs_summary_subdir.py │ ├── update_all_readme.sh │ ├── gs_summary_util.py │ └── readme_gen.py │ ├── parse_platform_list.py │ ├── check_target_device.py │ ├── makefile_gen │ ├── update_makegen_all.sh │ ├── update_descgen_all.sh │ └── descgen.py │ ├── device_list.py │ ├── build_what.sh │ ├── md2rst │ └── update_md2rst_all.sh │ ├── check_license.sh │ ├── Consolidation.py │ ├── check_readme.sh │ ├── check_makefile.sh │ ├── check_descr.py │ ├── check_json.py │ └── create_catalog.py └── README.md /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "stencil"] 2 | path = stencil 3 | url = https://github.com/UCLA-VAST/hbmbench-stencil.git 4 | -------------------------------------------------------------------------------- /xilinx/latency/run: -------------------------------------------------------------------------------- 1 | make all TARGET=hw 2 | cp ./build_dir.hw.xilinx_u280_xdma_201920_3/vadd.xclbin . 3 | ./host vadd.xclbin 4 | -------------------------------------------------------------------------------- /xilinx/bucket_bica64/run: -------------------------------------------------------------------------------- 1 | make all TARGET=hw 2 | cp ./build_dir.hw.xilinx_u280_xdma_201920_3/vadd.xclbin . 3 | ./host vadd.xclbin 4 | -------------------------------------------------------------------------------- /xilinx/dfs_baseline/run: -------------------------------------------------------------------------------- 1 | make all TARGET=hw 2 | cp ./build_dir.hw.xilinx_u280_xdma_201920_3/vadd.xclbin . 3 | ./host vadd.xclbin 4 | -------------------------------------------------------------------------------- /xilinx/dfs_bipa8/run: -------------------------------------------------------------------------------- 1 | make all TARGET=hw 2 | cp ./build_dir.hw.xilinx_u280_xdma_201920_3/vadd.xclbin . 3 | ./host vadd.xclbin 4 | -------------------------------------------------------------------------------- /xilinx/mv_pc28_u280/run: -------------------------------------------------------------------------------- 1 | make all TARGET=hw 2 | cp ./build_dir.hw.xilinx_u280_xdma_201920_3/vadd.xclbin . 3 | ./host vadd.xclbin 4 | -------------------------------------------------------------------------------- /xilinx/radix_bica64/run: -------------------------------------------------------------------------------- 1 | make all TARGET=hw 2 | cp ./build_dir.hw.xilinx_u280_xdma_201920_3/vadd.xclbin . 3 | ./host vadd.xclbin 4 | -------------------------------------------------------------------------------- /xilinx/seq_u280_ch30/run: -------------------------------------------------------------------------------- 1 | make all TARGET=hw 2 | cp ./build_dir.hw.xilinx_u280_xdma_201920_3/vadd.xclbin . 3 | ./host vadd.xclbin 4 | -------------------------------------------------------------------------------- /xilinx/bsearch_baseline/run: -------------------------------------------------------------------------------- 1 | make all TARGET=hw 2 | cp ./build_dir.hw.xilinx_u280_xdma_201920_3/vadd.xclbin . 3 | ./host vadd.xclbin 4 | -------------------------------------------------------------------------------- /xilinx/bsearch_bipa16/run: -------------------------------------------------------------------------------- 1 | make all TARGET=hw 2 | cp ./build_dir.hw.xilinx_u280_xdma_201920_3/vadd.xclbin . 3 | ./host vadd.xclbin 4 | -------------------------------------------------------------------------------- /xilinx/bucket_baseline/run: -------------------------------------------------------------------------------- 1 | make all TARGET=hw 2 | cp ./build_dir.hw.xilinx_u280_xdma_201920_3/vadd.xclbin . 3 | ./host vadd.xclbin 4 | -------------------------------------------------------------------------------- /xilinx/multiunicast8x8/run: -------------------------------------------------------------------------------- 1 | make all TARGET=hw 2 | cp ./build_dir.hw.xilinx_u280_xdma_201920_3/vadd.xclbin . 3 | ./host vadd.xclbin 4 | -------------------------------------------------------------------------------- /xilinx/mv_pc24_u50/run: -------------------------------------------------------------------------------- 1 | make all TARGET=hw 2 | cp ./build_dir.hw.xilinx_u50_gen3x16_xdma_201920_3/vadd.xclbin . 3 | ./host vadd.xclbin 4 | -------------------------------------------------------------------------------- /xilinx/radix_baseline/run: -------------------------------------------------------------------------------- 1 | make all TARGET=hw 2 | cp ./build_dir.hw.xilinx_u280_xdma_201920_3/vadd.xclbin . 3 | ./host vadd.xclbin 4 | -------------------------------------------------------------------------------- /xilinx/seq_u280_ch30_64b/run: -------------------------------------------------------------------------------- 1 | make all TARGET=hw 2 | cp ./build_dir.hw.xilinx_u280_xdma_201920_3/vadd.xclbin . 3 | ./host vadd.xclbin 4 | -------------------------------------------------------------------------------- /xilinx/strided_u280_ch30/run: -------------------------------------------------------------------------------- 1 | make all TARGET=hw 2 | cp ./build_dir.hw.xilinx_u280_xdma_201920_3/vadd.xclbin . 3 | ./host vadd.xclbin 4 | -------------------------------------------------------------------------------- /xilinx/seq_u50_ch24/run: -------------------------------------------------------------------------------- 1 | make all TARGET=hw 2 | cp ./build_dir.hw.xilinx_u50_gen3x16_xdma_201920_3/vadd.xclbin . 3 | ./host vadd.xclbin 4 | -------------------------------------------------------------------------------- /xilinx/common/includes/xcl2/xcl2.mk: -------------------------------------------------------------------------------- 1 | xcl2_SRCS:=${COMMON_REPO}/common/includes/xcl2/xcl2.cpp 2 | xcl2_HDRS:=${COMMON_REPO}/common/includes/xcl2/xcl2.hpp 3 | 4 | xcl2_CXXFLAGS:=-I${COMMON_REPO}/common/includes/xcl2 5 | -------------------------------------------------------------------------------- /xilinx/latency/xrt.ini: -------------------------------------------------------------------------------- 1 | [Emulation] 2 | ;launch_waveform = batch 3 | ;launch_waveform = off 4 | launch_waveform = gui 5 | 6 | [Debug] 7 | profile = true 8 | timeline_trace = true 9 | data_transfer_trace = fine 10 | -------------------------------------------------------------------------------- /xilinx/dfs_baseline/xrt.ini: -------------------------------------------------------------------------------- 1 | [Emulation] 2 | ;launch_waveform = batch 3 | ;launch_waveform = off 4 | launch_waveform = gui 5 | 6 | [Debug] 7 | profile = true 8 | timeline_trace = true 9 | data_transfer_trace = fine 10 | -------------------------------------------------------------------------------- /xilinx/dfs_bipa8/xrt.ini: -------------------------------------------------------------------------------- 1 | [Emulation] 2 | ;launch_waveform = batch 3 | ;launch_waveform = off 4 | launch_waveform = gui 5 | 6 | [Debug] 7 | profile = true 8 | timeline_trace = true 9 | data_transfer_trace = fine 10 | -------------------------------------------------------------------------------- /xilinx/bsearch_bipa16/xrt.ini: -------------------------------------------------------------------------------- 1 | [Emulation] 2 | ;launch_waveform = batch 3 | ;launch_waveform = off 4 | launch_waveform = gui 5 | 6 | [Debug] 7 | profile = true 8 | timeline_trace = true 9 | data_transfer_trace = fine 10 | -------------------------------------------------------------------------------- /xilinx/bucket_baseline/xrt.ini: -------------------------------------------------------------------------------- 1 | [Emulation] 2 | ;launch_waveform = batch 3 | ;launch_waveform = off 4 | launch_waveform = gui 5 | 6 | [Debug] 7 | profile = true 8 | timeline_trace = true 9 | data_transfer_trace = fine 10 | -------------------------------------------------------------------------------- /xilinx/bucket_bica64/xrt.ini: -------------------------------------------------------------------------------- 1 | [Emulation] 2 | ;launch_waveform = batch 3 | ;launch_waveform = off 4 | launch_waveform = gui 5 | 6 | [Debug] 7 | profile = true 8 | timeline_trace = true 9 | data_transfer_trace = fine 10 | -------------------------------------------------------------------------------- /xilinx/common/includes/bitmap/bitmap.mk: -------------------------------------------------------------------------------- 1 | bitmap_SRCS:=${COMMON_REPO}/common/includes/bitmap/bitmap.cpp 2 | bitmap_HDRS:=${COMMON_REPO}/common/includes/bitmap/bitmap.h 3 | bitmap_CXXFLAGS:=-I${COMMON_REPO}/common/includes/bitmap 4 | -------------------------------------------------------------------------------- /xilinx/common/includes/logger/logger.mk: -------------------------------------------------------------------------------- 1 | logger_SRCS:=${COMMON_REPO}/common/includes/logger/logger.cpp 2 | logger_HDRS:=${COMMON_REPO}/common/includes/logger/logger.h 3 | logger_CXXFLAGS:=-I${COMMON_REPO}/common/includes/logger 4 | -------------------------------------------------------------------------------- /xilinx/multiunicast8x8/xrt.ini: -------------------------------------------------------------------------------- 1 | [Emulation] 2 | ;launch_waveform = batch 3 | ;launch_waveform = off 4 | launch_waveform = gui 5 | 6 | [Debug] 7 | profile = true 8 | timeline_trace = true 9 | data_transfer_trace = fine 10 | -------------------------------------------------------------------------------- /xilinx/common/includes/lodepng/lodepng.mk: -------------------------------------------------------------------------------- 1 | lodepng_SRCS:=${COMMON_REPO}/common/includes/lodepng/lodepng.cpp 2 | lodepng_HDRS:=${COMMON_REPO}/common/includes/lodepng/lodepng.h 3 | lodepng_CXXFLAGS:=-I${COMMON_REPO}/common/includes/lodepng 4 | -------------------------------------------------------------------------------- /xilinx/common/includes/simplebmp/simplebmp.mk: -------------------------------------------------------------------------------- 1 | simplebmp_SRCS:=${COMMON_REPO}/common/includes/simplebmp/simplebmp.cpp 2 | simplebmp_HDRS:=${COMMON_REPO}/common/includes/simplebmp/simplebmp.h 3 | simplebmp_CXXFLAGS:=-I${COMMON_REPO}/common/includes/simplebmp 4 | -------------------------------------------------------------------------------- /xilinx/common/includes/cmdparser/cmdparser.mk: -------------------------------------------------------------------------------- 1 | cmdparser_SRCS:=${COMMON_REPO}/common/includes/cmdparser/cmdlineparser.cpp 2 | cmdparser_HDRS:=${COMMON_REPO}/common/includes/cmdparser/cmdlineparser.h 3 | cmdparser_CXXFLAGS:=-I${COMMON_REPO}/common/includes/cmdparser 4 | -------------------------------------------------------------------------------- /xilinx/common/includes/oclHelper/oclHelper.mk: -------------------------------------------------------------------------------- 1 | oclHelper_SRCS:=${COMMON_REPO}/common/includes/oclHelper/oclHelper.cpp ${COMMON_REPO}/common/includes/oclHelper/oclErrorCodes.cpp 2 | oclHelper_HDRS:=${COMMON_REPO}/common/includes/oclHelper/oclHelper.h 3 | oclHelper_CXXFLAGS:=-I${COMMON_REPO}/common/includes/oclHelper 4 | -------------------------------------------------------------------------------- /xilinx/common/utility/readme_gen/gs_summary.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import os, re 4 | import fnmatch 5 | import json 6 | import sys 7 | 8 | # To avoid .pyc files 9 | sys.dont_write_bytecode = True 10 | 11 | sys.path.append(".") 12 | import gs_summary_util 13 | 14 | gs_summary_util.genReadMe(".") 15 | -------------------------------------------------------------------------------- /xilinx/common/utility/readme_gen/gs_summary_subdir.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import os, re 4 | import fnmatch 5 | import json 6 | import sys 7 | 8 | # To avoid .pyc files 9 | sys.dont_write_bytecode = True 10 | 11 | sys.path.append(".") 12 | import gs_summary_util 13 | 14 | gs_summary_util.genReadMe2(".") 15 | -------------------------------------------------------------------------------- /xilinx/common/utility/parse_platform_list.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | import os 3 | import sys 4 | 5 | def main (): 6 | dev = sys.argv[1] 7 | if "PLATFORM_REPO_PATHS" in os.environ: 8 | plist = os.environ['PLATFORM_REPO_PATHS'].split(":") 9 | for shell in plist: 10 | if os.path.isdir(shell + "/" + dev): 11 | return shell 12 | 13 | print (main()) 14 | -------------------------------------------------------------------------------- /xilinx/common/includes/opencl/opencl.mk: -------------------------------------------------------------------------------- 1 | # Definition of include file locations 2 | xrt_path = $(XILINX_XRT) 3 | ifneq ($(HOST_ARCH), x86) 4 | xrt_path = $(SYSROOT)/usr/ 5 | endif 6 | 7 | OPENCL_INCLUDE:= $(xrt_path)/include 8 | ifneq ($(HOST_ARCH), x86) 9 | OPENCL_INCLUDE:= $(xrt_path)/include/xrt 10 | endif 11 | 12 | VIVADO_INCLUDE:= $(XILINX_VIVADO)/include 13 | opencl_CXXFLAGS=-I$(OPENCL_INCLUDE) -I$(VIVADO_INCLUDE) 14 | OPENCL_LIB:= $(xrt_path)/lib 15 | opencl_LDFLAGS=-L$(OPENCL_LIB) -lOpenCL -lpthread 16 | -------------------------------------------------------------------------------- /xilinx/common/utility/check_target_device.py: -------------------------------------------------------------------------------- 1 | import json, sys 2 | 3 | descriptionfile = sys.argv[1] 4 | target = sys.argv[2] 5 | device = sys.argv[3] 6 | 7 | with open(descriptionfile) as json_file: 8 | data = json.load(json_file) 9 | 10 | targetNotSupported = 'targets' in data and target not in data['targets'] 11 | if targetNotSupported: 12 | print("%s target not supported for this example" % target) 13 | 14 | deviceNotSupported = 'nboard' in data and any(nboard in device for nboard in data['nboard']) 15 | if deviceNotSupported: 16 | print("%s device not supported for this example" % device) 17 | 18 | sys.exit(not(targetNotSupported or deviceNotSupported)) 19 | -------------------------------------------------------------------------------- /xilinx/common/utility/makefile_gen/update_makegen_all.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | appDir=$(dirname $(dirname $(dirname $(readlink -f $0)))) 3 | 4 | echo "-----------------------" 5 | echo "-- UPDATING MAKEFILES --" 6 | echo "-----------------------" 7 | 8 | update_file() { 9 | ignore=0 10 | 11 | for i in $IGNORE; do 12 | if [[ $1 =~ ^description.json ]]; then 13 | ignore=1 14 | fi 15 | done 16 | 17 | if [[ $VERBOSE == "true" ]]; then 18 | echo -n "Checking $1 ... " 19 | fi 20 | if [[ $ignore == 1 ]]; then 21 | if [[ $VERBOSE == "true" ]]; then 22 | echo "SKIP" 23 | fi 24 | else 25 | pushd . > /dev/null 26 | cd $(dirname $1) 27 | $appDir/utility/makefile_gen/makegen.py description.json #> /dev/null 2>&1 28 | popd >/dev/null 29 | fi 30 | } 31 | 32 | 33 | VCS_FILES=$(git ls-files) 34 | 35 | for f in $VCS_FILES; do 36 | if [[ ($f == */description.json) ]]; then 37 | if grep -q '"match_makefile": "false"' $f; then 38 | echo $f 39 | echo "Makefile Manually Edited:: AutoMakefile Generator Failed" 40 | else 41 | echo $f 42 | update_file $(readlink -f $f) 43 | fi 44 | fi 45 | done 46 | -------------------------------------------------------------------------------- /xilinx/common/utility/makefile_gen/update_descgen_all.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | appDir=$(dirname $(dirname $(dirname $(readlink -f $0)))) 3 | 4 | echo "-----------------------" 5 | echo "-- UPDATING MAKEFILES --" 6 | echo "-----------------------" 7 | 8 | update_file() { 9 | ignore=0 10 | 11 | for i in $IGNORE; do 12 | if [[ $1 =~ ^description.json ]]; then 13 | ignore=1 14 | fi 15 | done 16 | 17 | if [[ $VERBOSE == "true" ]]; then 18 | echo -n "Checking $1 ... " 19 | fi 20 | if [[ $ignore == 1 ]]; then 21 | if [[ $VERBOSE == "true" ]]; then 22 | echo "SKIP" 23 | fi 24 | else 25 | pushd . > /dev/null 26 | cd $(dirname $1) 27 | $appDir/utility/makefile_gen/descgen.py description.json #> /dev/null 2>&1 28 | popd >/dev/null 29 | fi 30 | } 31 | 32 | 33 | VCS_FILES=$(git ls-files) 34 | 35 | for f in $VCS_FILES; do 36 | if [[ ($f == */description.json) ]]; then 37 | if grep -q '"match_makefile": "false"' $f; then 38 | echo $f 39 | echo "Makefile Manually Edited:: AutoMakefile Generator Failed" 40 | else 41 | echo $f 42 | update_file $(readlink -f $f) 43 | fi 44 | fi 45 | done 46 | -------------------------------------------------------------------------------- /xilinx/common/utility/readme_gen/update_all_readme.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # This script regenerates all of the README files in the Vitis example repository 3 | # An example with an auto-generated README file requires a description.json file 4 | # Only examples with a valid description.json file are updated by this script 5 | 6 | BASEDIR=$(pwd) 7 | 8 | dir_list=( $(git ls-files | grep 'description.json' | sed -r 's|/[^/]+$||' | sort | uniq )) 9 | 10 | echo ${dir_list[@]} 11 | echo $BASEDIR 12 | 13 | for i in "${dir_list[@]}" 14 | do 15 | cd $i 16 | if grep -qr '"match_readme": "false"' .; then 17 | echo "Ignoring README.md ::" $i 18 | else 19 | echo "Updating README for = $i" 20 | rm README.md 21 | fi 22 | make docs 23 | git add README.md 24 | cd $BASEDIR 25 | done 26 | 27 | summary_list=( $(git ls-files | grep 'summary.json' | sed -r 's|/[^/]+$||' | sort | uniq )) 28 | echo ${summary_list[@]} 29 | echo $BASEDIR 30 | for i in "${summary_list[@]}" 31 | do 32 | cd $i 33 | echo "Updating README for = $i" 34 | rm README.md 35 | make docs 36 | git add README.md 37 | cd $BASEDIR 38 | done 39 | -------------------------------------------------------------------------------- /xilinx/common/utility/device_list.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | # 4 | # utility that creates a file that lists down the supported and unsupported devices 5 | # for each example 6 | # 7 | 8 | import glob 9 | import json 10 | import re 11 | import sys 12 | import os 13 | 14 | import os.path 15 | 16 | string = "" 17 | for dirpath, dirnames, filenames in os.walk("../../."): 18 | for filename in [f for f in filenames if (f.endswith("description.json") and f not in "../../common/.")]: 19 | 20 | f = open(os.path.join(dirpath, filename), "r+") 21 | listing = [] 22 | flag = 0 23 | name_flag = 0 24 | 25 | for txt in f: 26 | 27 | x = re.search(".*device\".*", txt) 28 | 29 | if (x): 30 | if(name_flag is 0): 31 | name_flag = 1 32 | string = string + "\n" + dirpath + "\n" 33 | 34 | if(',' not in txt): 35 | flag = 1 36 | 37 | string = string + txt 38 | continue 39 | 40 | if (flag): 41 | string = string + txt 42 | 43 | if(']' in txt): 44 | flag = 0 45 | f.close() 46 | 47 | g = open ("Data.txt", "w") 48 | g.write(string) 49 | g.close() 50 | 51 | -------------------------------------------------------------------------------- /xilinx/common/utility/build_what.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | 3 | HEAD= 4 | 5 | if [[ "$BRANCH_NAME" == "" ]]; then 6 | HEAD=remotes/origin/master 7 | else 8 | HEAD=remotes/origin/${BRANCH_NAME} 9 | fi 10 | 11 | PROJS=$(git ls-files | grep description.json | sed -e 's/\.\///' -e 's/\/description.json//') 12 | CHANGES=$(git diff --name-only $HEAD) 13 | 14 | howmany() { echo $#; } 15 | NUM_CHANGES=$(howmany $CHANGES) 16 | 17 | echo NUM_CHANGES=$NUM_CHANGES 18 | 19 | REBUILDS= 20 | for change in $CHANGES; do 21 | IN_PROJS= 22 | for proj in $PROJS; do 23 | if [[ "$change" == ${proj}* ]]; then 24 | IN_PROJS="$proj $IN_PROJS" 25 | fi 26 | done 27 | 28 | if [[ "$change" == */README.md 29 | || "$change" == "utility/build_what.sh" 30 | || "$change" == "Jenkinsfile" ]]; then 31 | echo "SKIPPING $change" 32 | NUM_CHANGES=$((NUM_CHANGES-1)) 33 | elif [[ "$IN_PROJS" != "" ]]; then 34 | echo "REBUILD $change" 35 | NUM_CHANGES=$((NUM_CHANGES-1)) 36 | REBUILDS="$IN_PROJS $REBUILDS" 37 | else 38 | echo "UNKNOWN $change" 39 | fi 40 | done 41 | 42 | UNIQ_REBUILDS=$(echo $REBUILDS | xargs -n 1 | sort -u | xargs) 43 | 44 | echo UNIQ_REBUILDS = $UNIQ_REBUILDS 45 | echo NUM_CHANGES = $NUM_CHANGES 46 | 47 | # if we know that we only changed something inside a single example then do a rebuild 48 | # of that example only else rebuild all examples. 49 | cat /dev/null > examples.dat 50 | if [[ "$NUM_CHANGES" == "0" && "$UNIQ_REBUILDS" != "" ]]; then 51 | for rebuild in $UNIQ_REBUILDS; do 52 | echo $rebuild >> examples.dat 53 | done 54 | else 55 | for proj in $PROJS; do 56 | echo $proj >> examples.dat 57 | done 58 | fi 59 | -------------------------------------------------------------------------------- /xilinx/common/utility/md2rst/update_md2rst_all.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | appDir=$(dirname $(dirname $(dirname $(readlink -f $0)))) 3 | 4 | echo "-----------------------" 5 | echo "-- UPDATING .md to .rst --" 6 | echo "-----------------------" 7 | 8 | update_file() { 9 | ignore=0 10 | 11 | for i in $IGNORE; do 12 | if [[ $1 =~ ^description.json ]]; then 13 | ignore=1 14 | fi 15 | done 16 | 17 | if [[ $VERBOSE == "true" ]]; then 18 | echo -n "Checking $1 ... " 19 | fi 20 | if [[ $ignore == 1 ]]; then 21 | if [[ $VERBOSE == "true" ]]; then 22 | echo "SKIP" 23 | fi 24 | else 25 | pushd . > /dev/null 26 | # Migrate to the example directory 27 | cd $(dirname $1) 28 | # Take out the name of the example 29 | b_name=$(basename $(dirname $1)) 30 | # Run the detailed .md generator 31 | $appDir/utility/md2rst/md2rst.py description.json #> /dev/null 2>&1 32 | # Run the .md to .rst file generator using correct path to pandoc 33 | $appDir/pandoc-2.7.3/bin/pandoc -f markdown D_README.md -t rst -o $b_name.rst 34 | # move the generated .rst to desired folder 35 | mv $b_name.rst $appDir/../../test/ 36 | # delete the detailed readme 37 | rm D_README.md 38 | # Locate the desired folder and run sphinx to generate html files from 39 | # rst files. Go live... 40 | popd >/dev/null 41 | fi 42 | } 43 | 44 | VCS_FILES=$(git ls-files) 45 | 46 | for f in $VCS_FILES; do 47 | if [[ ($f == */description.json) ]]; then 48 | if grep -q '"match_readme": "false"' $f; then 49 | echo $f 50 | echo "Readme Manually Edited:: Autofile Generator Failed" 51 | else 52 | echo $f 53 | update_file $(readlink -f $f) 54 | fi 55 | fi 56 | done 57 | -------------------------------------------------------------------------------- /xilinx/common/utility/check_license.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Check if LICENSE.txt is provided as an argument 4 | 5 | if [ $# -eq 0 ]; then 6 | echo "ERROR: LICENSE.txt not found" 7 | exit 1 8 | fi 9 | 10 | # Check if all source files have the correct license 11 | 12 | LICENSE=$1 13 | TYPES="c cpp h cl" 14 | IGNORE=$(cat .LICENSE_IGNORE.txt) 15 | 16 | LICENSE_LEN=$(cat $LICENSE | wc -l) 17 | 18 | echo "-------------------------------------" 19 | echo "-- CHECKING LICENSE of all $TYPES --" 20 | echo "-------------------------------------" 21 | echo "-- IGNORING --" 22 | echo "$IGNORE" 23 | echo "--------------" 24 | 25 | FAIL=0 26 | 27 | check_file() { 28 | ignore=0 29 | 30 | for i in $IGNORE; do 31 | if [[ $1 =~ $i ]]; then 32 | ignore=1 33 | fi 34 | done 35 | 36 | if [[ $VERBOSE == "true" ]]; then 37 | echo -n "Checking $1 ... " 38 | fi 39 | if [[ $ignore == 1 ]]; then 40 | if [[ $VERBOSE == "true" ]]; then 41 | echo "SKIP" 42 | fi 43 | else 44 | diff $LICENSE <(head -n$LICENSE_LEN $1) 2>/dev/null 1>&2 45 | if [[ $? == 0 ]]; then 46 | if [[ $VERBOSE == "true" ]]; then 47 | echo "PASS" 48 | fi 49 | else 50 | if [[ $VERBOSE == "true" ]]; then 51 | echo "FAIL" 52 | diff $LICENSE <(head -n$LICENSE_LEN $1) 53 | else 54 | echo "$1" 55 | fi 56 | (( FAIL += 1 )) 57 | fi 58 | fi 59 | } 60 | 61 | 62 | VCS_FILES=$(git ls-files) 63 | 64 | for f in $VCS_FILES; do 65 | for t in $TYPES; do 66 | if [[ $f == *.$t ]]; then 67 | check_file $f 68 | fi 69 | done 70 | done 71 | 72 | if [[ $FAIL != 0 ]]; then 73 | echo "ERROR: License check failed" 74 | echo "ERROR: please fix the license in these files (or add to ignored if external)" 75 | fi 76 | 77 | exit $FAIL 78 | -------------------------------------------------------------------------------- /xilinx/common/utility/Consolidation.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | # 4 | # utility that creates a folder that contains the common folder and 5 | # all the files of the example 6 | # 7 | 8 | from sys import argv 9 | import re 10 | import sys 11 | import os 12 | import os.path 13 | 14 | path = os.getcwd() 15 | 16 | actual_folder = path 17 | folder_created = path + '_backup' 18 | route = argv[0].split('common') 19 | 20 | if(not os.path.isdir(folder_created)): 21 | cmd = 'cp -rf ' + actual_folder + ' ' + folder_created 22 | os.system(cmd) 23 | os.chmod(folder_created, 0o777) 24 | 25 | f = open(folder_created + '/Makefile', "r+") 26 | 27 | string = "" 28 | listing = ['opencl'] 29 | 30 | for txt in f: 31 | 32 | x = re.search("^COMMON_REPO =.*", txt) 33 | 34 | if (x): 35 | txt = "COMMON_REPO = ./\n" 36 | 37 | string = string + txt 38 | 39 | f.close() 40 | 41 | f = open(folder_created + '/description.json', "r+") 42 | 43 | flag = 0 44 | for txt in f: 45 | if "\"includepaths\"" in txt: 46 | flag = 1 47 | continue 48 | 49 | if (flag == 1): 50 | if (']' in txt or '}' in txt): 51 | break 52 | else: 53 | listing.append(txt[txt.find("includes/") + 9 : txt.rfind('\"')]) 54 | 55 | f.close() 56 | 57 | commonfolders = route[0] + "common/includes/" 58 | 59 | for foldername in os.listdir(commonfolders): 60 | if foldername in listing: 61 | cmd1 = 'mkdir -p ' + folder_created + '/common/includes/' + foldername 62 | cmd2 = 'cp -rf ' + commonfolders + '/' + foldername + '/* ' + folder_created + '/common/includes/' + foldername 63 | os.system(cmd1) 64 | os.system(cmd2) 65 | 66 | g = open(folder_created + '/Makefile', "w") 67 | g.write(string) 68 | g.close() 69 | 70 | print ("The new folder's location is %s" % folder_created) 71 | -------------------------------------------------------------------------------- /xilinx/common/utility/check_readme.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Check if all examples have correct Readme 4 | 5 | echo "-----------------------" 6 | echo "-- CHECKING READMEs --" 7 | echo "-----------------------" 8 | 9 | FAIL=0 10 | 11 | check_file() { 12 | ignore=0 13 | 14 | for i in $IGNORE; do 15 | if [[ $1 =~ ^description.json ]]; then 16 | ignore=1 17 | fi 18 | done 19 | 20 | if [[ $VERBOSE == "true" ]]; then 21 | echo -n "Checking $1 ... " 22 | fi 23 | if [[ $ignore == 1 ]]; then 24 | if [[ $VERBOSE == "true" ]]; then 25 | echo "SKIP" 26 | fi 27 | else 28 | pushd . > /dev/null 29 | cd $(dirname $1) 30 | mv README.md README.md.check > /dev/null 2>&1 31 | make README.md 2>/dev/null 1>&2 32 | rc=$? 33 | if [[ $2 != "false" ]]; then 34 | diff README.md README.md.check 2>/dev/null 1>&2 35 | if [[ $rc == 0 && $? == 0 ]]; then 36 | if [[ $VERBOSE == "true" ]]; then 37 | echo "PASS" 38 | fi 39 | else 40 | if [[ $VERBOSE == "true" ]]; then 41 | echo "FAIL" 42 | diff README.md README.md.check 43 | else 44 | echo "$1" 45 | fi 46 | (( FAIL += 1 )) 47 | fi 48 | fi 49 | 50 | mv README.md.check README.md > /dev/null 2>&1 51 | popd >/dev/null 52 | fi 53 | } 54 | 55 | 56 | VCS_FILES=$(git ls-files) 57 | 58 | for f in $VCS_FILES; do 59 | CHECK_MATCH=true 60 | if [[ ($f == */description.json) || ($f == */summary.json) ]]; then 61 | if grep -q '"match_readme": "false"' $f; then 62 | CHECK_MATCH=false 63 | echo "Ignoring README.md ::" $f 64 | fi 65 | check_file $f $CHECK_MATCH 66 | fi 67 | done 68 | 69 | if [[ $FAIL != 0 ]]; then 70 | echo "ERROR: Readme check failed" 71 | echo "ERROR: please fix the README.md in these files" 72 | fi 73 | 74 | exit $FAIL 75 | -------------------------------------------------------------------------------- /xilinx/common/utility/check_makefile.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Check if all examples have correct Makefiles 4 | 5 | echo "-----------------------" 6 | echo "-- CHECKING MAKEFILES --" 7 | echo "-----------------------" 8 | 9 | FAIL=0 10 | 11 | check_file() { 12 | ignore=0 13 | 14 | for i in $IGNORE; do 15 | if [[ $1 =~ ^description.json ]]; then 16 | ignore=1 17 | fi 18 | done 19 | 20 | if [[ $VERBOSE == "true" ]]; then 21 | echo -n "Checking $1 ... " 22 | fi 23 | if [[ $ignore == 1 ]]; then 24 | if [[ $VERBOSE == "true" ]]; then 25 | echo "SKIP" 26 | fi 27 | else 28 | pushd . > /dev/null 29 | jsonDir=$(dirname $(readlink -f $1)) 30 | cd $jsonDir 31 | mv Makefile Makefile.check > /dev/null 2>&1 32 | mv utils.mk utils.mk.check > /dev/null 2>&1 33 | $utilityDir/makefile_gen/makegen.py $1 > /dev/null 2>&1 34 | rc=$? 35 | diff Makefile Makefile.check 2>/dev/null 1>&2 36 | if [[ $rc == 0 && $? == 0 ]]; then 37 | #echo 'pass file' 38 | if [[ $VERBOSE == "true" ]]; then 39 | echo "PASS" 40 | fi 41 | else 42 | if [[ $VERBOSE == "true" ]]; then 43 | echo "FAIL" 44 | diff Makefile Makefile.check 45 | else 46 | echo "$1" 47 | fi 48 | (( FAIL += 1 )) 49 | fi 50 | mv Makefile.check Makefile > /dev/null 2>&1 51 | 52 | diff utils.mk utils.mk.check 2>/dev/null 1>&2 53 | if [[ $rc == 0 && $? == 0 ]]; then 54 | #echo 'pass file' 55 | if [[ $VERBOSE == "true" ]]; then 56 | echo "PASS" 57 | fi 58 | else 59 | if [[ $VERBOSE == "true" ]]; then 60 | echo "FAIL" 61 | diff utils.mk utils.mk.check 62 | else 63 | echo "$1" 64 | fi 65 | (( FAIL += 1 )) 66 | fi 67 | mv utils.mk.check utils.mk > /dev/null 2>&1 68 | popd >/dev/null 69 | fi 70 | } 71 | 72 | utilityDir=$(dirname $(readlink -f $0)) 73 | cd $utilityDir 74 | cd .. 75 | VCS_FILES=$(git ls-files) 76 | 77 | for f in $VCS_FILES; do 78 | if [[ ($f == */description.json) ]]; then 79 | if grep -q '"match_ini": "false"' $f; then 80 | echo "Manually Edited ini File ::" $f 81 | fi 82 | if grep -q '"match_makefile": "false"' $f; then 83 | echo "Ignoring ::" $f 84 | else 85 | check_file $(readlink -f $f) 86 | fi 87 | fi 88 | done 89 | 90 | if [[ $FAIL != 0 ]]; then 91 | echo "ERROR: Makefile check failed" 92 | echo "ERROR: please fix the makefile in these files" 93 | fi 94 | 95 | exit $FAIL 96 | -------------------------------------------------------------------------------- /xilinx/common/utility/check_descr.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | # 4 | # utility that lists down 5 | # all the examples with respective unnecessary keywords mentioned 6 | # 7 | 8 | import glob 9 | import json 10 | import re 11 | import sys 12 | import os 13 | 14 | import os.path 15 | 16 | for dirpath, dirnames, filenames in os.walk("../.././"): 17 | for filename in [f for f in filenames if (f.endswith("description.json") and f not in "../../common/.")]: 18 | 19 | f = open(os.path.join(dirpath, filename), "r+") 20 | flag = 0 21 | t = 0 22 | string_check = "" 23 | 24 | for txt in f: 25 | if ("keywords" in txt and flag == 0): 26 | flag = 1 27 | continue 28 | 29 | if (flag): 30 | if('}' in txt or ']' in txt): 31 | break 32 | 33 | else: 34 | c_list = txt.split("\"") 35 | check_flag = 0 36 | for c_dirpath, c_dirnames, c_filenames in os.walk(os.path.join(dirpath)): 37 | for check_filename in [c_f for c_f in c_filenames if (not (c_f.endswith(".md") or c_f.endswith("description.json")))]: 38 | c_f = open(os.path.join(c_dirpath, check_filename), "rb+") 39 | 40 | for check_txt in c_f: 41 | if (c_list[1].encode('utf-8') in check_txt): 42 | check_flag = 1 43 | break 44 | 45 | c_f.close() 46 | 47 | if (check_flag is 0): 48 | string_check = string_check + txt 49 | t = 1 50 | 51 | if (t): 52 | print(os.path.join(dirpath)) 53 | print(string_check) 54 | 55 | f.close() 56 | -------------------------------------------------------------------------------- /xilinx/common/includes/oclHelper/oclHelper.h: -------------------------------------------------------------------------------- 1 | /********** 2 | Copyright (c) 2019, Xilinx, Inc. 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without modification, 6 | are permitted provided that the following conditions are met: 7 | 8 | 1. Redistributions of source code must retain the above copyright notice, 9 | this list of conditions and the following disclaimer. 10 | 11 | 2. Redistributions in binary form must reproduce the above copyright notice, 12 | this list of conditions and the following disclaimer in the documentation 13 | and/or other materials provided with the distribution. 14 | 15 | 3. Neither the name of the copyright holder nor the names of its contributors 16 | may be used to endorse or promote products derived from this software 17 | without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 20 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 21 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 22 | IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 23 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 24 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 26 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 27 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | **********/ 29 | #ifndef _OCL_HELP_H_ 30 | #define _OCL_HELP_H_ 31 | 32 | #include 33 | 34 | struct oclHardware { 35 | cl_platform_id mPlatform; 36 | cl_context mContext; 37 | cl_device_id mDevice; 38 | cl_command_queue mQueue; 39 | short mMajorVersion; 40 | short mMinorVersion; 41 | }; 42 | 43 | struct oclSoftware { 44 | cl_program mProgram; 45 | cl_kernel mKernel; 46 | char mKernelName[128]; 47 | char mFileName[1024]; 48 | char mCompileOptions[1024]; 49 | }; 50 | 51 | oclHardware getOclHardware(cl_device_type type); 52 | 53 | int getOclSoftware(oclSoftware &software, const oclHardware &hardware); 54 | 55 | void release(oclSoftware& software); 56 | 57 | void release(oclHardware& hardware); 58 | 59 | const char *oclErrorCode(cl_int code); 60 | 61 | #endif 62 | -------------------------------------------------------------------------------- /xilinx/common/includes/bitmap/bitmap.h: -------------------------------------------------------------------------------- 1 | /********** 2 | Copyright (c) 2019, Xilinx, Inc. 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without modification, 6 | are permitted provided that the following conditions are met: 7 | 8 | 1. Redistributions of source code must retain the above copyright notice, 9 | this list of conditions and the following disclaimer. 10 | 11 | 2. Redistributions in binary form must reproduce the above copyright notice, 12 | this list of conditions and the following disclaimer in the documentation 13 | and/or other materials provided with the distribution. 14 | 15 | 3. Neither the name of the copyright holder nor the names of its contributors 16 | may be used to endorse or promote products derived from this software 17 | without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 20 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 21 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 22 | IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 23 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 24 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 26 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 27 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | **********/ 29 | #ifndef BITMAP_DOT_H 30 | #define BITMAP_DOT_H 31 | 32 | #include 33 | 34 | class BitmapInterface 35 | { 36 | private: 37 | char* core ; 38 | char* dib ; 39 | const char* filename ; 40 | int* image ; 41 | 42 | // Core header information 43 | unsigned short magicNumber ; 44 | unsigned int fileSize ; 45 | unsigned int offsetOfImage ; 46 | 47 | // DIB information 48 | int sizeOfDIB ; 49 | int sizeOfImage ; 50 | int height ; 51 | int width ; 52 | 53 | public: 54 | BitmapInterface(const char* f) ; 55 | ~BitmapInterface() ; 56 | 57 | bool readBitmapFile() ; 58 | bool writeBitmapFile(int* otherImage = NULL); 59 | 60 | inline int* bitmap() { return image ; } 61 | unsigned int numPixels() { return sizeOfImage/3 ; } 62 | 63 | inline int getHeight() { return height ; } 64 | inline int getWidth() { return width ; } 65 | 66 | } ; 67 | 68 | #endif 69 | -------------------------------------------------------------------------------- /xilinx/common/includes/simplebmp/simplebmp.h: -------------------------------------------------------------------------------- 1 | /********** 2 | Copyright (c) 2019, Xilinx, Inc. 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without modification, 6 | are permitted provided that the following conditions are met: 7 | 8 | 1. Redistributions of source code must retain the above copyright notice, 9 | this list of conditions and the following disclaimer. 10 | 11 | 2. Redistributions in binary form must reproduce the above copyright notice, 12 | this list of conditions and the following disclaimer in the documentation 13 | and/or other materials provided with the distribution. 14 | 15 | 3. Neither the name of the copyright holder nor the names of its contributors 16 | may be used to endorse or promote products derived from this software 17 | without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 20 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 21 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 22 | IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 23 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 24 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 26 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 27 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | **********/ 29 | //Read and write uncompressed 24 bit BMP image format image 30 | //based on http://en.wikipedia.org/wiki/BMP_file_formt 31 | //Copyright Xilinx 32 | 33 | 34 | #ifndef __SIMPLE_BMP 35 | #define __SIMPLE_BMP 36 | 37 | struct bmpheader_t{ 38 | //Header 39 | char headerB; 40 | char headerM; 41 | uint32_t headerbmpsize; 42 | uint16_t headerapp0; 43 | uint16_t headerapp1; 44 | uint32_t headerpixelsoffset; 45 | 46 | //DIB header 47 | uint32_t dibheadersize; 48 | uint32_t dibwidth; 49 | uint32_t dibheight; 50 | uint16_t dibplane; 51 | uint16_t dibdepth; 52 | uint32_t dibcompression; 53 | uint32_t dibsize; 54 | uint32_t dibhor; 55 | uint32_t dibver; 56 | uint32_t dibpal; 57 | uint32_t dibimportant; 58 | 59 | }; 60 | 61 | 62 | struct bmp_t{ 63 | struct bmpheader_t header; 64 | uint32_t width; 65 | uint32_t height; 66 | uint32_t *pixels; 67 | }; 68 | 69 | int writebmp(char *filename,struct bmp_t *bitmap); 70 | 71 | int readbmp(char *filename,struct bmp_t *bitmap); 72 | //-1 file access error 73 | //-2 invalid BMP 74 | //-3 memory allocation error 75 | 76 | 77 | #endif 78 | -------------------------------------------------------------------------------- /xilinx/dfs_bipa8/utils.mk: -------------------------------------------------------------------------------- 1 | #+------------------------------------------------------------------------------- 2 | # The following parameters are assigned with default values. These parameters can 3 | # be overridden through the make command line 4 | #+------------------------------------------------------------------------------- 5 | 6 | PROFILE := no 7 | 8 | #Generates profile summary report 9 | ifeq ($(PROFILE), yes) 10 | LDCLFLAGS += --profile_kernel data:all:all:all 11 | endif 12 | 13 | DEBUG := no 14 | B_TEMP = `$(ABS_COMMON_REPO)/common/utility/parse_platform_list.py $(DEVICE)` 15 | 16 | #Generates debug summary report 17 | ifeq ($(DEBUG), yes) 18 | LDCLFLAGS += --dk list_ports 19 | endif 20 | 21 | #Setting Platform Path 22 | ifeq ($(findstring xpfm, $(DEVICE)), xpfm) 23 | B_NAME = $(shell dirname $(DEVICE)) 24 | else 25 | B_NAME = $(B_TEMP)/$(DEVICE) 26 | endif 27 | 28 | #Checks for XILINX_VITIS 29 | ifndef XILINX_VITIS 30 | $(error XILINX_VITIS variable is not set, please set correctly and rerun) 31 | endif 32 | 33 | #Checks for Device Family 34 | ifeq ($(HOST_ARCH), aarch32) 35 | DEV_FAM = 7Series 36 | else ifeq ($(HOST_ARCH), aarch64) 37 | DEV_FAM = Ultrascale 38 | endif 39 | 40 | #Checks for XILINX_XRT 41 | check-xrt: 42 | ifndef XILINX_XRT 43 | $(error XILINX_XRT variable is not set, please set correctly and rerun) 44 | endif 45 | 46 | #Checks for Correct architecture 47 | ifneq ($(HOST_ARCH), $(filter $(HOST_ARCH),aarch64 aarch32 x86)) 48 | $(error HOST_ARCH variable not set, please set correctly and rerun) 49 | endif 50 | 51 | #Checks for SYSROOT 52 | ifneq ($(HOST_ARCH), x86) 53 | ifndef SYSROOT 54 | $(error SYSROOT variable is not set, please set correctly and rerun) 55 | endif 56 | endif 57 | 58 | #Checks for g++ 59 | ifeq ($(HOST_ARCH), x86) 60 | ifneq ($(shell expr $(shell g++ -dumpversion) \>= 5), 1) 61 | ifndef XILINX_VIVADO 62 | $(error [ERROR]: g++ version older. Please use 5.0 or above.) 63 | else 64 | CXX := $(XILINX_VIVADO)/tps/lnx64/gcc-6.2.0/bin/g++ 65 | $(warning [WARNING]: g++ version older. Using g++ provided by the tool : $(CXX)) 66 | endif 67 | endif 68 | else ifeq ($(HOST_ARCH), aarch64) 69 | CXX := $(XILINX_VITIS)/gnu/aarch64/lin/aarch64-linux/bin/aarch64-linux-gnu-g++ 70 | else ifeq ($(HOST_ARCH), aarch32) 71 | CXX := $(XILINX_VITIS)/gnu/aarch32/lin/gcc-arm-linux-gnueabi/bin/arm-linux-gnueabihf-g++ 72 | endif 73 | 74 | check-devices: 75 | ifndef DEVICE 76 | $(error DEVICE not set. Please set the DEVICE properly and rerun. Run "make help" for more details.) 77 | endif 78 | 79 | # device2xsa - create a filesystem friendly name from device name 80 | # $(1) - full name of device 81 | device2xsa = $(strip $(patsubst %.xpfm, % , $(shell basename $(DEVICE)))) 82 | 83 | # Cleaning stuff 84 | RM = rm -f 85 | RMDIR = rm -rf 86 | 87 | ECHO:= @echo 88 | 89 | docs: README.md 90 | 91 | README.md: description.json 92 | $(ABS_COMMON_REPO)/common/utility/readme_gen/readme_gen.py description.json 93 | -------------------------------------------------------------------------------- /xilinx/latency/utils.mk: -------------------------------------------------------------------------------- 1 | #+------------------------------------------------------------------------------- 2 | # The following parameters are assigned with default values. These parameters can 3 | # be overridden through the make command line 4 | #+------------------------------------------------------------------------------- 5 | 6 | PROFILE := no 7 | 8 | #Generates profile summary report 9 | ifeq ($(PROFILE), yes) 10 | LDCLFLAGS += --profile_kernel data:all:all:all 11 | endif 12 | 13 | DEBUG := no 14 | B_TEMP = `$(ABS_COMMON_REPO)/common/utility/parse_platform_list.py $(DEVICE)` 15 | 16 | #Generates debug summary report 17 | ifeq ($(DEBUG), yes) 18 | LDCLFLAGS += --dk list_ports 19 | endif 20 | 21 | #Setting Platform Path 22 | ifeq ($(findstring xpfm, $(DEVICE)), xpfm) 23 | B_NAME = $(shell dirname $(DEVICE)) 24 | else 25 | B_NAME = $(B_TEMP)/$(DEVICE) 26 | endif 27 | 28 | #Checks for XILINX_VITIS 29 | ifndef XILINX_VITIS 30 | $(error XILINX_VITIS variable is not set, please set correctly and rerun) 31 | endif 32 | 33 | #Checks for Device Family 34 | ifeq ($(HOST_ARCH), aarch32) 35 | DEV_FAM = 7Series 36 | else ifeq ($(HOST_ARCH), aarch64) 37 | DEV_FAM = Ultrascale 38 | endif 39 | 40 | #Checks for XILINX_XRT 41 | check-xrt: 42 | ifndef XILINX_XRT 43 | $(error XILINX_XRT variable is not set, please set correctly and rerun) 44 | endif 45 | 46 | #Checks for Correct architecture 47 | ifneq ($(HOST_ARCH), $(filter $(HOST_ARCH),aarch64 aarch32 x86)) 48 | $(error HOST_ARCH variable not set, please set correctly and rerun) 49 | endif 50 | 51 | #Checks for SYSROOT 52 | ifneq ($(HOST_ARCH), x86) 53 | ifndef SYSROOT 54 | $(error SYSROOT variable is not set, please set correctly and rerun) 55 | endif 56 | endif 57 | 58 | #Checks for g++ 59 | ifeq ($(HOST_ARCH), x86) 60 | ifneq ($(shell expr $(shell g++ -dumpversion) \>= 5), 1) 61 | ifndef XILINX_VIVADO 62 | $(error [ERROR]: g++ version older. Please use 5.0 or above.) 63 | else 64 | CXX := $(XILINX_VIVADO)/tps/lnx64/gcc-6.2.0/bin/g++ 65 | $(warning [WARNING]: g++ version older. Using g++ provided by the tool : $(CXX)) 66 | endif 67 | endif 68 | else ifeq ($(HOST_ARCH), aarch64) 69 | CXX := $(XILINX_VITIS)/gnu/aarch64/lin/aarch64-linux/bin/aarch64-linux-gnu-g++ 70 | else ifeq ($(HOST_ARCH), aarch32) 71 | CXX := $(XILINX_VITIS)/gnu/aarch32/lin/gcc-arm-linux-gnueabi/bin/arm-linux-gnueabihf-g++ 72 | endif 73 | 74 | check-devices: 75 | ifndef DEVICE 76 | $(error DEVICE not set. Please set the DEVICE properly and rerun. Run "make help" for more details.) 77 | endif 78 | 79 | # device2xsa - create a filesystem friendly name from device name 80 | # $(1) - full name of device 81 | device2xsa = $(strip $(patsubst %.xpfm, % , $(shell basename $(DEVICE)))) 82 | 83 | # Cleaning stuff 84 | RM = rm -f 85 | RMDIR = rm -rf 86 | 87 | ECHO:= @echo 88 | 89 | docs: README.md 90 | 91 | README.md: description.json 92 | $(ABS_COMMON_REPO)/common/utility/readme_gen/readme_gen.py description.json 93 | -------------------------------------------------------------------------------- /xilinx/bsearch_bipa16/utils.mk: -------------------------------------------------------------------------------- 1 | #+------------------------------------------------------------------------------- 2 | # The following parameters are assigned with default values. These parameters can 3 | # be overridden through the make command line 4 | #+------------------------------------------------------------------------------- 5 | 6 | PROFILE := no 7 | 8 | #Generates profile summary report 9 | ifeq ($(PROFILE), yes) 10 | LDCLFLAGS += --profile_kernel data:all:all:all 11 | endif 12 | 13 | DEBUG := no 14 | B_TEMP = `$(ABS_COMMON_REPO)/common/utility/parse_platform_list.py $(DEVICE)` 15 | 16 | #Generates debug summary report 17 | ifeq ($(DEBUG), yes) 18 | LDCLFLAGS += --dk list_ports 19 | endif 20 | 21 | #Setting Platform Path 22 | ifeq ($(findstring xpfm, $(DEVICE)), xpfm) 23 | B_NAME = $(shell dirname $(DEVICE)) 24 | else 25 | B_NAME = $(B_TEMP)/$(DEVICE) 26 | endif 27 | 28 | #Checks for XILINX_VITIS 29 | ifndef XILINX_VITIS 30 | $(error XILINX_VITIS variable is not set, please set correctly and rerun) 31 | endif 32 | 33 | #Checks for Device Family 34 | ifeq ($(HOST_ARCH), aarch32) 35 | DEV_FAM = 7Series 36 | else ifeq ($(HOST_ARCH), aarch64) 37 | DEV_FAM = Ultrascale 38 | endif 39 | 40 | #Checks for XILINX_XRT 41 | check-xrt: 42 | ifndef XILINX_XRT 43 | $(error XILINX_XRT variable is not set, please set correctly and rerun) 44 | endif 45 | 46 | #Checks for Correct architecture 47 | ifneq ($(HOST_ARCH), $(filter $(HOST_ARCH),aarch64 aarch32 x86)) 48 | $(error HOST_ARCH variable not set, please set correctly and rerun) 49 | endif 50 | 51 | #Checks for SYSROOT 52 | ifneq ($(HOST_ARCH), x86) 53 | ifndef SYSROOT 54 | $(error SYSROOT variable is not set, please set correctly and rerun) 55 | endif 56 | endif 57 | 58 | #Checks for g++ 59 | ifeq ($(HOST_ARCH), x86) 60 | ifneq ($(shell expr $(shell g++ -dumpversion) \>= 5), 1) 61 | ifndef XILINX_VIVADO 62 | $(error [ERROR]: g++ version older. Please use 5.0 or above.) 63 | else 64 | CXX := $(XILINX_VIVADO)/tps/lnx64/gcc-6.2.0/bin/g++ 65 | $(warning [WARNING]: g++ version older. Using g++ provided by the tool : $(CXX)) 66 | endif 67 | endif 68 | else ifeq ($(HOST_ARCH), aarch64) 69 | CXX := $(XILINX_VITIS)/gnu/aarch64/lin/aarch64-linux/bin/aarch64-linux-gnu-g++ 70 | else ifeq ($(HOST_ARCH), aarch32) 71 | CXX := $(XILINX_VITIS)/gnu/aarch32/lin/gcc-arm-linux-gnueabi/bin/arm-linux-gnueabihf-g++ 72 | endif 73 | 74 | check-devices: 75 | ifndef DEVICE 76 | $(error DEVICE not set. Please set the DEVICE properly and rerun. Run "make help" for more details.) 77 | endif 78 | 79 | # device2xsa - create a filesystem friendly name from device name 80 | # $(1) - full name of device 81 | device2xsa = $(strip $(patsubst %.xpfm, % , $(shell basename $(DEVICE)))) 82 | 83 | # Cleaning stuff 84 | RM = rm -f 85 | RMDIR = rm -rf 86 | 87 | ECHO:= @echo 88 | 89 | docs: README.md 90 | 91 | README.md: description.json 92 | $(ABS_COMMON_REPO)/common/utility/readme_gen/readme_gen.py description.json 93 | -------------------------------------------------------------------------------- /xilinx/bucket_baseline/utils.mk: -------------------------------------------------------------------------------- 1 | #+------------------------------------------------------------------------------- 2 | # The following parameters are assigned with default values. These parameters can 3 | # be overridden through the make command line 4 | #+------------------------------------------------------------------------------- 5 | 6 | PROFILE := no 7 | 8 | #Generates profile summary report 9 | ifeq ($(PROFILE), yes) 10 | LDCLFLAGS += --profile_kernel data:all:all:all 11 | endif 12 | 13 | DEBUG := no 14 | B_TEMP = `$(ABS_COMMON_REPO)/common/utility/parse_platform_list.py $(DEVICE)` 15 | 16 | #Generates debug summary report 17 | ifeq ($(DEBUG), yes) 18 | LDCLFLAGS += --dk list_ports 19 | endif 20 | 21 | #Setting Platform Path 22 | ifeq ($(findstring xpfm, $(DEVICE)), xpfm) 23 | B_NAME = $(shell dirname $(DEVICE)) 24 | else 25 | B_NAME = $(B_TEMP)/$(DEVICE) 26 | endif 27 | 28 | #Checks for XILINX_VITIS 29 | ifndef XILINX_VITIS 30 | $(error XILINX_VITIS variable is not set, please set correctly and rerun) 31 | endif 32 | 33 | #Checks for Device Family 34 | ifeq ($(HOST_ARCH), aarch32) 35 | DEV_FAM = 7Series 36 | else ifeq ($(HOST_ARCH), aarch64) 37 | DEV_FAM = Ultrascale 38 | endif 39 | 40 | #Checks for XILINX_XRT 41 | check-xrt: 42 | ifndef XILINX_XRT 43 | $(error XILINX_XRT variable is not set, please set correctly and rerun) 44 | endif 45 | 46 | #Checks for Correct architecture 47 | ifneq ($(HOST_ARCH), $(filter $(HOST_ARCH),aarch64 aarch32 x86)) 48 | $(error HOST_ARCH variable not set, please set correctly and rerun) 49 | endif 50 | 51 | #Checks for SYSROOT 52 | ifneq ($(HOST_ARCH), x86) 53 | ifndef SYSROOT 54 | $(error SYSROOT variable is not set, please set correctly and rerun) 55 | endif 56 | endif 57 | 58 | #Checks for g++ 59 | ifeq ($(HOST_ARCH), x86) 60 | ifneq ($(shell expr $(shell g++ -dumpversion) \>= 5), 1) 61 | ifndef XILINX_VIVADO 62 | $(error [ERROR]: g++ version older. Please use 5.0 or above.) 63 | else 64 | CXX := $(XILINX_VIVADO)/tps/lnx64/gcc-6.2.0/bin/g++ 65 | $(warning [WARNING]: g++ version older. Using g++ provided by the tool : $(CXX)) 66 | endif 67 | endif 68 | else ifeq ($(HOST_ARCH), aarch64) 69 | CXX := $(XILINX_VITIS)/gnu/aarch64/lin/aarch64-linux/bin/aarch64-linux-gnu-g++ 70 | else ifeq ($(HOST_ARCH), aarch32) 71 | CXX := $(XILINX_VITIS)/gnu/aarch32/lin/gcc-arm-linux-gnueabi/bin/arm-linux-gnueabihf-g++ 72 | endif 73 | 74 | check-devices: 75 | ifndef DEVICE 76 | $(error DEVICE not set. Please set the DEVICE properly and rerun. Run "make help" for more details.) 77 | endif 78 | 79 | # device2xsa - create a filesystem friendly name from device name 80 | # $(1) - full name of device 81 | device2xsa = $(strip $(patsubst %.xpfm, % , $(shell basename $(DEVICE)))) 82 | 83 | # Cleaning stuff 84 | RM = rm -f 85 | RMDIR = rm -rf 86 | 87 | ECHO:= @echo 88 | 89 | docs: README.md 90 | 91 | README.md: description.json 92 | $(ABS_COMMON_REPO)/common/utility/readme_gen/readme_gen.py description.json 93 | -------------------------------------------------------------------------------- /xilinx/bucket_bica64/utils.mk: -------------------------------------------------------------------------------- 1 | #+------------------------------------------------------------------------------- 2 | # The following parameters are assigned with default values. These parameters can 3 | # be overridden through the make command line 4 | #+------------------------------------------------------------------------------- 5 | 6 | PROFILE := no 7 | 8 | #Generates profile summary report 9 | ifeq ($(PROFILE), yes) 10 | LDCLFLAGS += --profile_kernel data:all:all:all 11 | endif 12 | 13 | DEBUG := no 14 | B_TEMP = `$(ABS_COMMON_REPO)/common/utility/parse_platform_list.py $(DEVICE)` 15 | 16 | #Generates debug summary report 17 | ifeq ($(DEBUG), yes) 18 | LDCLFLAGS += --dk list_ports 19 | endif 20 | 21 | #Setting Platform Path 22 | ifeq ($(findstring xpfm, $(DEVICE)), xpfm) 23 | B_NAME = $(shell dirname $(DEVICE)) 24 | else 25 | B_NAME = $(B_TEMP)/$(DEVICE) 26 | endif 27 | 28 | #Checks for XILINX_VITIS 29 | ifndef XILINX_VITIS 30 | $(error XILINX_VITIS variable is not set, please set correctly and rerun) 31 | endif 32 | 33 | #Checks for Device Family 34 | ifeq ($(HOST_ARCH), aarch32) 35 | DEV_FAM = 7Series 36 | else ifeq ($(HOST_ARCH), aarch64) 37 | DEV_FAM = Ultrascale 38 | endif 39 | 40 | #Checks for XILINX_XRT 41 | check-xrt: 42 | ifndef XILINX_XRT 43 | $(error XILINX_XRT variable is not set, please set correctly and rerun) 44 | endif 45 | 46 | #Checks for Correct architecture 47 | ifneq ($(HOST_ARCH), $(filter $(HOST_ARCH),aarch64 aarch32 x86)) 48 | $(error HOST_ARCH variable not set, please set correctly and rerun) 49 | endif 50 | 51 | #Checks for SYSROOT 52 | ifneq ($(HOST_ARCH), x86) 53 | ifndef SYSROOT 54 | $(error SYSROOT variable is not set, please set correctly and rerun) 55 | endif 56 | endif 57 | 58 | #Checks for g++ 59 | ifeq ($(HOST_ARCH), x86) 60 | ifneq ($(shell expr $(shell g++ -dumpversion) \>= 5), 1) 61 | ifndef XILINX_VIVADO 62 | $(error [ERROR]: g++ version older. Please use 5.0 or above.) 63 | else 64 | CXX := $(XILINX_VIVADO)/tps/lnx64/gcc-6.2.0/bin/g++ 65 | $(warning [WARNING]: g++ version older. Using g++ provided by the tool : $(CXX)) 66 | endif 67 | endif 68 | else ifeq ($(HOST_ARCH), aarch64) 69 | CXX := $(XILINX_VITIS)/gnu/aarch64/lin/aarch64-linux/bin/aarch64-linux-gnu-g++ 70 | else ifeq ($(HOST_ARCH), aarch32) 71 | CXX := $(XILINX_VITIS)/gnu/aarch32/lin/gcc-arm-linux-gnueabi/bin/arm-linux-gnueabihf-g++ 72 | endif 73 | 74 | check-devices: 75 | ifndef DEVICE 76 | $(error DEVICE not set. Please set the DEVICE properly and rerun. Run "make help" for more details.) 77 | endif 78 | 79 | # device2xsa - create a filesystem friendly name from device name 80 | # $(1) - full name of device 81 | device2xsa = $(strip $(patsubst %.xpfm, % , $(shell basename $(DEVICE)))) 82 | 83 | # Cleaning stuff 84 | RM = rm -f 85 | RMDIR = rm -rf 86 | 87 | ECHO:= @echo 88 | 89 | docs: README.md 90 | 91 | README.md: description.json 92 | $(ABS_COMMON_REPO)/common/utility/readme_gen/readme_gen.py description.json 93 | -------------------------------------------------------------------------------- /xilinx/dfs_baseline/utils.mk: -------------------------------------------------------------------------------- 1 | #+------------------------------------------------------------------------------- 2 | # The following parameters are assigned with default values. These parameters can 3 | # be overridden through the make command line 4 | #+------------------------------------------------------------------------------- 5 | 6 | PROFILE := no 7 | 8 | #Generates profile summary report 9 | ifeq ($(PROFILE), yes) 10 | LDCLFLAGS += --profile_kernel data:all:all:all 11 | endif 12 | 13 | DEBUG := no 14 | B_TEMP = `$(ABS_COMMON_REPO)/common/utility/parse_platform_list.py $(DEVICE)` 15 | 16 | #Generates debug summary report 17 | ifeq ($(DEBUG), yes) 18 | LDCLFLAGS += --dk list_ports 19 | endif 20 | 21 | #Setting Platform Path 22 | ifeq ($(findstring xpfm, $(DEVICE)), xpfm) 23 | B_NAME = $(shell dirname $(DEVICE)) 24 | else 25 | B_NAME = $(B_TEMP)/$(DEVICE) 26 | endif 27 | 28 | #Checks for XILINX_VITIS 29 | ifndef XILINX_VITIS 30 | $(error XILINX_VITIS variable is not set, please set correctly and rerun) 31 | endif 32 | 33 | #Checks for Device Family 34 | ifeq ($(HOST_ARCH), aarch32) 35 | DEV_FAM = 7Series 36 | else ifeq ($(HOST_ARCH), aarch64) 37 | DEV_FAM = Ultrascale 38 | endif 39 | 40 | #Checks for XILINX_XRT 41 | check-xrt: 42 | ifndef XILINX_XRT 43 | $(error XILINX_XRT variable is not set, please set correctly and rerun) 44 | endif 45 | 46 | #Checks for Correct architecture 47 | ifneq ($(HOST_ARCH), $(filter $(HOST_ARCH),aarch64 aarch32 x86)) 48 | $(error HOST_ARCH variable not set, please set correctly and rerun) 49 | endif 50 | 51 | #Checks for SYSROOT 52 | ifneq ($(HOST_ARCH), x86) 53 | ifndef SYSROOT 54 | $(error SYSROOT variable is not set, please set correctly and rerun) 55 | endif 56 | endif 57 | 58 | #Checks for g++ 59 | ifeq ($(HOST_ARCH), x86) 60 | ifneq ($(shell expr $(shell g++ -dumpversion) \>= 5), 1) 61 | ifndef XILINX_VIVADO 62 | $(error [ERROR]: g++ version older. Please use 5.0 or above.) 63 | else 64 | CXX := $(XILINX_VIVADO)/tps/lnx64/gcc-6.2.0/bin/g++ 65 | $(warning [WARNING]: g++ version older. Using g++ provided by the tool : $(CXX)) 66 | endif 67 | endif 68 | else ifeq ($(HOST_ARCH), aarch64) 69 | CXX := $(XILINX_VITIS)/gnu/aarch64/lin/aarch64-linux/bin/aarch64-linux-gnu-g++ 70 | else ifeq ($(HOST_ARCH), aarch32) 71 | CXX := $(XILINX_VITIS)/gnu/aarch32/lin/gcc-arm-linux-gnueabi/bin/arm-linux-gnueabihf-g++ 72 | endif 73 | 74 | check-devices: 75 | ifndef DEVICE 76 | $(error DEVICE not set. Please set the DEVICE properly and rerun. Run "make help" for more details.) 77 | endif 78 | 79 | # device2xsa - create a filesystem friendly name from device name 80 | # $(1) - full name of device 81 | device2xsa = $(strip $(patsubst %.xpfm, % , $(shell basename $(DEVICE)))) 82 | 83 | # Cleaning stuff 84 | RM = rm -f 85 | RMDIR = rm -rf 86 | 87 | ECHO:= @echo 88 | 89 | docs: README.md 90 | 91 | README.md: description.json 92 | $(ABS_COMMON_REPO)/common/utility/readme_gen/readme_gen.py description.json 93 | -------------------------------------------------------------------------------- /xilinx/multiunicast8x8/utils.mk: -------------------------------------------------------------------------------- 1 | #+------------------------------------------------------------------------------- 2 | # The following parameters are assigned with default values. These parameters can 3 | # be overridden through the make command line 4 | #+------------------------------------------------------------------------------- 5 | 6 | PROFILE := no 7 | 8 | #Generates profile summary report 9 | ifeq ($(PROFILE), yes) 10 | LDCLFLAGS += --profile_kernel data:all:all:all 11 | endif 12 | 13 | DEBUG := no 14 | B_TEMP = `$(ABS_COMMON_REPO)/common/utility/parse_platform_list.py $(DEVICE)` 15 | 16 | #Generates debug summary report 17 | ifeq ($(DEBUG), yes) 18 | LDCLFLAGS += --dk list_ports 19 | endif 20 | 21 | #Setting Platform Path 22 | ifeq ($(findstring xpfm, $(DEVICE)), xpfm) 23 | B_NAME = $(shell dirname $(DEVICE)) 24 | else 25 | B_NAME = $(B_TEMP)/$(DEVICE) 26 | endif 27 | 28 | #Checks for XILINX_VITIS 29 | ifndef XILINX_VITIS 30 | $(error XILINX_VITIS variable is not set, please set correctly and rerun) 31 | endif 32 | 33 | #Checks for Device Family 34 | ifeq ($(HOST_ARCH), aarch32) 35 | DEV_FAM = 7Series 36 | else ifeq ($(HOST_ARCH), aarch64) 37 | DEV_FAM = Ultrascale 38 | endif 39 | 40 | #Checks for XILINX_XRT 41 | check-xrt: 42 | ifndef XILINX_XRT 43 | $(error XILINX_XRT variable is not set, please set correctly and rerun) 44 | endif 45 | 46 | #Checks for Correct architecture 47 | ifneq ($(HOST_ARCH), $(filter $(HOST_ARCH),aarch64 aarch32 x86)) 48 | $(error HOST_ARCH variable not set, please set correctly and rerun) 49 | endif 50 | 51 | #Checks for SYSROOT 52 | ifneq ($(HOST_ARCH), x86) 53 | ifndef SYSROOT 54 | $(error SYSROOT variable is not set, please set correctly and rerun) 55 | endif 56 | endif 57 | 58 | #Checks for g++ 59 | ifeq ($(HOST_ARCH), x86) 60 | ifneq ($(shell expr $(shell g++ -dumpversion) \>= 5), 1) 61 | ifndef XILINX_VIVADO 62 | $(error [ERROR]: g++ version older. Please use 5.0 or above.) 63 | else 64 | CXX := $(XILINX_VIVADO)/tps/lnx64/gcc-6.2.0/bin/g++ 65 | $(warning [WARNING]: g++ version older. Using g++ provided by the tool : $(CXX)) 66 | endif 67 | endif 68 | else ifeq ($(HOST_ARCH), aarch64) 69 | CXX := $(XILINX_VITIS)/gnu/aarch64/lin/aarch64-linux/bin/aarch64-linux-gnu-g++ 70 | else ifeq ($(HOST_ARCH), aarch32) 71 | CXX := $(XILINX_VITIS)/gnu/aarch32/lin/gcc-arm-linux-gnueabi/bin/arm-linux-gnueabihf-g++ 72 | endif 73 | 74 | check-devices: 75 | ifndef DEVICE 76 | $(error DEVICE not set. Please set the DEVICE properly and rerun. Run "make help" for more details.) 77 | endif 78 | 79 | # device2xsa - create a filesystem friendly name from device name 80 | # $(1) - full name of device 81 | device2xsa = $(strip $(patsubst %.xpfm, % , $(shell basename $(DEVICE)))) 82 | 83 | # Cleaning stuff 84 | RM = rm -f 85 | RMDIR = rm -rf 86 | 87 | ECHO:= @echo 88 | 89 | docs: README.md 90 | 91 | README.md: description.json 92 | $(ABS_COMMON_REPO)/common/utility/readme_gen/readme_gen.py description.json 93 | -------------------------------------------------------------------------------- /xilinx/mv_pc24_u50/utils.mk: -------------------------------------------------------------------------------- 1 | #+------------------------------------------------------------------------------- 2 | # The following parameters are assigned with default values. These parameters can 3 | # be overridden through the make command line 4 | #+------------------------------------------------------------------------------- 5 | 6 | PROFILE := no 7 | 8 | #Generates profile summary report 9 | ifeq ($(PROFILE), yes) 10 | LDCLFLAGS += --profile_kernel data:all:all:all 11 | endif 12 | 13 | DEBUG := no 14 | B_TEMP = `$(ABS_COMMON_REPO)/common/utility/parse_platform_list.py $(DEVICE)` 15 | 16 | #Generates debug summary report 17 | ifeq ($(DEBUG), yes) 18 | LDCLFLAGS += --dk list_ports 19 | endif 20 | 21 | #Setting Platform Path 22 | ifeq ($(findstring xpfm, $(DEVICE)), xpfm) 23 | B_NAME = $(shell dirname $(DEVICE)) 24 | else 25 | B_NAME = $(B_TEMP)/$(DEVICE) 26 | endif 27 | 28 | #Checks for XILINX_VITIS 29 | ifndef XILINX_VITIS 30 | $(error XILINX_VITIS variable is not set, please set correctly and rerun) 31 | endif 32 | 33 | #Checks for Device Family 34 | ifeq ($(HOST_ARCH), aarch32) 35 | DEV_FAM = 7Series 36 | else ifeq ($(HOST_ARCH), aarch64) 37 | DEV_FAM = Ultrascale 38 | endif 39 | 40 | #Checks for XILINX_XRT 41 | check-xrt: 42 | ifndef XILINX_XRT 43 | $(error XILINX_XRT variable is not set, please set correctly and rerun) 44 | endif 45 | 46 | #Checks for Correct architecture 47 | ifneq ($(HOST_ARCH), $(filter $(HOST_ARCH),aarch64 aarch32 x86)) 48 | $(error HOST_ARCH variable not set, please set correctly and rerun) 49 | endif 50 | 51 | #Checks for SYSROOT 52 | ifneq ($(HOST_ARCH), x86) 53 | ifndef SYSROOT 54 | $(error SYSROOT variable is not set, please set correctly and rerun) 55 | endif 56 | endif 57 | 58 | #Checks for g++ 59 | ifeq ($(HOST_ARCH), x86) 60 | ifneq ($(shell expr $(shell g++ -dumpversion) \>= 5), 1) 61 | ifndef XILINX_VIVADO 62 | $(error [ERROR]: g++ version older. Please use 5.0 or above.) 63 | else 64 | CXX := $(XILINX_VIVADO)/tps/lnx64/gcc-6.2.0/bin/g++ 65 | $(warning [WARNING]: g++ version older. Using g++ provided by the tool : $(CXX)) 66 | endif 67 | endif 68 | else ifeq ($(HOST_ARCH), aarch64) 69 | CXX := $(XILINX_VITIS)/gnu/aarch64/lin/aarch64-linux/bin/aarch64-linux-gnu-g++ 70 | else ifeq ($(HOST_ARCH), aarch32) 71 | CXX := $(XILINX_VITIS)/gnu/aarch32/lin/gcc-arm-linux-gnueabi/bin/arm-linux-gnueabihf-g++ 72 | endif 73 | 74 | check-devices: 75 | ifndef DEVICE 76 | $(error DEVICE not set. Please set the DEVICE properly and rerun. Run "make help" for more details.) 77 | endif 78 | 79 | # device2xsa - create a filesystem friendly name from device name 80 | # $(1) - full name of device 81 | device2xsa = $(strip $(patsubst %.xpfm, % , $(shell basename $(DEVICE)))) 82 | 83 | # Cleaning stuff 84 | RM = rm -f 85 | RMDIR = rm -rf 86 | 87 | ECHO:= @echo 88 | 89 | docs: README.md 90 | 91 | README.md: description.json 92 | $(ABS_COMMON_REPO)/common/utility/readme_gen/readme_gen.py description.json 93 | -------------------------------------------------------------------------------- /xilinx/mv_pc28_u280/utils.mk: -------------------------------------------------------------------------------- 1 | #+------------------------------------------------------------------------------- 2 | # The following parameters are assigned with default values. These parameters can 3 | # be overridden through the make command line 4 | #+------------------------------------------------------------------------------- 5 | 6 | PROFILE := no 7 | 8 | #Generates profile summary report 9 | ifeq ($(PROFILE), yes) 10 | LDCLFLAGS += --profile_kernel data:all:all:all 11 | endif 12 | 13 | DEBUG := no 14 | B_TEMP = `$(ABS_COMMON_REPO)/common/utility/parse_platform_list.py $(DEVICE)` 15 | 16 | #Generates debug summary report 17 | ifeq ($(DEBUG), yes) 18 | LDCLFLAGS += --dk list_ports 19 | endif 20 | 21 | #Setting Platform Path 22 | ifeq ($(findstring xpfm, $(DEVICE)), xpfm) 23 | B_NAME = $(shell dirname $(DEVICE)) 24 | else 25 | B_NAME = $(B_TEMP)/$(DEVICE) 26 | endif 27 | 28 | #Checks for XILINX_VITIS 29 | ifndef XILINX_VITIS 30 | $(error XILINX_VITIS variable is not set, please set correctly and rerun) 31 | endif 32 | 33 | #Checks for Device Family 34 | ifeq ($(HOST_ARCH), aarch32) 35 | DEV_FAM = 7Series 36 | else ifeq ($(HOST_ARCH), aarch64) 37 | DEV_FAM = Ultrascale 38 | endif 39 | 40 | #Checks for XILINX_XRT 41 | check-xrt: 42 | ifndef XILINX_XRT 43 | $(error XILINX_XRT variable is not set, please set correctly and rerun) 44 | endif 45 | 46 | #Checks for Correct architecture 47 | ifneq ($(HOST_ARCH), $(filter $(HOST_ARCH),aarch64 aarch32 x86)) 48 | $(error HOST_ARCH variable not set, please set correctly and rerun) 49 | endif 50 | 51 | #Checks for SYSROOT 52 | ifneq ($(HOST_ARCH), x86) 53 | ifndef SYSROOT 54 | $(error SYSROOT variable is not set, please set correctly and rerun) 55 | endif 56 | endif 57 | 58 | #Checks for g++ 59 | ifeq ($(HOST_ARCH), x86) 60 | ifneq ($(shell expr $(shell g++ -dumpversion) \>= 5), 1) 61 | ifndef XILINX_VIVADO 62 | $(error [ERROR]: g++ version older. Please use 5.0 or above.) 63 | else 64 | CXX := $(XILINX_VIVADO)/tps/lnx64/gcc-6.2.0/bin/g++ 65 | $(warning [WARNING]: g++ version older. Using g++ provided by the tool : $(CXX)) 66 | endif 67 | endif 68 | else ifeq ($(HOST_ARCH), aarch64) 69 | CXX := $(XILINX_VITIS)/gnu/aarch64/lin/aarch64-linux/bin/aarch64-linux-gnu-g++ 70 | else ifeq ($(HOST_ARCH), aarch32) 71 | CXX := $(XILINX_VITIS)/gnu/aarch32/lin/gcc-arm-linux-gnueabi/bin/arm-linux-gnueabihf-g++ 72 | endif 73 | 74 | check-devices: 75 | ifndef DEVICE 76 | $(error DEVICE not set. Please set the DEVICE properly and rerun. Run "make help" for more details.) 77 | endif 78 | 79 | # device2xsa - create a filesystem friendly name from device name 80 | # $(1) - full name of device 81 | device2xsa = $(strip $(patsubst %.xpfm, % , $(shell basename $(DEVICE)))) 82 | 83 | # Cleaning stuff 84 | RM = rm -f 85 | RMDIR = rm -rf 86 | 87 | ECHO:= @echo 88 | 89 | docs: README.md 90 | 91 | README.md: description.json 92 | $(ABS_COMMON_REPO)/common/utility/readme_gen/readme_gen.py description.json 93 | -------------------------------------------------------------------------------- /xilinx/radix_baseline/utils.mk: -------------------------------------------------------------------------------- 1 | #+------------------------------------------------------------------------------- 2 | # The following parameters are assigned with default values. These parameters can 3 | # be overridden through the make command line 4 | #+------------------------------------------------------------------------------- 5 | 6 | PROFILE := no 7 | 8 | #Generates profile summary report 9 | ifeq ($(PROFILE), yes) 10 | LDCLFLAGS += --profile_kernel data:all:all:all 11 | endif 12 | 13 | DEBUG := no 14 | B_TEMP = `$(ABS_COMMON_REPO)/common/utility/parse_platform_list.py $(DEVICE)` 15 | 16 | #Generates debug summary report 17 | ifeq ($(DEBUG), yes) 18 | LDCLFLAGS += --dk list_ports 19 | endif 20 | 21 | #Setting Platform Path 22 | ifeq ($(findstring xpfm, $(DEVICE)), xpfm) 23 | B_NAME = $(shell dirname $(DEVICE)) 24 | else 25 | B_NAME = $(B_TEMP)/$(DEVICE) 26 | endif 27 | 28 | #Checks for XILINX_VITIS 29 | ifndef XILINX_VITIS 30 | $(error XILINX_VITIS variable is not set, please set correctly and rerun) 31 | endif 32 | 33 | #Checks for Device Family 34 | ifeq ($(HOST_ARCH), aarch32) 35 | DEV_FAM = 7Series 36 | else ifeq ($(HOST_ARCH), aarch64) 37 | DEV_FAM = Ultrascale 38 | endif 39 | 40 | #Checks for XILINX_XRT 41 | check-xrt: 42 | ifndef XILINX_XRT 43 | $(error XILINX_XRT variable is not set, please set correctly and rerun) 44 | endif 45 | 46 | #Checks for Correct architecture 47 | ifneq ($(HOST_ARCH), $(filter $(HOST_ARCH),aarch64 aarch32 x86)) 48 | $(error HOST_ARCH variable not set, please set correctly and rerun) 49 | endif 50 | 51 | #Checks for SYSROOT 52 | ifneq ($(HOST_ARCH), x86) 53 | ifndef SYSROOT 54 | $(error SYSROOT variable is not set, please set correctly and rerun) 55 | endif 56 | endif 57 | 58 | #Checks for g++ 59 | ifeq ($(HOST_ARCH), x86) 60 | ifneq ($(shell expr $(shell g++ -dumpversion) \>= 5), 1) 61 | ifndef XILINX_VIVADO 62 | $(error [ERROR]: g++ version older. Please use 5.0 or above.) 63 | else 64 | CXX := $(XILINX_VIVADO)/tps/lnx64/gcc-6.2.0/bin/g++ 65 | $(warning [WARNING]: g++ version older. Using g++ provided by the tool : $(CXX)) 66 | endif 67 | endif 68 | else ifeq ($(HOST_ARCH), aarch64) 69 | CXX := $(XILINX_VITIS)/gnu/aarch64/lin/aarch64-linux/bin/aarch64-linux-gnu-g++ 70 | else ifeq ($(HOST_ARCH), aarch32) 71 | CXX := $(XILINX_VITIS)/gnu/aarch32/lin/gcc-arm-linux-gnueabi/bin/arm-linux-gnueabihf-g++ 72 | endif 73 | 74 | check-devices: 75 | ifndef DEVICE 76 | $(error DEVICE not set. Please set the DEVICE properly and rerun. Run "make help" for more details.) 77 | endif 78 | 79 | # device2xsa - create a filesystem friendly name from device name 80 | # $(1) - full name of device 81 | device2xsa = $(strip $(patsubst %.xpfm, % , $(shell basename $(DEVICE)))) 82 | 83 | # Cleaning stuff 84 | RM = rm -f 85 | RMDIR = rm -rf 86 | 87 | ECHO:= @echo 88 | 89 | docs: README.md 90 | 91 | README.md: description.json 92 | $(ABS_COMMON_REPO)/common/utility/readme_gen/readme_gen.py description.json 93 | -------------------------------------------------------------------------------- /xilinx/radix_bica64/utils.mk: -------------------------------------------------------------------------------- 1 | #+------------------------------------------------------------------------------- 2 | # The following parameters are assigned with default values. These parameters can 3 | # be overridden through the make command line 4 | #+------------------------------------------------------------------------------- 5 | 6 | PROFILE := no 7 | 8 | #Generates profile summary report 9 | ifeq ($(PROFILE), yes) 10 | LDCLFLAGS += --profile_kernel data:all:all:all 11 | endif 12 | 13 | DEBUG := no 14 | B_TEMP = `$(ABS_COMMON_REPO)/common/utility/parse_platform_list.py $(DEVICE)` 15 | 16 | #Generates debug summary report 17 | ifeq ($(DEBUG), yes) 18 | LDCLFLAGS += --dk list_ports 19 | endif 20 | 21 | #Setting Platform Path 22 | ifeq ($(findstring xpfm, $(DEVICE)), xpfm) 23 | B_NAME = $(shell dirname $(DEVICE)) 24 | else 25 | B_NAME = $(B_TEMP)/$(DEVICE) 26 | endif 27 | 28 | #Checks for XILINX_VITIS 29 | ifndef XILINX_VITIS 30 | $(error XILINX_VITIS variable is not set, please set correctly and rerun) 31 | endif 32 | 33 | #Checks for Device Family 34 | ifeq ($(HOST_ARCH), aarch32) 35 | DEV_FAM = 7Series 36 | else ifeq ($(HOST_ARCH), aarch64) 37 | DEV_FAM = Ultrascale 38 | endif 39 | 40 | #Checks for XILINX_XRT 41 | check-xrt: 42 | ifndef XILINX_XRT 43 | $(error XILINX_XRT variable is not set, please set correctly and rerun) 44 | endif 45 | 46 | #Checks for Correct architecture 47 | ifneq ($(HOST_ARCH), $(filter $(HOST_ARCH),aarch64 aarch32 x86)) 48 | $(error HOST_ARCH variable not set, please set correctly and rerun) 49 | endif 50 | 51 | #Checks for SYSROOT 52 | ifneq ($(HOST_ARCH), x86) 53 | ifndef SYSROOT 54 | $(error SYSROOT variable is not set, please set correctly and rerun) 55 | endif 56 | endif 57 | 58 | #Checks for g++ 59 | ifeq ($(HOST_ARCH), x86) 60 | ifneq ($(shell expr $(shell g++ -dumpversion) \>= 5), 1) 61 | ifndef XILINX_VIVADO 62 | $(error [ERROR]: g++ version older. Please use 5.0 or above.) 63 | else 64 | CXX := $(XILINX_VIVADO)/tps/lnx64/gcc-6.2.0/bin/g++ 65 | $(warning [WARNING]: g++ version older. Using g++ provided by the tool : $(CXX)) 66 | endif 67 | endif 68 | else ifeq ($(HOST_ARCH), aarch64) 69 | CXX := $(XILINX_VITIS)/gnu/aarch64/lin/aarch64-linux/bin/aarch64-linux-gnu-g++ 70 | else ifeq ($(HOST_ARCH), aarch32) 71 | CXX := $(XILINX_VITIS)/gnu/aarch32/lin/gcc-arm-linux-gnueabi/bin/arm-linux-gnueabihf-g++ 72 | endif 73 | 74 | check-devices: 75 | ifndef DEVICE 76 | $(error DEVICE not set. Please set the DEVICE properly and rerun. Run "make help" for more details.) 77 | endif 78 | 79 | # device2xsa - create a filesystem friendly name from device name 80 | # $(1) - full name of device 81 | device2xsa = $(strip $(patsubst %.xpfm, % , $(shell basename $(DEVICE)))) 82 | 83 | # Cleaning stuff 84 | RM = rm -f 85 | RMDIR = rm -rf 86 | 87 | ECHO:= @echo 88 | 89 | docs: README.md 90 | 91 | README.md: description.json 92 | $(ABS_COMMON_REPO)/common/utility/readme_gen/readme_gen.py description.json 93 | -------------------------------------------------------------------------------- /xilinx/seq_u280_ch30/utils.mk: -------------------------------------------------------------------------------- 1 | #+------------------------------------------------------------------------------- 2 | # The following parameters are assigned with default values. These parameters can 3 | # be overridden through the make command line 4 | #+------------------------------------------------------------------------------- 5 | 6 | PROFILE := no 7 | 8 | #Generates profile summary report 9 | ifeq ($(PROFILE), yes) 10 | LDCLFLAGS += --profile_kernel data:all:all:all 11 | endif 12 | 13 | DEBUG := no 14 | B_TEMP = `$(ABS_COMMON_REPO)/common/utility/parse_platform_list.py $(DEVICE)` 15 | 16 | #Generates debug summary report 17 | ifeq ($(DEBUG), yes) 18 | LDCLFLAGS += --dk list_ports 19 | endif 20 | 21 | #Setting Platform Path 22 | ifeq ($(findstring xpfm, $(DEVICE)), xpfm) 23 | B_NAME = $(shell dirname $(DEVICE)) 24 | else 25 | B_NAME = $(B_TEMP)/$(DEVICE) 26 | endif 27 | 28 | #Checks for XILINX_VITIS 29 | ifndef XILINX_VITIS 30 | $(error XILINX_VITIS variable is not set, please set correctly and rerun) 31 | endif 32 | 33 | #Checks for Device Family 34 | ifeq ($(HOST_ARCH), aarch32) 35 | DEV_FAM = 7Series 36 | else ifeq ($(HOST_ARCH), aarch64) 37 | DEV_FAM = Ultrascale 38 | endif 39 | 40 | #Checks for XILINX_XRT 41 | check-xrt: 42 | ifndef XILINX_XRT 43 | $(error XILINX_XRT variable is not set, please set correctly and rerun) 44 | endif 45 | 46 | #Checks for Correct architecture 47 | ifneq ($(HOST_ARCH), $(filter $(HOST_ARCH),aarch64 aarch32 x86)) 48 | $(error HOST_ARCH variable not set, please set correctly and rerun) 49 | endif 50 | 51 | #Checks for SYSROOT 52 | ifneq ($(HOST_ARCH), x86) 53 | ifndef SYSROOT 54 | $(error SYSROOT variable is not set, please set correctly and rerun) 55 | endif 56 | endif 57 | 58 | #Checks for g++ 59 | ifeq ($(HOST_ARCH), x86) 60 | ifneq ($(shell expr $(shell g++ -dumpversion) \>= 5), 1) 61 | ifndef XILINX_VIVADO 62 | $(error [ERROR]: g++ version older. Please use 5.0 or above.) 63 | else 64 | CXX := $(XILINX_VIVADO)/tps/lnx64/gcc-6.2.0/bin/g++ 65 | $(warning [WARNING]: g++ version older. Using g++ provided by the tool : $(CXX)) 66 | endif 67 | endif 68 | else ifeq ($(HOST_ARCH), aarch64) 69 | CXX := $(XILINX_VITIS)/gnu/aarch64/lin/aarch64-linux/bin/aarch64-linux-gnu-g++ 70 | else ifeq ($(HOST_ARCH), aarch32) 71 | CXX := $(XILINX_VITIS)/gnu/aarch32/lin/gcc-arm-linux-gnueabi/bin/arm-linux-gnueabihf-g++ 72 | endif 73 | 74 | check-devices: 75 | ifndef DEVICE 76 | $(error DEVICE not set. Please set the DEVICE properly and rerun. Run "make help" for more details.) 77 | endif 78 | 79 | # device2xsa - create a filesystem friendly name from device name 80 | # $(1) - full name of device 81 | device2xsa = $(strip $(patsubst %.xpfm, % , $(shell basename $(DEVICE)))) 82 | 83 | # Cleaning stuff 84 | RM = rm -f 85 | RMDIR = rm -rf 86 | 87 | ECHO:= @echo 88 | 89 | docs: README.md 90 | 91 | README.md: description.json 92 | $(ABS_COMMON_REPO)/common/utility/readme_gen/readme_gen.py description.json 93 | -------------------------------------------------------------------------------- /xilinx/seq_u50_ch24/utils.mk: -------------------------------------------------------------------------------- 1 | #+------------------------------------------------------------------------------- 2 | # The following parameters are assigned with default values. These parameters can 3 | # be overridden through the make command line 4 | #+------------------------------------------------------------------------------- 5 | 6 | PROFILE := no 7 | 8 | #Generates profile summary report 9 | ifeq ($(PROFILE), yes) 10 | LDCLFLAGS += --profile_kernel data:all:all:all 11 | endif 12 | 13 | DEBUG := no 14 | B_TEMP = `$(ABS_COMMON_REPO)/common/utility/parse_platform_list.py $(DEVICE)` 15 | 16 | #Generates debug summary report 17 | ifeq ($(DEBUG), yes) 18 | LDCLFLAGS += --dk list_ports 19 | endif 20 | 21 | #Setting Platform Path 22 | ifeq ($(findstring xpfm, $(DEVICE)), xpfm) 23 | B_NAME = $(shell dirname $(DEVICE)) 24 | else 25 | B_NAME = $(B_TEMP)/$(DEVICE) 26 | endif 27 | 28 | #Checks for XILINX_VITIS 29 | ifndef XILINX_VITIS 30 | $(error XILINX_VITIS variable is not set, please set correctly and rerun) 31 | endif 32 | 33 | #Checks for Device Family 34 | ifeq ($(HOST_ARCH), aarch32) 35 | DEV_FAM = 7Series 36 | else ifeq ($(HOST_ARCH), aarch64) 37 | DEV_FAM = Ultrascale 38 | endif 39 | 40 | #Checks for XILINX_XRT 41 | check-xrt: 42 | ifndef XILINX_XRT 43 | $(error XILINX_XRT variable is not set, please set correctly and rerun) 44 | endif 45 | 46 | #Checks for Correct architecture 47 | ifneq ($(HOST_ARCH), $(filter $(HOST_ARCH),aarch64 aarch32 x86)) 48 | $(error HOST_ARCH variable not set, please set correctly and rerun) 49 | endif 50 | 51 | #Checks for SYSROOT 52 | ifneq ($(HOST_ARCH), x86) 53 | ifndef SYSROOT 54 | $(error SYSROOT variable is not set, please set correctly and rerun) 55 | endif 56 | endif 57 | 58 | #Checks for g++ 59 | ifeq ($(HOST_ARCH), x86) 60 | ifneq ($(shell expr $(shell g++ -dumpversion) \>= 5), 1) 61 | ifndef XILINX_VIVADO 62 | $(error [ERROR]: g++ version older. Please use 5.0 or above.) 63 | else 64 | CXX := $(XILINX_VIVADO)/tps/lnx64/gcc-6.2.0/bin/g++ 65 | $(warning [WARNING]: g++ version older. Using g++ provided by the tool : $(CXX)) 66 | endif 67 | endif 68 | else ifeq ($(HOST_ARCH), aarch64) 69 | CXX := $(XILINX_VITIS)/gnu/aarch64/lin/aarch64-linux/bin/aarch64-linux-gnu-g++ 70 | else ifeq ($(HOST_ARCH), aarch32) 71 | CXX := $(XILINX_VITIS)/gnu/aarch32/lin/gcc-arm-linux-gnueabi/bin/arm-linux-gnueabihf-g++ 72 | endif 73 | 74 | check-devices: 75 | ifndef DEVICE 76 | $(error DEVICE not set. Please set the DEVICE properly and rerun. Run "make help" for more details.) 77 | endif 78 | 79 | # device2xsa - create a filesystem friendly name from device name 80 | # $(1) - full name of device 81 | device2xsa = $(strip $(patsubst %.xpfm, % , $(shell basename $(DEVICE)))) 82 | 83 | # Cleaning stuff 84 | RM = rm -f 85 | RMDIR = rm -rf 86 | 87 | ECHO:= @echo 88 | 89 | docs: README.md 90 | 91 | README.md: description.json 92 | $(ABS_COMMON_REPO)/common/utility/readme_gen/readme_gen.py description.json 93 | -------------------------------------------------------------------------------- /xilinx/bsearch_baseline/utils.mk: -------------------------------------------------------------------------------- 1 | #+------------------------------------------------------------------------------- 2 | # The following parameters are assigned with default values. These parameters can 3 | # be overridden through the make command line 4 | #+------------------------------------------------------------------------------- 5 | 6 | PROFILE := no 7 | 8 | #Generates profile summary report 9 | ifeq ($(PROFILE), yes) 10 | LDCLFLAGS += --profile_kernel data:all:all:all 11 | endif 12 | 13 | DEBUG := no 14 | B_TEMP = `$(ABS_COMMON_REPO)/common/utility/parse_platform_list.py $(DEVICE)` 15 | 16 | #Generates debug summary report 17 | ifeq ($(DEBUG), yes) 18 | LDCLFLAGS += --dk list_ports 19 | endif 20 | 21 | #Setting Platform Path 22 | ifeq ($(findstring xpfm, $(DEVICE)), xpfm) 23 | B_NAME = $(shell dirname $(DEVICE)) 24 | else 25 | B_NAME = $(B_TEMP)/$(DEVICE) 26 | endif 27 | 28 | #Checks for XILINX_VITIS 29 | ifndef XILINX_VITIS 30 | $(error XILINX_VITIS variable is not set, please set correctly and rerun) 31 | endif 32 | 33 | #Checks for Device Family 34 | ifeq ($(HOST_ARCH), aarch32) 35 | DEV_FAM = 7Series 36 | else ifeq ($(HOST_ARCH), aarch64) 37 | DEV_FAM = Ultrascale 38 | endif 39 | 40 | #Checks for XILINX_XRT 41 | check-xrt: 42 | ifndef XILINX_XRT 43 | $(error XILINX_XRT variable is not set, please set correctly and rerun) 44 | endif 45 | 46 | #Checks for Correct architecture 47 | ifneq ($(HOST_ARCH), $(filter $(HOST_ARCH),aarch64 aarch32 x86)) 48 | $(error HOST_ARCH variable not set, please set correctly and rerun) 49 | endif 50 | 51 | #Checks for SYSROOT 52 | ifneq ($(HOST_ARCH), x86) 53 | ifndef SYSROOT 54 | $(error SYSROOT variable is not set, please set correctly and rerun) 55 | endif 56 | endif 57 | 58 | #Checks for g++ 59 | ifeq ($(HOST_ARCH), x86) 60 | ifneq ($(shell expr $(shell g++ -dumpversion) \>= 5), 1) 61 | ifndef XILINX_VIVADO 62 | $(error [ERROR]: g++ version older. Please use 5.0 or above.) 63 | else 64 | CXX := $(XILINX_VIVADO)/tps/lnx64/gcc-6.2.0/bin/g++ 65 | $(warning [WARNING]: g++ version older. Using g++ provided by the tool : $(CXX)) 66 | endif 67 | endif 68 | else ifeq ($(HOST_ARCH), aarch64) 69 | CXX := $(XILINX_VITIS)/gnu/aarch64/lin/aarch64-linux/bin/aarch64-linux-gnu-g++ 70 | else ifeq ($(HOST_ARCH), aarch32) 71 | CXX := $(XILINX_VITIS)/gnu/aarch32/lin/gcc-arm-linux-gnueabi/bin/arm-linux-gnueabihf-g++ 72 | endif 73 | 74 | check-devices: 75 | ifndef DEVICE 76 | $(error DEVICE not set. Please set the DEVICE properly and rerun. Run "make help" for more details.) 77 | endif 78 | 79 | # device2xsa - create a filesystem friendly name from device name 80 | # $(1) - full name of device 81 | device2xsa = $(strip $(patsubst %.xpfm, % , $(shell basename $(DEVICE)))) 82 | 83 | # Cleaning stuff 84 | RM = rm -f 85 | RMDIR = rm -rf 86 | 87 | ECHO:= @echo 88 | 89 | docs: README.md 90 | 91 | README.md: description.json 92 | $(ABS_COMMON_REPO)/common/utility/readme_gen/readme_gen.py description.json 93 | -------------------------------------------------------------------------------- /xilinx/seq_u280_ch30_64b/utils.mk: -------------------------------------------------------------------------------- 1 | #+------------------------------------------------------------------------------- 2 | # The following parameters are assigned with default values. These parameters can 3 | # be overridden through the make command line 4 | #+------------------------------------------------------------------------------- 5 | 6 | PROFILE := no 7 | 8 | #Generates profile summary report 9 | ifeq ($(PROFILE), yes) 10 | LDCLFLAGS += --profile_kernel data:all:all:all 11 | endif 12 | 13 | DEBUG := no 14 | B_TEMP = `$(ABS_COMMON_REPO)/common/utility/parse_platform_list.py $(DEVICE)` 15 | 16 | #Generates debug summary report 17 | ifeq ($(DEBUG), yes) 18 | LDCLFLAGS += --dk list_ports 19 | endif 20 | 21 | #Setting Platform Path 22 | ifeq ($(findstring xpfm, $(DEVICE)), xpfm) 23 | B_NAME = $(shell dirname $(DEVICE)) 24 | else 25 | B_NAME = $(B_TEMP)/$(DEVICE) 26 | endif 27 | 28 | #Checks for XILINX_VITIS 29 | ifndef XILINX_VITIS 30 | $(error XILINX_VITIS variable is not set, please set correctly and rerun) 31 | endif 32 | 33 | #Checks for Device Family 34 | ifeq ($(HOST_ARCH), aarch32) 35 | DEV_FAM = 7Series 36 | else ifeq ($(HOST_ARCH), aarch64) 37 | DEV_FAM = Ultrascale 38 | endif 39 | 40 | #Checks for XILINX_XRT 41 | check-xrt: 42 | ifndef XILINX_XRT 43 | $(error XILINX_XRT variable is not set, please set correctly and rerun) 44 | endif 45 | 46 | #Checks for Correct architecture 47 | ifneq ($(HOST_ARCH), $(filter $(HOST_ARCH),aarch64 aarch32 x86)) 48 | $(error HOST_ARCH variable not set, please set correctly and rerun) 49 | endif 50 | 51 | #Checks for SYSROOT 52 | ifneq ($(HOST_ARCH), x86) 53 | ifndef SYSROOT 54 | $(error SYSROOT variable is not set, please set correctly and rerun) 55 | endif 56 | endif 57 | 58 | #Checks for g++ 59 | ifeq ($(HOST_ARCH), x86) 60 | ifneq ($(shell expr $(shell g++ -dumpversion) \>= 5), 1) 61 | ifndef XILINX_VIVADO 62 | $(error [ERROR]: g++ version older. Please use 5.0 or above.) 63 | else 64 | CXX := $(XILINX_VIVADO)/tps/lnx64/gcc-6.2.0/bin/g++ 65 | $(warning [WARNING]: g++ version older. Using g++ provided by the tool : $(CXX)) 66 | endif 67 | endif 68 | else ifeq ($(HOST_ARCH), aarch64) 69 | CXX := $(XILINX_VITIS)/gnu/aarch64/lin/aarch64-linux/bin/aarch64-linux-gnu-g++ 70 | else ifeq ($(HOST_ARCH), aarch32) 71 | CXX := $(XILINX_VITIS)/gnu/aarch32/lin/gcc-arm-linux-gnueabi/bin/arm-linux-gnueabihf-g++ 72 | endif 73 | 74 | check-devices: 75 | ifndef DEVICE 76 | $(error DEVICE not set. Please set the DEVICE properly and rerun. Run "make help" for more details.) 77 | endif 78 | 79 | # device2xsa - create a filesystem friendly name from device name 80 | # $(1) - full name of device 81 | device2xsa = $(strip $(patsubst %.xpfm, % , $(shell basename $(DEVICE)))) 82 | 83 | # Cleaning stuff 84 | RM = rm -f 85 | RMDIR = rm -rf 86 | 87 | ECHO:= @echo 88 | 89 | docs: README.md 90 | 91 | README.md: description.json 92 | $(ABS_COMMON_REPO)/common/utility/readme_gen/readme_gen.py description.json 93 | -------------------------------------------------------------------------------- /xilinx/strided_u280_ch30/utils.mk: -------------------------------------------------------------------------------- 1 | #+------------------------------------------------------------------------------- 2 | # The following parameters are assigned with default values. These parameters can 3 | # be overridden through the make command line 4 | #+------------------------------------------------------------------------------- 5 | 6 | PROFILE := no 7 | 8 | #Generates profile summary report 9 | ifeq ($(PROFILE), yes) 10 | LDCLFLAGS += --profile_kernel data:all:all:all 11 | endif 12 | 13 | DEBUG := no 14 | B_TEMP = `$(ABS_COMMON_REPO)/common/utility/parse_platform_list.py $(DEVICE)` 15 | 16 | #Generates debug summary report 17 | ifeq ($(DEBUG), yes) 18 | LDCLFLAGS += --dk list_ports 19 | endif 20 | 21 | #Setting Platform Path 22 | ifeq ($(findstring xpfm, $(DEVICE)), xpfm) 23 | B_NAME = $(shell dirname $(DEVICE)) 24 | else 25 | B_NAME = $(B_TEMP)/$(DEVICE) 26 | endif 27 | 28 | #Checks for XILINX_VITIS 29 | ifndef XILINX_VITIS 30 | $(error XILINX_VITIS variable is not set, please set correctly and rerun) 31 | endif 32 | 33 | #Checks for Device Family 34 | ifeq ($(HOST_ARCH), aarch32) 35 | DEV_FAM = 7Series 36 | else ifeq ($(HOST_ARCH), aarch64) 37 | DEV_FAM = Ultrascale 38 | endif 39 | 40 | #Checks for XILINX_XRT 41 | check-xrt: 42 | ifndef XILINX_XRT 43 | $(error XILINX_XRT variable is not set, please set correctly and rerun) 44 | endif 45 | 46 | #Checks for Correct architecture 47 | ifneq ($(HOST_ARCH), $(filter $(HOST_ARCH),aarch64 aarch32 x86)) 48 | $(error HOST_ARCH variable not set, please set correctly and rerun) 49 | endif 50 | 51 | #Checks for SYSROOT 52 | ifneq ($(HOST_ARCH), x86) 53 | ifndef SYSROOT 54 | $(error SYSROOT variable is not set, please set correctly and rerun) 55 | endif 56 | endif 57 | 58 | #Checks for g++ 59 | ifeq ($(HOST_ARCH), x86) 60 | ifneq ($(shell expr $(shell g++ -dumpversion) \>= 5), 1) 61 | ifndef XILINX_VIVADO 62 | $(error [ERROR]: g++ version older. Please use 5.0 or above.) 63 | else 64 | CXX := $(XILINX_VIVADO)/tps/lnx64/gcc-6.2.0/bin/g++ 65 | $(warning [WARNING]: g++ version older. Using g++ provided by the tool : $(CXX)) 66 | endif 67 | endif 68 | else ifeq ($(HOST_ARCH), aarch64) 69 | CXX := $(XILINX_VITIS)/gnu/aarch64/lin/aarch64-linux/bin/aarch64-linux-gnu-g++ 70 | else ifeq ($(HOST_ARCH), aarch32) 71 | CXX := $(XILINX_VITIS)/gnu/aarch32/lin/gcc-arm-linux-gnueabi/bin/arm-linux-gnueabihf-g++ 72 | endif 73 | 74 | check-devices: 75 | ifndef DEVICE 76 | $(error DEVICE not set. Please set the DEVICE properly and rerun. Run "make help" for more details.) 77 | endif 78 | 79 | # device2xsa - create a filesystem friendly name from device name 80 | # $(1) - full name of device 81 | device2xsa = $(strip $(patsubst %.xpfm, % , $(shell basename $(DEVICE)))) 82 | 83 | # Cleaning stuff 84 | RM = rm -f 85 | RMDIR = rm -rf 86 | 87 | ECHO:= @echo 88 | 89 | docs: README.md 90 | 91 | README.md: description.json 92 | $(ABS_COMMON_REPO)/common/utility/readme_gen/readme_gen.py description.json 93 | -------------------------------------------------------------------------------- /xilinx/common/utility/makefile_gen/descgen.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | from sys import argv 3 | import json 4 | import glob 5 | import os 6 | import re 7 | import subprocess 8 | 9 | script, desc_file = argv 10 | desc = open(desc_file, 'r') 11 | data = json.load(desc) 12 | desc.close() 13 | 14 | #top level list : dict_new 15 | dict_new = {} 16 | if 'example' in data: 17 | dict_new['name'] = data.pop('example') 18 | if 'overview' in data: 19 | dict_new['description'] = data.pop('overview') 20 | if 'board' in data: 21 | dict_new['device'] = data.pop('board') 22 | if 'nboard' in data: 23 | dict_new['ndevice'] = data.pop('nboard') 24 | if 'sdx_gui' in data: 25 | dict_new['gui'] = data.pop('sdx_gui') 26 | 27 | 28 | 29 | #host_list = [] 30 | host_dict = {} 31 | if 'host_exe' in data: 32 | host_dict['host_exe'] = data.pop('host_exe') 33 | 34 | #if 'host_srcs' in data: 35 | # srcs = data['host_srcs'].split(" ") 36 | # host_dict['sources'] = srcs 37 | # del data['host_srcs'] 38 | #if 'host_hdrs' in data: 39 | # hdrs = data['host_hdrs'].split(" ") 40 | # host_dict['sources'].extend(hdrs) 41 | # del data['host_hdrs'] 42 | 43 | #linker_list = [] 44 | #linker_dict = {} 45 | #library_paths = [] 46 | #library_paths.append("REPO_DIR/common/libs/") 47 | #linker_dict['librarypaths'] = library_paths 48 | #if 'libs' in data: 49 | # library = [] 50 | # for item in data['libs']: 51 | # library.append(item["name"]) 52 | # linker_dict['libraries'] = library 53 | 54 | if 'linker' in data: 55 | linker_dict = {} 56 | linker_dict.update(data['linker']) 57 | del data['linker'] 58 | #linker_list.append(linker_dict) 59 | host_dict['linker'] = linker_dict 60 | 61 | 62 | 63 | if 'libs' or 'compiler' or 'host_srcs' or 'host_hdrs' in data: 64 | #compiler_list = [] 65 | compiler_dict = {} 66 | if 'libs' or 'host_srcs' or 'host_hdrs' in data: 67 | srcs = [] 68 | if 'libs' in data: 69 | include_paths = [] 70 | for item in data['libs']: 71 | include_paths.append('REPO_DIR/common/includes/'+ item) 72 | srcs.append('REPO_DIR/common/includes/'+ item) 73 | compiler_dict['includepaths'] = include_paths 74 | del data['libs'] 75 | if 'compiler' in data: 76 | compiler_dict.update(data['compiler']) 77 | if 'host_srcs' in data: 78 | srcs.extend(data['host_srcs'].split(" ")) 79 | #compiler_dict['sources'] = srcs 80 | del data['host_srcs'] 81 | if 'host_hdrs' in data: 82 | hdrs = data['host_hdrs'].split(" ") 83 | srcs.extend(hdrs) 84 | del data['host_hdrs'] 85 | 86 | compiler_dict['sources'] = srcs 87 | 88 | 89 | #compiler_list.append(compiler_dict) 90 | #host_dict['compiler'] = compiler_list 91 | host_dict['compiler'] = compiler_dict 92 | 93 | 94 | if 'cmd_args' in data: 95 | launch_list = [] 96 | emu_cmd_dictny = {} 97 | emu_cmd_dictny['name'] = 'generic launch for all flows' 98 | emu_cmd_dictny['cmd_args'] = data.pop('cmd_args') 99 | launch_list.append(emu_cmd_dictny) 100 | dict_new['launch'] = launch_list 101 | 102 | 103 | #host_list.append(host_dict) 104 | dict_new['host'] = host_dict 105 | 106 | dict_new['platform_type'] = "pcie" 107 | 108 | data.update(dict_new) 109 | 110 | target = open('description.json', 'w+') 111 | json.dump(data, target, indent=4, sort_keys=False) 112 | -------------------------------------------------------------------------------- /xilinx/common/includes/logger/logger.h: -------------------------------------------------------------------------------- 1 | /********** 2 | Copyright (c) 2019, Xilinx, Inc. 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without modification, 6 | are permitted provided that the following conditions are met: 7 | 8 | 1. Redistributions of source code must retain the above copyright notice, 9 | this list of conditions and the following disclaimer. 10 | 11 | 2. Redistributions in binary form must reproduce the above copyright notice, 12 | this list of conditions and the following disclaimer in the documentation 13 | and/or other materials provided with the distribution. 14 | 15 | 3. Neither the name of the copyright holder nor the names of its contributors 16 | may be used to endorse or promote products derived from this software 17 | without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 20 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 21 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 22 | IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 23 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 24 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 26 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 27 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | **********/ 29 | #ifndef LOGGER_H_ 30 | #define LOGGER_H_ 31 | 32 | #include 33 | #include 34 | #include 35 | #include 36 | 37 | 38 | #define ENABLE_LOG_TOFILE 1 39 | #define ENABLE_LOG_TIME 1 40 | 41 | //global logging 42 | #define LogInfo(desc, ...) sda::LogWrapper(0, __FILE__, __LINE__, desc, ##__VA_ARGS__) 43 | #define LogWarn(desc, ...) sda::LogWrapper(1, __FILE__, __LINE__, desc, ##__VA_ARGS__) 44 | #define LogError(desc, ...) sda::LogWrapper(2, __FILE__, __LINE__, desc, ##__VA_ARGS__) 45 | 46 | using namespace std; 47 | 48 | namespace sda { 49 | 50 | enum LOGTYPE {etInfo, etWarning, etError}; 51 | 52 | //string 53 | string& ltrim(string& s); 54 | string& rtrim(string& s); 55 | string& trim(string& s); 56 | string GetFileExt(const string& s); 57 | string GetFileTitleOnly(const string& s); 58 | 59 | string ToLower(const string& s); 60 | string ToUpper(const string& s); 61 | 62 | //time 63 | string GetTimeStamp(); 64 | 65 | //paths 66 | string GetApplicationPath(); 67 | 68 | 69 | //debug 70 | template 71 | void PrintPOD(const vector& pod, size_t display_count = 0, const int precision = 4) { 72 | 73 | size_t count = pod.size(); 74 | if(display_count > 0) 75 | count = std::min(pod.size(), display_count); 76 | 77 | for(size_t i = 0; i < count; i++) { 78 | cout << std::setprecision(precision) << pod[i] << ", "; 79 | } 80 | cout << endl; 81 | } 82 | 83 | //logging 84 | void LogWrapper(int etype, const char* file, int line, const char* desc, ...); 85 | 86 | } 87 | 88 | 89 | 90 | #endif /* LOGGER_H_ */ 91 | -------------------------------------------------------------------------------- /xilinx/common/includes/bitmap/bitmap.cpp: -------------------------------------------------------------------------------- 1 | /********** 2 | Copyright (c) 2019, Xilinx, Inc. 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without modification, 6 | are permitted provided that the following conditions are met: 7 | 8 | 1. Redistributions of source code must retain the above copyright notice, 9 | this list of conditions and the following disclaimer. 10 | 11 | 2. Redistributions in binary form must reproduce the above copyright notice, 12 | this list of conditions and the following disclaimer in the documentation 13 | and/or other materials provided with the distribution. 14 | 15 | 3. Neither the name of the copyright holder nor the names of its contributors 16 | may be used to endorse or promote products derived from this software 17 | without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 20 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 21 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 22 | IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 23 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 24 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 26 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 27 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | **********/ 29 | #include 30 | #include 31 | #include 32 | #include 33 | 34 | #include 35 | 36 | #include "bitmap.h" 37 | 38 | BitmapInterface::BitmapInterface(const char *f) : filename(f) { 39 | core = NULL; 40 | dib = NULL; 41 | image = NULL; 42 | 43 | magicNumber = 0; 44 | fileSize = 0; 45 | offsetOfImage = 0; 46 | 47 | sizeOfDIB = 0; 48 | sizeOfImage = 0; 49 | 50 | height = -1; 51 | width = -1; 52 | } 53 | 54 | BitmapInterface::~BitmapInterface() { 55 | if (core != NULL) 56 | delete[] core; 57 | if (dib != NULL) 58 | delete[] dib; 59 | if (image != NULL) 60 | delete[] image; 61 | } 62 | 63 | bool BitmapInterface::readBitmapFile() { 64 | // First, open the bitmap file 65 | int fd; 66 | unsigned int fileSize; 67 | 68 | fd = open(filename, O_RDONLY); 69 | if (fd < 0) { 70 | std::cerr << "Cannot read image file " << filename << std::endl; 71 | return false; 72 | } 73 | 74 | core = new char[14]; 75 | read(fd, core, 14); 76 | magicNumber = (*(unsigned short *)(&(core[0]))); 77 | fileSize = (*(unsigned int *)(&(core[2]))); 78 | offsetOfImage = (*(unsigned int *)(&(core[10]))); 79 | 80 | // Just read in the DIB, but don't process it 81 | sizeOfDIB = offsetOfImage - 14; 82 | dib = new char[sizeOfDIB]; 83 | read(fd, dib, sizeOfDIB); 84 | 85 | width = (*(int *)(&(dib[4]))); 86 | height = (*(int *)(&(dib[8]))); 87 | 88 | sizeOfImage = fileSize - 14 - sizeOfDIB; 89 | int numPixels = sizeOfImage / 3; // RGB 90 | 91 | image = new int[numPixels]; 92 | 93 | for (int i = 0; i < numPixels; ++i) { 94 | // Use an integer for every pixel even though we might not need that 95 | // much space (padding 0 bits in the rest of the integer) 96 | image[i] = 0; 97 | read(fd, &(image[i]), 3); 98 | } 99 | 100 | return true; 101 | } 102 | 103 | bool BitmapInterface::writeBitmapFile(int *otherImage) { 104 | int fd; 105 | fd = open("output.bmp", O_WRONLY | O_CREAT, 0644); 106 | 107 | if (fd < 0) { 108 | std::cerr << "Cannot open output.bmp for writing!" << std::endl; 109 | return false; 110 | } 111 | 112 | write(fd, core, 14); 113 | write(fd, dib, sizeOfDIB); 114 | 115 | int numPixels = sizeOfImage / 3; 116 | 117 | int *outputImage = otherImage != NULL ? otherImage : image; 118 | 119 | for (int i = 0; i < numPixels; ++i) { 120 | write(fd, &(outputImage[i]), 3); 121 | } 122 | 123 | return true; 124 | } 125 | -------------------------------------------------------------------------------- /xilinx/common/includes/xcl2/xcl2.cpp: -------------------------------------------------------------------------------- 1 | /********** 2 | Copyright (c) 2019, Xilinx, Inc. 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without modification, 6 | are permitted provided that the following conditions are met: 7 | 8 | 1. Redistributions of source code must retain the above copyright notice, 9 | this list of conditions and the following disclaimer. 10 | 11 | 2. Redistributions in binary form must reproduce the above copyright notice, 12 | this list of conditions and the following disclaimer in the documentation 13 | and/or other materials provided with the distribution. 14 | 15 | 3. Neither the name of the copyright holder nor the names of its contributors 16 | may be used to endorse or promote products derived from this software 17 | without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 20 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 21 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 22 | IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 23 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 24 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 26 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 27 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | **********/ 29 | 30 | #include "xcl2.hpp" 31 | #include 32 | #include 33 | #include 34 | 35 | namespace xcl { 36 | std::vector get_devices(const std::string &vendor_name) { 37 | size_t i; 38 | cl_int err; 39 | std::vector platforms; 40 | OCL_CHECK(err, err = cl::Platform::get(&platforms)); 41 | cl::Platform platform; 42 | for (i = 0; i < platforms.size(); i++) { 43 | platform = platforms[i]; 44 | OCL_CHECK(err, 45 | std::string platformName = 46 | platform.getInfo(&err)); 47 | if (platformName == vendor_name) { 48 | std::cout << "Found Platform" << std::endl; 49 | std::cout << "Platform Name: " << platformName.c_str() << std::endl; 50 | break; 51 | } 52 | } 53 | if (i == platforms.size()) { 54 | std::cout << "Error: Failed to find Xilinx platform" << std::endl; 55 | exit(EXIT_FAILURE); 56 | } 57 | //Getting ACCELERATOR Devices and selecting 1st such device 58 | std::vector devices; 59 | OCL_CHECK(err, 60 | err = platform.getDevices(CL_DEVICE_TYPE_ACCELERATOR, &devices)); 61 | return devices; 62 | } 63 | 64 | std::vector get_xil_devices() { return get_devices("Xilinx"); } 65 | 66 | std::vector 67 | read_binary_file(const std::string &xclbin_file_name) { 68 | std::cout << "INFO: Reading " << xclbin_file_name << std::endl; 69 | 70 | if (access(xclbin_file_name.c_str(), R_OK) != 0) { 71 | printf("ERROR: %s xclbin not available please build\n", 72 | xclbin_file_name.c_str()); 73 | exit(EXIT_FAILURE); 74 | } 75 | //Loading XCL Bin into char buffer 76 | std::cout << "Loading: '" << xclbin_file_name.c_str() << "'\n"; 77 | std::ifstream bin_file(xclbin_file_name.c_str(), std::ifstream::binary); 78 | bin_file.seekg(0, bin_file.end); 79 | auto nb = bin_file.tellg(); 80 | bin_file.seekg(0, bin_file.beg); 81 | std::vector buf; 82 | buf.resize(nb); 83 | bin_file.read(reinterpret_cast(buf.data()), nb); 84 | return buf; 85 | } 86 | 87 | bool is_emulation() { 88 | bool ret = false; 89 | char *xcl_mode = getenv("XCL_EMULATION_MODE"); 90 | if (xcl_mode != NULL) { 91 | ret = true; 92 | } 93 | return ret; 94 | } 95 | 96 | bool is_hw_emulation() { 97 | bool ret = false; 98 | char *xcl_mode = getenv("XCL_EMULATION_MODE"); 99 | if ((xcl_mode != NULL) && !strcmp(xcl_mode, "hw_emu")) { 100 | ret = true; 101 | } 102 | return ret; 103 | } 104 | 105 | bool is_xpr_device(const char *device_name) { 106 | const char *output = strstr(device_name, "xpr"); 107 | 108 | if (output == NULL) { 109 | return false; 110 | } else { 111 | return true; 112 | } 113 | } 114 | }; // namespace xcl 115 | -------------------------------------------------------------------------------- /xilinx/common/utility/readme_gen/gs_summary_util.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import os, re 4 | import fnmatch 5 | import json 6 | 7 | 8 | def get_testcases(dir): 9 | testcase_list = [] 10 | for root, dirnames, filenames in os.walk(dir): 11 | for filename in fnmatch.filter(filenames, 'description.json'): 12 | testcase_list.append(os.path.join(root, filename)) 13 | return testcase_list 14 | 15 | def get_drives(dir): 16 | folders = [] 17 | while 1: 18 | dir, folder = os.path.split(dir) 19 | if folder != "" and folder != ".": 20 | folders.append(folder) 21 | else: 22 | break 23 | folders.reverse() 24 | return folders 25 | 26 | def get_immediate_subdirectories(dir): 27 | return [name for name in os.listdir(dir) 28 | if os.path.isdir(os.path.join(dir, name))] 29 | 30 | def gen_category(dir ,outfile, subdircount): 31 | 32 | links = "[" + dir +"]:"+ dir + "\n" 33 | testcaselist = get_testcases(dir); 34 | testcaselist.sort(); 35 | for testcase in testcaselist: 36 | drives = get_drives(testcase) 37 | link = "" 38 | if len(drives) <= subdircount : 39 | continue 40 | for drive in drives: 41 | if drive == "description.json": 42 | continue 43 | link += drive +"/" 44 | links += "[" + link + "]:" + link + "\n" 45 | 46 | outfile.write("["+link+"][]") 47 | outfile.write("|") 48 | desc = open(testcase,'r') 49 | data = json.load(desc) 50 | outfile.write(('\n').join(data["description"])) 51 | outfile.write("|") 52 | if 'key_concepts' in data: 53 | outfile.write("__Key__ __Concepts__") 54 | key_concepts = data["key_concepts"] 55 | for i, kc in enumerate(key_concepts): 56 | outfile.write("
") 57 | outfile.write(" - ") 58 | outfile.write(kc) 59 | outfile.write("
") 60 | if 'keywords' in data: 61 | outfile.write("__Keywords__") 62 | keywords = data["keywords"] 63 | for i, kw in enumerate(keywords): 64 | outfile.write("
") 65 | outfile.write(" - ") 66 | outfile.write(kw) 67 | outfile.write("\n") 68 | desc.close() 69 | return links 70 | 71 | def genReadMe(dir): 72 | desc = open(os.path.join(dir,"summary.json"),'r') 73 | data = json.load(desc) 74 | outfile = open(os.path.join(dir, "README.md"), "w") 75 | outfile.write(('\n').join((data["description"]))) 76 | outfile.write("\n") 77 | outfile.write("==================================\n") 78 | outfile.write(('\n').join((data["description"]))) 79 | outfile.write("\n") 80 | if 'subdirs' in data: 81 | subDirs = data['subdirs']; 82 | else: 83 | subDirs = get_immediate_subdirectories(dir); 84 | subDirs.sort(); 85 | outfile.write("\nS.No. | Category | Description \n") 86 | outfile.write("--------|-----------|-----------------------------------------\n") 87 | counter = 1; 88 | links = "" 89 | 90 | for subDir in subDirs: 91 | desc_file = os.path.join(subDir,"summary.json") 92 | if os.path.exists(desc_file): 93 | subDirDesc = open(os.path.join(subDir,"summary.json"),'r') 94 | subDirData = json.load(subDirDesc) 95 | outfile.write(str(counter)); 96 | outfile.write(" | [" +subDir +"][] |") 97 | outfile.write(('\n').join(subDirData["description"])) 98 | outfile.write("\n") 99 | counter = counter + 1; 100 | 101 | outfile.write("\n __Examples Table__ \n") 102 | table_header = """ 103 | Example | Description | Key Concepts / Keywords 104 | ---------------|-----------------------|------------------------- 105 | """ 106 | outfile.write(table_header) 107 | for subDir in subDirs: 108 | links = links + gen_category(subDir,outfile,2); 109 | 110 | outfile.write("\n") 111 | outfile.write(links) 112 | outfile.close(); 113 | 114 | def genReadMe2(dir): 115 | desc = open(os.path.join(dir,"summary.json"),'r') 116 | data = json.load(desc) 117 | outfile = open(os.path.join(dir, "README.md"), "w") 118 | outfile.write(('\n').join((data["overview"]))) 119 | outfile.write("\n") 120 | outfile.write("==================================\n") 121 | outfile.write(('\n').join((data["description"]))) 122 | outfile.write("\n") 123 | outfile.write("\n __Examples Table__ \n") 124 | table_header = """ 125 | Example | Description | Key Concepts / Keywords 126 | ---------------|-----------------------|------------------------- 127 | """ 128 | outfile.write(table_header) 129 | links = gen_category(dir,outfile,1) 130 | outfile.write("\n") 131 | outfile.write(links) 132 | outfile.close(); 133 | 134 | -------------------------------------------------------------------------------- /xilinx/common/includes/cmdparser/cmdlineparser.h: -------------------------------------------------------------------------------- 1 | /********** 2 | Copyright (c) 2019, Xilinx, Inc. 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without modification, 6 | are permitted provided that the following conditions are met: 7 | 8 | 1. Redistributions of source code must retain the above copyright notice, 9 | this list of conditions and the following disclaimer. 10 | 11 | 2. Redistributions in binary form must reproduce the above copyright notice, 12 | this list of conditions and the following disclaimer in the documentation 13 | and/or other materials provided with the distribution. 14 | 15 | 3. Neither the name of the copyright holder nor the names of its contributors 16 | may be used to endorse or promote products derived from this software 17 | without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 20 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 21 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 22 | IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 23 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 24 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 26 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 27 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | **********/ 29 | #ifndef CMDLINEPARSER_H_ 30 | #define CMDLINEPARSER_H_ 31 | 32 | #include 33 | #include 34 | #include 35 | 36 | using namespace std; 37 | 38 | namespace sda { 39 | namespace utils { 40 | 41 | bool is_file(const std::string& name); 42 | 43 | /*! 44 | * Synopsis: 45 | * 1.Parses the command line passed in from the user and stores all enabled 46 | * system options. 47 | * 2.Prints help for the user if an option is not valid. 48 | * 3.Stores options and provides a mechanism to read those options 49 | */ 50 | class CmdLineParser { 51 | public: 52 | class CmdSwitch { 53 | public: 54 | CmdSwitch() {} 55 | CmdSwitch(const CmdSwitch& rhs) { 56 | copyfrom(rhs); 57 | } 58 | 59 | void copyfrom(const CmdSwitch& rhs) { 60 | this->key = rhs.key; 61 | this->shortcut = rhs.shortcut; 62 | this->default_value = rhs.default_value; 63 | this->value = rhs.value; 64 | this->desc = rhs.desc; 65 | this->istoggle = rhs.istoggle; 66 | this->isvalid = rhs.isvalid; 67 | } 68 | 69 | CmdSwitch& operator=(const CmdSwitch& rhs) { 70 | this->copyfrom(rhs); 71 | return *this; 72 | } 73 | public: 74 | string key; 75 | string shortcut; 76 | string default_value; 77 | string value; 78 | string desc; 79 | bool istoggle; 80 | bool isvalid; 81 | }; 82 | 83 | public: 84 | CmdLineParser(); 85 | //CmdLineParser(int argc, char* argv[]); 86 | virtual ~CmdLineParser(); 87 | 88 | 89 | bool addSwitch(const CmdSwitch& s); 90 | bool addSwitch(const string& name, const string& shortcut, 91 | const string& desc, const string& default_value = "", 92 | bool istoggle = false); 93 | 94 | /*! 95 | * sets default key to be able to read a 2 argumented call 96 | */ 97 | bool setDefaultKey(const char* key); 98 | 99 | /*! 100 | * parse and store command line 101 | */ 102 | int parse(int argc, char* argv[]); 103 | 104 | /*! 105 | * retrieve value using a key 106 | */ 107 | string value(const char* key); 108 | 109 | int value_to_int(const char* key); 110 | 111 | 112 | double value_to_double(const char* key); 113 | 114 | /*! 115 | * Returns true if a valid value is supplied by user 116 | */ 117 | bool isValid(const char* key); 118 | 119 | /*! 120 | * prints the help menu in case the options are not correct. 121 | */ 122 | virtual void printHelp(); 123 | 124 | protected: 125 | /*! 126 | * Retrieve command switch 127 | */ 128 | CmdSwitch* getCmdSwitch(const char* key); 129 | 130 | bool token_to_fullkeyname(const string& token, string& fullkey); 131 | 132 | 133 | private: 134 | map m_mapKeySwitch; 135 | map m_mapShortcutKeys; 136 | vector m_vSwitches; 137 | string m_strDefaultKey; 138 | string m_appname; 139 | }; 140 | 141 | //bool starts_with(const string& src, const string& sub); 142 | 143 | } 144 | } 145 | #endif /* CMDLINEPARSER_H_ */ 146 | -------------------------------------------------------------------------------- /xilinx/common/includes/xcl2/xcl2.hpp: -------------------------------------------------------------------------------- 1 | /********** 2 | Copyright (c) 2018, Xilinx, Inc. 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without modification, 6 | are permitted provided that the following conditions are met: 7 | 8 | 1. Redistributions of source code must retain the above copyright notice, 9 | this list of conditions and the following disclaimer. 10 | 11 | 2. Redistributions in binary form must reproduce the above copyright notice, 12 | this list of conditions and the following disclaimer in the documentation 13 | and/or other materials provided with the distribution. 14 | 15 | 3. Neither the name of the copyright holder nor the names of its contributors 16 | may be used to endorse or promote products derived from this software 17 | without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 20 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 21 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 22 | IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 23 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 24 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 26 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 27 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | **********/ 29 | 30 | 31 | #pragma once 32 | 33 | #define CL_HPP_CL_1_2_DEFAULT_BUILD 34 | #define CL_HPP_TARGET_OPENCL_VERSION 120 35 | #define CL_HPP_MINIMUM_OPENCL_VERSION 120 36 | #define CL_HPP_ENABLE_PROGRAM_CONSTRUCTION_FROM_ARRAY_COMPATIBILITY 1 37 | #define CL_USE_DEPRECATED_OPENCL_1_2_APIS 38 | 39 | //OCL_CHECK doesn't work if call has templatized function call 40 | #define OCL_CHECK(error,call) \ 41 | call; \ 42 | if (error != CL_SUCCESS) { \ 43 | printf("%s:%d Error calling " #call ", error code is: %d\n", \ 44 | __FILE__,__LINE__, error); \ 45 | exit(EXIT_FAILURE); \ 46 | } 47 | 48 | #include 49 | #include 50 | #include 51 | #include 52 | // When creating a buffer with user pointer (CL_MEM_USE_HOST_PTR), under the hood 53 | // User ptr is used if and only if it is properly aligned (page aligned). When not 54 | // aligned, runtime has no choice but to create its own host side buffer that backs 55 | // user ptr. This in turn implies that all operations that move data to and from 56 | // device incur an extra memcpy to move data to/from runtime's own host buffer 57 | // from/to user pointer. So it is recommended to use this allocator if user wish to 58 | // Create Buffer/Memory Object with CL_MEM_USE_HOST_PTR to align user buffer to the 59 | // page boundary. It will ensure that user buffer will be used when user create 60 | // Buffer/Mem Object with CL_MEM_USE_HOST_PTR. 61 | template 62 | struct aligned_allocator 63 | { 64 | using value_type = T; 65 | T* allocate(std::size_t num) 66 | { 67 | void* ptr = nullptr; 68 | if (posix_memalign(&ptr,4096,num*sizeof(T))) 69 | throw std::bad_alloc(); 70 | return reinterpret_cast(ptr); 71 | } 72 | void deallocate(T* p, std::size_t num) 73 | { 74 | free(p); 75 | } 76 | }; 77 | 78 | namespace xcl { 79 | std::vector get_xil_devices(); 80 | std::vector get_devices(const std::string& vendor_name); 81 | std::vector read_binary_file(const std::string &xclbin_file_name); 82 | bool is_emulation (); 83 | bool is_hw_emulation (); 84 | bool is_xpr_device (const char *device_name); 85 | class Stream{ 86 | public: 87 | static decltype(&clCreateStream) createStream; 88 | static decltype(&clReleaseStream) releaseStream; 89 | static decltype(&clReadStream) readStream; 90 | static decltype(&clWriteStream) writeStream; 91 | static decltype(&clPollStreams) pollStreams; 92 | static void init(const cl_platform_id& platform) { 93 | void *bar = clGetExtensionFunctionAddressForPlatform(platform, "clCreateStream"); 94 | createStream = (decltype(&clCreateStream))bar; 95 | bar = clGetExtensionFunctionAddressForPlatform(platform, "clReleaseStream"); 96 | releaseStream = (decltype(&clReleaseStream))bar; 97 | bar = clGetExtensionFunctionAddressForPlatform(platform, "clReadStream"); 98 | readStream = (decltype(&clReadStream))bar; 99 | bar = clGetExtensionFunctionAddressForPlatform(platform, "clWriteStream"); 100 | writeStream = (decltype(&clWriteStream))bar; 101 | bar = clGetExtensionFunctionAddressForPlatform(platform, "clPollStreams"); 102 | pollStreams = (decltype(&clPollStreams))bar; 103 | } 104 | }; 105 | } 106 | -------------------------------------------------------------------------------- /xilinx/common/utility/readme_gen/readme_gen.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env /tools/cpkg/.packages/x86_64/RHEL7.2/python/3.7.1/bin/python3.7 2 | from sys import argv 3 | import json 4 | from collections import OrderedDict 5 | import os 6 | import subprocess 7 | 8 | XSA = 'xilinx_u200_qdma' 9 | VERSION = 'VITIS 2019.2' 10 | 11 | def overview(target,data): 12 | target.write(data["name"]) 13 | target.write("\n") 14 | target.write("======================\n\n") 15 | target.write(('\n').join(data["description"])) 16 | target.write("\n\n") 17 | if 'more_info' in data: 18 | target.write(('\n').join(data["more_info"])) 19 | target.write("\n\n") 20 | if 'perf_fields' in data: 21 | target.write("### PERFORMANCE\n") 22 | ctr = len(data["perf_fields"]) 23 | for idx in range(0, ctr - 1): 24 | target.write(data["perf_fields"][idx]) 25 | target.write("|") 26 | target.write(data["perf_fields"][ctr - 1]) 27 | target.write("\n") 28 | for idx in range(0, ctr - 1): 29 | target.write("-----|") 30 | target.write("-----\n") 31 | count = len(data["performance"]) 32 | for result in range(0, count): 33 | for i in range(0, ctr - 1): 34 | target.write(data["performance"][result][i]) 35 | target.write("|") 36 | target.write(data["performance"][result][ctr - 1]) 37 | target.write("\n") 38 | if 'key_concepts' in data: 39 | target.write("***KEY CONCEPTS:*** ") 40 | elem_count = len(data["key_concepts"]) 41 | for result in data["key_concepts"]: 42 | elem_count -= 1 43 | target.write(result) 44 | if elem_count != 0: 45 | target.write(", ") 46 | target.write("\n\n") 47 | if 'keywords' in data: 48 | target.write("***KEYWORDS:*** ") 49 | word_count = len(data["keywords"]) 50 | for result in data["keywords"]: 51 | word_count -= 1 52 | target.write(result) 53 | if word_count != 0: 54 | target.write(", ") 55 | target.write("\n\n") 56 | return 57 | 58 | def requirements(target,data): 59 | if 'ndevice' in data: 60 | target.write("## EXCLUDED PLATFORMS\n") 61 | target.write("Platforms containing following strings in their names are not supported for this example :") 62 | target.write("\n") 63 | target.write("```\n") 64 | for board in data['ndevice']: 65 | target.write(board) 66 | target.write("\n") 67 | target.write("```") 68 | target.write("\n\n") 69 | if 'device' in data: 70 | target.write('## SUPPORTED PLATFORMS\n') 71 | target.write('Platforms containing following strings in their names are supported for this example :\n\n') 72 | for board in data['device']: 73 | target.write(board) 74 | target.write("\n") 75 | target.write("```") 76 | target.write('\n\n') 77 | return 78 | 79 | def hierarchy(target): 80 | target.write("## DESIGN FILES\n") 81 | target.write("Application code is located in the src directory. ") 82 | target.write("Accelerator binary files will be compiled to the xclbin directory. ") 83 | target.write("The xclbin directory is required by the Makefile and its contents will be filled during compilation. A listing of all the files ") 84 | target.write("in this example is shown below\n\n") 85 | target.write("```\n") 86 | tree_cmd = ["git ls-files | grep -e data -e src"] 87 | proc = subprocess.Popen(tree_cmd,stdout=subprocess.PIPE, shell=True) 88 | output = proc.communicate()[0] 89 | output = str(output).split("\'")[1] 90 | output = output.split("\\n") 91 | flag = 0 92 | for lines in output: 93 | if flag is 1: 94 | target.write("\n") 95 | target.write(lines) 96 | flag = 1 97 | target.write("```\n") 98 | target.write("\n") 99 | return 100 | 101 | def commandargs(target,data): 102 | target.write("## COMMAND LINE ARGUMENTS\n") 103 | target.write("Once the environment has been configured, the application can be executed by\n") 104 | target.write("```\n") 105 | if "launch" in data: 106 | if not "cmd_args" in data["launch"][0]: 107 | target.write('./' + data["host"]["host_exe"]) 108 | else: 109 | target.write('./' + data["host"]["host_exe"]) 110 | args = data["launch"][0]["cmd_args"].split(" ") 111 | for arg in args[0:]: 112 | target.write(" ") 113 | arg = arg.replace('BUILD/', '<') 114 | arg = arg.replace('PROJECT', '.') 115 | arg = arg.replace('.xclbin', ' XCLBIN>') 116 | target.write(arg) 117 | else: 118 | target.write('./' + data["host"]["host_exe"]) 119 | target.write("\n```\n") 120 | target.write("\n") 121 | 122 | 123 | 124 | # Get the argument from the description 125 | script, desc_file = argv 126 | 127 | # load the description file 128 | print ("VITIS README File Genarator") 129 | desc = open(desc_file,'r') 130 | 131 | # load the json data from the file 132 | data = json.load(desc) 133 | desc.close() 134 | 135 | assert("OpenCL" in data['runtime']) 136 | 137 | if "match_readme" in data and data["match_readme"] == "false": 138 | print ("ERROR:: README Manually Edited:: README Generator Failed\n") 139 | else: 140 | print ("Generating the README for %s" % data["name"]) 141 | target = open("README.md","w") 142 | overview(target,data) 143 | requirements(target,data) 144 | hierarchy(target) 145 | commandargs(target,data) 146 | 147 | target.close 148 | -------------------------------------------------------------------------------- /xilinx/common/utility/check_json.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | # 4 | # utility that reports mismatches between data encoded 5 | # in both the description.json and the Makefile 6 | # 7 | 8 | import os 9 | import json 10 | import collections 11 | from collections import OrderedDict 12 | import re 13 | import sys 14 | 15 | okExitCode = os.EX_OK 16 | failExitCode = 1 17 | exitCode = os.EX_OK 18 | # read data from the json file 19 | 20 | jsonLibs = [] 21 | jsonKernels = {} 22 | 23 | match_makefile = True 24 | 25 | fail = "FAIL" 26 | with open("description.json") as json_file: 27 | data = json.load(json_file, object_pairs_hook=OrderedDict) 28 | if data.get("match_makefile"): 29 | match_makefile = data.get("match_makefile") 30 | match_makefile = match_makefile.lower() 31 | if match_makefile not in [ "true", "1", "yes" ]: 32 | print("WARNING: allowing mismatches between description.json and Makefile") 33 | fail = "WARNING" 34 | failExitCode = okExitCode 35 | match_makefile = False 36 | if data.get("libs"): 37 | jsonLibs = data.get("libs") 38 | if data.get("containers"): 39 | containers = data.get("containers") 40 | for containerobj in containers: 41 | container = containerobj.get("name") 42 | if containerobj.get("accelerators"): 43 | accelerators = containerobj.get("accelerators") 44 | if accelerators: 45 | for accelerator in accelerators: 46 | name = container + "/" + accelerator.get("name") 47 | src = accelerator.get("location") 48 | if src.startswith("./"): 49 | src = src[2:] 50 | jsonKernels[name] = src 51 | print("found accelerator %s, src = %s" % (name,jsonKernels[name])) 52 | if data.get("accelerators"): 53 | accelerators = data.get("accelerators") 54 | if accelerators: 55 | for accelerator in accelerators: 56 | name = accelerator.get("name") 57 | container = accelerator.get("container") 58 | if container: 59 | name = container + "/" + name 60 | src = accelerator.get("location") 61 | if src.startswith("./"): 62 | src = src[2:] 63 | jsonKernels[name] = src 64 | print("found accelerator %s, src = %s" % (name,jsonKernels[name])) 65 | 66 | # read data from the makefile 67 | 68 | makeLibs = [] 69 | makeKernels = {} 70 | 71 | assignments = {} 72 | 73 | libPat = re.compile("\s*include\s+\$[{\(]COMMON_REPO[}\)]/libs/([^/]+)/.*.mk.*") 74 | assignPat = re.compile("\s*([^=:]+)\s*[:]*=\s*(.*)\s*") 75 | for line in open("Makefile",'r'): 76 | m = libPat.match(line) 77 | if m: 78 | lib = m.group(1) 79 | makeLibs.append(lib) 80 | m = assignPat.match(line) 81 | if m: 82 | key = m.group(1) 83 | val = m.group(2) 84 | assignments[key] = val 85 | 86 | x = None 87 | if "XCLBINS" in assignments.keys(): 88 | x = assignments["XCLBINS"] 89 | x = x.strip() 90 | xclbins = [] 91 | if x: 92 | xclbins = re.split(r"\W+", x) 93 | print("xclbins: %s" % xclbins) 94 | for xclbin in xclbins: 95 | name = xclbin 96 | src = "" 97 | if name + "_SRCS" in assignments.keys(): 98 | src = assignments[name + "_SRCS"] 99 | src = src.strip() 100 | # multiple kernels get their own xclbins, matching kernel/container names 101 | if len(xclbins) > 1: 102 | name += "/" + name 103 | if src.startswith("./"): 104 | src = src[2:] 105 | makeKernels[name] = src 106 | print("xclbin=%s src=%s" % (name, src)) 107 | 108 | # opencl support already baked into gui projects 109 | # no need to include in "libs" 110 | if "opencl" in makeLibs: 111 | makeLibs.remove("opencl") 112 | 113 | # ensure libs from json match the makefile 114 | jsonOnlyLibs = list(set(jsonLibs) - set(makeLibs)) 115 | makeOnlyLibs = list(set(makeLibs) - set(jsonLibs)) 116 | 117 | print("json libs: %s" % jsonLibs) 118 | print("make libs: %s" % makeLibs) 119 | 120 | if len(jsonOnlyLibs) > 0: 121 | print("%s: libs in json, missing from Makefile: %s" % (fail, jsonOnlyLibs)) 122 | exitCode = 1 123 | if len(makeOnlyLibs) > 0: 124 | print("%s: libs in Makefile, missing from json: %s" % (fail, makeOnlyLibs)) 125 | exitCode = 1 126 | 127 | # ensure kernels and xclbins match the makefile 128 | jsonOnlyKernels = list(set(jsonKernels.keys()) - set(makeKernels.keys())) 129 | makeOnlyKernels = list(set(makeKernels.keys()) - set(jsonKernels.keys())) 130 | 131 | commonKernels = list(set(makeKernels.keys()).intersection(set(jsonKernels.keys()))) 132 | 133 | print("json kernels: %s" % jsonKernels) 134 | print("make kernels: %s" % makeKernels) 135 | 136 | if len(jsonOnlyKernels) > 0: 137 | print("%s: kernels in json, missing from Makefile: %s" % (fail, jsonOnlyKernels)) 138 | exitCode = 1 139 | if len(makeOnlyKernels) > 0: 140 | print("%s: kernels in Makefile, missing from json: %s" % (fail, makeOnlyKernels)) 141 | exitCode = 1 142 | 143 | # confirm source paths match for each kernel 144 | for kernel in commonKernels: 145 | jsonSrc = jsonKernels[kernel] 146 | makeSrc = makeKernels[kernel] 147 | if jsonSrc != makeSrc: 148 | print("%s: source paths differ: json=%s Makefile=%s" % (fail, jsonSrc, makeSrc)) 149 | exitCode = 1 150 | 151 | 152 | if exitCode == okExitCode: 153 | print("PASS: description.json and Makefile libs and kernels match") 154 | else: 155 | print("%s: description.json and Makefile do not match." % fail) 156 | if match_makefile: 157 | print("If unavoidable, add \"match_makefile\" : \"false\" to description.json") 158 | exitCode = failExitCode 159 | 160 | sys.exit(exitCode) 161 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # FPGA HBM Benchmarks (Alveo U280, Stratix 10 MX) 2 | 3 | 4 | ## Contents: 5 | * HLS microbenchmarks that measures effective BW (sequential, strided, bitwidth varied, many-to-many unicasting) and latency of FPGA HBM boards 6 | * Dense matrix-vector multiplication 7 | * Stencil 8 | * Bucket sort, radix sort 9 | * Binary search, depth-first search 10 | 11 | 12 | ## Target Platforms 13 | * Xilinx Alveo U280, U50 14 | * Intel Stratix 10 MX (to be updated) 15 | 16 | 17 | ## Citation 18 | When using the files in this project, please cite: 19 | 20 | * Y. Choi, Y. Chi, J. Wang, L. Guo, and J. Cong, "When HLS meets FPGA HBM: Benchmarking and bandwidth optimization," arXiv preprint arXiv:2010.06075, 2020. 21 | 22 | Available at: https://arxiv.org/abs/2010.06075 23 | 24 | ## Prerequisites 25 | * Intel Quartus (with AOCL) 19.4 26 | * Xilinx Vitis (with Vivado HLS) 2019.2 27 | 28 | Please refer to vendors' manual for installation steps. 29 | 30 | 31 | ## How to run 32 | Please type "./run" in each project folder. It will generate a bitstream, compile host code, and run the program. 33 | 34 | ### If you are an UCLA VAST member: 35 | * For Xilinx flow, please source "setup\_alveo.sh" in my home directory before compilation 36 | * For Intel flow, please put "with-aocl" before the second and third line of "run" file: 37 | 38 | with-aocl make 39 | with-aocl ./host/host 40 | 41 | ## Description of the benchmarks 42 | 43 | The below is a brief description of the benchmarks. Please see the cited arxiv paper for experimental result. 44 | 45 | ### Sequential access bandwidth 46 | Measures the maximum memory bandwidth - repeatedly copies 64MB of data. 47 | Supports read/write, read only, write only. 48 | 49 | ### Strided access bandwidth 50 | Measures the effective bandwidth when accessing data with a fixed address stride. 51 | 52 | ### Sequential access with different bitwidth 53 | Measures the effective bandwidth of sequential access after varying the bitwidth of the kernel's top function argument 54 | 55 | ### Many-to-many unicast bandwidth (for write) 56 | Each PE reads from one PC and write to 8 different PCs. Data is transferred from a single source PC to a single destination PC in round-robin (many-to-many unicast). 57 | 58 | ### Read latency (pointer chasing) 59 | Data read from a memory space is used to an address to access another memory space. 60 | 61 | ### Dense matrix-vector multiplication 62 | We consider dense matrix-vector multiplication of $y=Ax$. The variables are stored in a 32b integer format. For ease of partitioning, matrix $A$ is assigned row and column size of PC\_num X 1024, where PC\_num is the number of PCs used in the experiment (24 to 28). 63 | 64 | ### Stencil 65 | We apply a 3x3 Gaussian blur stencil kernel on an image of size 32768 X 32768$. Each data element is a 16-bit fixed-point number. The accelerator fetches data from all the input HBM PCs to the on-chip data-reuse line buffers, performs computation, and writes the data back to output HBM PCs. 66 | 67 | ### Bucket sort 68 | We sort an array of keys that would be sent to buckets. Each bucket is stored in a single HBM PC, and this allows a second stage of sorting (e.g., with merge sort) to be independently performed for each bucket. We fetch keys from 8 read HBM PCs and send them to the buckets among 8 write HBM PCs. 69 | 70 | ### Radix sort 71 | Radix sort is composed of multiple iterations---each iteration sorting based on 3 (=log8) bits of the key. We switch the input and output PCs in each iteration and send the 512b/256b keys in a ping-pong fashion. 72 | 73 | ### Binary search 74 | Binary search is conducted on an array with the size of 16MB. Each data element is set to 512b/256b. Each PE accesses one PC, and multiple PEs executes the search independent of each other. 75 | 76 | ### Depth-first search 77 | Depth-first search is conducted on a binary tree implemented as a linked list. The value of each node and ID of the connected nodes form 512b/256b data. Each PE has a stack to store the address of the nodes to be searched later. 78 | 79 | 80 | ## Copyright notice 81 | 82 | The copyright notice of the Intel files: 83 | [.... to be filled .....] 84 | 85 | All the files in xilinx/ folder has been modified from the https://github.com/Xilinx/Vitis_Accel_Examples/ 19.2 version. The below is the original copyright notice from Xilinx: 86 | 87 | /********** 88 | Copyright (c) 2020, Xilinx, Inc. 89 | All rights reserved. 90 | 91 | Redistribution and use in source and binary forms, with or without modification, 92 | are permitted provided that the following conditions are met: 93 | 94 | 1. Redistributions of source code must retain the above copyright notice, 95 | this list of conditions and the following disclaimer. 96 | 97 | 2. Redistributions in binary form must reproduce the above copyright notice, 98 | this list of conditions and the following disclaimer in the documentation 99 | and/or other materials provided with the distribution. 100 | 101 | 3. Neither the name of the copyright holder nor the names of its contributors 102 | may be used to endorse or promote products derived from this software 103 | without specific prior written permission. 104 | 105 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 106 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 107 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 108 | ARE DISCLAIMED. 109 | IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 110 | INDIRECT, 111 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 112 | LIMITED TO, 113 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 114 | BUSINESS INTERRUPTION) 115 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 116 | LIABILITY, 117 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 118 | THIS SOFTWARE, 119 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 120 | **********/ 121 | 122 | -------------------------------------------------------------------------------- /xilinx/common/utility/create_catalog.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | # 4 | # This searches and indexes all of the example designs with description.json 5 | # index files. To omit an example from the index, add "sdx_gui": "false" to 6 | # the description.json. 7 | # 8 | # This should be run at the example root directory. The argument is the 9 | # name of the output index file. 10 | # 11 | 12 | import os 13 | import json 14 | import collections 15 | import sys 16 | import subprocess 17 | 18 | if len(sys.argv) > 2: 19 | print("Usage: %s [.json]" % sys.argv[0]) 20 | sys.exit(os.EX_USAGE) 21 | 22 | echo_progress = (len(sys.argv) == 2) 23 | 24 | def addexample(path): 25 | example = collections.OrderedDict() 26 | example["name"] = os.path.basename(path) 27 | example["commit_id"] = get_commit_id(path) 28 | example_json_file = os.path.join(path, "description.json") 29 | if (os.path.isfile(example_json_file)): 30 | with open(example_json_file) as json_file: 31 | data = json.load(json_file) 32 | if data.get("sdx_gui") or data.get("sdx_gui") == False: 33 | supported_in_gui = data.get("sdx_gui") 34 | if supported_in_gui == False: 35 | return None 36 | if supported_in_gui.lower() not in [ "true", "1", "yes" ]: 37 | return None 38 | if data.get("overview"): 39 | example["description"] = data.get("overview") 40 | if data.get("example"): 41 | example["displayName"] = data.get("example") 42 | if data.get("keywords"): 43 | example["keywords"] = data.get("keywords") 44 | if data.get("key_concepts"): 45 | example["key_concepts"] = data.get("key_concepts") 46 | if data.get("revision"): 47 | revisions = data.get("revision") 48 | highestVersion = "" 49 | for r in range(len(revisions)): 50 | revision = revisions[r] 51 | if revision["version"]: 52 | highestVersion = revision["version"] 53 | # TODO: choose latest revision 54 | example["version"] = highestVersion 55 | if data.get("contributors"): 56 | contributors = data.get("contributors") 57 | for r in range(len(contributors)): 58 | contributor = contributors[r] 59 | author = contributor["group"] 60 | example["author"] = author 61 | if echo_progress: 62 | print("adding %s" % path) 63 | return example 64 | 65 | def get_git_root_directory(): 66 | # git rev-parse --show-toplevel 67 | p = subprocess.Popen(["git", "rev-parse", "--show-toplevel"], stdout=subprocess.PIPE) 68 | dir = p.communicate()[0].strip() 69 | dir = str(dir).split("\'")[1] 70 | returncode = p.returncode 71 | if returncode == 0: 72 | return dir 73 | else: 74 | sys.stderr.write("Not a git repository. Could not find .git\n") 75 | sys.exit(os.EX_CONFIG) 76 | 77 | def get_commit_id(filename): 78 | # git log -n 1 --pretty=format:%H $filename 79 | id = subprocess.Popen(["git", "log", "-n", "1", "--pretty=format:%H", filename], stdout=subprocess.PIPE).communicate()[0] 80 | id = str(id).split("\'")[1] 81 | return id 82 | 83 | def get_git_branch(): 84 | branch = subprocess.Popen(["git", "rev-parse", "--abbrev-ref", "HEAD"], stdout=subprocess.PIPE).communicate()[0] 85 | # only works on python 2.7+: 86 | #branch = subprocess.check_output(["git", "rev-parse", "--abbrev-ref", "HEAD"]) 87 | branch = branch.strip() 88 | branch = str(branch).split("\'")[1] 89 | return branch 90 | 91 | def searchdir(dir): 92 | if (not os.path.isdir(dir)): 93 | sys.stderr.write("%s not found, but indexed in parent summary.json\n" % dir) 94 | emptycat = collections.OrderedDict() 95 | emptycat["categories"] = [] 96 | emptycat["examples"] = [] 97 | return emptycat 98 | dirnames = [entry for entry in os.listdir(dir) if os.path.isdir(os.path.join(dir,entry))] 99 | index = collections.OrderedDict() 100 | subdirs = {} 101 | category = collections.OrderedDict() 102 | category["name"] = os.path.basename(dir) 103 | category["displayName"] = "" 104 | category["description"] = "" 105 | category["categories"] = [] 106 | category["examples"] = [] 107 | summary_json_file = os.path.join(dir, "summary.json") 108 | if (os.path.isfile(summary_json_file)): 109 | with open(summary_json_file) as json_file: 110 | data = json.load(json_file) 111 | if data.get("overview"): 112 | category["displayName"] = data.get("overview") 113 | if data.get("description"): 114 | category["description"] = data.get("description") 115 | if data.get("subdirs"): 116 | subdirs = data["subdirs"] 117 | if (not subdirs): 118 | subdirs = dirnames 119 | subdirs = sorted(subdirs) 120 | # TODO: Sort subdirs 121 | for subdir in subdirs: 122 | if (subdir.startswith(".")): 123 | continue 124 | path = os.path.join(dir, subdir) 125 | example_file = os.path.join(path, "description.json") 126 | if (os.path.isfile(example_file)): 127 | example = addexample(path) 128 | if example is not None: 129 | category["examples"].append(example) 130 | else: 131 | subcategory = searchdir(path) 132 | if (subcategory is not None): 133 | category["categories"].append(subcategory) 134 | if (len(category["categories"]) + len(category["examples"]) > 0): 135 | return category 136 | return None 137 | 138 | root = get_git_root_directory() 139 | index = searchdir(root) 140 | index["branch"] = get_git_branch() 141 | 142 | if len(sys.argv) == 2: 143 | index_filename = sys.argv[1] 144 | indexdir = os.path.dirname(index_filename) 145 | if (indexdir): 146 | if (not os.path.exists(indexdir)): 147 | os.makedirs(indexdir) 148 | index_file = open(index_filename, "w") 149 | else: 150 | index_file = sys.stdout 151 | 152 | json.dump(index, index_file, indent = 4) 153 | -------------------------------------------------------------------------------- /xilinx/common/includes/simplebmp/simplebmp.cpp: -------------------------------------------------------------------------------- 1 | /********** 2 | Copyright (c) 2019, Xilinx, Inc. 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without modification, 6 | are permitted provided that the following conditions are met: 7 | 8 | 1. Redistributions of source code must retain the above copyright notice, 9 | this list of conditions and the following disclaimer. 10 | 11 | 2. Redistributions in binary form must reproduce the above copyright notice, 12 | this list of conditions and the following disclaimer in the documentation 13 | and/or other materials provided with the distribution. 14 | 15 | 3. Neither the name of the copyright holder nor the names of its contributors 16 | may be used to endorse or promote products derived from this software 17 | without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 20 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 21 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 22 | IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 23 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 24 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 26 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 27 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | **********/ 29 | #include "simplebmp.h" 30 | #include 31 | #include 32 | #include 33 | 34 | int writebmp(char *filename, struct bmp_t *bitmap) { 35 | //24 bpp uncompressed 36 | 37 | FILE *fp = fopen(filename, "w+b"); 38 | if (fp == NULL) 39 | return -1; 40 | 41 | //compute dib entries 42 | bitmap->header.dibheadersize = 40; 43 | bitmap->header.dibwidth = bitmap->width; 44 | bitmap->header.dibheight = bitmap->height; 45 | bitmap->header.dibplane = 1; 46 | bitmap->header.dibdepth = 24; 47 | bitmap->header.dibcompression = 0; 48 | bitmap->header.dibsize = 49 | (bitmap->width) * (bitmap->height) * (bitmap->header.dibdepth / 8); 50 | bitmap->header.dibhor = 2835; 51 | bitmap->header.dibver = 2835; 52 | bitmap->header.dibpal = 0; 53 | bitmap->header.dibimportant = 0; 54 | 55 | //compute header entries 56 | bitmap->header.headerB = 'B'; 57 | bitmap->header.headerM = 'M'; 58 | bitmap->header.headerpixelsoffset = 54; 59 | bitmap->header.headerbmpsize = 60 | bitmap->header.dibsize + bitmap->header.headerpixelsoffset; 61 | bitmap->header.headerapp0 = 0; 62 | bitmap->header.headerapp1 = 0; 63 | 64 | //write header 65 | fwrite(&(bitmap->header.headerB), 1, 1, fp); 66 | fwrite(&(bitmap->header.headerM), 1, 1, fp); 67 | fwrite(&(bitmap->header.headerbmpsize), 4, 1, fp); 68 | fwrite(&(bitmap->header.headerapp0), 2, 1, fp); 69 | fwrite(&(bitmap->header.headerapp1), 2, 1, fp); 70 | fwrite(&(bitmap->header.headerpixelsoffset), 4, 1, fp); 71 | 72 | //write dib header 73 | fwrite(&(bitmap->header.dibheadersize), 4, 1, fp); 74 | fwrite(&(bitmap->header.dibwidth), 4, 1, fp); 75 | fwrite(&(bitmap->header.dibheight), 4, 1, fp); 76 | fwrite(&(bitmap->header.dibplane), 2, 1, fp); 77 | fwrite(&(bitmap->header.dibdepth), 2, 1, fp); 78 | fwrite(&(bitmap->header.dibcompression), 4, 1, fp); 79 | fwrite(&(bitmap->header.dibsize), 4, 1, fp); 80 | fwrite(&(bitmap->header.dibhor), 4, 1, fp); 81 | fwrite(&(bitmap->header.dibver), 4, 1, fp); 82 | fwrite(&(bitmap->header.dibpal), 4, 1, fp); 83 | fwrite(&(bitmap->header.dibimportant), 4, 1, fp); 84 | 85 | //write pixels 86 | fwrite(bitmap->pixels, bitmap->header.dibsize, 1, fp); 87 | 88 | if (ferror(fp)) 89 | return -1; 90 | 91 | fclose(fp); 92 | return 0; 93 | } 94 | 95 | int readbmp(char *filename, struct bmp_t *bitmap) { 96 | //-1 file access error 97 | //-2 invalid BMP 98 | //-3 memory allocation error 99 | FILE *fp = fopen(filename, "r+b"); 100 | if (fp == NULL) 101 | return -1; 102 | 103 | //read header 104 | fread(&(bitmap->header.headerB), 1, 1, fp); 105 | fread(&(bitmap->header.headerM), 1, 1, fp); 106 | fread(&(bitmap->header.headerbmpsize), 4, 1, fp); 107 | fread(&(bitmap->header.headerapp0), 2, 1, fp); 108 | fread(&(bitmap->header.headerapp1), 2, 1, fp); 109 | fread(&(bitmap->header.headerpixelsoffset), 4, 1, fp); 110 | //read dib header 111 | fread(&(bitmap->header.dibheadersize), 4, 1, fp); 112 | fread(&(bitmap->header.dibwidth), 4, 1, fp); 113 | fread(&(bitmap->header.dibheight), 4, 1, fp); 114 | fread(&(bitmap->header.dibplane), 2, 1, fp); 115 | fread(&(bitmap->header.dibdepth), 2, 1, fp); 116 | fread(&(bitmap->header.dibcompression), 4, 1, fp); 117 | fread(&(bitmap->header.dibsize), 4, 1, fp); 118 | fread(&(bitmap->header.dibhor), 4, 1, fp); 119 | fread(&(bitmap->header.dibver), 4, 1, fp); 120 | fread(&(bitmap->header.dibpal), 4, 1, fp); 121 | fread(&(bitmap->header.dibimportant), 4, 1, fp); 122 | 123 | if (ferror(fp)) 124 | return -1; 125 | 126 | //validate header 127 | //header 128 | if (bitmap->header.headerB != 'B') 129 | return -2; 130 | if (bitmap->header.headerM != 'M') 131 | return -2; 132 | //headerbmpsize 133 | if (bitmap->header.headerapp0 != 0) 134 | return -2; 135 | if (bitmap->header.headerapp1 != 0) 136 | return -2; 137 | if (bitmap->header.headerpixelsoffset != 54) 138 | return -2; 139 | //dib header 140 | if (bitmap->header.dibheadersize != 40) 141 | return -2; 142 | bitmap->width = bitmap->header.dibwidth; 143 | bitmap->height = bitmap->header.dibheight; 144 | if (bitmap->header.dibplane != 1) 145 | return -2; 146 | if (bitmap->header.dibdepth != 24) 147 | return -2; 148 | if (bitmap->header.dibcompression != 0) 149 | return -2; 150 | if (bitmap->header.dibsize != 151 | (bitmap->header.dibwidth * bitmap->header.dibheight * 3)) 152 | return -2; 153 | //dibsize do nothing yet 154 | //dibhor unused 155 | //dibver unused 156 | if (bitmap->header.dibpal != 0) 157 | return -2; 158 | if (bitmap->header.dibimportant != 0) 159 | return -2; 160 | 161 | //read pixels 162 | bitmap->pixels = (uint32_t *)malloc(bitmap->header.dibsize); 163 | if (bitmap->pixels == NULL) 164 | return -3; 165 | fread(bitmap->pixels, bitmap->header.dibsize, 1, fp); 166 | 167 | if (ferror(fp)) 168 | return -1; 169 | 170 | fclose(fp); 171 | return 0; 172 | } 173 | -------------------------------------------------------------------------------- /xilinx/common/includes/oclHelper/oclErrorCodes.cpp: -------------------------------------------------------------------------------- 1 | /********** 2 | Copyright (c) 2019, Xilinx, Inc. 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without modification, 6 | are permitted provided that the following conditions are met: 7 | 8 | 1. Redistributions of source code must retain the above copyright notice, 9 | this list of conditions and the following disclaimer. 10 | 11 | 2. Redistributions in binary form must reproduce the above copyright notice, 12 | this list of conditions and the following disclaimer in the documentation 13 | and/or other materials provided with the distribution. 14 | 15 | 3. Neither the name of the copyright holder nor the names of its contributors 16 | may be used to endorse or promote products derived from this software 17 | without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 20 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 21 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 22 | IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 23 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 24 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 26 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 27 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | **********/ 29 | #include 30 | #include 31 | 32 | #include 33 | 34 | #define TO_STRING(x) #x 35 | 36 | static const std::pair map_pairs[] = { 37 | std::make_pair(CL_SUCCESS, TO_STRING(CL_SUCCESS)), 38 | std::make_pair(CL_DEVICE_NOT_FOUND, TO_STRING(CL_DEVICE_NOT_FOUND)), 39 | std::make_pair(CL_DEVICE_NOT_AVAILABLE, TO_STRING(CL_DEVICE_NOT_AVAILABLE)), 40 | std::make_pair(CL_COMPILER_NOT_AVAILABLE, 41 | TO_STRING(CL_COMPILER_NOT_AVAILABLE)), 42 | std::make_pair(CL_MEM_OBJECT_ALLOCATION_FAILURE, 43 | TO_STRING(CL_MEM_OBJECT_ALLOCATION_FAILURE)), 44 | std::make_pair(CL_OUT_OF_RESOURCES, TO_STRING(CL_OUT_OF_RESOURCES)), 45 | std::make_pair(CL_OUT_OF_HOST_MEMORY, TO_STRING(CL_OUT_OF_HOST_MEMORY)), 46 | std::make_pair(CL_PROFILING_INFO_NOT_AVAILABLE, 47 | TO_STRING(CL_PROFILING_INFO_NOT_AVAILABLE)), 48 | std::make_pair(CL_MEM_COPY_OVERLAP, TO_STRING(CL_MEM_COPY_OVERLAP)), 49 | std::make_pair(CL_IMAGE_FORMAT_MISMATCH, 50 | TO_STRING(CL_IMAGE_FORMAT_MISMATCH)), 51 | std::make_pair(CL_IMAGE_FORMAT_NOT_SUPPORTED, 52 | TO_STRING(CL_IMAGE_FORMAT_NOT_SUPPORTED)), 53 | std::make_pair(CL_BUILD_PROGRAM_FAILURE, 54 | TO_STRING(CL_BUILD_PROGRAM_FAILURE)), 55 | std::make_pair(CL_MAP_FAILURE, TO_STRING(CL_MAP_FAILURE)), 56 | std::make_pair(CL_MISALIGNED_SUB_BUFFER_OFFSET, 57 | TO_STRING(CL_MISALIGNED_SUB_BUFFER_OFFSET)), 58 | std::make_pair(CL_EXEC_STATUS_ERROR_FOR_EVENTS_IN_WAIT_LIST, 59 | TO_STRING(CL_EXEC_STATUS_ERROR_FOR_EVENTS_IN_W)), 60 | std::make_pair(CL_INVALID_VALUE, TO_STRING(CL_INVALID_VALUE)), 61 | std::make_pair(CL_INVALID_DEVICE_TYPE, TO_STRING(CL_INVALID_DEVICE_TYPE)), 62 | std::make_pair(CL_INVALID_PLATFORM, TO_STRING(CL_INVALID_PLATFORM)), 63 | std::make_pair(CL_INVALID_DEVICE, TO_STRING(CL_INVALID_DEVICE)), 64 | std::make_pair(CL_INVALID_CONTEXT, TO_STRING(CL_INVALID_CONTEXT)), 65 | std::make_pair(CL_INVALID_QUEUE_PROPERTIES, 66 | TO_STRING(CL_INVALID_QUEUE_PROPERTIES)), 67 | std::make_pair(CL_INVALID_COMMAND_QUEUE, 68 | TO_STRING(CL_INVALID_COMMAND_QUEUE)), 69 | std::make_pair(CL_INVALID_HOST_PTR, TO_STRING(CL_INVALID_HOST_PTR)), 70 | std::make_pair(CL_INVALID_MEM_OBJECT, TO_STRING(CL_INVALID_MEM_OBJECT)), 71 | std::make_pair(CL_INVALID_IMAGE_FORMAT_DESCRIPTOR, 72 | TO_STRING(CL_INVALID_IMAGE_FORMAT_DESCRIPTOR)), 73 | std::make_pair(CL_INVALID_IMAGE_SIZE, TO_STRING(CL_INVALID_IMAGE_SIZE)), 74 | std::make_pair(CL_INVALID_SAMPLER, TO_STRING(CL_INVALID_SAMPLER)), 75 | std::make_pair(CL_INVALID_BINARY, TO_STRING(CL_INVALID_BINARY)), 76 | std::make_pair(CL_INVALID_BUILD_OPTIONS, 77 | TO_STRING(CL_INVALID_BUILD_OPTIONS)), 78 | std::make_pair(CL_INVALID_PROGRAM, TO_STRING(CL_INVALID_PROGRAM)), 79 | std::make_pair(CL_INVALID_PROGRAM_EXECUTABLE, 80 | TO_STRING(CL_INVALID_PROGRAM_EXECUTABLE)), 81 | std::make_pair(CL_INVALID_KERNEL_NAME, TO_STRING(CL_INVALID_KERNEL_NAME)), 82 | std::make_pair(CL_INVALID_KERNEL_DEFINITION, 83 | TO_STRING(CL_INVALID_KERNEL_DEFINITION)), 84 | std::make_pair(CL_INVALID_KERNEL, TO_STRING(CL_INVALID_KERNEL)), 85 | std::make_pair(CL_INVALID_ARG_INDEX, TO_STRING(CL_INVALID_ARG_INDEX)), 86 | std::make_pair(CL_INVALID_ARG_VALUE, TO_STRING(CL_INVALID_ARG_VALUE)), 87 | std::make_pair(CL_INVALID_ARG_SIZE, TO_STRING(CL_INVALID_ARG_SIZE)), 88 | std::make_pair(CL_INVALID_KERNEL_ARGS, TO_STRING(CL_INVALID_KERNEL_ARGS)), 89 | std::make_pair(CL_INVALID_WORK_DIMENSION, 90 | TO_STRING(CL_INVALID_WORK_DIMENSION)), 91 | std::make_pair(CL_INVALID_WORK_GROUP_SIZE, 92 | TO_STRING(CL_INVALID_WORK_GROUP_SIZE)), 93 | std::make_pair(CL_INVALID_WORK_ITEM_SIZE, 94 | TO_STRING(CL_INVALID_WORK_ITEM_SIZE)), 95 | std::make_pair(CL_INVALID_GLOBAL_OFFSET, 96 | TO_STRING(CL_INVALID_GLOBAL_OFFSET)), 97 | std::make_pair(CL_INVALID_EVENT_WAIT_LIST, 98 | TO_STRING(CL_INVALID_EVENT_WAIT_LIST)), 99 | std::make_pair(CL_INVALID_EVENT, TO_STRING(CL_INVALID_EVENT)), 100 | std::make_pair(CL_INVALID_OPERATION, TO_STRING(CL_INVALID_OPERATION)), 101 | std::make_pair(CL_INVALID_GL_OBJECT, TO_STRING(CL_INVALID_GL_OBJECT)), 102 | std::make_pair(CL_INVALID_BUFFER_SIZE, TO_STRING(CL_INVALID_BUFFER_SIZE)), 103 | std::make_pair(CL_INVALID_MIP_LEVEL, TO_STRING(CL_INVALID_MIP_LEVEL)), 104 | std::make_pair(CL_INVALID_GLOBAL_WORK_SIZE, 105 | TO_STRING(CL_INVALID_GLOBAL_WORK_SIZE)), 106 | std::make_pair(CL_INVALID_PROPERTY, TO_STRING(CL_INVALID_PROPERTY))}; 107 | 108 | static const std::map 109 | oclErrorCodes(map_pairs, 110 | map_pairs + sizeof(map_pairs) / sizeof(map_pairs[0])); 111 | 112 | const char *oclErrorCode(cl_int code) { 113 | std::map::const_iterator iter = 114 | oclErrorCodes.find(code); 115 | if (iter == oclErrorCodes.end()) 116 | return "UNKNOWN ERROR"; 117 | else 118 | return iter->second.c_str(); 119 | } 120 | -------------------------------------------------------------------------------- /xilinx/common/includes/logger/logger.cpp: -------------------------------------------------------------------------------- 1 | /********** 2 | Copyright (c) 2019, Xilinx, Inc. 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without modification, 6 | are permitted provided that the following conditions are met: 7 | 8 | 1. Redistributions of source code must retain the above copyright notice, 9 | this list of conditions and the following disclaimer. 10 | 11 | 2. Redistributions in binary form must reproduce the above copyright notice, 12 | this list of conditions and the following disclaimer in the documentation 13 | and/or other materials provided with the distribution. 14 | 15 | 3. Neither the name of the copyright holder nor the names of its contributors 16 | may be used to endorse or promote products derived from this software 17 | without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 20 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 21 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 22 | IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 23 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 24 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 26 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 27 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | **********/ 29 | #include "logger.h" 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include 35 | #ifdef WINDOWS 36 | #include 37 | #else 38 | #include 39 | #endif 40 | 41 | using namespace std; 42 | 43 | namespace sda { 44 | 45 | /////////////////////////////////////////////////////////////////////// 46 | string GetApplicationPath() { 47 | #ifdef WINDOWS 48 | #define GetCurrentDir _getcwd 49 | #else 50 | #define GetCurrentDir getcwd 51 | #endif 52 | 53 | char strCurrentPath[FILENAME_MAX]; 54 | 55 | if (!GetCurrentDir(strCurrentPath, sizeof(strCurrentPath))) { 56 | return string(""); 57 | } 58 | 59 | /* not really required */ 60 | strCurrentPath[sizeof(strCurrentPath) - 1] = '\0'; 61 | return string(strCurrentPath); 62 | } 63 | 64 | string ToLower(const string &s) { 65 | string result = s; 66 | std::transform(result.begin(), result.end(), result.begin(), ::tolower); 67 | return result; 68 | } 69 | 70 | string ToUpper(const string &s) { 71 | string result = s; 72 | std::transform(result.begin(), result.end(), result.begin(), ::toupper); 73 | return result; 74 | } 75 | 76 | string GetTimeStamp() { return ""; } 77 | 78 | // trim from start 79 | string <rim(std::string &s) { 80 | s.erase(s.begin(), 81 | std::find_if(s.begin(), 82 | s.end(), 83 | std::not1(std::ptr_fun(std::isspace)))); 84 | return s; 85 | } 86 | 87 | // trim from end 88 | string &rtrim(std::string &s) { 89 | s.erase(std::find_if(s.rbegin(), 90 | s.rend(), 91 | std::not1(std::ptr_fun(std::isspace))) 92 | .base(), 93 | s.end()); 94 | return s; 95 | } 96 | 97 | // trim from both ends 98 | string &trim(std::string &s) { return ltrim(rtrim(s)); } 99 | 100 | string GetFileExt(const string &s) { 101 | string strext = s.substr(s.find_last_of(".") + 1); 102 | return strext; 103 | } 104 | 105 | string GetFileTitleOnly(const string &s) { 106 | 107 | string temp = s; 108 | string::size_type d = temp.find_last_of("//"); 109 | if (d == string::npos) 110 | d = temp.find_last_of("\\"); 111 | if (d != string::npos) 112 | temp = temp.substr(d + 1); 113 | 114 | d = temp.find_last_of("."); 115 | if (d != string::npos) 116 | temp = temp.substr(0, d); 117 | 118 | return temp; 119 | } 120 | 121 | void LogWrapper(int etype, const char *file, int line, const char *desc, ...) { 122 | 123 | //crop file name from full path 124 | string strFileLoc(file); 125 | strFileLoc = strFileLoc.substr(strFileLoc.find_last_of("\\/") + 1); 126 | 127 | string strHeader = ""; 128 | { 129 | char header[512]; 130 | //source 131 | switch (etype) { 132 | case (sda::etError): { 133 | snprintf(header, 134 | sizeof(header), 135 | "ERROR: [%s:%d]", 136 | strFileLoc.c_str(), 137 | line); 138 | break; 139 | } 140 | case (sda::etInfo): { 141 | snprintf(header, 142 | sizeof(header), 143 | "INFO: [%s:%d]", 144 | strFileLoc.c_str(), 145 | line); 146 | break; 147 | } 148 | case (sda::etWarning): { 149 | snprintf(header, 150 | sizeof(header), 151 | "WARN: [%s:%d]", 152 | strFileLoc.c_str(), 153 | line); 154 | break; 155 | } 156 | } 157 | strHeader = string(header); 158 | } 159 | 160 | //time 161 | string strTime = ""; 162 | #ifdef ENABLE_LOG_TIME 163 | { 164 | time_t rawtime; 165 | time(&rawtime); 166 | #ifdef ENABLE_SECURE_API 167 | char buffer[64]; 168 | struct tm timeinfo; 169 | localtime_s(&timeinfo, &rawtime); 170 | asctime_s(timeinfo, buffer, sizeof(buffer)) 171 | snprintf(buffer, sizeof(buffer), "TIME: [%s]", asctime(timeinfo)); 172 | strTime = string(buffer); 173 | #else 174 | char buffer[64]; 175 | struct tm *timeinfo = localtime(&rawtime); 176 | string temp = string(asctime(timeinfo)); 177 | temp = trim(temp); 178 | 179 | // strftime(buffer, sizeof(buffer), "TIME: []") 180 | snprintf(buffer, sizeof(buffer), "TIME: [%s]", temp.c_str()); 181 | strTime = string(buffer); 182 | #endif 183 | } 184 | #endif 185 | 186 | //format the message itself 187 | string strMsg = ""; 188 | { 189 | char msg[512]; 190 | va_list args; 191 | va_start(args, desc); 192 | vsnprintf(msg, sizeof(msg), desc, args); 193 | va_end(args); 194 | strMsg = string(msg); 195 | } 196 | 197 | //combine 198 | string strOut = 199 | strHeader + string(" ") + strTime + string(" ") + strMsg + string("\n"); 200 | 201 | //display 202 | cout << strOut; 203 | 204 | //store 205 | #ifdef ENABLE_LOG_TOFILE 206 | std::ofstream outfile; 207 | outfile.open("benchapp.log", std::ios_base::app); 208 | outfile << strOut; 209 | #endif 210 | 211 | return; 212 | } 213 | 214 | } // namespace sda 215 | -------------------------------------------------------------------------------- /xilinx/seq_u50_ch24/Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: help 2 | 3 | help:: 4 | $(ECHO) "Makefile Usage:" 5 | $(ECHO) " make all TARGET= DEVICE= HOST_ARCH= SYSROOT=" 6 | $(ECHO) " Command to generate the design for specified Target and Shell." 7 | $(ECHO) " By default, HOST_ARCH=x86. HOST_ARCH and SYSROOT is required for SoC shells" 8 | $(ECHO) "" 9 | $(ECHO) " make clean " 10 | $(ECHO) " Command to remove the generated non-hardware files." 11 | $(ECHO) "" 12 | $(ECHO) " make cleanall" 13 | $(ECHO) " Command to remove all the generated files." 14 | $(ECHO) "" 15 | $(ECHO) " make sd_card TARGET= DEVICE= HOST_ARCH= SYSROOT=" 16 | $(ECHO) " Command to prepare sd_card files." 17 | $(ECHO) " By default, HOST_ARCH=x86. HOST_ARCH and SYSROOT is required for SoC shells" 18 | $(ECHO) "" 19 | $(ECHO) " make check TARGET= DEVICE= HOST_ARCH= SYSROOT=" 20 | $(ECHO) " Command to run application in emulation." 21 | $(ECHO) " By default, HOST_ARCH=x86. HOST_ARCH and SYSROOT is required for SoC shells" 22 | $(ECHO) "" 23 | $(ECHO) " make build TARGET= DEVICE= HOST_ARCH= SYSROOT=" 24 | $(ECHO) " Command to build xclbin application." 25 | $(ECHO) " By default, HOST_ARCH=x86. HOST_ARCH and SYSROOT is required for SoC shells" 26 | $(ECHO) "" 27 | 28 | # Points to top directory of Git repository 29 | COMMON_REPO = ../ 30 | PWD = $(shell readlink -f .) 31 | ABS_COMMON_REPO = $(shell readlink -f $(COMMON_REPO)) 32 | 33 | TARGET := hw 34 | HOST_ARCH := x86 35 | SYSROOT := 36 | DEVICE = xilinx_u50_gen3x16_xdma_201920_3 37 | #DEVICE = xilinx_u280_xdma_201920_1 38 | 39 | include ./utils.mk 40 | 41 | XSA := $(call device2xsa, $(DEVICE)) 42 | TEMP_DIR := ./_x.$(TARGET).$(XSA) 43 | BUILD_DIR := ./build_dir.$(TARGET).$(XSA) 44 | 45 | VPP := v++ 46 | SDCARD := sd_card 47 | 48 | #Include Libraries 49 | include $(ABS_COMMON_REPO)/common/includes/opencl/opencl.mk 50 | include $(ABS_COMMON_REPO)/common/includes/xcl2/xcl2.mk 51 | CXXFLAGS += $(xcl2_CXXFLAGS) 52 | LDFLAGS += $(xcl2_LDFLAGS) 53 | HOST_SRCS += $(xcl2_SRCS) 54 | CXXFLAGS += $(opencl_CXXFLAGS) -Wall -O0 -g -std=c++11 55 | LDFLAGS += $(opencl_LDFLAGS) 56 | 57 | HOST_SRCS += src/host.cpp 58 | 59 | # Host compiler global settings 60 | CXXFLAGS += -fmessage-length=0 61 | LDFLAGS += -lrt -lstdc++ 62 | 63 | ifneq ($(HOST_ARCH), x86) 64 | LDFLAGS += --sysroot=$(SYSROOT) 65 | endif 66 | 67 | # Kernel compiler global settings 68 | CLFLAGS += -t $(TARGET) --platform $(DEVICE) --save-temps 69 | ifneq ($(TARGET), hw) 70 | CLFLAGS += -g 71 | endif 72 | 73 | CLFLAGS += --sp vadd_1.m_axi_hbm0:HBM[0] 74 | CLFLAGS += --sp vadd_1.m_axi_hbm1:HBM[1] 75 | CLFLAGS += --sp vadd_1.m_axi_hbm2:HBM[2] 76 | CLFLAGS += --sp vadd_1.m_axi_hbm3:HBM[3] 77 | CLFLAGS += --sp vadd_1.m_axi_hbm4:HBM[4] 78 | CLFLAGS += --sp vadd_1.m_axi_hbm5:HBM[5] 79 | CLFLAGS += --sp vadd_1.m_axi_hbm6:HBM[6] 80 | CLFLAGS += --sp vadd_1.m_axi_hbm7:HBM[7] 81 | CLFLAGS += --sp vadd_1.m_axi_hbm8:HBM[8] 82 | CLFLAGS += --sp vadd_1.m_axi_hbm9:HBM[9] 83 | CLFLAGS += --sp vadd_1.m_axi_hbm10:HBM[10] 84 | CLFLAGS += --sp vadd_1.m_axi_hbm11:HBM[11] 85 | CLFLAGS += --sp vadd_1.m_axi_hbm12:HBM[12] 86 | CLFLAGS += --sp vadd_1.m_axi_hbm13:HBM[13] 87 | CLFLAGS += --sp vadd_1.m_axi_hbm14:HBM[14] 88 | CLFLAGS += --sp vadd_1.m_axi_hbm15:HBM[15] 89 | CLFLAGS += --sp vadd_1.m_axi_hbm16:HBM[16] 90 | CLFLAGS += --sp vadd_1.m_axi_hbm17:HBM[17] 91 | CLFLAGS += --sp vadd_1.m_axi_hbm18:HBM[18] 92 | CLFLAGS += --sp vadd_1.m_axi_hbm19:HBM[19] 93 | CLFLAGS += --sp vadd_1.m_axi_hbm20:HBM[20] 94 | CLFLAGS += --sp vadd_1.m_axi_hbm21:HBM[21] 95 | CLFLAGS += --sp vadd_1.m_axi_hbm22:HBM[22] 96 | CLFLAGS += --sp vadd_1.m_axi_hbm23:HBM[23] 97 | 98 | CLFLAGS += --report_level 2 99 | 100 | EXECUTABLE = host 101 | CMD_ARGS = $(BUILD_DIR)/vadd.xclbin 102 | EMCONFIG_DIR = $(TEMP_DIR) 103 | EMU_DIR = $(SDCARD)/data/emulation 104 | 105 | BINARY_CONTAINERS += $(BUILD_DIR)/vadd.xclbin 106 | BINARY_CONTAINER_vadd_OBJS += $(TEMP_DIR)/vadd.xo 107 | 108 | CP = cp -rf 109 | 110 | .PHONY: all clean cleanall docs emconfig 111 | all: check-devices $(EXECUTABLE) $(BINARY_CONTAINERS) emconfig sd_card 112 | 113 | .PHONY: exe 114 | exe: $(EXECUTABLE) 115 | 116 | .PHONY: build 117 | build: $(BINARY_CONTAINERS) 118 | 119 | # Building kernel 120 | $(TEMP_DIR)/vadd.xo: src/vadd.cpp 121 | mkdir -p $(TEMP_DIR) 122 | $(VPP) $(CLFLAGS) --temp_dir $(TEMP_DIR) -c -k vadd -I'$(> $(SDCARD)/init.sh 162 | $(ECHO) 'export XILINX_VITIS=$$PWD' >> $(SDCARD)/init.sh 163 | $(ECHO) 'export XCL_EMULATION_MODE=$(TARGET)' >> $(SDCARD)/init.sh 164 | $(ECHO) './$(EXECUTABLE) $(CMD_ARGS)' >> $(SDCARD)/init.sh 165 | $(ECHO) 'reboot' >> $(SDCARD)/init.sh 166 | else 167 | [ -f $(SDCARD)/BOOT.BIN ] && echo "INFO: BOOT.BIN already exists" || $(CP) $(BUILD_DIR)/sd_card/BOOT.BIN $(SDCARD)/ 168 | $(ECHO) './$(EXECUTABLE) $(CMD_ARGS)' >> $(SDCARD)/init.sh 169 | endif 170 | endif 171 | 172 | # Cleaning stuff 173 | clean: 174 | -$(RMDIR) $(EXECUTABLE) $(XCLBIN)/{*sw_emu*,*hw_emu*} 175 | -$(RMDIR) profile_* TempConfig system_estimate.xtxt *.rpt *.csv 176 | -$(RMDIR) src/*.ll *v++* .Xil emconfig.json dltmp* xmltmp* *.log *.jou *.wcfg *.wdb 177 | 178 | cleanall: clean 179 | -$(RMDIR) build_dir* sd_card* 180 | -$(RMDIR) _x.* *xclbin.run_summary qemu-memory-_* emulation/ _vimage/ pl* start_simulation.sh *.xclbin 181 | 182 | -------------------------------------------------------------------------------- /xilinx/seq_u280_ch30_64b/Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: help 2 | 3 | help:: 4 | $(ECHO) "Makefile Usage:" 5 | $(ECHO) " make all TARGET= DEVICE= HOST_ARCH= SYSROOT=" 6 | $(ECHO) " Command to generate the design for specified Target and Shell." 7 | $(ECHO) " By default, HOST_ARCH=x86. HOST_ARCH and SYSROOT is required for SoC shells" 8 | $(ECHO) "" 9 | $(ECHO) " make clean " 10 | $(ECHO) " Command to remove the generated non-hardware files." 11 | $(ECHO) "" 12 | $(ECHO) " make cleanall" 13 | $(ECHO) " Command to remove all the generated files." 14 | $(ECHO) "" 15 | $(ECHO) " make sd_card TARGET= DEVICE= HOST_ARCH= SYSROOT=" 16 | $(ECHO) " Command to prepare sd_card files." 17 | $(ECHO) " By default, HOST_ARCH=x86. HOST_ARCH and SYSROOT is required for SoC shells" 18 | $(ECHO) "" 19 | $(ECHO) " make check TARGET= DEVICE= HOST_ARCH= SYSROOT=" 20 | $(ECHO) " Command to run application in emulation." 21 | $(ECHO) " By default, HOST_ARCH=x86. HOST_ARCH and SYSROOT is required for SoC shells" 22 | $(ECHO) "" 23 | $(ECHO) " make build TARGET= DEVICE= HOST_ARCH= SYSROOT=" 24 | $(ECHO) " Command to build xclbin application." 25 | $(ECHO) " By default, HOST_ARCH=x86. HOST_ARCH and SYSROOT is required for SoC shells" 26 | $(ECHO) "" 27 | 28 | # Points to top directory of Git repository 29 | COMMON_REPO = ../ 30 | PWD = $(shell readlink -f .) 31 | ABS_COMMON_REPO = $(shell readlink -f $(COMMON_REPO)) 32 | 33 | TARGET := hw 34 | HOST_ARCH := x86 35 | SYSROOT := 36 | DEVICE = xilinx_u280_xdma_201920_3 37 | 38 | include ./utils.mk 39 | 40 | XSA := $(call device2xsa, $(DEVICE)) 41 | TEMP_DIR := ./_x.$(TARGET).$(XSA) 42 | BUILD_DIR := ./build_dir.$(TARGET).$(XSA) 43 | 44 | VPP := v++ 45 | SDCARD := sd_card 46 | 47 | #Include Libraries 48 | include $(ABS_COMMON_REPO)/common/includes/opencl/opencl.mk 49 | include $(ABS_COMMON_REPO)/common/includes/xcl2/xcl2.mk 50 | CXXFLAGS += $(xcl2_CXXFLAGS) 51 | LDFLAGS += $(xcl2_LDFLAGS) 52 | HOST_SRCS += $(xcl2_SRCS) 53 | CXXFLAGS += $(opencl_CXXFLAGS) -Wall -O0 -g -std=c++11 54 | LDFLAGS += $(opencl_LDFLAGS) 55 | 56 | HOST_SRCS += src/host.cpp 57 | 58 | # Host compiler global settings 59 | CXXFLAGS += -fmessage-length=0 60 | LDFLAGS += -lrt -lstdc++ 61 | 62 | ifneq ($(HOST_ARCH), x86) 63 | LDFLAGS += --sysroot=$(SYSROOT) 64 | endif 65 | 66 | # Kernel compiler global settings 67 | CLFLAGS += -t $(TARGET) --platform $(DEVICE) --save-temps 68 | ifneq ($(TARGET), hw) 69 | CLFLAGS += -g 70 | endif 71 | 72 | CLFLAGS += --sp vadd_1.m_axi_hbm0:HBM[0] 73 | CLFLAGS += --sp vadd_1.m_axi_hbm1:HBM[1] 74 | CLFLAGS += --sp vadd_1.m_axi_hbm2:HBM[2] 75 | CLFLAGS += --sp vadd_1.m_axi_hbm3:HBM[3] 76 | CLFLAGS += --sp vadd_1.m_axi_hbm4:HBM[4] 77 | CLFLAGS += --sp vadd_1.m_axi_hbm5:HBM[5] 78 | CLFLAGS += --sp vadd_1.m_axi_hbm6:HBM[6] 79 | CLFLAGS += --sp vadd_1.m_axi_hbm7:HBM[7] 80 | CLFLAGS += --sp vadd_1.m_axi_hbm8:HBM[8] 81 | CLFLAGS += --sp vadd_1.m_axi_hbm9:HBM[9] 82 | CLFLAGS += --sp vadd_1.m_axi_hbm10:HBM[10] 83 | CLFLAGS += --sp vadd_1.m_axi_hbm11:HBM[11] 84 | CLFLAGS += --sp vadd_1.m_axi_hbm12:HBM[12] 85 | CLFLAGS += --sp vadd_1.m_axi_hbm13:HBM[13] 86 | CLFLAGS += --sp vadd_1.m_axi_hbm14:HBM[14] 87 | CLFLAGS += --sp vadd_1.m_axi_hbm15:HBM[15] 88 | CLFLAGS += --sp vadd_1.m_axi_hbm16:HBM[16] 89 | CLFLAGS += --sp vadd_1.m_axi_hbm17:HBM[17] 90 | CLFLAGS += --sp vadd_1.m_axi_hbm18:HBM[18] 91 | CLFLAGS += --sp vadd_1.m_axi_hbm19:HBM[19] 92 | CLFLAGS += --sp vadd_1.m_axi_hbm20:HBM[20] 93 | CLFLAGS += --sp vadd_1.m_axi_hbm21:HBM[21] 94 | CLFLAGS += --sp vadd_1.m_axi_hbm22:HBM[22] 95 | CLFLAGS += --sp vadd_1.m_axi_hbm23:HBM[23] 96 | CLFLAGS += --sp vadd_1.m_axi_hbm24:HBM[24] 97 | CLFLAGS += --sp vadd_1.m_axi_hbm25:HBM[25] 98 | CLFLAGS += --sp vadd_1.m_axi_hbm26:HBM[26] 99 | CLFLAGS += --sp vadd_1.m_axi_hbm27:HBM[27] 100 | CLFLAGS += --sp vadd_1.m_axi_hbm28:HBM[28] 101 | CLFLAGS += --sp vadd_1.m_axi_hbm29:HBM[29] 102 | 103 | EXECUTABLE = host 104 | CMD_ARGS = $(BUILD_DIR)/vadd.xclbin 105 | EMCONFIG_DIR = $(TEMP_DIR) 106 | EMU_DIR = $(SDCARD)/data/emulation 107 | 108 | BINARY_CONTAINERS += $(BUILD_DIR)/vadd.xclbin 109 | BINARY_CONTAINER_vadd_OBJS += $(TEMP_DIR)/vadd.xo 110 | 111 | CP = cp -rf 112 | 113 | .PHONY: all clean cleanall docs emconfig 114 | all: check-devices $(EXECUTABLE) $(BINARY_CONTAINERS) emconfig sd_card 115 | 116 | .PHONY: exe 117 | exe: $(EXECUTABLE) 118 | 119 | .PHONY: build 120 | build: $(BINARY_CONTAINERS) 121 | 122 | # Building kernel 123 | $(TEMP_DIR)/vadd.xo: src/vadd.cpp 124 | mkdir -p $(TEMP_DIR) 125 | $(VPP) $(CLFLAGS) --temp_dir $(TEMP_DIR) -c -k vadd -I'$(> $(SDCARD)/init.sh 165 | $(ECHO) 'export XILINX_VITIS=$$PWD' >> $(SDCARD)/init.sh 166 | $(ECHO) 'export XCL_EMULATION_MODE=$(TARGET)' >> $(SDCARD)/init.sh 167 | $(ECHO) './$(EXECUTABLE) $(CMD_ARGS)' >> $(SDCARD)/init.sh 168 | $(ECHO) 'reboot' >> $(SDCARD)/init.sh 169 | else 170 | [ -f $(SDCARD)/BOOT.BIN ] && echo "INFO: BOOT.BIN already exists" || $(CP) $(BUILD_DIR)/sd_card/BOOT.BIN $(SDCARD)/ 171 | $(ECHO) './$(EXECUTABLE) $(CMD_ARGS)' >> $(SDCARD)/init.sh 172 | endif 173 | endif 174 | 175 | # Cleaning stuff 176 | clean: 177 | -$(RMDIR) $(EXECUTABLE) $(XCLBIN)/{*sw_emu*,*hw_emu*} 178 | -$(RMDIR) profile_* TempConfig system_estimate.xtxt *.rpt *.csv 179 | -$(RMDIR) src/*.ll *v++* .Xil emconfig.json dltmp* xmltmp* *.log *.jou *.wcfg *.wdb 180 | 181 | cleanall: clean 182 | -$(RMDIR) build_dir* sd_card* 183 | -$(RMDIR) _x.* *xclbin.run_summary qemu-memory-_* emulation/ _vimage/ pl* start_simulation.sh *.xclbin 184 | 185 | -------------------------------------------------------------------------------- /xilinx/dfs_baseline/Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: help 2 | 3 | help:: 4 | $(ECHO) "Makefile Usage:" 5 | $(ECHO) " make all TARGET= DEVICE= HOST_ARCH= SYSROOT=" 6 | $(ECHO) " Command to generate the design for specified Target and Shell." 7 | $(ECHO) " By default, HOST_ARCH=x86. HOST_ARCH and SYSROOT is required for SoC shells" 8 | $(ECHO) "" 9 | $(ECHO) " make clean " 10 | $(ECHO) " Command to remove the generated non-hardware files." 11 | $(ECHO) "" 12 | $(ECHO) " make cleanall" 13 | $(ECHO) " Command to remove all the generated files." 14 | $(ECHO) "" 15 | $(ECHO) " make sd_card TARGET= DEVICE= HOST_ARCH= SYSROOT=" 16 | $(ECHO) " Command to prepare sd_card files." 17 | $(ECHO) " By default, HOST_ARCH=x86. HOST_ARCH and SYSROOT is required for SoC shells" 18 | $(ECHO) "" 19 | $(ECHO) " make check TARGET= DEVICE= HOST_ARCH= SYSROOT=" 20 | $(ECHO) " Command to run application in emulation." 21 | $(ECHO) " By default, HOST_ARCH=x86. HOST_ARCH and SYSROOT is required for SoC shells" 22 | $(ECHO) "" 23 | $(ECHO) " make build TARGET= DEVICE= HOST_ARCH= SYSROOT=" 24 | $(ECHO) " Command to build xclbin application." 25 | $(ECHO) " By default, HOST_ARCH=x86. HOST_ARCH and SYSROOT is required for SoC shells" 26 | $(ECHO) "" 27 | 28 | # Points to top directory of Git repository 29 | COMMON_REPO = ../ 30 | PWD = $(shell readlink -f .) 31 | ABS_COMMON_REPO = $(shell readlink -f $(COMMON_REPO)) 32 | 33 | TARGET := hw 34 | HOST_ARCH := x86 35 | SYSROOT := 36 | DEVICE = xilinx_u280_xdma_201920_3 37 | 38 | include ./utils.mk 39 | 40 | XSA := $(call device2xsa, $(DEVICE)) 41 | TEMP_DIR := ./_x.$(TARGET).$(XSA) 42 | BUILD_DIR := ./build_dir.$(TARGET).$(XSA) 43 | 44 | VPP := v++ 45 | SDCARD := sd_card 46 | 47 | #Include Libraries 48 | include $(ABS_COMMON_REPO)/common/includes/opencl/opencl.mk 49 | include $(ABS_COMMON_REPO)/common/includes/xcl2/xcl2.mk 50 | CXXFLAGS += $(xcl2_CXXFLAGS) 51 | LDFLAGS += $(xcl2_LDFLAGS) 52 | HOST_SRCS += $(xcl2_SRCS) 53 | CXXFLAGS += $(opencl_CXXFLAGS) -Wall -O0 -g -std=c++11 54 | LDFLAGS += $(opencl_LDFLAGS) 55 | 56 | HOST_SRCS += src/host.cpp 57 | 58 | # Host compiler global settings 59 | CXXFLAGS += -fmessage-length=0 60 | LDFLAGS += -lrt -lstdc++ 61 | 62 | ifneq ($(HOST_ARCH), x86) 63 | LDFLAGS += --sysroot=$(SYSROOT) 64 | endif 65 | 66 | # Kernel compiler global settings 67 | CLFLAGS += -t $(TARGET) --platform $(DEVICE) --save-temps 68 | ifneq ($(TARGET), hw) 69 | CLFLAGS += -g 70 | endif 71 | 72 | CLFLAGS += --sp vadd_1.m_axi_hbm0:HBM[0] 73 | CLFLAGS += --sp vadd_1.m_axi_hbm1:HBM[1] 74 | CLFLAGS += --sp vadd_1.m_axi_hbm2:HBM[2] 75 | CLFLAGS += --sp vadd_1.m_axi_hbm3:HBM[3] 76 | CLFLAGS += --sp vadd_1.m_axi_hbm4:HBM[4] 77 | CLFLAGS += --sp vadd_1.m_axi_hbm5:HBM[5] 78 | CLFLAGS += --sp vadd_1.m_axi_hbm6:HBM[6] 79 | CLFLAGS += --sp vadd_1.m_axi_hbm7:HBM[7] 80 | CLFLAGS += --sp vadd_1.m_axi_hbm8:HBM[8] 81 | CLFLAGS += --sp vadd_1.m_axi_hbm9:HBM[9] 82 | CLFLAGS += --sp vadd_1.m_axi_hbm10:HBM[10] 83 | CLFLAGS += --sp vadd_1.m_axi_hbm11:HBM[11] 84 | CLFLAGS += --sp vadd_1.m_axi_hbm12:HBM[12] 85 | CLFLAGS += --sp vadd_1.m_axi_hbm13:HBM[13] 86 | CLFLAGS += --sp vadd_1.m_axi_hbm14:HBM[14] 87 | CLFLAGS += --sp vadd_1.m_axi_hbm15:HBM[15] 88 | CLFLAGS += --sp vadd_1.m_axi_hbm16:HBM[16] 89 | CLFLAGS += --sp vadd_1.m_axi_hbm17:HBM[17] 90 | CLFLAGS += --sp vadd_1.m_axi_hbm18:HBM[18] 91 | CLFLAGS += --sp vadd_1.m_axi_hbm19:HBM[19] 92 | CLFLAGS += --sp vadd_1.m_axi_hbm20:HBM[20] 93 | CLFLAGS += --sp vadd_1.m_axi_hbm21:HBM[21] 94 | CLFLAGS += --sp vadd_1.m_axi_hbm22:HBM[22] 95 | CLFLAGS += --sp vadd_1.m_axi_hbm23:HBM[23] 96 | CLFLAGS += --sp vadd_1.m_axi_hbm24:HBM[24] 97 | CLFLAGS += --sp vadd_1.m_axi_hbm25:HBM[25] 98 | CLFLAGS += --sp vadd_1.m_axi_hbm26:HBM[26] 99 | CLFLAGS += --sp vadd_1.m_axi_hbm27:HBM[27] 100 | CLFLAGS += --sp vadd_1.m_axi_hbm28:HBM[28] 101 | CLFLAGS += --sp vadd_1.m_axi_hbm29:HBM[29] 102 | 103 | CLFLAGS += --report_level 2 104 | 105 | EXECUTABLE = host 106 | CMD_ARGS = $(BUILD_DIR)/vadd.xclbin 107 | EMCONFIG_DIR = $(TEMP_DIR) 108 | EMU_DIR = $(SDCARD)/data/emulation 109 | 110 | BINARY_CONTAINERS += $(BUILD_DIR)/vadd.xclbin 111 | BINARY_CONTAINER_vadd_OBJS += $(TEMP_DIR)/vadd.xo 112 | 113 | CP = cp -rf 114 | 115 | .PHONY: all clean cleanall docs emconfig 116 | all: check-devices $(EXECUTABLE) $(BINARY_CONTAINERS) emconfig sd_card 117 | 118 | .PHONY: exe 119 | exe: $(EXECUTABLE) 120 | 121 | .PHONY: build 122 | build: $(BINARY_CONTAINERS) 123 | 124 | # Building kernel 125 | $(TEMP_DIR)/vadd.xo: src/vadd.cpp 126 | mkdir -p $(TEMP_DIR) 127 | $(VPP) $(CLFLAGS) --temp_dir $(TEMP_DIR) -c -k vadd -I'$(> $(SDCARD)/init.sh 167 | $(ECHO) 'export XILINX_VITIS=$$PWD' >> $(SDCARD)/init.sh 168 | $(ECHO) 'export XCL_EMULATION_MODE=$(TARGET)' >> $(SDCARD)/init.sh 169 | $(ECHO) './$(EXECUTABLE) $(CMD_ARGS)' >> $(SDCARD)/init.sh 170 | $(ECHO) 'reboot' >> $(SDCARD)/init.sh 171 | else 172 | [ -f $(SDCARD)/BOOT.BIN ] && echo "INFO: BOOT.BIN already exists" || $(CP) $(BUILD_DIR)/sd_card/BOOT.BIN $(SDCARD)/ 173 | $(ECHO) './$(EXECUTABLE) $(CMD_ARGS)' >> $(SDCARD)/init.sh 174 | endif 175 | endif 176 | 177 | # Cleaning stuff 178 | clean: 179 | -$(RMDIR) $(EXECUTABLE) $(XCLBIN)/{*sw_emu*,*hw_emu*} 180 | -$(RMDIR) profile_* TempConfig system_estimate.xtxt *.rpt *.csv 181 | -$(RMDIR) src/*.ll *v++* .Xil emconfig.json dltmp* xmltmp* *.log *.jou *.wcfg *.wdb 182 | 183 | cleanall: clean 184 | -$(RMDIR) build_dir* sd_card* 185 | -$(RMDIR) _x.* *xclbin.run_summary qemu-memory-_* emulation/ _vimage/ pl* start_simulation.sh *.xclbin 186 | 187 | -------------------------------------------------------------------------------- /xilinx/dfs_bipa8/Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: help 2 | 3 | help:: 4 | $(ECHO) "Makefile Usage:" 5 | $(ECHO) " make all TARGET= DEVICE= HOST_ARCH= SYSROOT=" 6 | $(ECHO) " Command to generate the design for specified Target and Shell." 7 | $(ECHO) " By default, HOST_ARCH=x86. HOST_ARCH and SYSROOT is required for SoC shells" 8 | $(ECHO) "" 9 | $(ECHO) " make clean " 10 | $(ECHO) " Command to remove the generated non-hardware files." 11 | $(ECHO) "" 12 | $(ECHO) " make cleanall" 13 | $(ECHO) " Command to remove all the generated files." 14 | $(ECHO) "" 15 | $(ECHO) " make sd_card TARGET= DEVICE= HOST_ARCH= SYSROOT=" 16 | $(ECHO) " Command to prepare sd_card files." 17 | $(ECHO) " By default, HOST_ARCH=x86. HOST_ARCH and SYSROOT is required for SoC shells" 18 | $(ECHO) "" 19 | $(ECHO) " make check TARGET= DEVICE= HOST_ARCH= SYSROOT=" 20 | $(ECHO) " Command to run application in emulation." 21 | $(ECHO) " By default, HOST_ARCH=x86. HOST_ARCH and SYSROOT is required for SoC shells" 22 | $(ECHO) "" 23 | $(ECHO) " make build TARGET= DEVICE= HOST_ARCH= SYSROOT=" 24 | $(ECHO) " Command to build xclbin application." 25 | $(ECHO) " By default, HOST_ARCH=x86. HOST_ARCH and SYSROOT is required for SoC shells" 26 | $(ECHO) "" 27 | 28 | # Points to top directory of Git repository 29 | COMMON_REPO = ../ 30 | PWD = $(shell readlink -f .) 31 | ABS_COMMON_REPO = $(shell readlink -f $(COMMON_REPO)) 32 | 33 | TARGET := hw 34 | HOST_ARCH := x86 35 | SYSROOT := 36 | DEVICE = xilinx_u280_xdma_201920_3 37 | 38 | include ./utils.mk 39 | 40 | XSA := $(call device2xsa, $(DEVICE)) 41 | TEMP_DIR := ./_x.$(TARGET).$(XSA) 42 | BUILD_DIR := ./build_dir.$(TARGET).$(XSA) 43 | 44 | VPP := v++ 45 | SDCARD := sd_card 46 | 47 | #Include Libraries 48 | include $(ABS_COMMON_REPO)/common/includes/opencl/opencl.mk 49 | include $(ABS_COMMON_REPO)/common/includes/xcl2/xcl2.mk 50 | CXXFLAGS += $(xcl2_CXXFLAGS) 51 | LDFLAGS += $(xcl2_LDFLAGS) 52 | HOST_SRCS += $(xcl2_SRCS) 53 | CXXFLAGS += $(opencl_CXXFLAGS) -Wall -O0 -g -std=c++11 54 | LDFLAGS += $(opencl_LDFLAGS) 55 | 56 | HOST_SRCS += src/host.cpp 57 | 58 | # Host compiler global settings 59 | CXXFLAGS += -fmessage-length=0 60 | LDFLAGS += -lrt -lstdc++ 61 | 62 | ifneq ($(HOST_ARCH), x86) 63 | LDFLAGS += --sysroot=$(SYSROOT) 64 | endif 65 | 66 | # Kernel compiler global settings 67 | CLFLAGS += -t $(TARGET) --platform $(DEVICE) --save-temps 68 | ifneq ($(TARGET), hw) 69 | CLFLAGS += -g 70 | endif 71 | 72 | CLFLAGS += --sp vadd_1.m_axi_hbm0:HBM[0] 73 | CLFLAGS += --sp vadd_1.m_axi_hbm1:HBM[1] 74 | CLFLAGS += --sp vadd_1.m_axi_hbm2:HBM[2] 75 | CLFLAGS += --sp vadd_1.m_axi_hbm3:HBM[3] 76 | CLFLAGS += --sp vadd_1.m_axi_hbm4:HBM[4] 77 | CLFLAGS += --sp vadd_1.m_axi_hbm5:HBM[5] 78 | CLFLAGS += --sp vadd_1.m_axi_hbm6:HBM[6] 79 | CLFLAGS += --sp vadd_1.m_axi_hbm7:HBM[7] 80 | CLFLAGS += --sp vadd_1.m_axi_hbm8:HBM[8] 81 | CLFLAGS += --sp vadd_1.m_axi_hbm9:HBM[9] 82 | CLFLAGS += --sp vadd_1.m_axi_hbm10:HBM[10] 83 | CLFLAGS += --sp vadd_1.m_axi_hbm11:HBM[11] 84 | CLFLAGS += --sp vadd_1.m_axi_hbm12:HBM[12] 85 | CLFLAGS += --sp vadd_1.m_axi_hbm13:HBM[13] 86 | CLFLAGS += --sp vadd_1.m_axi_hbm14:HBM[14] 87 | CLFLAGS += --sp vadd_1.m_axi_hbm15:HBM[15] 88 | CLFLAGS += --sp vadd_1.m_axi_hbm16:HBM[16] 89 | CLFLAGS += --sp vadd_1.m_axi_hbm17:HBM[17] 90 | CLFLAGS += --sp vadd_1.m_axi_hbm18:HBM[18] 91 | CLFLAGS += --sp vadd_1.m_axi_hbm19:HBM[19] 92 | CLFLAGS += --sp vadd_1.m_axi_hbm20:HBM[20] 93 | CLFLAGS += --sp vadd_1.m_axi_hbm21:HBM[21] 94 | CLFLAGS += --sp vadd_1.m_axi_hbm22:HBM[22] 95 | CLFLAGS += --sp vadd_1.m_axi_hbm23:HBM[23] 96 | CLFLAGS += --sp vadd_1.m_axi_hbm24:HBM[24] 97 | CLFLAGS += --sp vadd_1.m_axi_hbm25:HBM[25] 98 | CLFLAGS += --sp vadd_1.m_axi_hbm26:HBM[26] 99 | CLFLAGS += --sp vadd_1.m_axi_hbm27:HBM[27] 100 | CLFLAGS += --sp vadd_1.m_axi_hbm28:HBM[28] 101 | CLFLAGS += --sp vadd_1.m_axi_hbm29:HBM[29] 102 | 103 | CLFLAGS += --report_level 2 104 | 105 | EXECUTABLE = host 106 | CMD_ARGS = $(BUILD_DIR)/vadd.xclbin 107 | EMCONFIG_DIR = $(TEMP_DIR) 108 | EMU_DIR = $(SDCARD)/data/emulation 109 | 110 | BINARY_CONTAINERS += $(BUILD_DIR)/vadd.xclbin 111 | BINARY_CONTAINER_vadd_OBJS += $(TEMP_DIR)/vadd.xo 112 | 113 | CP = cp -rf 114 | 115 | .PHONY: all clean cleanall docs emconfig 116 | all: check-devices $(EXECUTABLE) $(BINARY_CONTAINERS) emconfig sd_card 117 | 118 | .PHONY: exe 119 | exe: $(EXECUTABLE) 120 | 121 | .PHONY: build 122 | build: $(BINARY_CONTAINERS) 123 | 124 | # Building kernel 125 | $(TEMP_DIR)/vadd.xo: src/vadd.cpp 126 | mkdir -p $(TEMP_DIR) 127 | $(VPP) $(CLFLAGS) --temp_dir $(TEMP_DIR) -c -k vadd -I'$(> $(SDCARD)/init.sh 167 | $(ECHO) 'export XILINX_VITIS=$$PWD' >> $(SDCARD)/init.sh 168 | $(ECHO) 'export XCL_EMULATION_MODE=$(TARGET)' >> $(SDCARD)/init.sh 169 | $(ECHO) './$(EXECUTABLE) $(CMD_ARGS)' >> $(SDCARD)/init.sh 170 | $(ECHO) 'reboot' >> $(SDCARD)/init.sh 171 | else 172 | [ -f $(SDCARD)/BOOT.BIN ] && echo "INFO: BOOT.BIN already exists" || $(CP) $(BUILD_DIR)/sd_card/BOOT.BIN $(SDCARD)/ 173 | $(ECHO) './$(EXECUTABLE) $(CMD_ARGS)' >> $(SDCARD)/init.sh 174 | endif 175 | endif 176 | 177 | # Cleaning stuff 178 | clean: 179 | -$(RMDIR) $(EXECUTABLE) $(XCLBIN)/{*sw_emu*,*hw_emu*} 180 | -$(RMDIR) profile_* TempConfig system_estimate.xtxt *.rpt *.csv 181 | -$(RMDIR) src/*.ll *v++* .Xil emconfig.json dltmp* xmltmp* *.log *.jou *.wcfg *.wdb 182 | 183 | cleanall: clean 184 | -$(RMDIR) build_dir* sd_card* 185 | -$(RMDIR) _x.* *xclbin.run_summary qemu-memory-_* emulation/ _vimage/ pl* start_simulation.sh *.xclbin 186 | 187 | -------------------------------------------------------------------------------- /xilinx/seq_u280_ch30/Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: help 2 | 3 | help:: 4 | $(ECHO) "Makefile Usage:" 5 | $(ECHO) " make all TARGET= DEVICE= HOST_ARCH= SYSROOT=" 6 | $(ECHO) " Command to generate the design for specified Target and Shell." 7 | $(ECHO) " By default, HOST_ARCH=x86. HOST_ARCH and SYSROOT is required for SoC shells" 8 | $(ECHO) "" 9 | $(ECHO) " make clean " 10 | $(ECHO) " Command to remove the generated non-hardware files." 11 | $(ECHO) "" 12 | $(ECHO) " make cleanall" 13 | $(ECHO) " Command to remove all the generated files." 14 | $(ECHO) "" 15 | $(ECHO) " make sd_card TARGET= DEVICE= HOST_ARCH= SYSROOT=" 16 | $(ECHO) " Command to prepare sd_card files." 17 | $(ECHO) " By default, HOST_ARCH=x86. HOST_ARCH and SYSROOT is required for SoC shells" 18 | $(ECHO) "" 19 | $(ECHO) " make check TARGET= DEVICE= HOST_ARCH= SYSROOT=" 20 | $(ECHO) " Command to run application in emulation." 21 | $(ECHO) " By default, HOST_ARCH=x86. HOST_ARCH and SYSROOT is required for SoC shells" 22 | $(ECHO) "" 23 | $(ECHO) " make build TARGET= DEVICE= HOST_ARCH= SYSROOT=" 24 | $(ECHO) " Command to build xclbin application." 25 | $(ECHO) " By default, HOST_ARCH=x86. HOST_ARCH and SYSROOT is required for SoC shells" 26 | $(ECHO) "" 27 | 28 | # Points to top directory of Git repository 29 | COMMON_REPO = ../ 30 | PWD = $(shell readlink -f .) 31 | ABS_COMMON_REPO = $(shell readlink -f $(COMMON_REPO)) 32 | 33 | TARGET := hw 34 | HOST_ARCH := x86 35 | SYSROOT := 36 | DEVICE = xilinx_u280_xdma_201920_3 37 | 38 | include ./utils.mk 39 | 40 | XSA := $(call device2xsa, $(DEVICE)) 41 | TEMP_DIR := ./_x.$(TARGET).$(XSA) 42 | BUILD_DIR := ./build_dir.$(TARGET).$(XSA) 43 | 44 | VPP := v++ 45 | SDCARD := sd_card 46 | 47 | #Include Libraries 48 | include $(ABS_COMMON_REPO)/common/includes/opencl/opencl.mk 49 | include $(ABS_COMMON_REPO)/common/includes/xcl2/xcl2.mk 50 | CXXFLAGS += $(xcl2_CXXFLAGS) 51 | LDFLAGS += $(xcl2_LDFLAGS) 52 | HOST_SRCS += $(xcl2_SRCS) 53 | CXXFLAGS += $(opencl_CXXFLAGS) -Wall -O0 -g -std=c++11 54 | LDFLAGS += $(opencl_LDFLAGS) 55 | 56 | HOST_SRCS += src/host.cpp 57 | 58 | # Host compiler global settings 59 | CXXFLAGS += -fmessage-length=0 60 | LDFLAGS += -lrt -lstdc++ 61 | 62 | ifneq ($(HOST_ARCH), x86) 63 | LDFLAGS += --sysroot=$(SYSROOT) 64 | endif 65 | 66 | # Kernel compiler global settings 67 | CLFLAGS += -t $(TARGET) --platform $(DEVICE) --save-temps 68 | ifneq ($(TARGET), hw) 69 | CLFLAGS += -g 70 | endif 71 | 72 | CLFLAGS += --sp vadd_1.m_axi_hbm0:HBM[0] 73 | CLFLAGS += --sp vadd_1.m_axi_hbm1:HBM[1] 74 | CLFLAGS += --sp vadd_1.m_axi_hbm2:HBM[2] 75 | CLFLAGS += --sp vadd_1.m_axi_hbm3:HBM[3] 76 | CLFLAGS += --sp vadd_1.m_axi_hbm4:HBM[4] 77 | CLFLAGS += --sp vadd_1.m_axi_hbm5:HBM[5] 78 | CLFLAGS += --sp vadd_1.m_axi_hbm6:HBM[6] 79 | CLFLAGS += --sp vadd_1.m_axi_hbm7:HBM[7] 80 | CLFLAGS += --sp vadd_1.m_axi_hbm8:HBM[8] 81 | CLFLAGS += --sp vadd_1.m_axi_hbm9:HBM[9] 82 | CLFLAGS += --sp vadd_1.m_axi_hbm10:HBM[10] 83 | CLFLAGS += --sp vadd_1.m_axi_hbm11:HBM[11] 84 | CLFLAGS += --sp vadd_1.m_axi_hbm12:HBM[12] 85 | CLFLAGS += --sp vadd_1.m_axi_hbm13:HBM[13] 86 | CLFLAGS += --sp vadd_1.m_axi_hbm14:HBM[14] 87 | CLFLAGS += --sp vadd_1.m_axi_hbm15:HBM[15] 88 | CLFLAGS += --sp vadd_1.m_axi_hbm16:HBM[16] 89 | CLFLAGS += --sp vadd_1.m_axi_hbm17:HBM[17] 90 | CLFLAGS += --sp vadd_1.m_axi_hbm18:HBM[18] 91 | CLFLAGS += --sp vadd_1.m_axi_hbm19:HBM[19] 92 | CLFLAGS += --sp vadd_1.m_axi_hbm20:HBM[20] 93 | CLFLAGS += --sp vadd_1.m_axi_hbm21:HBM[21] 94 | CLFLAGS += --sp vadd_1.m_axi_hbm22:HBM[22] 95 | CLFLAGS += --sp vadd_1.m_axi_hbm23:HBM[23] 96 | CLFLAGS += --sp vadd_1.m_axi_hbm24:HBM[24] 97 | CLFLAGS += --sp vadd_1.m_axi_hbm25:HBM[25] 98 | CLFLAGS += --sp vadd_1.m_axi_hbm26:HBM[26] 99 | CLFLAGS += --sp vadd_1.m_axi_hbm27:HBM[27] 100 | CLFLAGS += --sp vadd_1.m_axi_hbm28:HBM[28] 101 | CLFLAGS += --sp vadd_1.m_axi_hbm29:HBM[29] 102 | 103 | CLFLAGS += --report_level 2 104 | 105 | EXECUTABLE = host 106 | CMD_ARGS = $(BUILD_DIR)/vadd.xclbin 107 | EMCONFIG_DIR = $(TEMP_DIR) 108 | EMU_DIR = $(SDCARD)/data/emulation 109 | 110 | BINARY_CONTAINERS += $(BUILD_DIR)/vadd.xclbin 111 | BINARY_CONTAINER_vadd_OBJS += $(TEMP_DIR)/vadd.xo 112 | 113 | CP = cp -rf 114 | 115 | .PHONY: all clean cleanall docs emconfig 116 | all: check-devices $(EXECUTABLE) $(BINARY_CONTAINERS) emconfig sd_card 117 | 118 | .PHONY: exe 119 | exe: $(EXECUTABLE) 120 | 121 | .PHONY: build 122 | build: $(BINARY_CONTAINERS) 123 | 124 | # Building kernel 125 | $(TEMP_DIR)/vadd.xo: src/vadd.cpp 126 | mkdir -p $(TEMP_DIR) 127 | $(VPP) $(CLFLAGS) --temp_dir $(TEMP_DIR) -c -k vadd -I'$(> $(SDCARD)/init.sh 167 | $(ECHO) 'export XILINX_VITIS=$$PWD' >> $(SDCARD)/init.sh 168 | $(ECHO) 'export XCL_EMULATION_MODE=$(TARGET)' >> $(SDCARD)/init.sh 169 | $(ECHO) './$(EXECUTABLE) $(CMD_ARGS)' >> $(SDCARD)/init.sh 170 | $(ECHO) 'reboot' >> $(SDCARD)/init.sh 171 | else 172 | [ -f $(SDCARD)/BOOT.BIN ] && echo "INFO: BOOT.BIN already exists" || $(CP) $(BUILD_DIR)/sd_card/BOOT.BIN $(SDCARD)/ 173 | $(ECHO) './$(EXECUTABLE) $(CMD_ARGS)' >> $(SDCARD)/init.sh 174 | endif 175 | endif 176 | 177 | # Cleaning stuff 178 | clean: 179 | -$(RMDIR) $(EXECUTABLE) $(XCLBIN)/{*sw_emu*,*hw_emu*} 180 | -$(RMDIR) profile_* TempConfig system_estimate.xtxt *.rpt *.csv 181 | -$(RMDIR) src/*.ll *v++* .Xil emconfig.json dltmp* xmltmp* *.log *.jou *.wcfg *.wdb 182 | 183 | cleanall: clean 184 | -$(RMDIR) build_dir* sd_card* 185 | -$(RMDIR) _x.* *xclbin.run_summary qemu-memory-_* emulation/ _vimage/ pl* start_simulation.sh *.xclbin 186 | 187 | -------------------------------------------------------------------------------- /xilinx/bsearch_baseline/Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: help 2 | 3 | help:: 4 | $(ECHO) "Makefile Usage:" 5 | $(ECHO) " make all TARGET= DEVICE= HOST_ARCH= SYSROOT=" 6 | $(ECHO) " Command to generate the design for specified Target and Shell." 7 | $(ECHO) " By default, HOST_ARCH=x86. HOST_ARCH and SYSROOT is required for SoC shells" 8 | $(ECHO) "" 9 | $(ECHO) " make clean " 10 | $(ECHO) " Command to remove the generated non-hardware files." 11 | $(ECHO) "" 12 | $(ECHO) " make cleanall" 13 | $(ECHO) " Command to remove all the generated files." 14 | $(ECHO) "" 15 | $(ECHO) " make sd_card TARGET= DEVICE= HOST_ARCH= SYSROOT=" 16 | $(ECHO) " Command to prepare sd_card files." 17 | $(ECHO) " By default, HOST_ARCH=x86. HOST_ARCH and SYSROOT is required for SoC shells" 18 | $(ECHO) "" 19 | $(ECHO) " make check TARGET= DEVICE= HOST_ARCH= SYSROOT=" 20 | $(ECHO) " Command to run application in emulation." 21 | $(ECHO) " By default, HOST_ARCH=x86. HOST_ARCH and SYSROOT is required for SoC shells" 22 | $(ECHO) "" 23 | $(ECHO) " make build TARGET= DEVICE= HOST_ARCH= SYSROOT=" 24 | $(ECHO) " Command to build xclbin application." 25 | $(ECHO) " By default, HOST_ARCH=x86. HOST_ARCH and SYSROOT is required for SoC shells" 26 | $(ECHO) "" 27 | 28 | # Points to top directory of Git repository 29 | COMMON_REPO = ../ 30 | PWD = $(shell readlink -f .) 31 | ABS_COMMON_REPO = $(shell readlink -f $(COMMON_REPO)) 32 | 33 | TARGET := hw 34 | HOST_ARCH := x86 35 | SYSROOT := 36 | DEVICE = xilinx_u280_xdma_201920_3 37 | 38 | include ./utils.mk 39 | 40 | XSA := $(call device2xsa, $(DEVICE)) 41 | TEMP_DIR := ./_x.$(TARGET).$(XSA) 42 | BUILD_DIR := ./build_dir.$(TARGET).$(XSA) 43 | 44 | VPP := v++ 45 | SDCARD := sd_card 46 | 47 | #Include Libraries 48 | include $(ABS_COMMON_REPO)/common/includes/opencl/opencl.mk 49 | include $(ABS_COMMON_REPO)/common/includes/xcl2/xcl2.mk 50 | CXXFLAGS += $(xcl2_CXXFLAGS) 51 | LDFLAGS += $(xcl2_LDFLAGS) 52 | HOST_SRCS += $(xcl2_SRCS) 53 | CXXFLAGS += $(opencl_CXXFLAGS) -Wall -O0 -g -std=c++11 54 | LDFLAGS += $(opencl_LDFLAGS) 55 | 56 | HOST_SRCS += src/host.cpp 57 | 58 | # Host compiler global settings 59 | CXXFLAGS += -fmessage-length=0 60 | LDFLAGS += -lrt -lstdc++ 61 | 62 | ifneq ($(HOST_ARCH), x86) 63 | LDFLAGS += --sysroot=$(SYSROOT) 64 | endif 65 | 66 | # Kernel compiler global settings 67 | CLFLAGS += -t $(TARGET) --platform $(DEVICE) --save-temps 68 | ifneq ($(TARGET), hw) 69 | CLFLAGS += -g 70 | endif 71 | 72 | CLFLAGS += --sp vadd_1.m_axi_hbm0:HBM[0] 73 | CLFLAGS += --sp vadd_1.m_axi_hbm1:HBM[1] 74 | CLFLAGS += --sp vadd_1.m_axi_hbm2:HBM[2] 75 | CLFLAGS += --sp vadd_1.m_axi_hbm3:HBM[3] 76 | CLFLAGS += --sp vadd_1.m_axi_hbm4:HBM[4] 77 | CLFLAGS += --sp vadd_1.m_axi_hbm5:HBM[5] 78 | CLFLAGS += --sp vadd_1.m_axi_hbm6:HBM[6] 79 | CLFLAGS += --sp vadd_1.m_axi_hbm7:HBM[7] 80 | CLFLAGS += --sp vadd_1.m_axi_hbm8:HBM[8] 81 | CLFLAGS += --sp vadd_1.m_axi_hbm9:HBM[9] 82 | CLFLAGS += --sp vadd_1.m_axi_hbm10:HBM[10] 83 | CLFLAGS += --sp vadd_1.m_axi_hbm11:HBM[11] 84 | CLFLAGS += --sp vadd_1.m_axi_hbm12:HBM[12] 85 | CLFLAGS += --sp vadd_1.m_axi_hbm13:HBM[13] 86 | CLFLAGS += --sp vadd_1.m_axi_hbm14:HBM[14] 87 | CLFLAGS += --sp vadd_1.m_axi_hbm15:HBM[15] 88 | CLFLAGS += --sp vadd_1.m_axi_hbm16:HBM[16] 89 | CLFLAGS += --sp vadd_1.m_axi_hbm17:HBM[17] 90 | CLFLAGS += --sp vadd_1.m_axi_hbm18:HBM[18] 91 | CLFLAGS += --sp vadd_1.m_axi_hbm19:HBM[19] 92 | CLFLAGS += --sp vadd_1.m_axi_hbm20:HBM[20] 93 | CLFLAGS += --sp vadd_1.m_axi_hbm21:HBM[21] 94 | CLFLAGS += --sp vadd_1.m_axi_hbm22:HBM[22] 95 | CLFLAGS += --sp vadd_1.m_axi_hbm23:HBM[23] 96 | CLFLAGS += --sp vadd_1.m_axi_hbm24:HBM[24] 97 | CLFLAGS += --sp vadd_1.m_axi_hbm25:HBM[25] 98 | CLFLAGS += --sp vadd_1.m_axi_hbm26:HBM[26] 99 | CLFLAGS += --sp vadd_1.m_axi_hbm27:HBM[27] 100 | CLFLAGS += --sp vadd_1.m_axi_hbm28:HBM[28] 101 | CLFLAGS += --sp vadd_1.m_axi_hbm29:HBM[29] 102 | 103 | CLFLAGS += --report_level 2 104 | 105 | EXECUTABLE = host 106 | CMD_ARGS = $(BUILD_DIR)/vadd.xclbin 107 | EMCONFIG_DIR = $(TEMP_DIR) 108 | EMU_DIR = $(SDCARD)/data/emulation 109 | 110 | BINARY_CONTAINERS += $(BUILD_DIR)/vadd.xclbin 111 | BINARY_CONTAINER_vadd_OBJS += $(TEMP_DIR)/vadd.xo 112 | 113 | CP = cp -rf 114 | 115 | .PHONY: all clean cleanall docs emconfig 116 | all: check-devices $(EXECUTABLE) $(BINARY_CONTAINERS) emconfig sd_card 117 | 118 | .PHONY: exe 119 | exe: $(EXECUTABLE) 120 | 121 | .PHONY: build 122 | build: $(BINARY_CONTAINERS) 123 | 124 | # Building kernel 125 | $(TEMP_DIR)/vadd.xo: src/vadd.cpp 126 | mkdir -p $(TEMP_DIR) 127 | $(VPP) $(CLFLAGS) --temp_dir $(TEMP_DIR) -c -k vadd -I'$(> $(SDCARD)/init.sh 167 | $(ECHO) 'export XILINX_VITIS=$$PWD' >> $(SDCARD)/init.sh 168 | $(ECHO) 'export XCL_EMULATION_MODE=$(TARGET)' >> $(SDCARD)/init.sh 169 | $(ECHO) './$(EXECUTABLE) $(CMD_ARGS)' >> $(SDCARD)/init.sh 170 | $(ECHO) 'reboot' >> $(SDCARD)/init.sh 171 | else 172 | [ -f $(SDCARD)/BOOT.BIN ] && echo "INFO: BOOT.BIN already exists" || $(CP) $(BUILD_DIR)/sd_card/BOOT.BIN $(SDCARD)/ 173 | $(ECHO) './$(EXECUTABLE) $(CMD_ARGS)' >> $(SDCARD)/init.sh 174 | endif 175 | endif 176 | 177 | # Cleaning stuff 178 | clean: 179 | -$(RMDIR) $(EXECUTABLE) $(XCLBIN)/{*sw_emu*,*hw_emu*} 180 | -$(RMDIR) profile_* TempConfig system_estimate.xtxt *.rpt *.csv 181 | -$(RMDIR) src/*.ll *v++* .Xil emconfig.json dltmp* xmltmp* *.log *.jou *.wcfg *.wdb 182 | 183 | cleanall: clean 184 | -$(RMDIR) build_dir* sd_card* 185 | -$(RMDIR) _x.* *xclbin.run_summary qemu-memory-_* emulation/ _vimage/ pl* start_simulation.sh *.xclbin 186 | 187 | -------------------------------------------------------------------------------- /xilinx/bsearch_bipa16/Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: help 2 | 3 | help:: 4 | $(ECHO) "Makefile Usage:" 5 | $(ECHO) " make all TARGET= DEVICE= HOST_ARCH= SYSROOT=" 6 | $(ECHO) " Command to generate the design for specified Target and Shell." 7 | $(ECHO) " By default, HOST_ARCH=x86. HOST_ARCH and SYSROOT is required for SoC shells" 8 | $(ECHO) "" 9 | $(ECHO) " make clean " 10 | $(ECHO) " Command to remove the generated non-hardware files." 11 | $(ECHO) "" 12 | $(ECHO) " make cleanall" 13 | $(ECHO) " Command to remove all the generated files." 14 | $(ECHO) "" 15 | $(ECHO) " make sd_card TARGET= DEVICE= HOST_ARCH= SYSROOT=" 16 | $(ECHO) " Command to prepare sd_card files." 17 | $(ECHO) " By default, HOST_ARCH=x86. HOST_ARCH and SYSROOT is required for SoC shells" 18 | $(ECHO) "" 19 | $(ECHO) " make check TARGET= DEVICE= HOST_ARCH= SYSROOT=" 20 | $(ECHO) " Command to run application in emulation." 21 | $(ECHO) " By default, HOST_ARCH=x86. HOST_ARCH and SYSROOT is required for SoC shells" 22 | $(ECHO) "" 23 | $(ECHO) " make build TARGET= DEVICE= HOST_ARCH= SYSROOT=" 24 | $(ECHO) " Command to build xclbin application." 25 | $(ECHO) " By default, HOST_ARCH=x86. HOST_ARCH and SYSROOT is required for SoC shells" 26 | $(ECHO) "" 27 | 28 | # Points to top directory of Git repository 29 | COMMON_REPO = ../ 30 | PWD = $(shell readlink -f .) 31 | ABS_COMMON_REPO = $(shell readlink -f $(COMMON_REPO)) 32 | 33 | TARGET := hw 34 | HOST_ARCH := x86 35 | SYSROOT := 36 | DEVICE = xilinx_u280_xdma_201920_3 37 | 38 | include ./utils.mk 39 | 40 | XSA := $(call device2xsa, $(DEVICE)) 41 | TEMP_DIR := ./_x.$(TARGET).$(XSA) 42 | BUILD_DIR := ./build_dir.$(TARGET).$(XSA) 43 | 44 | VPP := v++ 45 | SDCARD := sd_card 46 | 47 | #Include Libraries 48 | include $(ABS_COMMON_REPO)/common/includes/opencl/opencl.mk 49 | include $(ABS_COMMON_REPO)/common/includes/xcl2/xcl2.mk 50 | CXXFLAGS += $(xcl2_CXXFLAGS) 51 | LDFLAGS += $(xcl2_LDFLAGS) 52 | HOST_SRCS += $(xcl2_SRCS) 53 | CXXFLAGS += $(opencl_CXXFLAGS) -Wall -O0 -g -std=c++11 54 | LDFLAGS += $(opencl_LDFLAGS) 55 | 56 | HOST_SRCS += src/host.cpp 57 | 58 | # Host compiler global settings 59 | CXXFLAGS += -fmessage-length=0 60 | LDFLAGS += -lrt -lstdc++ 61 | 62 | ifneq ($(HOST_ARCH), x86) 63 | LDFLAGS += --sysroot=$(SYSROOT) 64 | endif 65 | 66 | # Kernel compiler global settings 67 | CLFLAGS += -t $(TARGET) --platform $(DEVICE) --save-temps 68 | ifneq ($(TARGET), hw) 69 | CLFLAGS += -g 70 | endif 71 | 72 | CLFLAGS += --sp vadd_1.m_axi_hbm0:HBM[0] 73 | CLFLAGS += --sp vadd_1.m_axi_hbm1:HBM[1] 74 | CLFLAGS += --sp vadd_1.m_axi_hbm2:HBM[2] 75 | CLFLAGS += --sp vadd_1.m_axi_hbm3:HBM[3] 76 | CLFLAGS += --sp vadd_1.m_axi_hbm4:HBM[4] 77 | CLFLAGS += --sp vadd_1.m_axi_hbm5:HBM[5] 78 | CLFLAGS += --sp vadd_1.m_axi_hbm6:HBM[6] 79 | CLFLAGS += --sp vadd_1.m_axi_hbm7:HBM[7] 80 | CLFLAGS += --sp vadd_1.m_axi_hbm8:HBM[8] 81 | CLFLAGS += --sp vadd_1.m_axi_hbm9:HBM[9] 82 | CLFLAGS += --sp vadd_1.m_axi_hbm10:HBM[10] 83 | CLFLAGS += --sp vadd_1.m_axi_hbm11:HBM[11] 84 | CLFLAGS += --sp vadd_1.m_axi_hbm12:HBM[12] 85 | CLFLAGS += --sp vadd_1.m_axi_hbm13:HBM[13] 86 | CLFLAGS += --sp vadd_1.m_axi_hbm14:HBM[14] 87 | CLFLAGS += --sp vadd_1.m_axi_hbm15:HBM[15] 88 | CLFLAGS += --sp vadd_1.m_axi_hbm16:HBM[16] 89 | CLFLAGS += --sp vadd_1.m_axi_hbm17:HBM[17] 90 | CLFLAGS += --sp vadd_1.m_axi_hbm18:HBM[18] 91 | CLFLAGS += --sp vadd_1.m_axi_hbm19:HBM[19] 92 | CLFLAGS += --sp vadd_1.m_axi_hbm20:HBM[20] 93 | CLFLAGS += --sp vadd_1.m_axi_hbm21:HBM[21] 94 | CLFLAGS += --sp vadd_1.m_axi_hbm22:HBM[22] 95 | CLFLAGS += --sp vadd_1.m_axi_hbm23:HBM[23] 96 | CLFLAGS += --sp vadd_1.m_axi_hbm24:HBM[24] 97 | CLFLAGS += --sp vadd_1.m_axi_hbm25:HBM[25] 98 | CLFLAGS += --sp vadd_1.m_axi_hbm26:HBM[26] 99 | CLFLAGS += --sp vadd_1.m_axi_hbm27:HBM[27] 100 | CLFLAGS += --sp vadd_1.m_axi_hbm28:HBM[28] 101 | CLFLAGS += --sp vadd_1.m_axi_hbm29:HBM[29] 102 | 103 | CLFLAGS += --report_level 2 104 | 105 | EXECUTABLE = host 106 | CMD_ARGS = $(BUILD_DIR)/vadd.xclbin 107 | EMCONFIG_DIR = $(TEMP_DIR) 108 | EMU_DIR = $(SDCARD)/data/emulation 109 | 110 | BINARY_CONTAINERS += $(BUILD_DIR)/vadd.xclbin 111 | BINARY_CONTAINER_vadd_OBJS += $(TEMP_DIR)/vadd.xo 112 | 113 | CP = cp -rf 114 | 115 | .PHONY: all clean cleanall docs emconfig 116 | all: check-devices $(EXECUTABLE) $(BINARY_CONTAINERS) emconfig sd_card 117 | 118 | .PHONY: exe 119 | exe: $(EXECUTABLE) 120 | 121 | .PHONY: build 122 | build: $(BINARY_CONTAINERS) 123 | 124 | # Building kernel 125 | $(TEMP_DIR)/vadd.xo: src/vadd.cpp 126 | mkdir -p $(TEMP_DIR) 127 | $(VPP) $(CLFLAGS) --temp_dir $(TEMP_DIR) -c -k vadd -I'$(> $(SDCARD)/init.sh 167 | $(ECHO) 'export XILINX_VITIS=$$PWD' >> $(SDCARD)/init.sh 168 | $(ECHO) 'export XCL_EMULATION_MODE=$(TARGET)' >> $(SDCARD)/init.sh 169 | $(ECHO) './$(EXECUTABLE) $(CMD_ARGS)' >> $(SDCARD)/init.sh 170 | $(ECHO) 'reboot' >> $(SDCARD)/init.sh 171 | else 172 | [ -f $(SDCARD)/BOOT.BIN ] && echo "INFO: BOOT.BIN already exists" || $(CP) $(BUILD_DIR)/sd_card/BOOT.BIN $(SDCARD)/ 173 | $(ECHO) './$(EXECUTABLE) $(CMD_ARGS)' >> $(SDCARD)/init.sh 174 | endif 175 | endif 176 | 177 | # Cleaning stuff 178 | clean: 179 | -$(RMDIR) $(EXECUTABLE) $(XCLBIN)/{*sw_emu*,*hw_emu*} 180 | -$(RMDIR) profile_* TempConfig system_estimate.xtxt *.rpt *.csv 181 | -$(RMDIR) src/*.ll *v++* .Xil emconfig.json dltmp* xmltmp* *.log *.jou *.wcfg *.wdb 182 | 183 | cleanall: clean 184 | -$(RMDIR) build_dir* sd_card* 185 | -$(RMDIR) _x.* *xclbin.run_summary qemu-memory-_* emulation/ _vimage/ pl* start_simulation.sh *.xclbin 186 | 187 | -------------------------------------------------------------------------------- /xilinx/strided_u280_ch30/Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: help 2 | 3 | help:: 4 | $(ECHO) "Makefile Usage:" 5 | $(ECHO) " make all TARGET= DEVICE= HOST_ARCH= SYSROOT=" 6 | $(ECHO) " Command to generate the design for specified Target and Shell." 7 | $(ECHO) " By default, HOST_ARCH=x86. HOST_ARCH and SYSROOT is required for SoC shells" 8 | $(ECHO) "" 9 | $(ECHO) " make clean " 10 | $(ECHO) " Command to remove the generated non-hardware files." 11 | $(ECHO) "" 12 | $(ECHO) " make cleanall" 13 | $(ECHO) " Command to remove all the generated files." 14 | $(ECHO) "" 15 | $(ECHO) " make sd_card TARGET= DEVICE= HOST_ARCH= SYSROOT=" 16 | $(ECHO) " Command to prepare sd_card files." 17 | $(ECHO) " By default, HOST_ARCH=x86. HOST_ARCH and SYSROOT is required for SoC shells" 18 | $(ECHO) "" 19 | $(ECHO) " make check TARGET= DEVICE= HOST_ARCH= SYSROOT=" 20 | $(ECHO) " Command to run application in emulation." 21 | $(ECHO) " By default, HOST_ARCH=x86. HOST_ARCH and SYSROOT is required for SoC shells" 22 | $(ECHO) "" 23 | $(ECHO) " make build TARGET= DEVICE= HOST_ARCH= SYSROOT=" 24 | $(ECHO) " Command to build xclbin application." 25 | $(ECHO) " By default, HOST_ARCH=x86. HOST_ARCH and SYSROOT is required for SoC shells" 26 | $(ECHO) "" 27 | 28 | # Points to top directory of Git repository 29 | COMMON_REPO = ../ 30 | PWD = $(shell readlink -f .) 31 | ABS_COMMON_REPO = $(shell readlink -f $(COMMON_REPO)) 32 | 33 | TARGET := hw 34 | HOST_ARCH := x86 35 | SYSROOT := 36 | DEVICE = xilinx_u280_xdma_201920_3 37 | 38 | include ./utils.mk 39 | 40 | XSA := $(call device2xsa, $(DEVICE)) 41 | TEMP_DIR := ./_x.$(TARGET).$(XSA) 42 | BUILD_DIR := ./build_dir.$(TARGET).$(XSA) 43 | 44 | VPP := v++ 45 | SDCARD := sd_card 46 | 47 | #Include Libraries 48 | include $(ABS_COMMON_REPO)/common/includes/opencl/opencl.mk 49 | include $(ABS_COMMON_REPO)/common/includes/xcl2/xcl2.mk 50 | CXXFLAGS += $(xcl2_CXXFLAGS) 51 | LDFLAGS += $(xcl2_LDFLAGS) 52 | HOST_SRCS += $(xcl2_SRCS) 53 | CXXFLAGS += $(opencl_CXXFLAGS) -Wall -O0 -g -std=c++11 54 | LDFLAGS += $(opencl_LDFLAGS) 55 | 56 | HOST_SRCS += src/host.cpp 57 | 58 | # Host compiler global settings 59 | CXXFLAGS += -fmessage-length=0 60 | LDFLAGS += -lrt -lstdc++ 61 | 62 | ifneq ($(HOST_ARCH), x86) 63 | LDFLAGS += --sysroot=$(SYSROOT) 64 | endif 65 | 66 | # Kernel compiler global settings 67 | CLFLAGS += -t $(TARGET) --platform $(DEVICE) --save-temps 68 | ifneq ($(TARGET), hw) 69 | CLFLAGS += -g 70 | endif 71 | 72 | CLFLAGS += --sp vadd_1.m_axi_hbm0:HBM[0] 73 | CLFLAGS += --sp vadd_1.m_axi_hbm1:HBM[1] 74 | CLFLAGS += --sp vadd_1.m_axi_hbm2:HBM[2] 75 | CLFLAGS += --sp vadd_1.m_axi_hbm3:HBM[3] 76 | CLFLAGS += --sp vadd_1.m_axi_hbm4:HBM[4] 77 | CLFLAGS += --sp vadd_1.m_axi_hbm5:HBM[5] 78 | CLFLAGS += --sp vadd_1.m_axi_hbm6:HBM[6] 79 | CLFLAGS += --sp vadd_1.m_axi_hbm7:HBM[7] 80 | CLFLAGS += --sp vadd_1.m_axi_hbm8:HBM[8] 81 | CLFLAGS += --sp vadd_1.m_axi_hbm9:HBM[9] 82 | CLFLAGS += --sp vadd_1.m_axi_hbm10:HBM[10] 83 | CLFLAGS += --sp vadd_1.m_axi_hbm11:HBM[11] 84 | CLFLAGS += --sp vadd_1.m_axi_hbm12:HBM[12] 85 | CLFLAGS += --sp vadd_1.m_axi_hbm13:HBM[13] 86 | CLFLAGS += --sp vadd_1.m_axi_hbm14:HBM[14] 87 | CLFLAGS += --sp vadd_1.m_axi_hbm15:HBM[15] 88 | CLFLAGS += --sp vadd_1.m_axi_hbm16:HBM[16] 89 | CLFLAGS += --sp vadd_1.m_axi_hbm17:HBM[17] 90 | CLFLAGS += --sp vadd_1.m_axi_hbm18:HBM[18] 91 | CLFLAGS += --sp vadd_1.m_axi_hbm19:HBM[19] 92 | CLFLAGS += --sp vadd_1.m_axi_hbm20:HBM[20] 93 | CLFLAGS += --sp vadd_1.m_axi_hbm21:HBM[21] 94 | CLFLAGS += --sp vadd_1.m_axi_hbm22:HBM[22] 95 | CLFLAGS += --sp vadd_1.m_axi_hbm23:HBM[23] 96 | CLFLAGS += --sp vadd_1.m_axi_hbm24:HBM[24] 97 | CLFLAGS += --sp vadd_1.m_axi_hbm25:HBM[25] 98 | CLFLAGS += --sp vadd_1.m_axi_hbm26:HBM[26] 99 | CLFLAGS += --sp vadd_1.m_axi_hbm27:HBM[27] 100 | CLFLAGS += --sp vadd_1.m_axi_hbm28:HBM[28] 101 | CLFLAGS += --sp vadd_1.m_axi_hbm29:HBM[29] 102 | 103 | CLFLAGS += --report_level 2 104 | 105 | EXECUTABLE = host 106 | CMD_ARGS = $(BUILD_DIR)/vadd.xclbin 107 | EMCONFIG_DIR = $(TEMP_DIR) 108 | EMU_DIR = $(SDCARD)/data/emulation 109 | 110 | BINARY_CONTAINERS += $(BUILD_DIR)/vadd.xclbin 111 | BINARY_CONTAINER_vadd_OBJS += $(TEMP_DIR)/vadd.xo 112 | 113 | CP = cp -rf 114 | 115 | .PHONY: all clean cleanall docs emconfig 116 | all: check-devices $(EXECUTABLE) $(BINARY_CONTAINERS) emconfig sd_card 117 | 118 | .PHONY: exe 119 | exe: $(EXECUTABLE) 120 | 121 | .PHONY: build 122 | build: $(BINARY_CONTAINERS) 123 | 124 | # Building kernel 125 | $(TEMP_DIR)/vadd.xo: src/vadd.cpp 126 | mkdir -p $(TEMP_DIR) 127 | $(VPP) $(CLFLAGS) --temp_dir $(TEMP_DIR) -c -k vadd -I'$(> $(SDCARD)/init.sh 167 | $(ECHO) 'export XILINX_VITIS=$$PWD' >> $(SDCARD)/init.sh 168 | $(ECHO) 'export XCL_EMULATION_MODE=$(TARGET)' >> $(SDCARD)/init.sh 169 | $(ECHO) './$(EXECUTABLE) $(CMD_ARGS)' >> $(SDCARD)/init.sh 170 | $(ECHO) 'reboot' >> $(SDCARD)/init.sh 171 | else 172 | [ -f $(SDCARD)/BOOT.BIN ] && echo "INFO: BOOT.BIN already exists" || $(CP) $(BUILD_DIR)/sd_card/BOOT.BIN $(SDCARD)/ 173 | $(ECHO) './$(EXECUTABLE) $(CMD_ARGS)' >> $(SDCARD)/init.sh 174 | endif 175 | endif 176 | 177 | # Cleaning stuff 178 | clean: 179 | -$(RMDIR) $(EXECUTABLE) $(XCLBIN)/{*sw_emu*,*hw_emu*} 180 | -$(RMDIR) profile_* TempConfig system_estimate.xtxt *.rpt *.csv 181 | -$(RMDIR) src/*.ll *v++* .Xil emconfig.json dltmp* xmltmp* *.log *.jou *.wcfg *.wdb 182 | 183 | cleanall: clean 184 | -$(RMDIR) build_dir* sd_card* 185 | -$(RMDIR) _x.* *xclbin.run_summary qemu-memory-_* emulation/ _vimage/ pl* start_simulation.sh *.xclbin 186 | 187 | -------------------------------------------------------------------------------- /xilinx/latency/Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: help 2 | 3 | help:: 4 | $(ECHO) "Makefile Usage:" 5 | $(ECHO) " make all TARGET= DEVICE= HOST_ARCH= SYSROOT=" 6 | $(ECHO) " Command to generate the design for specified Target and Shell." 7 | $(ECHO) " By default, HOST_ARCH=x86. HOST_ARCH and SYSROOT is required for SoC shells" 8 | $(ECHO) "" 9 | $(ECHO) " make clean " 10 | $(ECHO) " Command to remove the generated non-hardware files." 11 | $(ECHO) "" 12 | $(ECHO) " make cleanall" 13 | $(ECHO) " Command to remove all the generated files." 14 | $(ECHO) "" 15 | $(ECHO) " make sd_card TARGET= DEVICE= HOST_ARCH= SYSROOT=" 16 | $(ECHO) " Command to prepare sd_card files." 17 | $(ECHO) " By default, HOST_ARCH=x86. HOST_ARCH and SYSROOT is required for SoC shells" 18 | $(ECHO) "" 19 | $(ECHO) " make check TARGET= DEVICE= HOST_ARCH= SYSROOT=" 20 | $(ECHO) " Command to run application in emulation." 21 | $(ECHO) " By default, HOST_ARCH=x86. HOST_ARCH and SYSROOT is required for SoC shells" 22 | $(ECHO) "" 23 | $(ECHO) " make build TARGET= DEVICE= HOST_ARCH= SYSROOT=" 24 | $(ECHO) " Command to build xclbin application." 25 | $(ECHO) " By default, HOST_ARCH=x86. HOST_ARCH and SYSROOT is required for SoC shells" 26 | $(ECHO) "" 27 | 28 | # Points to top directory of Git repository 29 | COMMON_REPO = ../ 30 | PWD = $(shell readlink -f .) 31 | ABS_COMMON_REPO = $(shell readlink -f $(COMMON_REPO)) 32 | 33 | TARGET := hw 34 | HOST_ARCH := x86 35 | SYSROOT := 36 | #DEVICE = xilinx_u50_gen3x16_xdma_201920_3 37 | DEVICE = xilinx_u280_xdma_201920_3 38 | 39 | include ./utils.mk 40 | 41 | XSA := $(call device2xsa, $(DEVICE)) 42 | TEMP_DIR := ./_x.$(TARGET).$(XSA) 43 | BUILD_DIR := ./build_dir.$(TARGET).$(XSA) 44 | 45 | VPP := v++ 46 | SDCARD := sd_card 47 | 48 | #Include Libraries 49 | include $(ABS_COMMON_REPO)/common/includes/opencl/opencl.mk 50 | include $(ABS_COMMON_REPO)/common/includes/xcl2/xcl2.mk 51 | CXXFLAGS += $(xcl2_CXXFLAGS) 52 | LDFLAGS += $(xcl2_LDFLAGS) 53 | HOST_SRCS += $(xcl2_SRCS) 54 | CXXFLAGS += $(opencl_CXXFLAGS) -Wall -O0 -g -std=c++11 55 | LDFLAGS += $(opencl_LDFLAGS) 56 | 57 | HOST_SRCS += src/host.cpp 58 | 59 | # Host compiler global settings 60 | CXXFLAGS += -fmessage-length=0 61 | LDFLAGS += -lrt -lstdc++ 62 | 63 | ifneq ($(HOST_ARCH), x86) 64 | LDFLAGS += --sysroot=$(SYSROOT) 65 | endif 66 | 67 | # Kernel compiler global settings 68 | CLFLAGS += -t $(TARGET) --platform $(DEVICE) --save-temps 69 | ifneq ($(TARGET), hw) 70 | CLFLAGS += -g 71 | endif 72 | 73 | CLFLAGS += --sp vadd_1.m_axi_hbm0:HBM[0] 74 | CLFLAGS += --sp vadd_1.m_axi_hbm1:HBM[1] 75 | CLFLAGS += --sp vadd_1.m_axi_hbm2:HBM[2] 76 | CLFLAGS += --sp vadd_1.m_axi_hbm3:HBM[3] 77 | CLFLAGS += --sp vadd_1.m_axi_hbm4:HBM[4] 78 | CLFLAGS += --sp vadd_1.m_axi_hbm5:HBM[5] 79 | CLFLAGS += --sp vadd_1.m_axi_hbm6:HBM[6] 80 | CLFLAGS += --sp vadd_1.m_axi_hbm7:HBM[7] 81 | CLFLAGS += --sp vadd_1.m_axi_hbm8:HBM[8] 82 | CLFLAGS += --sp vadd_1.m_axi_hbm9:HBM[9] 83 | CLFLAGS += --sp vadd_1.m_axi_hbm10:HBM[10] 84 | CLFLAGS += --sp vadd_1.m_axi_hbm11:HBM[11] 85 | CLFLAGS += --sp vadd_1.m_axi_hbm12:HBM[12] 86 | CLFLAGS += --sp vadd_1.m_axi_hbm13:HBM[13] 87 | CLFLAGS += --sp vadd_1.m_axi_hbm14:HBM[14] 88 | CLFLAGS += --sp vadd_1.m_axi_hbm15:HBM[15] 89 | CLFLAGS += --sp vadd_1.m_axi_hbm16:HBM[16] 90 | CLFLAGS += --sp vadd_1.m_axi_hbm17:HBM[17] 91 | CLFLAGS += --sp vadd_1.m_axi_hbm18:HBM[18] 92 | CLFLAGS += --sp vadd_1.m_axi_hbm19:HBM[19] 93 | CLFLAGS += --sp vadd_1.m_axi_hbm20:HBM[20] 94 | CLFLAGS += --sp vadd_1.m_axi_hbm21:HBM[21] 95 | CLFLAGS += --sp vadd_1.m_axi_hbm22:HBM[22] 96 | CLFLAGS += --sp vadd_1.m_axi_hbm23:HBM[23] 97 | #CLFLAGS += --sp vadd_1.m_axi_hbm24:HBM[24] 98 | #CLFLAGS += --sp vadd_1.m_axi_hbm25:HBM[25] 99 | #CLFLAGS += --sp vadd_1.m_axi_hbm26:HBM[26] 100 | #CLFLAGS += --sp vadd_1.m_axi_hbm27:HBM[27] 101 | #CLFLAGS += --sp vadd_1.m_axi_hbm28:HBM[28] 102 | #CLFLAGS += --sp vadd_1.m_axi_hbm29:HBM[29] 103 | 104 | CLFLAGS += --report_level 2 105 | 106 | EXECUTABLE = host 107 | CMD_ARGS = $(BUILD_DIR)/vadd.xclbin 108 | EMCONFIG_DIR = $(TEMP_DIR) 109 | EMU_DIR = $(SDCARD)/data/emulation 110 | 111 | BINARY_CONTAINERS += $(BUILD_DIR)/vadd.xclbin 112 | BINARY_CONTAINER_vadd_OBJS += $(TEMP_DIR)/vadd.xo 113 | 114 | CP = cp -rf 115 | 116 | .PHONY: all clean cleanall docs emconfig 117 | all: check-devices $(EXECUTABLE) $(BINARY_CONTAINERS) emconfig sd_card 118 | 119 | .PHONY: exe 120 | exe: $(EXECUTABLE) 121 | 122 | .PHONY: build 123 | build: $(BINARY_CONTAINERS) 124 | 125 | # Building kernel 126 | $(TEMP_DIR)/vadd.xo: src/vadd.cpp 127 | mkdir -p $(TEMP_DIR) 128 | $(VPP) $(CLFLAGS) --temp_dir $(TEMP_DIR) -c -k vadd -I'$(> $(SDCARD)/init.sh 168 | $(ECHO) 'export XILINX_VITIS=$$PWD' >> $(SDCARD)/init.sh 169 | $(ECHO) 'export XCL_EMULATION_MODE=$(TARGET)' >> $(SDCARD)/init.sh 170 | $(ECHO) './$(EXECUTABLE) $(CMD_ARGS)' >> $(SDCARD)/init.sh 171 | $(ECHO) 'reboot' >> $(SDCARD)/init.sh 172 | else 173 | [ -f $(SDCARD)/BOOT.BIN ] && echo "INFO: BOOT.BIN already exists" || $(CP) $(BUILD_DIR)/sd_card/BOOT.BIN $(SDCARD)/ 174 | $(ECHO) './$(EXECUTABLE) $(CMD_ARGS)' >> $(SDCARD)/init.sh 175 | endif 176 | endif 177 | 178 | # Cleaning stuff 179 | clean: 180 | -$(RMDIR) $(EXECUTABLE) $(XCLBIN)/{*sw_emu*,*hw_emu*} 181 | -$(RMDIR) profile_* TempConfig system_estimate.xtxt *.rpt *.csv 182 | -$(RMDIR) src/*.ll *v++* .Xil emconfig.json dltmp* xmltmp* *.log *.jou *.wcfg *.wdb 183 | 184 | cleanall: clean 185 | -$(RMDIR) build_dir* sd_card* 186 | -$(RMDIR) _x.* *xclbin.run_summary qemu-memory-_* emulation/ _vimage/ pl* start_simulation.sh *.xclbin 187 | 188 | --------------------------------------------------------------------------------