diff --git a/security/Jenkinsfile b/security/Jenkinsfile index 08b20497fd..9478f422ad 100644 --- a/security/Jenkinsfile +++ b/security/Jenkinsfile @@ -1,4 +1,4 @@ @Library('pipeline-library')_ -VitisLibPipeline (branch: 'next', libname: 'xf_security', TARGETS: 'hls_csim:hls_csynth:hls_cosim:vitis_sw_emu:vitis_hw_emu:vitis_hw_build', +VitisLibPipeline (branch: 'next', libname: 'xf_security', TARGETS: 'hls_csim:hls_cosim:vivado_syn:vitis_sw_emu:vitis_hw_emu:vitis_hw_build', upstream_dependencies: 'xf_utils_hw,next,../utils', - email: 'tuol@xilinx.com', devtest: 'RunDeploy.sh', TOOLVERSION: '2021.2_stable_latest') + devtest: 'RunDeploy.sh', TOOLVERSION: '2022.1_stable_latest') diff --git a/security/L1/benchmarks/adler32/Makefile b/security/L1/benchmarks/adler32/Makefile index 359298ec07..417ed619a5 100644 --- a/security/L1/benchmarks/adler32/Makefile +++ b/security/L1/benchmarks/adler32/Makefile @@ -1,5 +1,4 @@ -# -# Copyright 2019-2021 Xilinx, Inc. +# Copyright 2019-2022 Xilinx, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -12,16 +11,32 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -# makefile-generator v1.0.4 -# +# vitis makefile-generator v2.0.6 -# ####################################### Help Section ##################################### +############################## Help Section ############################## .PHONY: help help:: $(ECHO) "Makefile Usage:" - $(ECHO) " make all TARGET= DEVICE= HOST_ARCH=" + $(ECHO) " make all TARGET= PLATFORM= HOST_ARCH=" $(ECHO) " Command to generate the design for specified Target and Shell." + $(ECHO) " By default, HOST_ARCH=x86. HOST_ARCH is required for SoC shells" + $(ECHO) "" + $(ECHO) " make run TARGET= PLATFORM= HOST_ARCH=" + $(ECHO) " Command to run application in emulation." + $(ECHO) " By default, HOST_ARCH=x86. HOST_ARCH required for SoC shells" + $(ECHO) "" + $(ECHO) " make xclbin TARGET= PLATFORM= HOST_ARCH=" + $(ECHO) " Command to build xclbin application." + $(ECHO) " By default, HOST_ARCH=x86. HOST_ARCH is required for SoC shells" + $(ECHO) "" + $(ECHO) " make host TARGET=" + $(ECHO) " Command to build host application." + $(ECHO) " By default, HOST_ARCH=x86. HOST_ARCH is required for SoC shells" + $(ECHO) "" + $(ECHO) " NOTE: For embedded devices, e.g. zcu102/zcu104/vck190, env variable SYSROOT and EDGE_COMMON_SW need to be set first, and HOST_ARCH is either aarch32 or aarch64. For example," + $(ECHO) " export SYSROOT=< path-to-platform-sysroot >" + $(ECHO) " export EDGE_COMMON_SW=< path-to-rootfs-and-Image-files >" $(ECHO) "" $(ECHO) " make clean " $(ECHO) " Command to remove the generated non-hardware files." @@ -29,192 +44,286 @@ help:: $(ECHO) " make cleanall" $(ECHO) " Command to remove all the generated files." $(ECHO) "" - $(ECHO) " make run TARGET= DEVICE= HOST_ARCH=" - $(ECHO) " Command to run application in emulation or on board." - $(ECHO) "" - $(ECHO) " make build TARGET= DEVICE= HOST_ARCH=" - $(ECHO) " Command to build xclbin application." - $(ECHO) "" - $(ECHO) " make host HOST_ARCH=" - $(ECHO) " Command to build host application." - $(ECHO) "" -# ##################### Setting up default value of TARGET ########################## -TARGET ?= sw_emu +############################## Setting up Project Variables ############################## -# ################### Setting up default value of DEVICE ############################## -DEVICE ?= xilinx_u50_gen3x16_xdma_201920_3 +MK_PATH := $(abspath $(lastword $(MAKEFILE_LIST))) +XF_PROJ_ROOT ?= $(shell bash -c 'export MK_PATH=$(MK_PATH); echo $${MK_PATH%/L1/*}') +CUR_DIR := $(patsubst %/,%,$(dir $(MK_PATH))) +XFLIB_DIR = $(XF_PROJ_ROOT) -# ###################### Setting up default value of HOST_ARCH ####################### +# setting devault value +TARGET ?= sw_emu HOST_ARCH ?= x86 -# #################### Checking if DEVICE in blacklist ############################# -ifeq ($(findstring zc, $(DEVICE)), zc) -$(error [ERROR]: This project is not supported for $(DEVICE).) -endif - -# #################### Checking if DEVICE in whitelist ############################ -ifneq ($(findstring u50, $(DEVICE)), u50) -ifneq ($(findstring aws-vu9p-f1, $(DEVICE)), aws-vu9p-f1) -$(warning [WARNING]: This project has not been tested for $(DEVICE). It may or may not work.) +#setting PLATFORM +ifeq ($(PLATFORM),) +PLATFORM := $(DEVICE) endif +ifeq ($(PLATFORM),) +PLATFORM := xilinx_u50_gen3x16_xdma_5_202210_1 endif -# ######################## Setting up Project Variables ################################# -MK_PATH := $(abspath $(lastword $(MAKEFILE_LIST))) -XF_PROJ_ROOT ?= $(shell bash -c 'export MK_PATH=$(MK_PATH); echo $${MK_PATH%/L1/*}') -CUR_DIR := $(patsubst %/,%,$(dir $(MK_PATH))) -XFLIB_DIR = $(XF_PROJ_ROOT) +# #################### Checking if PLATFORM in whitelist ############################ +PLATFORM_ALLOWLIST += u50 aws-vu9p-f1 +PLATFORM_BLOCKLIST += zc -# ######################### Include environment variables in utils.mk #################### include ./utils.mk -XDEVICE := $(call device2xsa, $(DEVICE)) -TEMP_DIR := _x_temp.$(TARGET).$(XDEVICE) -TEMP_REPORT_DIR := $(CUR_DIR)/reports/_x.$(TARGET).$(XDEVICE) -BUILD_DIR := build_dir.$(TARGET).$(XDEVICE) -BUILD_REPORT_DIR := $(CUR_DIR)/reports/_build.$(TARGET).$(XDEVICE) -EMCONFIG_DIR := $(BUILD_DIR) +TEMP_DIR := _x_temp.$(TARGET).$(PLATFORM_NAME) +TEMP_REPORT_DIR := $(CUR_DIR)/reports/_x.$(TARGET).$(PLATFORM_NAME) +BUILD_DIR := build_dir.$(TARGET).$(PLATFORM_NAME) +ifneq ($(RESULT_DIR),) +BUILD_DIR = $(RESULT_DIR) +endif +BUILD_REPORT_DIR := $(CUR_DIR)/reports/_build.$(TARGET).$(PLATFORM_NAME) +EMCONFIG := $(BUILD_DIR)/emconfig.json XCLBIN_DIR := $(CUR_DIR)/$(BUILD_DIR) export XCL_BINDIR = $(XCLBIN_DIR) -# ######################### Setting up Host Variables ######################### -#Include Required Host Source Files -HOST_SRCS += $(XFLIB_DIR)/L1/benchmarks/adler32/host/main.cpp -HOST_SRCS += $(XFLIB_DIR)/ext/xcl2/xcl2.cpp -CXXFLAGS += -I$(XFLIB_DIR)/L1/include -CXXFLAGS += -I$(XFLIB_DIR)/L1/benchmarks/adler32/host -CXXFLAGS += -I$(XFLIB_DIR)/L1/benchmarks/adler32/kernel -CXXFLAGS += -I$(XFLIB_DIR)/ext/xcl2 -CXXFLAGS += -I$(XFLIB_DIR)/../utils/L1/include -CXXFLAGS += -I$(XFLIB_DIR)/ext/xcl2 - +EXE_FILE_DEPS := +BINARY_CONTAINERS_DEPS := +RUN_DEPS := +# get global setting +ifeq ($(HOST_ARCH), x86) +CXXFLAGS += -fmessage-length=0 -I$(CUR_DIR)/src/ -I$(XILINX_XRT)/include -I$(XILINX_HLS)/include -std=c++14 -O3 -Wall -Wno-unknown-pragmas -Wno-unused-label +LDFLAGS += -pthread -L$(XILINX_XRT)/lib -L$(XILINX_HLS)/lnx64/tools/fpo_v7_0 -Wl,--as-needed -lOpenCL -lxrt_coreutil -lgmp -lmpfr -lIp_floating_point_v7_0_bitacc_cmodel +VPP_FLAGS += -t $(TARGET) --platform $(XPLATFORM) --save-temps +VPP_LDFLAGS += --optimize 2 -R 2 +else ifeq ($(HOST_ARCH), aarch64) +CXXFLAGS += -I$(CUR_DIR)/src/ -fmessage-length=0 --sysroot=$(SYSROOT) -I$(SYSROOT)/usr/include/xrt -I$(XILINX_HLS)/include -std=c++14 -O3 -Wall -Wno-unknown-pragmas -Wno-unused-label +LDFLAGS += -pthread -L$(SYSROOT)/usr/lib -L$(XILINX_VITIS_AIETOOLS)/lib/aarch64.o -Wl,--as-needed -lxilinxopencl -lxrt_coreutil +VPP_FLAGS += -t $(TARGET) --platform $(XPLATFORM) --save-temps +VPP_LDFLAGS += --optimize 2 -R 2 +endif +CXXFLAGS += $(EXTRA_CXXFLAGS) +VPP_FLAGS += $(EXTRA_VPP_FLAGS) +########################## Setting up Host Variables ########################## ifeq ($(TARGET),sw_emu) CXXFLAGS += -D SW_EMU_TEST endif - ifeq ($(TARGET),hw_emu) CXXFLAGS += -D HW_EMU_TEST endif -# ######################### Host compiler global settings ############################ -CXXFLAGS += -I$(XILINX_XRT)/include -I$(XILINX_HLS)/include -std=c++11 -O3 -Wall -Wno-unknown-pragmas -Wno-unused-label -LDFLAGS += -L$(XILINX_XRT)/lib -lOpenCL -lpthread -lrt -Wno-unused-label -Wno-narrowing -DVERBOSE -CXXFLAGS += -fmessage-length=0 -O3 -CXXFLAGS += -I$(CUR_DIR)/src/ - -ifeq ($(HOST_ARCH), x86) -LDFLAGS += -L$(XILINX_HLS)/lnx64/tools/fpo_v7_0 -Wl,--as-needed -lgmp -lmpfr -lIp_floating_point_v7_0_bitacc_cmodel +ifeq (,$(findstring opencv,$(CXXFLAGS))) +CXXFLAGS += $(XRT_CXXFLAGS) endif -# ################### Setting package and image directory ####################### +#Inclue Required Host Source Files +HOST_SRCS += $(XFLIB_DIR)/L1/benchmarks/adler32/host/main.cpp $(XFLIB_DIR)/ext/xcl2/xcl2.cpp +CXXFLAGS += -I $(XFLIB_DIR)/L1/include -I $(XFLIB_DIR)/L1/benchmarks/adler32/host -I $(XFLIB_DIR)/L1/benchmarks/adler32/kernel -I $(XFLIB_DIR)/ext/xcl2 -I $(XFLIB_DIR)/../utils/L1/include -I $(XFLIB_DIR)/ext/xcl2 +CXXFLAGS += -O3 EXE_NAME := host.exe EXE_FILE := $(BUILD_DIR)/$(EXE_NAME) -HOST_ARGS := -xclbin $(BUILD_DIR)/Adler32Kernel.xclbin -data $(CUR_DIR)/data/test.dat -num 16 +EXE_FILE_DEPS := $(HOST_SRCS) $(EXE_FILE_DEPS) -# ##################### Kernel compiler global settings ########################## -VPP_FLAGS += -t $(TARGET) --platform $(XPLATFORM) --save-temps --optimize 2 -VPP_FLAGS += --hls.jobs 8 -VPP_LDFLAGS += --vivado.synth.jobs 8 --vivado.impl.jobs 8 -ifneq (,$(shell echo $(XPLATFORM) | awk '/u50/')) -VPP_FLAGS += --config $(CUR_DIR)/conn_u50.cfg +HOST_ARGS := -xclbin $(BUILD_DIR)/Adler32Kernel.xclbin -data $(CUR_DIR)/data/test.dat -num 16 +ifneq ($(HOST_ARCH), x86) +PKG_HOST_ARGS = $(foreach args,$(HOST_ARGS),$(subst $(dir $(patsubst %/,%,$(args))),,$(args))) endif -VPP_FLAGS += -I$(XFLIB_DIR)/L1/include - -VPP_FLAGS += -I$(XFLIB_DIR)/L1/include -VPP_FLAGS += -I$(XFLIB_DIR)/L1/benchmarks/adler32/kernel - -Adler32Kernel_VPP_FLAGS += --hls.clock 300000000:Adler32Kernel -VPP_LDFLAGS_Adler32Kernel += --kernel_frequency 300 - - -# Kernel args - -# ############################ Declaring Binary Containers ########################## - -BINARY_CONTAINERS += $(BUILD_DIR)/Adler32Kernel.xclbin -BINARY_CONTAINER_Adler32Kernel_OBJS += $(TEMP_DIR)/Adler32Kernel.xo +########################## Kernel compiler global settings ########################## +ifneq (,$(shell echo $(XPLATFORM) | awk '/u50/')) +VPP_FLAGS += --config $(CUR_DIR)/conn_u50.cfg +VPP_FLAGS += -I $(XFLIB_DIR)/L1/include -I $(XFLIB_DIR)/L1/benchmarks/adler32/kernel -I $(XFLIB_DIR)/L1/include -# ######################### Setting Targets of Makefile ################################ +else +VPP_FLAGS += -I $(XFLIB_DIR)/L1/include -I $(XFLIB_DIR)/L1/benchmarks/adler32/kernel -I $(XFLIB_DIR)/L1/include -.PHONY: all clean cleanall docs emconfig -ifeq ($(HOST_ARCH), x86) -all: check_version check_vpp check_platform check_xrt $(EXE_FILE) $(BINARY_CONTAINERS) emconfig -else -all: check_version check_vpp check_platform check_sysroot $(EXE_FILE) $(BINARY_CONTAINERS) emconfig sd_card endif -.PHONY: host -ifeq ($(HOST_ARCH), x86) -host: check_xrt $(EXE_FILE) +######################### binary container global settings ########################## +VPP_FLAGS_Adler32Kernel += --hls.clock 300000000:Adler32Kernel +ifneq ($(HOST_ARCH), x86) +VPP_LDFLAGS_Adler32Kernel += --clock.defaultFreqHz 300000000 else -host: check_sysroot $(EXE_FILE) +VPP_LDFLAGS_Adler32Kernel += --kernel_frequency 300 endif -.PHONY: xclbin ifeq ($(HOST_ARCH), x86) -xclbin: check_vpp check_xrt $(BINARY_CONTAINERS) +BINARY_CONTAINERS += $(BUILD_DIR)/Adler32Kernel.xclbin else -xclbin: check_vpp check_sysroot $(BINARY_CONTAINERS) +BINARY_CONTAINERS += $(BUILD_DIR)/Adler32Kernel_pkg.$(LINK_TARGET_FMT) +BINARY_CONTAINERS_PKG += $(BUILD_DIR)/Adler32Kernel.xclbin endif -.PHONY: build -build: xclbin - # ################ Setting Rules for Binary Containers (Building Kernels) ################ -$(TEMP_DIR)/Adler32Kernel.xo: $(XFLIB_DIR)/L1/benchmarks/adler32/kernel/adler32_kernel.cpp +$(TEMP_DIR)/Adler32Kernel.xo: $(XFLIB_DIR)/L1/benchmarks/adler32/kernel/adler32_kernel.cpp $(ECHO) "Compiling Kernel: Adler32Kernel" mkdir -p $(TEMP_DIR) - $(VPP) -c $(Adler32Kernel_VPP_FLAGS) $(VPP_FLAGS) -k Adler32Kernel -I'$(> $(RUN_SCRIPT) +ifneq ($(filter sw_emu hw_emu, $(TARGET)),) + @echo 'export XCL_EMULATION_MODE=$(TARGET)' >> $(RUN_SCRIPT) +endif + @echo 'export XILINX_VITIS=/mnt' >> $(RUN_SCRIPT) + @echo 'export XILINX_XRT=/usr' >> $(RUN_SCRIPT) + @echo 'if [ -f platform_desc.txt ]; then' >> $(RUN_SCRIPT) + @echo ' cp platform_desc.txt /etc/xocl.txt' >> $(RUN_SCRIPT) + @echo 'fi' >> $(RUN_SCRIPT) + @echo './$(EXE_NAME) $(PKG_HOST_ARGS)' >> $(RUN_SCRIPT) + @echo 'return_code=$$?' >> $(RUN_SCRIPT) + @echo 'if [ $$return_code -ne 0 ]; then' >> $(RUN_SCRIPT) + @echo ' echo "ERROR: Embedded host run failed, RC=$$return_code"' >> $(RUN_SCRIPT) + @echo 'else' >> $(RUN_SCRIPT) + @echo ' echo "INFO: TEST PASSED, RC=0"' >> $(RUN_SCRIPT) + @echo 'fi' >> $(RUN_SCRIPT) + @echo 'echo "INFO: Embedded host run completed."' >> $(RUN_SCRIPT) + @echo 'exit $$return_code' >> $(RUN_SCRIPT) +DATA_FILE := +DATA_DIR := +SD_FILES += $(RUN_SCRIPT) +SD_FILES += $(EXE_FILE) +SD_FILES += $(EMCONFIG) +SD_FILES += xrt.ini +SD_FILES += $(DATA_FILE)# where define DATAFILE in json +SD_FILES_WITH_PREFIX = $(foreach sd_file,$(SD_FILES), $(if $(filter $(sd_file),$(wildcard $(sd_file))), --package.sd_file $(sd_file))) +SD_DIRS_WITH_PREFIX = $(foreach sd_dir,$(DATA_DIR),--package.sd_dir $(sd_dir)) +PACKAGE_FILES := $(BINARY_CONTAINERS) +PACKAGE_FILES += $(AIE_CONTAINER) +SD_CARD := $(CUR_DIR)/package_$(TARGET) +vck190_dfx_hw := false +$(SD_CARD): $(EXE_FILE) $(BINARY_CONTAINERS) $(RUN_SCRIPT) $(EMCONFIG) + @echo "Generating sd_card folder...." + mkdir -p $(SD_CARD) + chmod a+rx $(BUILD_DIR)/run_script.sh +ifneq (,$(findstring vck190_base_dfx, $(PLATFORM_NAME))) +ifeq ($(TARGET),hw) + $(VPP) -t $(TARGET) --platform $(XPLATFORM) -p $(PACKAGE_FILES) -o $(BINARY_CONTAINERS_PKG) + $(VPP) -t $(TARGET) --platform $(XPLATFORM) -p --package.out_dir $(SD_CARD) --package.rootfs $(SYSROOT)/../../rootfs.ext4 --package.kernel_image $(K_IMAGE) $(SD_FILES_WITH_PREFIX) $(SD_DIRS_WITH_PREFIX) --package.sd_file $(BINARY_CONTAINERS_PKG) + @echo "### ***** sd_card generation done! ***** ###" +vck190_dfx_hw := true +endif +endif +ifeq ($(vck190_dfx_hw), false) + $(VPP) -t $(TARGET) --platform $(XPLATFORM) -o $(BINARY_CONTAINERS_PKG) -p $(PACKAGE_FILES) $(VPP_PACKAGE) --package.out_dir $(SD_CARD) --package.rootfs $(SYSROOT)/../../rootfs.ext4 --package.kernel_image $(K_IMAGE) $(SD_FILES_WITH_PREFIX) $(SD_DIRS_WITH_PREFIX) + @echo "### ***** sd_card generation done! ***** ###" +endif +.PHONY: sd_card +sd_card: $(SD_CARD) +endif +############################## Setting Essential Checks and Building Rules ############################## +RUN_DEPS += $(EXE_FILE) $(BINARY_CONTAINERS) $(EMCONFIG) +RUN_DEPS += $(SD_CARD) -# ###############Setting Essential Checks And Running Rules For Vitis Flow ############# +.PHONY: mkflag all run +mkflag: + mkdir -p $(BUILD_DIR) + rm -rf $(BUILD_DIR)/makefile_args.txt + @for var in $(MAKEFLAGS); do echo $$var >> $(BUILD_DIR)/makefile_args.txt; done +all: check_device check_vpp check_platform mkflag $(RUN_DEPS) run: all -ifeq ($(TARGET),$(filter $(TARGET),sw_emu hw_emu)) - $(CP) $(EMCONFIG_DIR)/emconfig.json . +#hw_emu +ifneq (,$(filter hw_emu, $(TARGET))) +ifeq ($(HOST_ARCH), x86) + LD_LIBRARY_PATH=$(LIBRARY_PATH):$$LD_LIBRARY_PATH \ XCL_EMULATION_MODE=$(TARGET) $(EXE_FILE) $(HOST_ARGS) + else + @echo $(RUN_DEPS) + $(SD_CARD)/launch_$(TARGET).sh -no-reboot -run-app $(notdir $(RUN_SCRIPT)) + grep "TEST PASSED, RC=0" $(SD_CARD)/qemu_output.log || exit 1 + +endif +endif +#sw_emu +ifneq (,$(filter sw_emu, $(TARGET))) +ifeq ($(HOST_ARCH), x86) + LD_LIBRARY_PATH=$(LIBRARY_PATH):$$LD_LIBRARY_PATH \ + XCL_EMULATION_MODE=$(TARGET) $(EXE_FILE) $(HOST_ARGS) + +else + @echo $(RUN_DEPS) + $(SD_CARD)/launch_$(TARGET).sh -no-reboot -run-app $(notdir $(RUN_SCRIPT)) + grep "TEST PASSED, RC=0" $(SD_CARD)/qemu_output.log || exit 1 + +endif +endif +#hw +ifeq ($(TARGET), hw) +ifneq (,$(findstring aws-vu9p-f1, $(PLATFORM_NAME))) +ifneq ($(JENKINS_INTERNAL_BUILD), 1) + $(ECHO) "This makefile does not directly support converting .xclbin to .awsxclbin, please refer https://github.com/aws/aws-fpga/blob/master/Vitis/README.md for next operations" +else + $(ECHO) "Running inside Xilinx regression without converting to .awsxclbin" + $(EXE_FILE) $(HOST_ARGS) + +endif +else ifeq ($(HOST_ARCH), x86) $(EXE_FILE) $(HOST_ARGS) + +else + $(ECHO) "Please copy the content of sd_card folder and data to an SD Card and run on the board" +endif +endif + +############################## Setting Targets ############################## + +.PHONY: clean cleanall emconfig +emconfig: $(EMCONFIG) + +.PHONY: host +ifeq ($(HOST_ARCH), x86) +host: check_xrt $(EXE_FILE) +else +host: check_sysroot $(EXE_FILE) endif -# ################################# Cleaning Rules ################################## +.PHONY: xclbin +ifeq ($(HOST_ARCH), x86) +xclbin: check_vpp check_xrt $(BINARY_CONTAINERS) +else +xclbin: check_vpp check_sysroot $(BINARY_CONTAINERS) +endif + +############################## Cleaning Rules ############################## cleanh: -$(RMDIR) $(EXE_FILE) vitis_* TempConfig system_estimate.xtxt *.rpt .run/ - -$(RMDIR) src/*.ll _xocc_* .Xil dltmp* xmltmp* *.log *.jou *.wcfg *.wdb sample_link.ini sample_compile.ini obj* bin* *.csv *.jpg *.jpeg *.png + -$(RMDIR) src/*.ll _xocc_* .Xil dltmp* xmltmp* *.log *.jou *.wcfg *.wdb sample_link.ini sample_compile.ini obj* bin* *.csv *.jpg *.jpeg *.png cleank: - -$(RMDIR) $(BUILD_DIR)/*.xclbin _vimage *xclbin.run_summary qemu-memory-_* emulation/ _vimage/ start_simulation.sh *.xclbin + -$(RMDIR) $(BUILD_DIR)/*.xclbin _vimage *xclbin.run_summary qemu-memory-_* emulation/ _vimage/ pl*start_simulation. sh *.xclbin -$(RMDIR) _x_temp.*/_x.* _x_temp.*/.Xil _x_temp.*/profile_summary.* xo_* _x* - -$(RMDIR) _x_temp.*/dltmp* _x_temp.*/kernel_info.dat _x_temp.*/*.log + -$(RMDIR) _x_temp.*/dltmp* _x_temp.*/kernel_info.dat _x_temp.*/*.log -$(RMDIR) _x_temp.* cleanall: cleanh cleank - -$(RMDIR) $(BUILD_DIR) build_dir.* emconfig.json *.html $(TEMP_DIR) $(CUR_DIR)/reports *.csv *.run_summary $(CUR_DIR)/*.raw package_* run_script.sh .ipcache *.str - -$(RMDIR) $(XFLIB_DIR)/common/data/*.xe2xd* $(XFLIB_DIR)/common/data/*.orig* - - -$(RMDIR) $(AIE_CONTAINERS) $(CUR_DIR)/Work $(CUR_DIR)/*.xpe $(CUR_DIR)/hw.o $(CUR_DIR)/*.xsa $(CUR_DIR)/xnwOut aiesimulator_output .AIE_SIM_CMD_LINE_OPTIONS + -$(RMDIR) $(BUILD_DIR) emconfig.json *.html $(TEMP_DIR) $(CUR_DIR)/reports *.csv *.run_summary $(CUR_DIR)/*.raw package_* $(BUILD_DIR)/run_script.sh .ipcache *.str + -$(RMDIR) $(CUR_DIR)/Work $(CUR_DIR)/*.xpe $(CUR_DIR)/hw.o $(CUR_DIR)/*.xsa $(CUR_DIR)/xnwOut -clean: cleanh +clean: cleanh \ No newline at end of file diff --git a/security/L1/benchmarks/adler32/README.md b/security/L1/benchmarks/adler32/README.md index e63931b807..a3b23cb7bb 100644 --- a/security/L1/benchmarks/adler32/README.md +++ b/security/L1/benchmarks/adler32/README.md @@ -19,12 +19,6 @@ The steps for library download and environment setup can be found in :ref:`l1_vi * **Build kernel(Step 2)** -Please check you've installed openSSL and make sure that its version is 1.0.2 or higher. Command to check openSSL version: - -``` - openssl version -``` - Run the following make command to build your XCLBIN and host binary targeting a specific device. Please be noticed that this process will take a long time, maybe couple of hours. ``` diff --git a/security/L1/benchmarks/adler32/description.json b/security/L1/benchmarks/adler32/description.json index bf7ca7205b..f65ff155ca 100644 --- a/security/L1/benchmarks/adler32/description.json +++ b/security/L1/benchmarks/adler32/description.json @@ -3,18 +3,18 @@ "name": "Xilinx Adler32 Benchmark", "description": "Adler32 checksum algorithm benchmark", "flow": "vitis", - "platform_whitelist": [ + "platform_allowlist": [ "u50", "aws-vu9p-f1" ], - "platform_blacklist": [ + "platform_blocklist": [ "zc" ], "platform_properties": { "u50": { "v++": { "compiler": { - "cflags": [ + "clflags": [ "--config PROJECT/conn_u50.cfg" ] } diff --git a/security/L1/benchmarks/adler32/utils.mk b/security/L1/benchmarks/adler32/utils.mk index 3892ff1942..0ee80e90da 100644 --- a/security/L1/benchmarks/adler32/utils.mk +++ b/security/L1/benchmarks/adler32/utils.mk @@ -1,5 +1,5 @@ # -# Copyright 2019-2021 Xilinx, Inc. +# Copyright 2019-2022 Xilinx, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -12,6 +12,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. +# vitis makefile-generator v2.0.6 # #+------------------------------------------------------------------------------- # The following parameters are assigned with default values. These parameters can @@ -39,17 +40,59 @@ ifeq ($(DEBUG), yes) VPP_LDFLAGS += --dk protocol:all:all:all endif -#Checks for XILINX_XRT -ifeq ($(HOST_ARCH), x86) +#Check environment setup +ifndef XILINX_VITIS + XILINX_VITIS = /opt/xilinx/Vitis/$(TOOL_VERSION) + export XILINX_VITIS +endif ifndef XILINX_XRT XILINX_XRT = /opt/xilinx/xrt export XILINX_XRT endif + +check_device: + @set -eu; \ + inallowlist=False; \ + inblocklist=False; \ + for dev in $(PLATFORM_ALLOWLIST); \ + do if [[ $$(echo $(PLATFORM_NAME) | grep $$dev) != "" ]]; \ + then inallowlist=True; fi; \ + done ;\ + for dev in $(PLATFORM_BLOCKLIST); \ + do if [[ $$(echo $(PLATFORM_NAME) | grep $$dev) != "" ]]; \ + then inblocklist=True; fi; \ + done ;\ + if [[ $$inallowlist == False ]]; \ + then echo "[Warning]: The device $(PLATFORM_NAME) not in allowlist."; \ + fi; \ + if [[ $$inblocklist == True ]]; \ + then echo "[ERROR]: The device $(PLATFORM_NAME) in blocklist."; exit 1;\ + fi; + +#get HOST_ARCH by PLATFORM +ifneq (,$(PLATFORM)) +HOST_ARCH_temp = $(shell platforminfo -p $(PLATFORM) | grep 'CPU Type' | sed 's/.*://' | sed '/ai_engine/d' | sed 's/^[[:space:]]*//') +ifeq ($(HOST_ARCH_temp), x86) +HOST_ARCH := x86 +else ifeq ($(HOST_ARCH_temp), cortex-a9) +HOST_ARCH := aarch32 +else ifneq (,$(findstring cortex-a, $(HOST_ARCH_temp))) +HOST_ARCH := aarch64 +endif +endif + + +#get suffix of kernel by PLATFORM +VITIS_VER = $(shell v++ --version | grep 'v++' | sed 's/^[[:space:]]*//' | sed -e 's/^[*]* v++ v//g' | cut -d " " -f1) +DEVICE_TYPE = $(shell platforminfo -p $(PLATFORM) | grep 'FPGA Family' | sed 's/.*://' | sed '/ai_engine/d' | sed 's/^[[:space:]]*//') +ifeq ($(DEVICE_TYPE), versal) +ifeq ($(shell expr $(VITIS_VER) \>= 2022.1), 1) +LINK_TARGET_FMT := xsa else -ifndef XILINX_VITIS - XILINX_VITIS = /opt/xilinx/Vitis/$(TOOL_VERSION) - export XILINX_VITIS +LINK_TARGET_FMT := xclbin endif +else +LINK_TARGET_FMT := xclbin endif #Checks for Device Family @@ -59,13 +102,18 @@ else ifeq ($(HOST_ARCH), aarch64) DEV_FAM = Ultrascale endif -B_NAME = $(shell dirname $(XPLATFORM)) - #Checks for Correct architecture ifneq ($(HOST_ARCH), $(filter $(HOST_ARCH),aarch64 aarch32 x86)) $(error HOST_ARCH variable not set, please set correctly and rerun) endif +check_version: +ifneq (, $(shell which git)) +ifneq (,$(wildcard $(XFLIB_DIR)/.git)) + @cd $(XFLIB_DIR) && git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit -n 1 && cd - +endif +endif + #Checks for SYSROOT check_sysroot: ifneq ($(HOST_ARCH), x86) @@ -74,25 +122,24 @@ ifndef SYSROOT endif endif -check_version: -ifneq (, $(shell which git)) -ifneq (,$(wildcard $(XFLIB_DIR)/.git)) - @cd $(XFLIB_DIR) && git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit -n 1 && cd - -endif -endif - #Checks for g++ CXX := g++ ifeq ($(HOST_ARCH), x86) -ifneq ($(shell expr $(shell g++ -dumpversion) \>= 5), 1) +ifeq ($(shell expr $(VITIS_VER) \>= 2022.1), 1) +CXX_VER := 8.3.0 +else +CXX_VER := 6.2.0 +endif +CXX_V := $(shell echo $(CXX_VER) | awk -F. '{print tolower($$1)}') +ifneq ($(shell expr $(shell echo "__GNUG__" | g++ -E -x c++ - | tail -1) \>= $(CXX_V)), 1) ifndef XILINX_VIVADO -$(error [ERROR]: g++ version too old. Please use 5.0 or above) +$(error [ERROR]: g++ version too old. Please use $(CXX_VER) or above) else -CXX := $(XILINX_VIVADO)/tps/lnx64/gcc-6.2.0/bin/g++ +CXX := $(XILINX_VIVADO)/tps/lnx64/gcc-$(CXX_VER)/bin/g++ ifeq ($(LD_LIBRARY_PATH),) -export LD_LIBRARY_PATH := $(XILINX_VIVADO)/tps/lnx64/gcc-6.2.0/lib64 +export LD_LIBRARY_PATH := $(XILINX_VIVADO)/tps/lnx64/gcc-$(CXX_VER)/lib64 else -export LD_LIBRARY_PATH := $(XILINX_VIVADO)/tps/lnx64/gcc-6.2.0/lib64:$(LD_LIBRARY_PATH) +export LD_LIBRARY_PATH := $(XILINX_VIVADO)/tps/lnx64/gcc-$(CXX_VER)/lib64:$(LD_LIBRARY_PATH) endif $(warning [WARNING]: g++ version too old. Using g++ provided by the tool: $(CXX)) endif @@ -103,13 +150,22 @@ else ifeq ($(HOST_ARCH), aarch32) CXX := $(XILINX_VITIS)/gnu/aarch32/lin/gcc-arm-linux-gnueabi/bin/arm-linux-gnueabihf-g++ endif -#Check OS and setting env +#Check OS and setting env for xrt c++ api OSDIST = $(shell lsb_release -i |awk -F: '{print tolower($$2)}' | tr -d ' \t' ) OSREL = $(shell lsb_release -r |awk -F: '{print tolower($$2)}' |tr -d ' \t') -ifeq ($(OSDIST), centos) +# for centos and redhat +ifneq ($(findstring centos,$(OSDIST)),) +ifeq (7,$(shell echo $(OSREL) | awk -F. '{print tolower($$1)}' )) +ifeq ($(HOST_ARCH), x86) +XRT_CXXFLAGS += -D_GLIBCXX_USE_CXX11_ABI=0 +endif +endif +else ifneq ($(findstring redhat,$(OSDIST)),) ifeq (7,$(shell echo $(OSREL) | awk -F. '{print tolower($$1)}' )) -CXXFLAGS += -D_GLIBCXX_USE_CXX11_ABI=0 +ifeq ($(HOST_ARCH), x86) +XRT_CXXFLAGS += -D_GLIBCXX_USE_CXX11_ABI=0 +endif endif endif @@ -117,6 +173,9 @@ endif VPP := v++ #Cheks for aiecompiler +AIECXX := aiecompiler +AIESIMULATOR := aiesimulator +X86SIMULATOR := x86simulator .PHONY: check_vivado check_vivado: @@ -132,11 +191,9 @@ endif .PHONY: check_xrt check_xrt: -ifeq ($(HOST_ARCH), x86) ifeq (,$(wildcard $(XILINX_XRT)/lib/libxilinxopencl.so)) @echo "Cannot locate XRT installation. Please set XILINX_XRT variable." && false endif -endif export PATH := $(XILINX_VITIS)/bin:$(XILINX_XRT)/bin:$(PATH) ifeq ($(HOST_ARCH), x86) @@ -145,82 +202,64 @@ LD_LIBRARY_PATH := $(XILINX_XRT)/lib else LD_LIBRARY_PATH := $(XILINX_XRT)/lib:$(LD_LIBRARY_PATH) endif -else # aarch64 -ifeq (,$(LD_LIBRARY_PATH)) -LD_LIBRARY_PATH := $(SYSROOT)/usr/lib -else -LD_LIBRARY_PATH := $(SYSROOT)/usr/lib:$(LD_LIBRARY_PATH) -endif -endif - -# check target -ifeq ($(filter $(TARGET),sw_emu hw_emu hw),) -$(error TARGET is not sw_emu, hw_emu or hw) endif -ifneq (,$(wildcard $(DEVICE))) -# Use DEVICE as a file path -XPLATFORM := $(DEVICE) +ifneq (,$(wildcard $(PLATFORM))) +# Use PLATFORM as a file path +XPLATFORM := $(PLATFORM) else -# Use DEVICE as a file name pattern +# Use PLATFORM as a file name pattern # 1. search paths specified by variable ifneq (,$(PLATFORM_REPO_PATHS)) # 1.1 as exact name -XPLATFORM := $(strip $(foreach p, $(subst :, ,$(PLATFORM_REPO_PATHS)), $(wildcard $(p)/$(DEVICE)/$(DEVICE).xpfm))) +XPLATFORM := $(strip $(foreach p, $(subst :, ,$(PLATFORM_REPO_PATHS)), $(wildcard $(p)/$(PLATFORM)/$(PLATFORM).xpfm))) # 1.2 as a pattern ifeq (,$(XPLATFORM)) XPLATFORMS := $(foreach p, $(subst :, ,$(PLATFORM_REPO_PATHS)), $(wildcard $(p)/*/*.xpfm)) -XPLATFORM := $(strip $(foreach p, $(XPLATFORMS), $(shell echo $(p) | awk '$$1 ~ /$(DEVICE)/'))) +XPLATFORM := $(strip $(foreach p, $(XPLATFORMS), $(shell echo $(p) | awk '$$1 ~ /$(PLATFORM)/'))) endif # 1.2 endif # 1 # 2. search Vitis installation ifeq (,$(XPLATFORM)) # 2.1 as exact name -XPLATFORM := $(strip $(wildcard $(XILINX_VITIS)/platforms/$(DEVICE)/$(DEVICE).xpfm)) +XPLATFORM := $(strip $(wildcard $(XILINX_VITIS)/platforms/$(PLATFORM)/$(PLATFORM).xpfm)) # 2.2 as a pattern ifeq (,$(XPLATFORM)) XPLATFORMS := $(wildcard $(XILINX_VITIS)/platforms/*/*.xpfm) -XPLATFORM := $(strip $(foreach p, $(XPLATFORMS), $(shell echo $(p) | awk '$$1 ~ /$(DEVICE)/'))) +XPLATFORM := $(strip $(foreach p, $(XPLATFORMS), $(shell echo $(p) | awk '$$1 ~ /$(PLATFORM)/'))) endif # 2.2 endif # 2 # 3. search default locations ifeq (,$(XPLATFORM)) # 3.1 as exact name -XPLATFORM := $(strip $(wildcard /opt/xilinx/platforms/$(DEVICE)/$(DEVICE).xpfm)) +XPLATFORM := $(strip $(wildcard /opt/xilinx/platforms/$(PLATFORM)/$(PLATFORM).xpfm)) # 3.2 as a pattern ifeq (,$(XPLATFORM)) XPLATFORMS := $(wildcard /opt/xilinx/platforms/*/*.xpfm) -XPLATFORM := $(strip $(foreach p, $(XPLATFORMS), $(shell echo $(p) | awk '$$1 ~ /$(DEVICE)/'))) +XPLATFORM := $(strip $(foreach p, $(XPLATFORMS), $(shell echo $(p) | awk '$$1 ~ /$(PLATFORM)/'))) endif # 3.2 endif # 3 endif define MSG_PLATFORM -No platform matched pattern '$(DEVICE)'. +No platform matched pattern '$(PLATFORM)'. Available platforms are: $(XPLATFORMS) -To add more platform directories, set the PLATFORM_REPO_PATHS variable or point DEVICE variable to the full path of platform .xpfm file. +To add more platform directories, set the PLATFORM_REPO_PATHS variable or point PLATFORM variable to the full path of platform .xpfm file. endef export MSG_PLATFORM -define MSG_DEVICE -More than one platform matched: $(XPLATFORM) -Please set DEVICE variable more accurately to select only one platform file, or set DEVICE variable to the full path of the platform .xpfm file. -endef -export MSG_DEVICE .PHONY: check_platform check_platform: ifeq (,$(XPLATFORM)) @echo "$${MSG_PLATFORM}" && false endif -ifneq (,$(word 2,$(XPLATFORM))) - @echo "$${MSG_DEVICE}" && false -endif #Check ends # device2xsa - create a filesystem friendly name from device name # $(1) - full name of device -device2xsa = $(strip $(patsubst %.xpfm, % , $(shell basename $(DEVICE)))) +PLATFORM_NAME = $(strip $(patsubst %.xpfm, % , $(shell basename $(PLATFORM)))) + # Cleaning stuff RM = rm -f diff --git a/security/L1/benchmarks/aes256CbcDecrypt/Makefile b/security/L1/benchmarks/aes256CbcDecrypt/Makefile index 72d8e2991d..7381419994 100644 --- a/security/L1/benchmarks/aes256CbcDecrypt/Makefile +++ b/security/L1/benchmarks/aes256CbcDecrypt/Makefile @@ -1,5 +1,4 @@ -# -# Copyright 2019-2021 Xilinx, Inc. +# Copyright 2019-2022 Xilinx, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -12,16 +11,32 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -# makefile-generator v1.0.4 -# +# vitis makefile-generator v2.0.6 -# ####################################### Help Section ##################################### +############################## Help Section ############################## .PHONY: help help:: $(ECHO) "Makefile Usage:" - $(ECHO) " make all TARGET= DEVICE= HOST_ARCH=" + $(ECHO) " make all TARGET= PLATFORM= HOST_ARCH=" $(ECHO) " Command to generate the design for specified Target and Shell." + $(ECHO) " By default, HOST_ARCH=x86. HOST_ARCH is required for SoC shells" + $(ECHO) "" + $(ECHO) " make run TARGET= PLATFORM= HOST_ARCH=" + $(ECHO) " Command to run application in emulation." + $(ECHO) " By default, HOST_ARCH=x86. HOST_ARCH required for SoC shells" + $(ECHO) "" + $(ECHO) " make xclbin TARGET= PLATFORM= HOST_ARCH=" + $(ECHO) " Command to build xclbin application." + $(ECHO) " By default, HOST_ARCH=x86. HOST_ARCH is required for SoC shells" + $(ECHO) "" + $(ECHO) " make host TARGET=" + $(ECHO) " Command to build host application." + $(ECHO) " By default, HOST_ARCH=x86. HOST_ARCH is required for SoC shells" + $(ECHO) "" + $(ECHO) " NOTE: For embedded devices, e.g. zcu102/zcu104/vck190, env variable SYSROOT and EDGE_COMMON_SW need to be set first, and HOST_ARCH is either aarch32 or aarch64. For example," + $(ECHO) " export SYSROOT=< path-to-platform-sysroot >" + $(ECHO) " export EDGE_COMMON_SW=< path-to-rootfs-and-Image-files >" $(ECHO) "" $(ECHO) " make clean " $(ECHO) " Command to remove the generated non-hardware files." @@ -29,208 +44,310 @@ help:: $(ECHO) " make cleanall" $(ECHO) " Command to remove all the generated files." $(ECHO) "" - $(ECHO) " make run TARGET= DEVICE= HOST_ARCH=" - $(ECHO) " Command to run application in emulation or on board." - $(ECHO) "" - $(ECHO) " make build TARGET= DEVICE= HOST_ARCH=" - $(ECHO) " Command to build xclbin application." - $(ECHO) "" - $(ECHO) " make host HOST_ARCH=" - $(ECHO) " Command to build host application." - $(ECHO) "" -# ##################### Setting up default value of TARGET ########################## -TARGET ?= sw_emu +############################## Setting up Project Variables ############################## -# ################### Setting up default value of DEVICE ############################## -DEVICE ?= xilinx_u250_gen3x16_xdma_3_1_202020_1 +MK_PATH := $(abspath $(lastword $(MAKEFILE_LIST))) +XF_PROJ_ROOT ?= $(shell bash -c 'export MK_PATH=$(MK_PATH); echo $${MK_PATH%/L1/*}') +CUR_DIR := $(patsubst %/,%,$(dir $(MK_PATH))) +XFLIB_DIR = $(XF_PROJ_ROOT) -# ###################### Setting up default value of HOST_ARCH ####################### +# setting devault value +TARGET ?= sw_emu HOST_ARCH ?= x86 -# #################### Checking if DEVICE in blacklist ############################# -ifeq ($(findstring zc, $(DEVICE)), zc) -$(error [ERROR]: This project is not supported for $(DEVICE).) -endif - -# #################### Checking if DEVICE in whitelist ############################ -ifneq ($(findstring u250, $(DEVICE)), u250) -ifneq ($(findstring u50, $(DEVICE)), u50) -ifneq ($(findstring aws-vu9p-f1, $(DEVICE)), aws-vu9p-f1) -$(warning [WARNING]: This project has not been tested for $(DEVICE). It may or may not work.) -endif +#setting PLATFORM +ifeq ($(PLATFORM),) +PLATFORM := $(DEVICE) endif +ifeq ($(PLATFORM),) +PLATFORM := xilinx_u250_gen3x16_xdma_4_1_202210_1 endif -# ######################## Setting up Project Variables ################################# -MK_PATH := $(abspath $(lastword $(MAKEFILE_LIST))) -XF_PROJ_ROOT ?= $(shell bash -c 'export MK_PATH=$(MK_PATH); echo $${MK_PATH%/L1/*}') -CUR_DIR := $(patsubst %/,%,$(dir $(MK_PATH))) -XFLIB_DIR = $(XF_PROJ_ROOT) +# #################### Checking if PLATFORM in whitelist ############################ +PLATFORM_ALLOWLIST += u250 u50 aws-vu9p-f1 +PLATFORM_BLOCKLIST += zc -# ######################### Include environment variables in utils.mk #################### include ./utils.mk -XDEVICE := $(call device2xsa, $(DEVICE)) -TEMP_DIR := _x_temp.$(TARGET).$(XDEVICE) -TEMP_REPORT_DIR := $(CUR_DIR)/reports/_x.$(TARGET).$(XDEVICE) -BUILD_DIR := build_dir.$(TARGET).$(XDEVICE) -BUILD_REPORT_DIR := $(CUR_DIR)/reports/_build.$(TARGET).$(XDEVICE) -EMCONFIG_DIR := $(BUILD_DIR) +TEMP_DIR := _x_temp.$(TARGET).$(PLATFORM_NAME) +TEMP_REPORT_DIR := $(CUR_DIR)/reports/_x.$(TARGET).$(PLATFORM_NAME) +BUILD_DIR := build_dir.$(TARGET).$(PLATFORM_NAME) +ifneq ($(RESULT_DIR),) +BUILD_DIR = $(RESULT_DIR) +endif +BUILD_REPORT_DIR := $(CUR_DIR)/reports/_build.$(TARGET).$(PLATFORM_NAME) +EMCONFIG := $(BUILD_DIR)/emconfig.json XCLBIN_DIR := $(CUR_DIR)/$(BUILD_DIR) export XCL_BINDIR = $(XCLBIN_DIR) -# ######################### Setting up Host Variables ######################### -#Include Required Host Source Files -HOST_SRCS += $(CUR_DIR)/host/main.cpp -HOST_SRCS += $(XFLIB_DIR)/ext/xcl2/xcl2.cpp -CXXFLAGS += -I$(XFLIB_DIR)/L1/include -CXXFLAGS += -I$(CUR_DIR)/host -CXXFLAGS += -I$(CUR_DIR)/kernel -CXXFLAGS += -I$(XFLIB_DIR)/ext/xcl2 -CXXFLAGS += -I$(XFLIB_DIR)/../utils/L1/include -CXXFLAGS += -I$(XFLIB_DIR)/ext/xcl2 +EXE_FILE_DEPS := +BINARY_CONTAINERS_DEPS := +RUN_DEPS := +# get global setting +ifeq ($(HOST_ARCH), x86) +CXXFLAGS += -fmessage-length=0 -I$(CUR_DIR)/src/ -I$(XILINX_XRT)/include -I$(XILINX_HLS)/include -std=c++14 -O3 -Wall -Wno-unknown-pragmas -Wno-unused-label +LDFLAGS += -pthread -L$(XILINX_XRT)/lib -L$(XILINX_HLS)/lnx64/tools/fpo_v7_0 -Wl,--as-needed -lOpenCL -lxrt_coreutil -lgmp -lmpfr -lIp_floating_point_v7_0_bitacc_cmodel +VPP_FLAGS += -t $(TARGET) --platform $(XPLATFORM) --save-temps +VPP_LDFLAGS += --optimize 2 -R 2 +else ifeq ($(HOST_ARCH), aarch64) +CXXFLAGS += -I$(CUR_DIR)/src/ -fmessage-length=0 --sysroot=$(SYSROOT) -I$(SYSROOT)/usr/include/xrt -I$(XILINX_HLS)/include -std=c++14 -O3 -Wall -Wno-unknown-pragmas -Wno-unused-label +LDFLAGS += -pthread -L$(SYSROOT)/usr/lib -L$(XILINX_VITIS_AIETOOLS)/lib/aarch64.o -Wl,--as-needed -lxilinxopencl -lxrt_coreutil +VPP_FLAGS += -t $(TARGET) --platform $(XPLATFORM) --save-temps +VPP_LDFLAGS += --optimize 2 -R 2 +endif +CXXFLAGS += $(EXTRA_CXXFLAGS) +VPP_FLAGS += $(EXTRA_VPP_FLAGS) +########################## Setting up Host Variables ########################## ifeq ($(TARGET),sw_emu) CXXFLAGS += -D SW_EMU_TEST endif - ifeq ($(TARGET),hw_emu) CXXFLAGS += -D HW_EMU_TEST endif -# ######################### Host compiler global settings ############################ -CXXFLAGS += -I$(XILINX_XRT)/include -I$(XILINX_HLS)/include -std=c++11 -O3 -Wall -Wno-unknown-pragmas -Wno-unused-label -LDFLAGS += -L$(XILINX_XRT)/lib -lOpenCL -lpthread -lrt -Wno-unused-label -Wno-narrowing -DVERBOSE -CXXFLAGS += -fmessage-length=0 -O3 -CXXFLAGS += -I$(CUR_DIR)/src/ - -ifeq ($(HOST_ARCH), x86) -LDFLAGS += -L$(XILINX_HLS)/lnx64/tools/fpo_v7_0 -Wl,--as-needed -lgmp -lmpfr -lIp_floating_point_v7_0_bitacc_cmodel +ifeq (,$(findstring opencv,$(CXXFLAGS))) +CXXFLAGS += $(XRT_CXXFLAGS) endif + +#Inclue Required Host Source Files ifneq (,$(shell echo $(XPLATFORM) | awk '/u250/')) -CXXFLAGS += -D USE_DDR +HOST_SRCS += $(CUR_DIR)/host/main.cpp $(XFLIB_DIR)/ext/xcl2/xcl2.cpp +CXXFLAGS += -D USE_DDR +CXXFLAGS += -I $(XFLIB_DIR)/L1/include -I $(CUR_DIR)/host -I $(CUR_DIR)/kernel -I $(XFLIB_DIR)/ext/xcl2 -I $(XFLIB_DIR)/../utils/L1/include -I $(XFLIB_DIR)/ext/xcl2 +CXXFLAGS += -O3 + else ifneq (,$(shell echo $(XPLATFORM) | awk '/u50/')) -CXXFLAGS += -D USE_HBM +HOST_SRCS += $(CUR_DIR)/host/main.cpp $(XFLIB_DIR)/ext/xcl2/xcl2.cpp +CXXFLAGS += -D USE_HBM +CXXFLAGS += -I $(XFLIB_DIR)/L1/include -I $(CUR_DIR)/host -I $(CUR_DIR)/kernel -I $(XFLIB_DIR)/ext/xcl2 -I $(XFLIB_DIR)/../utils/L1/include -I $(XFLIB_DIR)/ext/xcl2 +CXXFLAGS += -O3 + else ifneq (,$(shell echo $(XPLATFORM) | awk '/vck190/')) -CXXFLAGS += -I$(SYSROOT)/usr/include +HOST_SRCS += $(CUR_DIR)/host/main.cpp $(XFLIB_DIR)/ext/xcl2/xcl2.cpp +CXXFLAGS += -I $(SYSROOT)/usr/include -I $(XFLIB_DIR)/L1/include -I $(CUR_DIR)/host -I $(CUR_DIR)/kernel -I $(XFLIB_DIR)/ext/xcl2 -I $(XFLIB_DIR)/../utils/L1/include -I $(XFLIB_DIR)/ext/xcl2 CXXFLAGS += --sysroot=$(SYSROOT) -LDFLAGS += -L$(SYSROOT)/usr/lib -LDFLAGS += -L${SYSROOT}/opt/xilinx/xrt/lib -endif +LDFLAGS += -L $(SYSROOT)/usr/lib -L ${SYSROOT}/opt/xilinx/xrt/lib -# ################### Setting package and image directory ####################### +else +HOST_SRCS += $(CUR_DIR)/host/main.cpp $(XFLIB_DIR)/ext/xcl2/xcl2.cpp +CXXFLAGS += -I $(XFLIB_DIR)/L1/include -I $(CUR_DIR)/host -I $(CUR_DIR)/kernel -I $(XFLIB_DIR)/ext/xcl2 -I $(XFLIB_DIR)/../utils/L1/include -I $(XFLIB_DIR)/ext/xcl2 +CXXFLAGS += -O3 +endif EXE_NAME := aes256CbcDecryptBenchmark.exe EXE_FILE := $(BUILD_DIR)/$(EXE_NAME) -HOST_ARGS := -mode fpga -xclbin $(BUILD_DIR)/aes256CbcDecryptKernel.xclbin -len 1024 -num 16 -gld $(CUR_DIR)/data/gld.dat - -# ##################### Kernel compiler global settings ########################## -VPP_FLAGS += -t $(TARGET) --platform $(XPLATFORM) --save-temps --optimize 2 -VPP_FLAGS += --hls.jobs 8 -VPP_LDFLAGS += --vivado.synth.jobs 8 --vivado.impl.jobs 8 -ifneq (,$(shell echo $(XPLATFORM) | awk '/u250/')) -VPP_FLAGS += --config $(CUR_DIR)/conn_u250.cfg -endif +EXE_FILE_DEPS := $(HOST_SRCS) $(EXE_FILE_DEPS) -ifneq (,$(shell echo $(XPLATFORM) | awk '/u50/')) -VPP_FLAGS += --config $(CUR_DIR)/conn_u50.cfg +HOST_ARGS := -mode fpga -xclbin $(BUILD_DIR)/aes256CbcDecryptKernel.xclbin -len 1024 -num 16 -gld $(CUR_DIR)/data/gld.dat +ifneq ($(HOST_ARCH), x86) +PKG_HOST_ARGS = $(foreach args,$(HOST_ARGS),$(subst $(dir $(patsubst %/,%,$(args))),,$(args))) endif -VPP_FLAGS += -I$(XFLIB_DIR)/L1/include - -VPP_FLAGS += -I$(XFLIB_DIR)/L1/include -VPP_FLAGS += -I$(CUR_DIR)/kernel - -aes256CbcDecryptKernel_VPP_FLAGS += --hls.clock 300000000:aes256CbcDecryptKernel -VPP_LDFLAGS_aes256CbcDecryptKernel += --kernel_frequency 300 - - -# Kernel args - -# ############################ Declaring Binary Containers ########################## +########################## Kernel compiler global settings ########################## +ifneq (,$(shell echo $(XPLATFORM) | awk '/u250/')) +VPP_FLAGS += --config $(CUR_DIR)/conn_u250.cfg +VPP_FLAGS += -I $(XFLIB_DIR)/L1/include -I $(CUR_DIR)/kernel -I $(XFLIB_DIR)/L1/include -BINARY_CONTAINERS += $(BUILD_DIR)/aes256CbcDecryptKernel.xclbin -BINARY_CONTAINER_aes256CbcDecryptKernel_OBJS += $(TEMP_DIR)/aes256CbcDecryptKernel.xo +else ifneq (,$(shell echo $(XPLATFORM) | awk '/u50/')) +VPP_FLAGS += --config $(CUR_DIR)/conn_u50.cfg +VPP_FLAGS += -I $(XFLIB_DIR)/L1/include -I $(CUR_DIR)/kernel -I $(XFLIB_DIR)/L1/include -# ######################### Setting Targets of Makefile ################################ -DATA_FILE += $(CUR_DIR)//data/gld.dat +else +VPP_FLAGS += -I $(XFLIB_DIR)/L1/include -I $(CUR_DIR)/kernel -I $(XFLIB_DIR)/L1/include -.PHONY: all clean cleanall docs emconfig -ifeq ($(HOST_ARCH), x86) -all: check_version check_vpp check_platform check_xrt $(EXE_FILE) $(BINARY_CONTAINERS) emconfig -else -all: check_version check_vpp check_platform check_sysroot $(EXE_FILE) $(BINARY_CONTAINERS) emconfig sd_card endif -.PHONY: host -ifeq ($(HOST_ARCH), x86) -host: check_xrt $(EXE_FILE) +######################### binary container global settings ########################## +VPP_FLAGS_aes256CbcDecryptKernel += --hls.clock 300000000:aes256CbcDecryptKernel +ifneq ($(HOST_ARCH), x86) +VPP_LDFLAGS_aes256CbcDecryptKernel += --clock.defaultFreqHz 300000000 else -host: check_sysroot $(EXE_FILE) +VPP_LDFLAGS_aes256CbcDecryptKernel += --kernel_frequency 300 endif -.PHONY: xclbin ifeq ($(HOST_ARCH), x86) -xclbin: check_vpp check_xrt $(BINARY_CONTAINERS) +BINARY_CONTAINERS += $(BUILD_DIR)/aes256CbcDecryptKernel.xclbin else -xclbin: check_vpp check_sysroot $(BINARY_CONTAINERS) +BINARY_CONTAINERS += $(BUILD_DIR)/aes256CbcDecryptKernel_pkg.$(LINK_TARGET_FMT) +BINARY_CONTAINERS_PKG += $(BUILD_DIR)/aes256CbcDecryptKernel.xclbin endif -.PHONY: build -build: xclbin - # ################ Setting Rules for Binary Containers (Building Kernels) ################ -$(TEMP_DIR)/aes256CbcDecryptKernel.xo: $(CUR_DIR)/kernel/aes256CbcDecryptKernel.cpp +$(TEMP_DIR)/aes256CbcDecryptKernel.xo: $(CUR_DIR)/kernel/aes256CbcDecryptKernel.cpp $(ECHO) "Compiling Kernel: aes256CbcDecryptKernel" mkdir -p $(TEMP_DIR) - $(VPP) -c $(aes256CbcDecryptKernel_VPP_FLAGS) $(VPP_FLAGS) -k aes256CbcDecryptKernel -I'$(> $(RUN_SCRIPT) +ifneq ($(filter sw_emu hw_emu, $(TARGET)),) + @echo 'export XCL_EMULATION_MODE=$(TARGET)' >> $(RUN_SCRIPT) +endif + @echo 'export XILINX_VITIS=/mnt' >> $(RUN_SCRIPT) + @echo 'export XILINX_XRT=/usr' >> $(RUN_SCRIPT) + @echo 'if [ -f platform_desc.txt ]; then' >> $(RUN_SCRIPT) + @echo ' cp platform_desc.txt /etc/xocl.txt' >> $(RUN_SCRIPT) + @echo 'fi' >> $(RUN_SCRIPT) + @echo './$(EXE_NAME) $(PKG_HOST_ARGS)' >> $(RUN_SCRIPT) + @echo 'return_code=$$?' >> $(RUN_SCRIPT) + @echo 'if [ $$return_code -ne 0 ]; then' >> $(RUN_SCRIPT) + @echo ' echo "ERROR: Embedded host run failed, RC=$$return_code"' >> $(RUN_SCRIPT) + @echo 'else' >> $(RUN_SCRIPT) + @echo ' echo "INFO: TEST PASSED, RC=0"' >> $(RUN_SCRIPT) + @echo 'fi' >> $(RUN_SCRIPT) + @echo 'echo "INFO: Embedded host run completed."' >> $(RUN_SCRIPT) + @echo 'exit $$return_code' >> $(RUN_SCRIPT) +DATA_FILE := $(CUR_DIR)//data/gld.dat +DATA_DIR := +SD_FILES += $(RUN_SCRIPT) +SD_FILES += $(EXE_FILE) +SD_FILES += $(EMCONFIG) +SD_FILES += xrt.ini +SD_FILES += $(DATA_FILE)# where define DATAFILE in json +SD_FILES_WITH_PREFIX = $(foreach sd_file,$(SD_FILES), $(if $(filter $(sd_file),$(wildcard $(sd_file))), --package.sd_file $(sd_file))) +SD_DIRS_WITH_PREFIX = $(foreach sd_dir,$(DATA_DIR),--package.sd_dir $(sd_dir)) +PACKAGE_FILES := $(BINARY_CONTAINERS) +PACKAGE_FILES += $(AIE_CONTAINER) +SD_CARD := $(CUR_DIR)/package_$(TARGET) +vck190_dfx_hw := false +$(SD_CARD): $(EXE_FILE) $(BINARY_CONTAINERS) $(RUN_SCRIPT) $(EMCONFIG) + @echo "Generating sd_card folder...." + mkdir -p $(SD_CARD) + chmod a+rx $(BUILD_DIR)/run_script.sh +ifneq (,$(findstring vck190_base_dfx, $(PLATFORM_NAME))) +ifeq ($(TARGET),hw) + $(VPP) -t $(TARGET) --platform $(XPLATFORM) -p $(PACKAGE_FILES) -o $(BINARY_CONTAINERS_PKG) + $(VPP) -t $(TARGET) --platform $(XPLATFORM) -p --package.out_dir $(SD_CARD) --package.rootfs $(SYSROOT)/../../rootfs.ext4 --package.kernel_image $(K_IMAGE) $(SD_FILES_WITH_PREFIX) $(SD_DIRS_WITH_PREFIX) --package.sd_file $(BINARY_CONTAINERS_PKG) + @echo "### ***** sd_card generation done! ***** ###" +vck190_dfx_hw := true +endif +endif +ifeq ($(vck190_dfx_hw), false) + $(VPP) -t $(TARGET) --platform $(XPLATFORM) -o $(BINARY_CONTAINERS_PKG) -p $(PACKAGE_FILES) $(VPP_PACKAGE) --package.out_dir $(SD_CARD) --package.rootfs $(SYSROOT)/../../rootfs.ext4 --package.kernel_image $(K_IMAGE) $(SD_FILES_WITH_PREFIX) $(SD_DIRS_WITH_PREFIX) + @echo "### ***** sd_card generation done! ***** ###" +endif + +.PHONY: sd_card +sd_card: $(SD_CARD) +endif +############################## Setting Essential Checks and Building Rules ############################## +RUN_DEPS += $(EXE_FILE) $(BINARY_CONTAINERS) $(EMCONFIG) +RUN_DEPS += $(SD_CARD) -# ###############Setting Essential Checks And Running Rules For Vitis Flow ############# +.PHONY: mkflag all run +mkflag: + mkdir -p $(BUILD_DIR) + rm -rf $(BUILD_DIR)/makefile_args.txt + @for var in $(MAKEFLAGS); do echo $$var >> $(BUILD_DIR)/makefile_args.txt; done +all: check_device check_vpp check_platform mkflag $(RUN_DEPS) run: all -ifeq ($(TARGET),$(filter $(TARGET),sw_emu hw_emu)) - $(CP) $(EMCONFIG_DIR)/emconfig.json . +#hw_emu +ifneq (,$(filter hw_emu, $(TARGET))) +ifeq ($(HOST_ARCH), x86) + LD_LIBRARY_PATH=$(LIBRARY_PATH):$$LD_LIBRARY_PATH \ XCL_EMULATION_MODE=$(TARGET) $(EXE_FILE) $(HOST_ARGS) + else + @echo $(RUN_DEPS) + $(SD_CARD)/launch_$(TARGET).sh -no-reboot -run-app $(notdir $(RUN_SCRIPT)) + grep "TEST PASSED, RC=0" $(SD_CARD)/qemu_output.log || exit 1 + +endif +endif +#sw_emu +ifneq (,$(filter sw_emu, $(TARGET))) +ifeq ($(HOST_ARCH), x86) + LD_LIBRARY_PATH=$(LIBRARY_PATH):$$LD_LIBRARY_PATH \ + XCL_EMULATION_MODE=$(TARGET) $(EXE_FILE) $(HOST_ARGS) + +else + @echo $(RUN_DEPS) + $(SD_CARD)/launch_$(TARGET).sh -no-reboot -run-app $(notdir $(RUN_SCRIPT)) + grep "TEST PASSED, RC=0" $(SD_CARD)/qemu_output.log || exit 1 + +endif +endif +#hw +ifeq ($(TARGET), hw) +ifneq (,$(findstring aws-vu9p-f1, $(PLATFORM_NAME))) +ifneq ($(JENKINS_INTERNAL_BUILD), 1) + $(ECHO) "This makefile does not directly support converting .xclbin to .awsxclbin, please refer https://github.com/aws/aws-fpga/blob/master/Vitis/README.md for next operations" +else + $(ECHO) "Running inside Xilinx regression without converting to .awsxclbin" + $(EXE_FILE) $(HOST_ARGS) + +endif +else ifeq ($(HOST_ARCH), x86) $(EXE_FILE) $(HOST_ARGS) + +else + $(ECHO) "Please copy the content of sd_card folder and data to an SD Card and run on the board" +endif endif -# ################################# Cleaning Rules ################################## +############################## Setting Targets ############################## + +.PHONY: clean cleanall emconfig +emconfig: $(EMCONFIG) + +.PHONY: host +ifeq ($(HOST_ARCH), x86) +host: check_xrt $(EXE_FILE) +else +host: check_sysroot $(EXE_FILE) +endif + +.PHONY: xclbin +ifeq ($(HOST_ARCH), x86) +xclbin: check_vpp check_xrt $(BINARY_CONTAINERS) +else +xclbin: check_vpp check_sysroot $(BINARY_CONTAINERS) +endif + +############################## Cleaning Rules ############################## cleanh: -$(RMDIR) $(EXE_FILE) vitis_* TempConfig system_estimate.xtxt *.rpt .run/ - -$(RMDIR) src/*.ll _xocc_* .Xil dltmp* xmltmp* *.log *.jou *.wcfg *.wdb sample_link.ini sample_compile.ini obj* bin* *.csv *.jpg *.jpeg *.png + -$(RMDIR) src/*.ll _xocc_* .Xil dltmp* xmltmp* *.log *.jou *.wcfg *.wdb sample_link.ini sample_compile.ini obj* bin* *.csv *.jpg *.jpeg *.png cleank: - -$(RMDIR) $(BUILD_DIR)/*.xclbin _vimage *xclbin.run_summary qemu-memory-_* emulation/ _vimage/ start_simulation.sh *.xclbin + -$(RMDIR) $(BUILD_DIR)/*.xclbin _vimage *xclbin.run_summary qemu-memory-_* emulation/ _vimage/ pl*start_simulation. sh *.xclbin -$(RMDIR) _x_temp.*/_x.* _x_temp.*/.Xil _x_temp.*/profile_summary.* xo_* _x* - -$(RMDIR) _x_temp.*/dltmp* _x_temp.*/kernel_info.dat _x_temp.*/*.log + -$(RMDIR) _x_temp.*/dltmp* _x_temp.*/kernel_info.dat _x_temp.*/*.log -$(RMDIR) _x_temp.* cleanall: cleanh cleank - -$(RMDIR) $(BUILD_DIR) build_dir.* emconfig.json *.html $(TEMP_DIR) $(CUR_DIR)/reports *.csv *.run_summary $(CUR_DIR)/*.raw package_* run_script.sh .ipcache *.str - -$(RMDIR) $(XFLIB_DIR)/common/data/*.xe2xd* $(XFLIB_DIR)/common/data/*.orig* - - -$(RMDIR) $(AIE_CONTAINERS) $(CUR_DIR)/Work $(CUR_DIR)/*.xpe $(CUR_DIR)/hw.o $(CUR_DIR)/*.xsa $(CUR_DIR)/xnwOut aiesimulator_output .AIE_SIM_CMD_LINE_OPTIONS + -$(RMDIR) $(BUILD_DIR) emconfig.json *.html $(TEMP_DIR) $(CUR_DIR)/reports *.csv *.run_summary $(CUR_DIR)/*.raw package_* $(BUILD_DIR)/run_script.sh .ipcache *.str + -$(RMDIR) $(CUR_DIR)/Work $(CUR_DIR)/*.xpe $(CUR_DIR)/hw.o $(CUR_DIR)/*.xsa $(CUR_DIR)/xnwOut -clean: cleanh +clean: cleanh \ No newline at end of file diff --git a/security/L1/benchmarks/aes256CbcDecrypt/README.md b/security/L1/benchmarks/aes256CbcDecrypt/README.md index 99e02e2db9..598d6972ed 100644 --- a/security/L1/benchmarks/aes256CbcDecrypt/README.md +++ b/security/L1/benchmarks/aes256CbcDecrypt/README.md @@ -18,12 +18,6 @@ The steps for library download and environment setup can be found in :ref:`l1_vi * **Build kernel(Step 2)** -Please check you've installed openSSL and make sure that its version is 1.0.2 or higher. Command to check openSSL version: - -``` - openssl version -``` - Run the following make command to build your XCLBIN and host binary targeting a specific device. Please be noticed that this process will take a long time, maybe couple of hours. ``` diff --git a/security/L1/benchmarks/aes256CbcDecrypt/description.json b/security/L1/benchmarks/aes256CbcDecrypt/description.json index 054f8ea972..dd606e24bb 100644 --- a/security/L1/benchmarks/aes256CbcDecrypt/description.json +++ b/security/L1/benchmarks/aes256CbcDecrypt/description.json @@ -4,12 +4,12 @@ "description": "AES256 in CBC Mode Decryption Benchmark", "flow": "vitis", "platform_type": "", - "platform_whitelist": [ + "platform_allowlist": [ "u250", "u50", "aws-vu9p-f1" ], - "platform_blacklist": [ + "platform_blocklist": [ "zc" ], "platform_properties": { @@ -23,7 +23,7 @@ }, "v++": { "compiler": { - "cflags": [ + "clflags": [ "--config PROJECT/conn_u250.cfg" ] } @@ -39,7 +39,7 @@ }, "v++": { "compiler": { - "cflags": [ + "clflags": [ "--config PROJECT/conn_u50.cfg" ] } diff --git a/security/L1/benchmarks/aes256CbcDecrypt/utils.mk b/security/L1/benchmarks/aes256CbcDecrypt/utils.mk index 3892ff1942..0ee80e90da 100644 --- a/security/L1/benchmarks/aes256CbcDecrypt/utils.mk +++ b/security/L1/benchmarks/aes256CbcDecrypt/utils.mk @@ -1,5 +1,5 @@ # -# Copyright 2019-2021 Xilinx, Inc. +# Copyright 2019-2022 Xilinx, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -12,6 +12,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. +# vitis makefile-generator v2.0.6 # #+------------------------------------------------------------------------------- # The following parameters are assigned with default values. These parameters can @@ -39,17 +40,59 @@ ifeq ($(DEBUG), yes) VPP_LDFLAGS += --dk protocol:all:all:all endif -#Checks for XILINX_XRT -ifeq ($(HOST_ARCH), x86) +#Check environment setup +ifndef XILINX_VITIS + XILINX_VITIS = /opt/xilinx/Vitis/$(TOOL_VERSION) + export XILINX_VITIS +endif ifndef XILINX_XRT XILINX_XRT = /opt/xilinx/xrt export XILINX_XRT endif + +check_device: + @set -eu; \ + inallowlist=False; \ + inblocklist=False; \ + for dev in $(PLATFORM_ALLOWLIST); \ + do if [[ $$(echo $(PLATFORM_NAME) | grep $$dev) != "" ]]; \ + then inallowlist=True; fi; \ + done ;\ + for dev in $(PLATFORM_BLOCKLIST); \ + do if [[ $$(echo $(PLATFORM_NAME) | grep $$dev) != "" ]]; \ + then inblocklist=True; fi; \ + done ;\ + if [[ $$inallowlist == False ]]; \ + then echo "[Warning]: The device $(PLATFORM_NAME) not in allowlist."; \ + fi; \ + if [[ $$inblocklist == True ]]; \ + then echo "[ERROR]: The device $(PLATFORM_NAME) in blocklist."; exit 1;\ + fi; + +#get HOST_ARCH by PLATFORM +ifneq (,$(PLATFORM)) +HOST_ARCH_temp = $(shell platforminfo -p $(PLATFORM) | grep 'CPU Type' | sed 's/.*://' | sed '/ai_engine/d' | sed 's/^[[:space:]]*//') +ifeq ($(HOST_ARCH_temp), x86) +HOST_ARCH := x86 +else ifeq ($(HOST_ARCH_temp), cortex-a9) +HOST_ARCH := aarch32 +else ifneq (,$(findstring cortex-a, $(HOST_ARCH_temp))) +HOST_ARCH := aarch64 +endif +endif + + +#get suffix of kernel by PLATFORM +VITIS_VER = $(shell v++ --version | grep 'v++' | sed 's/^[[:space:]]*//' | sed -e 's/^[*]* v++ v//g' | cut -d " " -f1) +DEVICE_TYPE = $(shell platforminfo -p $(PLATFORM) | grep 'FPGA Family' | sed 's/.*://' | sed '/ai_engine/d' | sed 's/^[[:space:]]*//') +ifeq ($(DEVICE_TYPE), versal) +ifeq ($(shell expr $(VITIS_VER) \>= 2022.1), 1) +LINK_TARGET_FMT := xsa else -ifndef XILINX_VITIS - XILINX_VITIS = /opt/xilinx/Vitis/$(TOOL_VERSION) - export XILINX_VITIS +LINK_TARGET_FMT := xclbin endif +else +LINK_TARGET_FMT := xclbin endif #Checks for Device Family @@ -59,13 +102,18 @@ else ifeq ($(HOST_ARCH), aarch64) DEV_FAM = Ultrascale endif -B_NAME = $(shell dirname $(XPLATFORM)) - #Checks for Correct architecture ifneq ($(HOST_ARCH), $(filter $(HOST_ARCH),aarch64 aarch32 x86)) $(error HOST_ARCH variable not set, please set correctly and rerun) endif +check_version: +ifneq (, $(shell which git)) +ifneq (,$(wildcard $(XFLIB_DIR)/.git)) + @cd $(XFLIB_DIR) && git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit -n 1 && cd - +endif +endif + #Checks for SYSROOT check_sysroot: ifneq ($(HOST_ARCH), x86) @@ -74,25 +122,24 @@ ifndef SYSROOT endif endif -check_version: -ifneq (, $(shell which git)) -ifneq (,$(wildcard $(XFLIB_DIR)/.git)) - @cd $(XFLIB_DIR) && git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit -n 1 && cd - -endif -endif - #Checks for g++ CXX := g++ ifeq ($(HOST_ARCH), x86) -ifneq ($(shell expr $(shell g++ -dumpversion) \>= 5), 1) +ifeq ($(shell expr $(VITIS_VER) \>= 2022.1), 1) +CXX_VER := 8.3.0 +else +CXX_VER := 6.2.0 +endif +CXX_V := $(shell echo $(CXX_VER) | awk -F. '{print tolower($$1)}') +ifneq ($(shell expr $(shell echo "__GNUG__" | g++ -E -x c++ - | tail -1) \>= $(CXX_V)), 1) ifndef XILINX_VIVADO -$(error [ERROR]: g++ version too old. Please use 5.0 or above) +$(error [ERROR]: g++ version too old. Please use $(CXX_VER) or above) else -CXX := $(XILINX_VIVADO)/tps/lnx64/gcc-6.2.0/bin/g++ +CXX := $(XILINX_VIVADO)/tps/lnx64/gcc-$(CXX_VER)/bin/g++ ifeq ($(LD_LIBRARY_PATH),) -export LD_LIBRARY_PATH := $(XILINX_VIVADO)/tps/lnx64/gcc-6.2.0/lib64 +export LD_LIBRARY_PATH := $(XILINX_VIVADO)/tps/lnx64/gcc-$(CXX_VER)/lib64 else -export LD_LIBRARY_PATH := $(XILINX_VIVADO)/tps/lnx64/gcc-6.2.0/lib64:$(LD_LIBRARY_PATH) +export LD_LIBRARY_PATH := $(XILINX_VIVADO)/tps/lnx64/gcc-$(CXX_VER)/lib64:$(LD_LIBRARY_PATH) endif $(warning [WARNING]: g++ version too old. Using g++ provided by the tool: $(CXX)) endif @@ -103,13 +150,22 @@ else ifeq ($(HOST_ARCH), aarch32) CXX := $(XILINX_VITIS)/gnu/aarch32/lin/gcc-arm-linux-gnueabi/bin/arm-linux-gnueabihf-g++ endif -#Check OS and setting env +#Check OS and setting env for xrt c++ api OSDIST = $(shell lsb_release -i |awk -F: '{print tolower($$2)}' | tr -d ' \t' ) OSREL = $(shell lsb_release -r |awk -F: '{print tolower($$2)}' |tr -d ' \t') -ifeq ($(OSDIST), centos) +# for centos and redhat +ifneq ($(findstring centos,$(OSDIST)),) +ifeq (7,$(shell echo $(OSREL) | awk -F. '{print tolower($$1)}' )) +ifeq ($(HOST_ARCH), x86) +XRT_CXXFLAGS += -D_GLIBCXX_USE_CXX11_ABI=0 +endif +endif +else ifneq ($(findstring redhat,$(OSDIST)),) ifeq (7,$(shell echo $(OSREL) | awk -F. '{print tolower($$1)}' )) -CXXFLAGS += -D_GLIBCXX_USE_CXX11_ABI=0 +ifeq ($(HOST_ARCH), x86) +XRT_CXXFLAGS += -D_GLIBCXX_USE_CXX11_ABI=0 +endif endif endif @@ -117,6 +173,9 @@ endif VPP := v++ #Cheks for aiecompiler +AIECXX := aiecompiler +AIESIMULATOR := aiesimulator +X86SIMULATOR := x86simulator .PHONY: check_vivado check_vivado: @@ -132,11 +191,9 @@ endif .PHONY: check_xrt check_xrt: -ifeq ($(HOST_ARCH), x86) ifeq (,$(wildcard $(XILINX_XRT)/lib/libxilinxopencl.so)) @echo "Cannot locate XRT installation. Please set XILINX_XRT variable." && false endif -endif export PATH := $(XILINX_VITIS)/bin:$(XILINX_XRT)/bin:$(PATH) ifeq ($(HOST_ARCH), x86) @@ -145,82 +202,64 @@ LD_LIBRARY_PATH := $(XILINX_XRT)/lib else LD_LIBRARY_PATH := $(XILINX_XRT)/lib:$(LD_LIBRARY_PATH) endif -else # aarch64 -ifeq (,$(LD_LIBRARY_PATH)) -LD_LIBRARY_PATH := $(SYSROOT)/usr/lib -else -LD_LIBRARY_PATH := $(SYSROOT)/usr/lib:$(LD_LIBRARY_PATH) -endif -endif - -# check target -ifeq ($(filter $(TARGET),sw_emu hw_emu hw),) -$(error TARGET is not sw_emu, hw_emu or hw) endif -ifneq (,$(wildcard $(DEVICE))) -# Use DEVICE as a file path -XPLATFORM := $(DEVICE) +ifneq (,$(wildcard $(PLATFORM))) +# Use PLATFORM as a file path +XPLATFORM := $(PLATFORM) else -# Use DEVICE as a file name pattern +# Use PLATFORM as a file name pattern # 1. search paths specified by variable ifneq (,$(PLATFORM_REPO_PATHS)) # 1.1 as exact name -XPLATFORM := $(strip $(foreach p, $(subst :, ,$(PLATFORM_REPO_PATHS)), $(wildcard $(p)/$(DEVICE)/$(DEVICE).xpfm))) +XPLATFORM := $(strip $(foreach p, $(subst :, ,$(PLATFORM_REPO_PATHS)), $(wildcard $(p)/$(PLATFORM)/$(PLATFORM).xpfm))) # 1.2 as a pattern ifeq (,$(XPLATFORM)) XPLATFORMS := $(foreach p, $(subst :, ,$(PLATFORM_REPO_PATHS)), $(wildcard $(p)/*/*.xpfm)) -XPLATFORM := $(strip $(foreach p, $(XPLATFORMS), $(shell echo $(p) | awk '$$1 ~ /$(DEVICE)/'))) +XPLATFORM := $(strip $(foreach p, $(XPLATFORMS), $(shell echo $(p) | awk '$$1 ~ /$(PLATFORM)/'))) endif # 1.2 endif # 1 # 2. search Vitis installation ifeq (,$(XPLATFORM)) # 2.1 as exact name -XPLATFORM := $(strip $(wildcard $(XILINX_VITIS)/platforms/$(DEVICE)/$(DEVICE).xpfm)) +XPLATFORM := $(strip $(wildcard $(XILINX_VITIS)/platforms/$(PLATFORM)/$(PLATFORM).xpfm)) # 2.2 as a pattern ifeq (,$(XPLATFORM)) XPLATFORMS := $(wildcard $(XILINX_VITIS)/platforms/*/*.xpfm) -XPLATFORM := $(strip $(foreach p, $(XPLATFORMS), $(shell echo $(p) | awk '$$1 ~ /$(DEVICE)/'))) +XPLATFORM := $(strip $(foreach p, $(XPLATFORMS), $(shell echo $(p) | awk '$$1 ~ /$(PLATFORM)/'))) endif # 2.2 endif # 2 # 3. search default locations ifeq (,$(XPLATFORM)) # 3.1 as exact name -XPLATFORM := $(strip $(wildcard /opt/xilinx/platforms/$(DEVICE)/$(DEVICE).xpfm)) +XPLATFORM := $(strip $(wildcard /opt/xilinx/platforms/$(PLATFORM)/$(PLATFORM).xpfm)) # 3.2 as a pattern ifeq (,$(XPLATFORM)) XPLATFORMS := $(wildcard /opt/xilinx/platforms/*/*.xpfm) -XPLATFORM := $(strip $(foreach p, $(XPLATFORMS), $(shell echo $(p) | awk '$$1 ~ /$(DEVICE)/'))) +XPLATFORM := $(strip $(foreach p, $(XPLATFORMS), $(shell echo $(p) | awk '$$1 ~ /$(PLATFORM)/'))) endif # 3.2 endif # 3 endif define MSG_PLATFORM -No platform matched pattern '$(DEVICE)'. +No platform matched pattern '$(PLATFORM)'. Available platforms are: $(XPLATFORMS) -To add more platform directories, set the PLATFORM_REPO_PATHS variable or point DEVICE variable to the full path of platform .xpfm file. +To add more platform directories, set the PLATFORM_REPO_PATHS variable or point PLATFORM variable to the full path of platform .xpfm file. endef export MSG_PLATFORM -define MSG_DEVICE -More than one platform matched: $(XPLATFORM) -Please set DEVICE variable more accurately to select only one platform file, or set DEVICE variable to the full path of the platform .xpfm file. -endef -export MSG_DEVICE .PHONY: check_platform check_platform: ifeq (,$(XPLATFORM)) @echo "$${MSG_PLATFORM}" && false endif -ifneq (,$(word 2,$(XPLATFORM))) - @echo "$${MSG_DEVICE}" && false -endif #Check ends # device2xsa - create a filesystem friendly name from device name # $(1) - full name of device -device2xsa = $(strip $(patsubst %.xpfm, % , $(shell basename $(DEVICE)))) +PLATFORM_NAME = $(strip $(patsubst %.xpfm, % , $(shell basename $(PLATFORM)))) + # Cleaning stuff RM = rm -f diff --git a/security/L1/benchmarks/aes256CbcDecrypt_sc/Makefile b/security/L1/benchmarks/aes256CbcDecrypt_sc/Makefile index cd5ea9b5de..9697d9bca8 100755 --- a/security/L1/benchmarks/aes256CbcDecrypt_sc/Makefile +++ b/security/L1/benchmarks/aes256CbcDecrypt_sc/Makefile @@ -1,4 +1,3 @@ -# # Copyright 2019-2021 Xilinx, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -12,83 +11,258 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -# +# sc makefile-generator v1.0.0 -# ####################################### Help Section ##################################### +############################## Help Section ############################## .PHONY: help help:: $(ECHO) "Makefile Usage:" - $(ECHO) " make all TARGET= DEVICE= HOST_ARCH=" + $(ECHO) " make all TARGET= PLATFORM= HOST_ARCH=" $(ECHO) " Command to generate the design for specified Target and Shell." + $(ECHO) " By default, HOST_ARCH=x86. HOST_ARCH is required for SoC shells" + $(ECHO) "" + $(ECHO) " make run TARGET= PLATFORM= HOST_ARCH=" + $(ECHO) " Command to run application in emulation." + $(ECHO) " By default, HOST_ARCH=x86. HOST_ARCH required for SoC shells" + $(ECHO) "" + $(ECHO) " make host HOST_ARCH=" + $(ECHO) " Command to build host application." + $(ECHO) " By default, HOST_ARCH=x86. HOST_ARCH is required for SoC shells" $(ECHO) "" $(ECHO) " make clean " $(ECHO) " Command to remove the generated non-hardware files." $(ECHO) "" - $(ECHO) " make ultraclean" + $(ECHO) " make cleanall" $(ECHO) " Command to remove all the generated files." $(ECHO) "" - $(ECHO) " make sd_card TARGET= DEVICE= HOST_ARCH=" - $(ECHO) " Command to prepare sd_card files." - $(ECHO) " This target is only used in embedded device." - $(ECHO) "" - $(ECHO) " make run TARGET= DEVICE= HOST_ARCH=" - $(ECHO) " Command to run application in emulation or on board." - $(ECHO) "" - $(ECHO) " make build TARGET= DEVICE= HOST_ARCH=" - $(ECHO) " Command to build xclbin application." - $(ECHO) "" - $(ECHO) " NOTE: For embedded devices, e.g. zcu102/zcu104/vck190, env variable SYSROOT, EDGE_COMMON_SW and PERL need to be set first, and HOST_ARCH is either aarch32 or aarch64. For example," - $(ECHO) " export SYSROOT=< path-to-platform-sysroot >" - $(ECHO) " export EDGE_COMMON_SW=< path-to-rootfs-and-Image-files >" - $(ECHO) " export PERL=" - $(ECHO) "" -# ##################### Setting up default value of TARGET ########################## -TARGET ?= sw_emu +############################## Setting up Project Variables ############################## -# ###################### Setting up default value of HOST_ARCH ####################### +MK_PATH := $(abspath $(lastword $(MAKEFILE_LIST))) +XF_PROJ_ROOT ?= $(shell bash -c 'export MK_PATH=$(MK_PATH); echo $${MK_PATH%/L1/*}') +CUR_DIR := $(patsubst %/,%,$(dir $(MK_PATH))) +XFLIB_DIR = $(XF_PROJ_ROOT) + +# setting devault value +TARGET ?= sw_emu HOST_ARCH ?= x86 -# ################### Setting up default value of DEVICE ############################## -DEVICE ?= xilinx_u250_gen3x16_xdma_3_1_202020_1 +#setting PLATFORM +ifeq ($(PLATFORM),) +PLATFORM := $(DEVICE) +endif +ifeq ($(PLATFORM),) +PLATFORM := xilinx_u250_gen3x16_xdma_3_1_202020_1 +endif -# #################### Checking if DEVICE in blacklist ############################# -ifeq ($(findstring zc, $(DEVICE)), zc) -$(error [ERROR]: This project is not supported for $(DEVICE).) +# #################### Checking if PLATFORM in whitelist ############################ +PLATFORM_ALLOWLIST += u250 u200 +PLATFORM_BLOCKLIST += xilinx_u250_xdma_201830_2 xilinx_u200_xdma_201830_2 zc aws-vu9p-f1 + +GCC_INTOOL := 8.3.0 +BINUTILS_INTOOL := 2.37 +include ./utils.mk +TEMP_DIR := _x_temp.$(TARGET).$(PLATFORM_NAME) +TEMP_REPORT_DIR := $(CUR_DIR)/reports/_x.$(TARGET).$(PLATFORM_NAME) +BUILD_DIR := build_dir.$(TARGET).$(PLATFORM_NAME) +BUILD_REPORT_DIR := $(CUR_DIR)/reports/_build.$(TARGET).$(PLATFORM_NAME) +EMCONFIG := $(BUILD_DIR)/emconfig.json +XCLBIN_DIR := $(CUR_DIR)/$(BUILD_DIR) +export XCL_BINDIR = $(XCLBIN_DIR) + +EXE_FILE_DEPS := +BINARY_CONTAINERS_DEPS := +RUN_DEPS := + +# set debug switch +ifneq ($(debug),yes) +CXXFLAGS += -O3 endif -# #################### Checking if DEVICE in whitelist ############################ -ifneq ($(findstring u250, $(DEVICE)), u250) -ifneq ($(findstring u200, $(DEVICE)), u200) -$(warning [WARNING]: This project has not been tested for $(DEVICE). It may or may not work.) +# get global setting +ifdef XILINX_SC_PFM_CONFIG +CXXFLAGS += -DXILINX_SC_PFM_CONFIG=$(XILINX_SC_PFM_CONFIG) +endif +ifdef XILINX_SC_PFM_EXT +CXXFLAGS += -DXILINX_SC_PFM_EXT=$(XILINX_SC_PFM_EXT) endif +ifeq ($(HOST_ARCH), x86) +CXXFLAGS += -I $(XILINX_VITIS)/system_compiler/include -I $(XILINX_HLS)/include +LDFLAGS += -L$(XILINX_XRT)/lib -L$(XILINX_VITIS)/system_compiler/lib/x86 -lvpp_acc -l$(LIB_XRT) -lxrt_coreutil -Wl,-rpath=$(XILINX_VITIS)/system_compiler/lib/x86:$(XILINX_XRT)/lib:$(GCC_HOME)/lib64 -Wl,--enable-new-dtags -lpthread +VPP_FLAGS += -t $(TARGET) --platform $(XPLATFORM) --temp_dir $(TEMP_DIR) --save-temps -g -I $(XILINX_VITIS)/system_compiler/include +VPP_LDFLAGS += +else ifeq ($(HOST_ARCH), aarch64) +CXXFLAGS += +LDFLAGS += +VPP_FLAGS += +VPP_LDFLAGS += endif +CXXFLAGS += $(EXTRA_CXXFLAGS) +VPP_FLAGS += $(EXTRA_VPP_FLAGS) -include ./utils.mk -override DEVICE := $(call device2xsa, $(DEVICE)) +ifeq ($(TARGET),sw) + $(error Error: The sw target is not supported anymore. Please use sw_emu instead) +else ifeq ($(TARGET),sw_emu) + LIB_XRT := xrt_swemu + HOST_PREAMBLE := XCL_EMULATION_MODE=sw_emu +else ifeq ($(TARGET),hw_emu) + LIB_XRT := xrt_hwemu + HOST_PREAMBLE := XCL_EMULATION_MODE=hw_emu + ifneq (,$(findstring -g,$(EXTRA_VPPFLAGS) $(CXXFLAGS))) + # for sourcing pre/post xsim scripts + ifneq ($(XILINX_SC_HW_EMU),0) + HOST_PREAMBLE += XILINX_SC_HW_EMU=1 XILINX_SC_BUILD_DIR=$(PWD)/$(BUILD_DIR) + endif + endif +else ifeq ($(TARGET),hw) + LIB_XRT := xrt_core +endif -KERNEL ?= aes256CbcDecrypt -PLATFORM_PATH = $(PLATFORM_REPO_PATHS) +########################## Setting up Host Variables ########################## -# source files which have any accelerator code (ie. hls_kernel or vpp_acc code) -# must be specified here: -ACC_SRCS := kernel/$(KERNEL)_acc.cpp kernel/$(KERNEL)_kernel.cpp +#Inclue Required Host Source Files +HOST_SRCS += $(CUR_DIR)/host/main.cpp +CXXFLAGS += -I $(XFLIB_DIR)/L1/include -I $(CUR_DIR)/kernel -I $(XFLIB_DIR)/ext/xcl2 +CXXFLAGS += -O3 -# source files with only host code can go here: -HOST_SRCS := host/main.cpp -MK_PATH := $(abspath $(lastword $(MAKEFILE_LIST))) -XF_PROJ_ROOT ?= $(shell bash -c 'export MK_PATH=$(MK_PATH); echo $${MK_PATH%/L1/*}') -CUR_DIR := $(patsubst %/,%,$(dir $(MK_PATH))) +EXE_NAME := host.exe +EXE_OBJS := $(addprefix $(TEMP_DIR)/, $(addsuffix .o,$(basename $(HOST_SRCS)))) +EXE_FILE := $(BUILD_DIR)/$(EXE_NAME) +EXE_FILE_DEPS := $(EXE_OBJS) +MAKEDEPEND = $(CXX) $< -MM -MP -MF $(basename $@).d -MT $@ $(CXXFLAGS) + +HOST_ARGS := -len 1024 -num 16 -gld $(XFLIB_DIR)/L1/benchmarks/aes256CbcDecrypt_sc/data/gld.dat +ifneq ($(HOST_ARCH), x86) +PKG_HOST_ARGS = $(foreach args,$(HOST_ARGS),$(subst $(dir $(patsubst %/,%,$(args))),,$(args))) +endif + +########################## Kernel compiler global settings ########################## +VPP_FLAGS += -I $(XFLIB_DIR)/L1/include -I $(CUR_DIR)/kernel -I $(CUR_DIR)/host -I $(XFLIB_DIR)/L1/include + +######################### binary container global settings ########################## +VPP_FLAGS_hls_kernel += --hls.clock 300000000:hls_kernel +ifneq ($(HOST_ARCH), x86) +VPP_LDFLAGS_hls_kernel += --clock.defaultFreqHz 300000000 +else +VPP_LDFLAGS_hls_kernel += --kernel_frequency 300 +endif + +ifeq ($(HOST_ARCH), x86) +BINARY_CONTAINERS_TMP := $(BUILD_DIR)/$(TARGET).o +BINARY_CONTAINERS := $(BUILD_DIR)/$(TARGET).xclbin +ifeq ($(TARGET),sw_emu) + BINARY_CONTAINERS_TMP := +endif +else +# placeholder for non_x86 +endif + +.SECONDEXPANSION: +# ################ Setting Rules for Binary Containers (Building Kernels) ################ +ACC_SRCS_hls_kernel += $(CUR_DIR)/kernel/aes256CbcDecrypt_acc.cpp +ACC_OBJS_hls_kernel := $(addprefix $(TEMP_DIR)/, $(addsuffix .o,$(basename $(ACC_SRCS_hls_kernel)))) +$(ACC_OBJS_hls_kernel): $(TEMP_DIR)/%.o : %.cpp $$(@D)/.f + @echo "--> Making $@ from: $?" + $(MAKEDEPEND) + $(VPP) $(VPP_FLAGS) $(VPP_FLAGS_hls_kernel) -o $@ -c $< +BINARY_CONTAINERS_DEPS += $(ACC_OBJS_hls_kernel) +$(BINARY_CONTAINERS_TMP) : $(BINARY_CONTAINERS_DEPS) + @echo "--> Making $@ from: $?" + $(VPP) $(VPP_FLAGS) $(VPP_LDFLAGS) -o $(BINARY_CONTAINERS) -l $^ +EXE_FILE_DEPS += $(BINARY_CONTAINERS_TMP) +EXE_FILE_DEPS += $(BINARY_CONTAINERS_DEPS) + +############################## Setting Rules for Host (Building Host Executable) ############################## +ifeq ($(HOST_ARCH), x86) +$(TEMP_DIR)/%.o : %.cpp $$(@D)/.f + @echo "--> Making $@ from: $?" + mkdir -p $(BUILD_DIR) + $(MAKEDEPEND) + $(CXX) -o $@ $(CXXFLAGS) -I . -c $< +$(EXE_FILE): $(EXE_FILE_DEPS) + mkdir -p $(BUILD_DIR) + $(CXX) -o $@ $^ $(CXXFLAGS) $(LDFLAGS) +else +# place holder for arch64 +endif + +$(EMCONFIG): + emconfigutil --platform $(XPLATFORM) --od $(BUILD_DIR) + +%/.f: + mkdir -p $(dir $@) + touch $@ + +.PRECIOUS: %/.f + +RUN_DEPS += $(EXE_FILE) $(EMCONFIG) + +run: check_device $(RUN_DEPS) +#sw_emu +ifneq (,$(filter sw_emu, $(TARGET))) +ifeq ($(HOST_ARCH), x86) + LD_LIBRARY_PATH=$(LIBRARY_PATH):$$LD_LIBRARY_PATH \ + $(HOST_PREAMBLE) $(EXE_FILE) $(HOST_ARGS) + +else +# place holder for arch64 +endif +endif + +#hw_emu +ifneq (,$(filter hw_emu, $(TARGET))) +ifeq ($(HOST_ARCH), x86) + LD_LIBRARY_PATH=$(LIBRARY_PATH):$$LD_LIBRARY_PATH \ + $(HOST_PREAMBLE) $(EXE_FILE) $(HOST_ARGS) + +else +# place holder for arch64 +endif +endif + +#hw +ifeq ($(TARGET), hw) +ifeq ($(HOST_ARCH), x86) + LD_LIBRARY_PATH=$(LIBRARY_PATH):$$LD_LIBRARY_PATH \ + $(HOST_PREAMBLE) $(EXE_FILE) $(HOST_ARGS) + +else +# place holder for arch64 +endif +endif + +############################## Setting Targets ############################## + +.PHONY: all clean cleanall emconfig +emconfig: $(EMCONFIG) +ifeq ($(HOST_ARCH), x86) +all: check_vpp check_platform check_xrt $(EXE_FILE) $(BINARY_CONTAINERS) emconfig +else +all: check_vpp check_platform check_sysroot $(EXE_FILE) $(BINARY_CONTAINERS) emconfig sd_card +endif + +.PHONY: host xclbin +ifeq ($(HOST_ARCH), x86) +host: check_xrt $(EXE_FILE) +else +host: check_sysroot $(EXE_FILE) +endif +xclbin: $(BINARY_CONTAINERS_TMP) -# potential additional compile options, eg. adding extra -I directories -EXTRA_CFLAGS += -I kernel -I host -EXTRA_CFLAGS += -I$(XF_PROJ_ROOT)/L1/include +############################## Cleaning Rules ############################## +cleanh: + -$(RMDIR) $(EXE_FILE) vitis_* TempConfig system_estimate.xtxt *.rpt .run/ + -$(RMDIR) src/*.ll _xocc_* .Xil dltmp* xmltmp* *.log *.jou *.wcfg *.wdb sample_link.ini sample_compile.ini obj* bin* *.csv *.jpg *.jpeg *.png -EXTRA_VPPFLAGS = -g +cleank: + -$(RMDIR) $(BUILD_DIR)/*.xclbin _vimage *xclbin.run_summary qemu-memory-_* emulation/ _vimage/ pl*start_simulation. sh *.xclbin + -$(RMDIR) _x_temp.*/_x.* _x_temp.*/.Xil _x_temp.*/profile_summary.* xo_* _x* + -$(RMDIR) _x_temp.*/dltmp* _x_temp.*/kernel_info.dat _x_temp.*/*.log + -$(RMDIR) _x_temp.* -LIB_VPP := vpp_acc -include $(XILINX_VITIS)/data/system_compiler/examples/vpp_sc.mk +cleanall: cleanh cleank + -$(RMDIR) $(BUILD_DIR) build_dir.* emconfig.json *.html $(TEMP_DIR) $(CUR_DIR)/reports *.csv *.run_summary $(CUR_DIR)/*.raw package_* $(BUILD_DIR)/run_script.sh .ipcache *.str + -$(RMDIR) $(XFLIB_DIR)/common/data/*.xe2xd* $(XFLIB_DIR)/common/data/*.orig* -HOST_ARGS := -len 1024 -num 16 -gld $(CUR_DIR)/data/gld.dat -xclbin : build +clean: cleanh \ No newline at end of file diff --git a/security/L1/benchmarks/aes256CbcDecrypt_sc/description.json b/security/L1/benchmarks/aes256CbcDecrypt_sc/description.json index 1a92a9baa0..2c8fc37a62 100644 --- a/security/L1/benchmarks/aes256CbcDecrypt_sc/description.json +++ b/security/L1/benchmarks/aes256CbcDecrypt_sc/description.json @@ -1,46 +1,88 @@ { - "gui": false, - "name": "Xilinx AES256CBC Decryption SC Benchmark", - "description": "AES256 CBC Mode Decryption Benchmark with System Compiler", - "flow": "vitis", - "platform_type": "", - "platform_whitelist": [ - "u250", + "gui": false, + "name": "Xilinx AES256CBC Decryption SC Benchmark", + "description": "AES256 CBC Mode Decryption Benchmark with System Compiler", + "flow": "vitis", + "platform_type": "", + "platform_allowlist": [ + "u250", "u200" - ], - "platform_blacklist": [ + ], + "platform_blocklist": [ "xilinx_u250_xdma_201830_2", "xilinx_u200_xdma_201830_2", - "zc" + "zc", + "aws-vu9p-f1" + ], + "launch": [ + { + "cmd_args": "-len 1024 -num 16 -gld LIB_DIR/L1/benchmarks/aes256CbcDecrypt_sc/data/gld.dat", + "name": "generic launch for all flows" + } + ], + "host": { + "host_exe": "host.exe", + "compiler": { + "sources": [ + "host/main.cpp" + ], + "includepaths": [ + "LIB_DIR/L1/include", + "kernel" + ], + "options": "-O3" + } + }, + "v++": { + "compiler": { + "includepaths": [ + "LIB_DIR/L1/include", + "kernel", + "host" + ] + } + }, + "containers": [ + { + "accelerators": [ + { + "location": "kernel/aes256CbcDecrypt_acc.cpp", + "frequency": 300.0, + "name": "hls_kernel" + } + ], + "frequency": 300.0, + "name": "hls_kernel" + } ], "testinfo": { - "disable": false, + "disable": false, "jobs": [ { - "index": 0, - "dependency": [], - "env": "", - "cmd": "", + "index": 0, + "dependency": [], + "env": "", + "cmd": "", "max_memory_MB": { - "vitis_hw_build": 40960, - "vitis_hw_emu": 28672, - "vitis_sw_emu": 10240, + "vitis_hw_build": 40960, + "vitis_hw_emu": 28672, + "vitis_sw_emu": 10240, "vitis_hw_run": 10240 - }, + }, "max_time_min": { - "vitis_hw_build": 470, - "vitis_hw_emu": 470, - "vitis_sw_emu": 60, + "vitis_hw_build": 470, + "vitis_hw_emu": 470, + "vitis_sw_emu": 60, "vitis_hw_run": 10 } } - ], + ], "targets": [ - "vitis_sw_emu", - "vitis_hw_emu", - "vitis_hw_build", + "vitis_sw_emu", + "vitis_hw_emu", + "vitis_hw_build", "vitis_hw_run" - ], + ], "category": "canary" } } diff --git a/security/L1/benchmarks/aes256CbcDecrypt_sc/kernel/aes256CbcDecrypt_acc.cpp b/security/L1/benchmarks/aes256CbcDecrypt_sc/kernel/aes256CbcDecrypt_acc.cpp index bbdab87c40..2377fb6d74 100755 --- a/security/L1/benchmarks/aes256CbcDecrypt_sc/kernel/aes256CbcDecrypt_acc.cpp +++ b/security/L1/benchmarks/aes256CbcDecrypt_sc/kernel/aes256CbcDecrypt_acc.cpp @@ -15,7 +15,74 @@ */ #include "aes256CbcDecrypt_acc.hpp" +#include +#include +#include "xf_security/cbc.hpp" +#include "xf_security/msgpack.hpp" +#include "aes256CbcDecrypt_acc.hpp" + +#ifndef __SYNTHESIS +#include +#endif void aes256CbcDecrypt::compute(int hb_in_size, int hb_out_size, ap_uint<128>* hb_in, ap_uint<128>* hb_out) { hls_kernel(hb_in_size, hb_out_size, hb_in, hb_out); } + +void cbcWrapper(hls::stream >& plaintext, + hls::stream& plaintext_e, + hls::stream >& key, + hls::stream >& iv, + hls::stream >& res, + hls::stream& endRes, + ap_uint<64> msgNum) { + for (ap_uint<64> i = 0; i < msgNum; i++) { + xf::security::aes256CbcDecrypt(plaintext, plaintext_e, key, iv, res, endRes); + } +} + +void wrapper(ap_uint<128>* input, ap_uint<128>* output, ap_uint<64> msg_num, ap_uint<64> row_num) { +#pragma HLS dataflow + + hls::stream > textStrm; +#pragma HLS stream variable = textStrm depth = 128 +#pragma HLS resource variable = textStrm core = FIFO_LUTRAM + hls::stream endTextStrm; +#pragma HLS stream variable = endTextStrm depth = 128 +#pragma HLS resource variable = endTextStrm core = FIFO_LUTRAM + + hls::stream > keyStrm; +#pragma HLS stream variable = keyStrm depth = 4 +#pragma HLS resource variable = keyStrm core = FIFO_LUTRAM + + hls::stream > ivStrm; +#pragma HLS stream variable = ivStrm depth = 4 +#pragma HLS resource variable = ivStrm core = FIFO_LUTRAM + + hls::stream > lenStrm; +#pragma HLS stream variable = lenStrm depth = 4 +#pragma HLS resource variable = lenStrm core = FIFO_LUTRAM + + xf::security::internal::aesCbcPack<256> packer; + packer.scanPack(input, msg_num, row_num, textStrm, endTextStrm, keyStrm, ivStrm, lenStrm); + + hls::stream > resStrm; +#pragma HLS stream variable = resStrm depth = 128 +#pragma HLS resource variable = resStrm core = FIFO_LUTRAM + + hls::stream endResStrm; +#pragma HLS stream variable = endResStrm depth = 128 +#pragma HLS resource variable = endResStrm core = FIFO_LUTRAM + + cbcWrapper(textStrm, endTextStrm, keyStrm, ivStrm, resStrm, endResStrm, msg_num); + + packer.writeOutMsgPack(output, msg_num, resStrm, endResStrm, lenStrm); +} + +// @brief top of kernel +void aes256CbcDecrypt::hls_kernel(int hb_in_size, int hb_out_size, ap_uint<128>* hb_in, ap_uint<128>* hb_out) { + ap_uint<128> tmp = hb_in[0]; + ap_uint<64> msg_num = tmp.range(63, 0); + ap_uint<64> row_num = tmp.range(127, 64); + wrapper(hb_in, hb_out, msg_num, row_num); +} // end aes256CbcDecryptKernel diff --git a/security/L1/benchmarks/aes256CbcDecrypt_sc/kernel/aes256CbcDecrypt_kernel.cpp b/security/L1/benchmarks/aes256CbcDecrypt_sc/kernel/aes256CbcDecrypt_kernel.cpp deleted file mode 100644 index 46bf5395eb..0000000000 --- a/security/L1/benchmarks/aes256CbcDecrypt_sc/kernel/aes256CbcDecrypt_kernel.cpp +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Copyright 2019-2021 Xilinx, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * - * @file aes256CbcDecryptKernel.cpp - * @brief kernel code of Cipher Block Chaining (CBC) block cipher mode of operation. - * This file is part of Vitis Security Library. - * - * @detail Containing scan, distribute, encrypt, merge, and write-out functions. - * - */ - -#include -#include -#include "xf_security/cbc.hpp" -#include "xf_security/msgpack.hpp" -#include "aes256CbcDecrypt_acc.hpp" - -#ifndef __SYNTHESIS -#include -#endif - -void cbcWrapper(hls::stream >& plaintext, - hls::stream& plaintext_e, - hls::stream >& key, - hls::stream >& iv, - hls::stream >& res, - hls::stream& endRes, - ap_uint<64> msgNum) { - for (ap_uint<64> i = 0; i < msgNum; i++) { - xf::security::aes256CbcDecrypt(plaintext, plaintext_e, key, iv, res, endRes); - } -} - -void wrapper(ap_uint<128>* input, ap_uint<128>* output, ap_uint<64> msg_num, ap_uint<64> row_num) { -#pragma HLS dataflow - - hls::stream > textStrm; -#pragma HLS stream variable = textStrm depth = 128 -#pragma HLS resource variable = textStrm core = FIFO_LUTRAM - hls::stream endTextStrm; -#pragma HLS stream variable = endTextStrm depth = 128 -#pragma HLS resource variable = endTextStrm core = FIFO_LUTRAM - - hls::stream > keyStrm; -#pragma HLS stream variable = keyStrm depth = 4 -#pragma HLS resource variable = keyStrm core = FIFO_LUTRAM - - hls::stream > ivStrm; -#pragma HLS stream variable = ivStrm depth = 4 -#pragma HLS resource variable = ivStrm core = FIFO_LUTRAM - - hls::stream > lenStrm; -#pragma HLS stream variable = lenStrm depth = 4 -#pragma HLS resource variable = lenStrm core = FIFO_LUTRAM - - xf::security::internal::aesCbcPack<256> packer; - packer.scanPack(input, msg_num, row_num, textStrm, endTextStrm, keyStrm, ivStrm, lenStrm); - - hls::stream > resStrm; -#pragma HLS stream variable = resStrm depth = 128 -#pragma HLS resource variable = resStrm core = FIFO_LUTRAM - - hls::stream endResStrm; -#pragma HLS stream variable = endResStrm depth = 128 -#pragma HLS resource variable = endResStrm core = FIFO_LUTRAM - - cbcWrapper(textStrm, endTextStrm, keyStrm, ivStrm, resStrm, endResStrm, msg_num); - - packer.writeOutMsgPack(output, msg_num, resStrm, endResStrm, lenStrm); -} - -// @brief top of kernel -void aes256CbcDecrypt::hls_kernel(int hb_in_size, int hb_out_size, ap_uint<128>* hb_in, ap_uint<128>* hb_out) { - ap_uint<128> tmp = hb_in[0]; - ap_uint<64> msg_num = tmp.range(63, 0); - ap_uint<64> row_num = tmp.range(127, 64); - wrapper(hb_in, hb_out, msg_num, row_num); -} // end aes256CbcDecryptKernel diff --git a/security/L1/benchmarks/aes256CbcDecrypt_sc/utils.mk b/security/L1/benchmarks/aes256CbcDecrypt_sc/utils.mk index c2d86f799c..17354308c6 100644 --- a/security/L1/benchmarks/aes256CbcDecrypt_sc/utils.mk +++ b/security/L1/benchmarks/aes256CbcDecrypt_sc/utils.mk @@ -12,6 +12,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. +# vitis makefile-generator v2.0.4 # #+------------------------------------------------------------------------------- # The following parameters are assigned with default values. These parameters can @@ -39,17 +40,44 @@ ifeq ($(DEBUG), yes) VPP_LDFLAGS += --dk protocol:all:all:all endif -#Checks for XILINX_XRT -ifeq ($(HOST_ARCH), x86) -ifndef XILINX_XRT - XILINX_XRT = /opt/xilinx/xrt - export XILINX_XRT -endif -else +#Check environment setup ifndef XILINX_VITIS XILINX_VITIS = /opt/xilinx/Vitis/$(TOOL_VERSION) export XILINX_VITIS endif +ifndef XILINX_XRT + XILINX_XRT = /opt/xilinx/xrt + export XILINX_XRT +endif + +check_device: + @set -eu; \ + inallowlist=False; \ + inblocklist=False; \ + for dev in $(PLATFORM_ALLOWLIST); \ + do if [[ $$(echo $(PLATFORM_NAME) | grep $$dev) != "" ]]; \ + then inallowlist=True; fi; \ + done ;\ + for dev in $(PLATFORM_BLOCKLIST); \ + do if [[ $$(echo $(PLATFORM_NAME) | grep $$dev) != "" ]]; \ + then inblocklist=True; fi; \ + done ;\ + if [[ $$inallowlist == False ]]; \ + then echo "[Warning]: The device $(PLATFORM_NAME) not in allowlist."; \ + fi; \ + if [[ $$inblocklist == True ]]; \ + then echo "[ERROR]: The device $(PLATFORM_NAME) in blocklist."; exit 1;\ + fi; + +#get HOST_ARCH by PLATFORM +HOST_ARCH_temp = $(shell platforminfo -p $(PLATFORM) | grep 'CPU Type' | sed 's/.*://' | sed '/ai_engine/d' | sed 's/^[[:space:]]*//') +$(warning HOST_ARCH_temp:$(HOST_ARCH_temp)) +ifeq ($(HOST_ARCH_temp), x86) +HOST_ARCH := x86 +else ifeq ($(HOST_ARCH_temp), cortex-a9) +HOST_ARCH := aarch32 +else ifeq ($(HOST_ARCH_temp), cortex-a*) +HOST_ARCH := aarch64 endif #Checks for Device Family @@ -59,13 +87,18 @@ else ifeq ($(HOST_ARCH), aarch64) DEV_FAM = Ultrascale endif -B_NAME = $(shell dirname $(XPLATFORM)) - #Checks for Correct architecture ifneq ($(HOST_ARCH), $(filter $(HOST_ARCH),aarch64 aarch32 x86)) $(error HOST_ARCH variable not set, please set correctly and rerun) endif +check_version: +ifneq (, $(shell which git)) +ifneq (,$(wildcard $(XFLIB_DIR)/.git)) + @cd $(XFLIB_DIR) && git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit -n 1 && cd - +endif +endif + #Checks for SYSROOT check_sysroot: ifneq ($(HOST_ARCH), x86) @@ -74,25 +107,19 @@ ifndef SYSROOT endif endif -check_version: -ifneq (, $(shell which git)) -ifneq (,$(wildcard $(XFLIB_DIR)/.git)) - @cd $(XFLIB_DIR) && git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit -n 1 && cd - -endif -endif - #Checks for g++ CXX := g++ +CXX_REQ := $(shell echo $(GCC_INTOOL) | cut -f 1 -d ".") ifeq ($(HOST_ARCH), x86) -ifneq ($(shell expr $(shell g++ -dumpversion) \>= 5), 1) +ifneq ($(shell expr $(shell echo "__GNUG__" | g++ -E -x c++ - | tail -1) \>= $(CXX_REQ)), 1) ifndef XILINX_VIVADO -$(error [ERROR]: g++ version too old. Please use 5.0 or above) +$(error [ERROR]: g++ version too old. Please use $(CXX_REQ) or above) else -CXX := $(XILINX_VIVADO)/tps/lnx64/gcc-6.2.0/bin/g++ +CXX := $(XILINX_VIVADO)/tps/lnx64/gcc-$(GCC_INTOOL)/bin/g++ ifeq ($(LD_LIBRARY_PATH),) -export LD_LIBRARY_PATH := $(XILINX_VIVADO)/tps/lnx64/gcc-6.2.0/lib64 +export LD_LIBRARY_PATH := $(XILINX_VIVADO)/tps/lnx64/gcc-$(GCC_INTOOL)/lib64 else -export LD_LIBRARY_PATH := $(XILINX_VIVADO)/tps/lnx64/gcc-6.2.0/lib64:$(LD_LIBRARY_PATH) +export LD_LIBRARY_PATH := $(XILINX_VIVADO)/tps/lnx64/gcc-$(GCC_INTOOL)/lib64:$(LD_LIBRARY_PATH) endif $(warning [WARNING]: g++ version too old. Using g++ provided by the tool: $(CXX)) endif @@ -103,10 +130,20 @@ else ifeq ($(HOST_ARCH), aarch32) CXX := $(XILINX_VITIS)/gnu/aarch32/lin/gcc-arm-linux-gnueabi/bin/arm-linux-gnueabihf-g++ endif +#check binutils +BINUTILS := $(shell ld -v | cut -f 4 -d " " | cut -f 1 -d "-") +BINUTILS_REQ := $(BINUTILS_INTOOL) +ifneq ($(shell expr $(BINUTILS) \>= $(BINUTILS_REQ)), 1) +export PATH := $(XILINX_VIVADO)/tps/lnx64/binutils-$(BINUTILS_INTOOL)/bin:$(PATH) +endif + #Setting VPP VPP := v++ #Cheks for aiecompiler +AIECXX := aiecompiler +AIESIMULATOR := aiesimulator +X86SIMULATOR := x86simulator .PHONY: check_vivado check_vivado: @@ -122,11 +159,9 @@ endif .PHONY: check_xrt check_xrt: -ifeq ($(HOST_ARCH), x86) ifeq (,$(wildcard $(XILINX_XRT)/lib/libxilinxopencl.so)) @echo "Cannot locate XRT installation. Please set XILINX_XRT variable." && false endif -endif export PATH := $(XILINX_VITIS)/bin:$(XILINX_XRT)/bin:$(PATH) ifeq ($(HOST_ARCH), x86) @@ -135,82 +170,64 @@ LD_LIBRARY_PATH := $(XILINX_XRT)/lib else LD_LIBRARY_PATH := $(XILINX_XRT)/lib:$(LD_LIBRARY_PATH) endif -else # aarch64 -ifeq (,$(LD_LIBRARY_PATH)) -LD_LIBRARY_PATH := $(SYSROOT)/usr/lib -else -LD_LIBRARY_PATH := $(SYSROOT)/usr/lib:$(LD_LIBRARY_PATH) -endif endif -# check target -#ifeq ($(filter $(TARGET),sw_emu hw_emu hw),) -#$(error TARGET is not sw_emu, hw_emu or hw) -#endif - -ifneq (,$(wildcard $(DEVICE))) -# Use DEVICE as a file path -XPLATFORM := $(DEVICE) +ifneq (,$(wildcard $(PLATFORM))) +# Use PLATFORM as a file path +XPLATFORM := $(PLATFORM) else -# Use DEVICE as a file name pattern +# Use PLATFORM as a file name pattern # 1. search paths specified by variable ifneq (,$(PLATFORM_REPO_PATHS)) # 1.1 as exact name -XPLATFORM := $(strip $(foreach p, $(subst :, ,$(PLATFORM_REPO_PATHS)), $(wildcard $(p)/$(DEVICE)/$(DEVICE).xpfm))) +XPLATFORM := $(strip $(foreach p, $(subst :, ,$(PLATFORM_REPO_PATHS)), $(wildcard $(p)/$(PLATFORM)/$(PLATFORM).xpfm))) # 1.2 as a pattern ifeq (,$(XPLATFORM)) XPLATFORMS := $(foreach p, $(subst :, ,$(PLATFORM_REPO_PATHS)), $(wildcard $(p)/*/*.xpfm)) -XPLATFORM := $(strip $(foreach p, $(XPLATFORMS), $(shell echo $(p) | awk '$$1 ~ /$(DEVICE)/'))) +XPLATFORM := $(strip $(foreach p, $(XPLATFORMS), $(shell echo $(p) | awk '$$1 ~ /$(PLATFORM)/'))) endif # 1.2 endif # 1 # 2. search Vitis installation ifeq (,$(XPLATFORM)) # 2.1 as exact name -XPLATFORM := $(strip $(wildcard $(XILINX_VITIS)/platforms/$(DEVICE)/$(DEVICE).xpfm)) +XPLATFORM := $(strip $(wildcard $(XILINX_VITIS)/platforms/$(PLATFORM)/$(PLATFORM).xpfm)) # 2.2 as a pattern ifeq (,$(XPLATFORM)) XPLATFORMS := $(wildcard $(XILINX_VITIS)/platforms/*/*.xpfm) -XPLATFORM := $(strip $(foreach p, $(XPLATFORMS), $(shell echo $(p) | awk '$$1 ~ /$(DEVICE)/'))) +XPLATFORM := $(strip $(foreach p, $(XPLATFORMS), $(shell echo $(p) | awk '$$1 ~ /$(PLATFORM)/'))) endif # 2.2 endif # 2 # 3. search default locations ifeq (,$(XPLATFORM)) # 3.1 as exact name -XPLATFORM := $(strip $(wildcard /opt/xilinx/platforms/$(DEVICE)/$(DEVICE).xpfm)) +XPLATFORM := $(strip $(wildcard /opt/xilinx/platforms/$(PLATFORM)/$(PLATFORM).xpfm)) # 3.2 as a pattern ifeq (,$(XPLATFORM)) XPLATFORMS := $(wildcard /opt/xilinx/platforms/*/*.xpfm) -XPLATFORM := $(strip $(foreach p, $(XPLATFORMS), $(shell echo $(p) | awk '$$1 ~ /$(DEVICE)/'))) +XPLATFORM := $(strip $(foreach p, $(XPLATFORMS), $(shell echo $(p) | awk '$$1 ~ /$(PLATFORM)/'))) endif # 3.2 endif # 3 endif define MSG_PLATFORM -No platform matched pattern '$(DEVICE)'. +No platform matched pattern '$(PLATFORM)'. Available platforms are: $(XPLATFORMS) -To add more platform directories, set the PLATFORM_REPO_PATHS variable or point DEVICE variable to the full path of platform .xpfm file. +To add more platform directories, set the PLATFORM_REPO_PATHS variable or point PLATFORM variable to the full path of platform .xpfm file. endef export MSG_PLATFORM -define MSG_DEVICE -More than one platform matched: $(XPLATFORM) -Please set DEVICE variable more accurately to select only one platform file, or set DEVICE variable to the full path of the platform .xpfm file. -endef -export MSG_DEVICE .PHONY: check_platform check_platform: ifeq (,$(XPLATFORM)) @echo "$${MSG_PLATFORM}" && false endif -ifneq (,$(word 2,$(XPLATFORM))) - @echo "$${MSG_DEVICE}" && false -endif #Check ends # device2xsa - create a filesystem friendly name from device name # $(1) - full name of device -device2xsa = $(strip $(patsubst %.xpfm, % , $(shell basename $(DEVICE)))) +PLATFORM_NAME = $(strip $(patsubst %.xpfm, % , $(shell basename $(PLATFORM)))) + # Cleaning stuff RM = rm -f diff --git a/security/L1/benchmarks/aes256CbcEncrypt/Makefile b/security/L1/benchmarks/aes256CbcEncrypt/Makefile index b32c3794b7..2006853b8e 100644 --- a/security/L1/benchmarks/aes256CbcEncrypt/Makefile +++ b/security/L1/benchmarks/aes256CbcEncrypt/Makefile @@ -1,5 +1,4 @@ -# -# Copyright 2019-2021 Xilinx, Inc. +# Copyright 2019-2022 Xilinx, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -12,16 +11,32 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -# makefile-generator v1.0.4 -# +# vitis makefile-generator v2.0.6 -# ####################################### Help Section ##################################### +############################## Help Section ############################## .PHONY: help help:: $(ECHO) "Makefile Usage:" - $(ECHO) " make all TARGET= DEVICE= HOST_ARCH=" + $(ECHO) " make all TARGET= PLATFORM= HOST_ARCH=" $(ECHO) " Command to generate the design for specified Target and Shell." + $(ECHO) " By default, HOST_ARCH=x86. HOST_ARCH is required for SoC shells" + $(ECHO) "" + $(ECHO) " make run TARGET= PLATFORM= HOST_ARCH=" + $(ECHO) " Command to run application in emulation." + $(ECHO) " By default, HOST_ARCH=x86. HOST_ARCH required for SoC shells" + $(ECHO) "" + $(ECHO) " make xclbin TARGET= PLATFORM= HOST_ARCH=" + $(ECHO) " Command to build xclbin application." + $(ECHO) " By default, HOST_ARCH=x86. HOST_ARCH is required for SoC shells" + $(ECHO) "" + $(ECHO) " make host TARGET=" + $(ECHO) " Command to build host application." + $(ECHO) " By default, HOST_ARCH=x86. HOST_ARCH is required for SoC shells" + $(ECHO) "" + $(ECHO) " NOTE: For embedded devices, e.g. zcu102/zcu104/vck190, env variable SYSROOT and EDGE_COMMON_SW need to be set first, and HOST_ARCH is either aarch32 or aarch64. For example," + $(ECHO) " export SYSROOT=< path-to-platform-sysroot >" + $(ECHO) " export EDGE_COMMON_SW=< path-to-rootfs-and-Image-files >" $(ECHO) "" $(ECHO) " make clean " $(ECHO) " Command to remove the generated non-hardware files." @@ -29,199 +44,300 @@ help:: $(ECHO) " make cleanall" $(ECHO) " Command to remove all the generated files." $(ECHO) "" - $(ECHO) " make run TARGET= DEVICE= HOST_ARCH=" - $(ECHO) " Command to run application in emulation or on board." - $(ECHO) "" - $(ECHO) " make build TARGET= DEVICE= HOST_ARCH=" - $(ECHO) " Command to build xclbin application." - $(ECHO) "" - $(ECHO) " make host HOST_ARCH=" - $(ECHO) " Command to build host application." - $(ECHO) "" -# ##################### Setting up default value of TARGET ########################## -TARGET ?= sw_emu +############################## Setting up Project Variables ############################## -# ################### Setting up default value of DEVICE ############################## -DEVICE ?= xilinx_u250_gen3x16_xdma_3_1_202020_1 +MK_PATH := $(abspath $(lastword $(MAKEFILE_LIST))) +XF_PROJ_ROOT ?= $(shell bash -c 'export MK_PATH=$(MK_PATH); echo $${MK_PATH%/L1/*}') +CUR_DIR := $(patsubst %/,%,$(dir $(MK_PATH))) +XFLIB_DIR = $(XF_PROJ_ROOT) -# ###################### Setting up default value of HOST_ARCH ####################### +# setting devault value +TARGET ?= sw_emu HOST_ARCH ?= x86 -# #################### Checking if DEVICE in blacklist ############################# -ifeq ($(findstring zc, $(DEVICE)), zc) -$(error [ERROR]: This project is not supported for $(DEVICE).) +#setting PLATFORM +ifeq ($(PLATFORM),) +PLATFORM := $(DEVICE) endif - -# #################### Checking if DEVICE in whitelist ############################ -ifneq ($(findstring xilinx_u250_xdma_201830_2, $(DEVICE)), xilinx_u250_xdma_201830_2) -$(warning [WARNING]: This project has not been tested for $(DEVICE). It may or may not work.) +ifeq ($(PLATFORM),) +PLATFORM := xilinx_u250_gen3x16_xdma_4_1_202210_1 endif -# ######################## Setting up Project Variables ################################# -MK_PATH := $(abspath $(lastword $(MAKEFILE_LIST))) -XF_PROJ_ROOT ?= $(shell bash -c 'export MK_PATH=$(MK_PATH); echo $${MK_PATH%/L1/*}') -CUR_DIR := $(patsubst %/,%,$(dir $(MK_PATH))) -XFLIB_DIR = $(XF_PROJ_ROOT) +# #################### Checking if PLATFORM in whitelist ############################ +PLATFORM_ALLOWLIST += u250 +PLATFORM_BLOCKLIST += zc aws-vu9p-f1 -# ######################### Include environment variables in utils.mk #################### include ./utils.mk -XDEVICE := $(call device2xsa, $(DEVICE)) -TEMP_DIR := _x_temp.$(TARGET).$(XDEVICE) -TEMP_REPORT_DIR := $(CUR_DIR)/reports/_x.$(TARGET).$(XDEVICE) -BUILD_DIR := build_dir.$(TARGET).$(XDEVICE) -BUILD_REPORT_DIR := $(CUR_DIR)/reports/_build.$(TARGET).$(XDEVICE) -EMCONFIG_DIR := $(BUILD_DIR) +TEMP_DIR := _x_temp.$(TARGET).$(PLATFORM_NAME) +TEMP_REPORT_DIR := $(CUR_DIR)/reports/_x.$(TARGET).$(PLATFORM_NAME) +BUILD_DIR := build_dir.$(TARGET).$(PLATFORM_NAME) +ifneq ($(RESULT_DIR),) +BUILD_DIR = $(RESULT_DIR) +endif +BUILD_REPORT_DIR := $(CUR_DIR)/reports/_build.$(TARGET).$(PLATFORM_NAME) +EMCONFIG := $(BUILD_DIR)/emconfig.json XCLBIN_DIR := $(CUR_DIR)/$(BUILD_DIR) export XCL_BINDIR = $(XCLBIN_DIR) -# ######################### Setting up Host Variables ######################### -#Include Required Host Source Files -HOST_SRCS += $(CUR_DIR)/host/main.cpp -HOST_SRCS += $(XFLIB_DIR)/ext/xcl2/xcl2.cpp -CXXFLAGS += -I$(XFLIB_DIR)/L1/include -CXXFLAGS += -I$(CUR_DIR)/host -CXXFLAGS += -I$(CUR_DIR)/kernel -CXXFLAGS += -I$(XFLIB_DIR)/ext/xcl2 -CXXFLAGS += -I$(XFLIB_DIR)/../utils/L1/include -CXXFLAGS += -I$(XFLIB_DIR)/ext/xcl2 - +EXE_FILE_DEPS := +BINARY_CONTAINERS_DEPS := +RUN_DEPS := +# get global setting +ifeq ($(HOST_ARCH), x86) +CXXFLAGS += -fmessage-length=0 -I$(CUR_DIR)/src/ -I$(XILINX_XRT)/include -I$(XILINX_HLS)/include -std=c++14 -O3 -Wall -Wno-unknown-pragmas -Wno-unused-label +LDFLAGS += -pthread -L$(XILINX_XRT)/lib -L$(XILINX_HLS)/lnx64/tools/fpo_v7_0 -Wl,--as-needed -lOpenCL -lxrt_coreutil -lgmp -lmpfr -lIp_floating_point_v7_0_bitacc_cmodel +VPP_FLAGS += -t $(TARGET) --platform $(XPLATFORM) --save-temps +VPP_LDFLAGS += --optimize 2 -R 2 +else ifeq ($(HOST_ARCH), aarch64) +CXXFLAGS += -I$(CUR_DIR)/src/ -fmessage-length=0 --sysroot=$(SYSROOT) -I$(SYSROOT)/usr/include/xrt -I$(XILINX_HLS)/include -std=c++14 -O3 -Wall -Wno-unknown-pragmas -Wno-unused-label +LDFLAGS += -pthread -L$(SYSROOT)/usr/lib -L$(XILINX_VITIS_AIETOOLS)/lib/aarch64.o -Wl,--as-needed -lxilinxopencl -lxrt_coreutil +VPP_FLAGS += -t $(TARGET) --platform $(XPLATFORM) --save-temps +VPP_LDFLAGS += --optimize 2 -R 2 +endif +CXXFLAGS += $(EXTRA_CXXFLAGS) +VPP_FLAGS += $(EXTRA_VPP_FLAGS) +########################## Setting up Host Variables ########################## ifeq ($(TARGET),sw_emu) CXXFLAGS += -D SW_EMU_TEST endif - ifeq ($(TARGET),hw_emu) CXXFLAGS += -D HW_EMU_TEST endif -# ######################### Host compiler global settings ############################ -CXXFLAGS += -I$(XILINX_XRT)/include -I$(XILINX_HLS)/include -std=c++11 -O3 -Wall -Wno-unknown-pragmas -Wno-unused-label -LDFLAGS += -L$(XILINX_XRT)/lib -lOpenCL -lpthread -lrt -Wno-unused-label -Wno-narrowing -DVERBOSE -CXXFLAGS += -fmessage-length=0 -O3 -CXXFLAGS += -I$(CUR_DIR)/src/ - -ifeq ($(HOST_ARCH), x86) -LDFLAGS += -L$(XILINX_HLS)/lnx64/tools/fpo_v7_0 -Wl,--as-needed -lgmp -lmpfr -lIp_floating_point_v7_0_bitacc_cmodel +ifeq (,$(findstring opencv,$(CXXFLAGS))) +CXXFLAGS += $(XRT_CXXFLAGS) endif + +#Inclue Required Host Source Files ifneq (,$(shell echo $(XPLATFORM) | awk '/u250/')) -CXXFLAGS += -D USE_DDR +HOST_SRCS += $(CUR_DIR)/host/main.cpp $(XFLIB_DIR)/ext/xcl2/xcl2.cpp +CXXFLAGS += -D USE_DDR +CXXFLAGS += -I $(XFLIB_DIR)/L1/include -I $(CUR_DIR)/host -I $(CUR_DIR)/kernel -I $(XFLIB_DIR)/ext/xcl2 -I $(XFLIB_DIR)/../utils/L1/include -I $(XFLIB_DIR)/ext/xcl2 +CXXFLAGS += -O3 + else ifneq (,$(shell echo $(XPLATFORM) | awk '/vck190/')) -CXXFLAGS += -I$(SYSROOT)/usr/include +HOST_SRCS += $(CUR_DIR)/host/main.cpp $(XFLIB_DIR)/ext/xcl2/xcl2.cpp +CXXFLAGS += -I $(SYSROOT)/usr/include -I $(XFLIB_DIR)/L1/include -I $(CUR_DIR)/host -I $(CUR_DIR)/kernel -I $(XFLIB_DIR)/ext/xcl2 -I $(XFLIB_DIR)/../utils/L1/include -I $(XFLIB_DIR)/ext/xcl2 CXXFLAGS += --sysroot=$(SYSROOT) -LDFLAGS += -L$(SYSROOT)/usr/lib -LDFLAGS += -L${SYSROOT}/opt/xilinx/xrt/lib -endif +LDFLAGS += -L $(SYSROOT)/usr/lib -L ${SYSROOT}/opt/xilinx/xrt/lib -# ################### Setting package and image directory ####################### +else +HOST_SRCS += $(CUR_DIR)/host/main.cpp $(XFLIB_DIR)/ext/xcl2/xcl2.cpp +CXXFLAGS += -I $(XFLIB_DIR)/L1/include -I $(CUR_DIR)/host -I $(CUR_DIR)/kernel -I $(XFLIB_DIR)/ext/xcl2 -I $(XFLIB_DIR)/../utils/L1/include -I $(XFLIB_DIR)/ext/xcl2 +CXXFLAGS += -O3 +endif EXE_NAME := aes256CbcEncryptBenchmark.exe EXE_FILE := $(BUILD_DIR)/$(EXE_NAME) -HOST_ARGS := -mode fpga -xclbin $(BUILD_DIR)/aes256CbcEncryptKernel.xclbin -len 1024 -num 16 -gld $(CUR_DIR)/data/gld.dat +EXE_FILE_DEPS := $(HOST_SRCS) $(EXE_FILE_DEPS) -# ##################### Kernel compiler global settings ########################## -VPP_FLAGS += -t $(TARGET) --platform $(XPLATFORM) --save-temps --optimize 2 -VPP_FLAGS += --hls.jobs 8 -VPP_LDFLAGS += --vivado.synth.jobs 8 --vivado.impl.jobs 8 -ifneq (,$(shell echo $(XPLATFORM) | awk '/u250/')) -VPP_FLAGS += --config $(CUR_DIR)/conn_u250.cfg +HOST_ARGS := -mode fpga -xclbin $(BUILD_DIR)/aes256CbcEncryptKernel.xclbin -len 1024 -num 16 -gld $(CUR_DIR)/data/gld.dat +ifneq ($(HOST_ARCH), x86) +PKG_HOST_ARGS = $(foreach args,$(HOST_ARGS),$(subst $(dir $(patsubst %/,%,$(args))),,$(args))) endif -VPP_FLAGS += -I$(XFLIB_DIR)/L1/include - -VPP_FLAGS += -I$(XFLIB_DIR)/L1/include -VPP_FLAGS += -I$(CUR_DIR)/kernel - -aes256CbcEncryptKernel_VPP_FLAGS += --hls.clock 300000000:aes256CbcEncryptKernel -VPP_LDFLAGS_aes256CbcEncryptKernel += --kernel_frequency 300 - - -# Kernel args - -# ############################ Declaring Binary Containers ########################## - -BINARY_CONTAINERS += $(BUILD_DIR)/aes256CbcEncryptKernel.xclbin -BINARY_CONTAINER_aes256CbcEncryptKernel_OBJS += $(TEMP_DIR)/aes256CbcEncryptKernel.xo +########################## Kernel compiler global settings ########################## +ifneq (,$(shell echo $(XPLATFORM) | awk '/u250/')) +VPP_FLAGS += --config $(CUR_DIR)/conn_u250.cfg +VPP_FLAGS += -I $(XFLIB_DIR)/L1/include -I $(CUR_DIR)/kernel -I $(XFLIB_DIR)/L1/include -# ######################### Setting Targets of Makefile ################################ -DATA_FILE += $(CUR_DIR)//data/gld.dat +else +VPP_FLAGS += -I $(XFLIB_DIR)/L1/include -I $(CUR_DIR)/kernel -I $(XFLIB_DIR)/L1/include -.PHONY: all clean cleanall docs emconfig -ifeq ($(HOST_ARCH), x86) -all: check_version check_vpp check_platform check_xrt $(EXE_FILE) $(BINARY_CONTAINERS) emconfig -else -all: check_version check_vpp check_platform check_sysroot $(EXE_FILE) $(BINARY_CONTAINERS) emconfig sd_card endif -.PHONY: host -ifeq ($(HOST_ARCH), x86) -host: check_xrt $(EXE_FILE) +######################### binary container global settings ########################## +VPP_FLAGS_aes256CbcEncryptKernel += --hls.clock 300000000:aes256CbcEncryptKernel +ifneq ($(HOST_ARCH), x86) +VPP_LDFLAGS_aes256CbcEncryptKernel += --clock.defaultFreqHz 300000000 else -host: check_sysroot $(EXE_FILE) +VPP_LDFLAGS_aes256CbcEncryptKernel += --kernel_frequency 300 endif -.PHONY: xclbin ifeq ($(HOST_ARCH), x86) -xclbin: check_vpp check_xrt $(BINARY_CONTAINERS) +BINARY_CONTAINERS += $(BUILD_DIR)/aes256CbcEncryptKernel.xclbin else -xclbin: check_vpp check_sysroot $(BINARY_CONTAINERS) +BINARY_CONTAINERS += $(BUILD_DIR)/aes256CbcEncryptKernel_pkg.$(LINK_TARGET_FMT) +BINARY_CONTAINERS_PKG += $(BUILD_DIR)/aes256CbcEncryptKernel.xclbin endif -.PHONY: build -build: xclbin - # ################ Setting Rules for Binary Containers (Building Kernels) ################ -$(TEMP_DIR)/aes256CbcEncryptKernel.xo: $(CUR_DIR)/kernel/aes256CbcEncryptKernel.cpp +$(TEMP_DIR)/aes256CbcEncryptKernel.xo: $(CUR_DIR)/kernel/aes256CbcEncryptKernel.cpp $(ECHO) "Compiling Kernel: aes256CbcEncryptKernel" mkdir -p $(TEMP_DIR) - $(VPP) -c $(aes256CbcEncryptKernel_VPP_FLAGS) $(VPP_FLAGS) -k aes256CbcEncryptKernel -I'$(> $(RUN_SCRIPT) +ifneq ($(filter sw_emu hw_emu, $(TARGET)),) + @echo 'export XCL_EMULATION_MODE=$(TARGET)' >> $(RUN_SCRIPT) +endif + @echo 'export XILINX_VITIS=/mnt' >> $(RUN_SCRIPT) + @echo 'export XILINX_XRT=/usr' >> $(RUN_SCRIPT) + @echo 'if [ -f platform_desc.txt ]; then' >> $(RUN_SCRIPT) + @echo ' cp platform_desc.txt /etc/xocl.txt' >> $(RUN_SCRIPT) + @echo 'fi' >> $(RUN_SCRIPT) + @echo './$(EXE_NAME) $(PKG_HOST_ARGS)' >> $(RUN_SCRIPT) + @echo 'return_code=$$?' >> $(RUN_SCRIPT) + @echo 'if [ $$return_code -ne 0 ]; then' >> $(RUN_SCRIPT) + @echo ' echo "ERROR: Embedded host run failed, RC=$$return_code"' >> $(RUN_SCRIPT) + @echo 'else' >> $(RUN_SCRIPT) + @echo ' echo "INFO: TEST PASSED, RC=0"' >> $(RUN_SCRIPT) + @echo 'fi' >> $(RUN_SCRIPT) + @echo 'echo "INFO: Embedded host run completed."' >> $(RUN_SCRIPT) + @echo 'exit $$return_code' >> $(RUN_SCRIPT) +DATA_FILE := $(CUR_DIR)//data/gld.dat +DATA_DIR := +SD_FILES += $(RUN_SCRIPT) +SD_FILES += $(EXE_FILE) +SD_FILES += $(EMCONFIG) +SD_FILES += xrt.ini +SD_FILES += $(DATA_FILE)# where define DATAFILE in json +SD_FILES_WITH_PREFIX = $(foreach sd_file,$(SD_FILES), $(if $(filter $(sd_file),$(wildcard $(sd_file))), --package.sd_file $(sd_file))) +SD_DIRS_WITH_PREFIX = $(foreach sd_dir,$(DATA_DIR),--package.sd_dir $(sd_dir)) +PACKAGE_FILES := $(BINARY_CONTAINERS) +PACKAGE_FILES += $(AIE_CONTAINER) +SD_CARD := $(CUR_DIR)/package_$(TARGET) +vck190_dfx_hw := false +$(SD_CARD): $(EXE_FILE) $(BINARY_CONTAINERS) $(RUN_SCRIPT) $(EMCONFIG) + @echo "Generating sd_card folder...." + mkdir -p $(SD_CARD) + chmod a+rx $(BUILD_DIR)/run_script.sh +ifneq (,$(findstring vck190_base_dfx, $(PLATFORM_NAME))) +ifeq ($(TARGET),hw) + $(VPP) -t $(TARGET) --platform $(XPLATFORM) -p $(PACKAGE_FILES) -o $(BINARY_CONTAINERS_PKG) + $(VPP) -t $(TARGET) --platform $(XPLATFORM) -p --package.out_dir $(SD_CARD) --package.rootfs $(SYSROOT)/../../rootfs.ext4 --package.kernel_image $(K_IMAGE) $(SD_FILES_WITH_PREFIX) $(SD_DIRS_WITH_PREFIX) --package.sd_file $(BINARY_CONTAINERS_PKG) + @echo "### ***** sd_card generation done! ***** ###" +vck190_dfx_hw := true +endif +endif +ifeq ($(vck190_dfx_hw), false) + $(VPP) -t $(TARGET) --platform $(XPLATFORM) -o $(BINARY_CONTAINERS_PKG) -p $(PACKAGE_FILES) $(VPP_PACKAGE) --package.out_dir $(SD_CARD) --package.rootfs $(SYSROOT)/../../rootfs.ext4 --package.kernel_image $(K_IMAGE) $(SD_FILES_WITH_PREFIX) $(SD_DIRS_WITH_PREFIX) + @echo "### ***** sd_card generation done! ***** ###" +endif +.PHONY: sd_card +sd_card: $(SD_CARD) +endif +############################## Setting Essential Checks and Building Rules ############################## +RUN_DEPS += $(EXE_FILE) $(BINARY_CONTAINERS) $(EMCONFIG) +RUN_DEPS += $(SD_CARD) -# ###############Setting Essential Checks And Running Rules For Vitis Flow ############# +.PHONY: mkflag all run +mkflag: + mkdir -p $(BUILD_DIR) + rm -rf $(BUILD_DIR)/makefile_args.txt + @for var in $(MAKEFLAGS); do echo $$var >> $(BUILD_DIR)/makefile_args.txt; done +all: check_device check_vpp check_platform mkflag $(RUN_DEPS) run: all -ifeq ($(TARGET),$(filter $(TARGET),sw_emu hw_emu)) - $(CP) $(EMCONFIG_DIR)/emconfig.json . +#hw_emu +ifneq (,$(filter hw_emu, $(TARGET))) +ifeq ($(HOST_ARCH), x86) + LD_LIBRARY_PATH=$(LIBRARY_PATH):$$LD_LIBRARY_PATH \ XCL_EMULATION_MODE=$(TARGET) $(EXE_FILE) $(HOST_ARGS) + else + @echo $(RUN_DEPS) + $(SD_CARD)/launch_$(TARGET).sh -no-reboot -run-app $(notdir $(RUN_SCRIPT)) + grep "TEST PASSED, RC=0" $(SD_CARD)/qemu_output.log || exit 1 + +endif +endif +#sw_emu +ifneq (,$(filter sw_emu, $(TARGET))) +ifeq ($(HOST_ARCH), x86) + LD_LIBRARY_PATH=$(LIBRARY_PATH):$$LD_LIBRARY_PATH \ + XCL_EMULATION_MODE=$(TARGET) $(EXE_FILE) $(HOST_ARGS) + +else + @echo $(RUN_DEPS) + $(SD_CARD)/launch_$(TARGET).sh -no-reboot -run-app $(notdir $(RUN_SCRIPT)) + grep "TEST PASSED, RC=0" $(SD_CARD)/qemu_output.log || exit 1 + +endif +endif +#hw +ifeq ($(TARGET), hw) +ifneq (,$(findstring aws-vu9p-f1, $(PLATFORM_NAME))) +ifneq ($(JENKINS_INTERNAL_BUILD), 1) + $(ECHO) "This makefile does not directly support converting .xclbin to .awsxclbin, please refer https://github.com/aws/aws-fpga/blob/master/Vitis/README.md for next operations" +else + $(ECHO) "Running inside Xilinx regression without converting to .awsxclbin" + $(EXE_FILE) $(HOST_ARGS) + +endif +else ifeq ($(HOST_ARCH), x86) $(EXE_FILE) $(HOST_ARGS) + +else + $(ECHO) "Please copy the content of sd_card folder and data to an SD Card and run on the board" +endif endif -# ################################# Cleaning Rules ################################## +############################## Setting Targets ############################## + +.PHONY: clean cleanall emconfig +emconfig: $(EMCONFIG) + +.PHONY: host +ifeq ($(HOST_ARCH), x86) +host: check_xrt $(EXE_FILE) +else +host: check_sysroot $(EXE_FILE) +endif + +.PHONY: xclbin +ifeq ($(HOST_ARCH), x86) +xclbin: check_vpp check_xrt $(BINARY_CONTAINERS) +else +xclbin: check_vpp check_sysroot $(BINARY_CONTAINERS) +endif + +############################## Cleaning Rules ############################## cleanh: -$(RMDIR) $(EXE_FILE) vitis_* TempConfig system_estimate.xtxt *.rpt .run/ - -$(RMDIR) src/*.ll _xocc_* .Xil dltmp* xmltmp* *.log *.jou *.wcfg *.wdb sample_link.ini sample_compile.ini obj* bin* *.csv *.jpg *.jpeg *.png + -$(RMDIR) src/*.ll _xocc_* .Xil dltmp* xmltmp* *.log *.jou *.wcfg *.wdb sample_link.ini sample_compile.ini obj* bin* *.csv *.jpg *.jpeg *.png cleank: - -$(RMDIR) $(BUILD_DIR)/*.xclbin _vimage *xclbin.run_summary qemu-memory-_* emulation/ _vimage/ start_simulation.sh *.xclbin + -$(RMDIR) $(BUILD_DIR)/*.xclbin _vimage *xclbin.run_summary qemu-memory-_* emulation/ _vimage/ pl*start_simulation. sh *.xclbin -$(RMDIR) _x_temp.*/_x.* _x_temp.*/.Xil _x_temp.*/profile_summary.* xo_* _x* - -$(RMDIR) _x_temp.*/dltmp* _x_temp.*/kernel_info.dat _x_temp.*/*.log + -$(RMDIR) _x_temp.*/dltmp* _x_temp.*/kernel_info.dat _x_temp.*/*.log -$(RMDIR) _x_temp.* cleanall: cleanh cleank - -$(RMDIR) $(BUILD_DIR) build_dir.* emconfig.json *.html $(TEMP_DIR) $(CUR_DIR)/reports *.csv *.run_summary $(CUR_DIR)/*.raw package_* run_script.sh .ipcache *.str - -$(RMDIR) $(XFLIB_DIR)/common/data/*.xe2xd* $(XFLIB_DIR)/common/data/*.orig* - - -$(RMDIR) $(AIE_CONTAINERS) $(CUR_DIR)/Work $(CUR_DIR)/*.xpe $(CUR_DIR)/hw.o $(CUR_DIR)/*.xsa $(CUR_DIR)/xnwOut aiesimulator_output .AIE_SIM_CMD_LINE_OPTIONS + -$(RMDIR) $(BUILD_DIR) emconfig.json *.html $(TEMP_DIR) $(CUR_DIR)/reports *.csv *.run_summary $(CUR_DIR)/*.raw package_* $(BUILD_DIR)/run_script.sh .ipcache *.str + -$(RMDIR) $(CUR_DIR)/Work $(CUR_DIR)/*.xpe $(CUR_DIR)/hw.o $(CUR_DIR)/*.xsa $(CUR_DIR)/xnwOut -clean: cleanh +clean: cleanh \ No newline at end of file diff --git a/security/L1/benchmarks/aes256CbcEncrypt/README.md b/security/L1/benchmarks/aes256CbcEncrypt/README.md index 81eb7fbfed..eff1a7524f 100644 --- a/security/L1/benchmarks/aes256CbcEncrypt/README.md +++ b/security/L1/benchmarks/aes256CbcEncrypt/README.md @@ -18,12 +18,6 @@ The steps for library download and environment setup can be found in :ref:`l1_vi * **Build kernel(Step 2)** -Please check you've installed openSSL and make sure that its version is 1.0.2 or higher. Command to check openSSL version: - -``` - openssl version -``` - Run the following make command to build your XCLBIN and host binary targeting a specific device. Please be noticed that this process will take a long time, maybe couple of hours. ``` diff --git a/security/L1/benchmarks/aes256CbcEncrypt/description.json b/security/L1/benchmarks/aes256CbcEncrypt/description.json index db7a88c728..1d18ca34c0 100644 --- a/security/L1/benchmarks/aes256CbcEncrypt/description.json +++ b/security/L1/benchmarks/aes256CbcEncrypt/description.json @@ -1,15 +1,16 @@ { - "gui": true, - "name": "Xilinx AES256CBC Encryption Benchmark", - "description": "AES256 CBC Mode Encryption Benchmark", - "flow": "vitis", - "platform_type": "", - "platform_whitelist": [ - "xilinx_u250_xdma_201830_2" - ], - "platform_blacklist": [ - "zc" - ], + "gui": true, + "name": "Xilinx AES256CBC Encryption Benchmark", + "description": "AES256 CBC Mode Encryption Benchmark", + "flow": "vitis", + "platform_type": "", + "platform_allowlist": [ + "u250" + ], + "platform_blocklist": [ + "zc", + "aws-vu9p-f1" + ], "platform_properties": { "u250": { "host": { @@ -18,123 +19,123 @@ "USE_DDR" ] } - }, + }, "v++": { "compiler": { - "cflags": [ + "clflags": [ "--config PROJECT/conn_u250.cfg" ] } } - }, + }, "vck190": { "host": { "linker": { "librarypaths": [ - "$(SYSROOT)/usr/lib", + "$(SYSROOT)/usr/lib", "${SYSROOT}/opt/xilinx/xrt/lib" ] - }, + }, "compiler": { "includepaths": [ "$(SYSROOT)/usr/include" - ], + ], "options": "--sysroot=$(SYSROOT)" } } - } - }, + } + }, "launch": [ { - "cmd_args": " -mode fpga -xclbin BUILD/aes256CbcEncryptKernel.xclbin -len 1024 -num 16 -gld PROJECT/data/gld.dat", + "cmd_args": " -mode fpga -xclbin BUILD/aes256CbcEncryptKernel.xclbin -len 1024 -num 16 -gld PROJECT/data/gld.dat", "name": "generic launch for all flows" } ], - "data" : [ + "data": [ "PROJECT/data/gld.dat" - ], + ], "host": { - "host_exe": "aes256CbcEncryptBenchmark.exe", + "host_exe": "aes256CbcEncryptBenchmark.exe", "compiler": { "sources": [ - "host/main.cpp", + "host/main.cpp", "LIB_DIR/ext/xcl2/xcl2.cpp" - ], + ], "includepaths": [ - "LIB_DIR/L1/include", - "host", - "kernel", + "LIB_DIR/L1/include", + "host", + "kernel", "LIB_DIR/ext/xcl2", "LIB_DIR/../utils/L1/include" - ], + ], "options": "-O3" } - }, + }, "v++": { "compiler": { "includepaths": [ - "LIB_DIR/L1/include", + "LIB_DIR/L1/include", "kernel" ] } - }, + }, "containers": [ { "accelerators": [ { - "location": "kernel/aes256CbcEncryptKernel.cpp", - "frequency": 300.0, - "name": "aes256CbcEncryptKernel", - "num_compute_units": 1, + "location": "kernel/aes256CbcEncryptKernel.cpp", + "frequency": 300.0, + "name": "aes256CbcEncryptKernel", + "num_compute_units": 1, "compute_units": [ { - "name": "aes256CbcEncryptKernel", - "slr": "SLR0", + "name": "aes256CbcEncryptKernel", + "slr": "SLR0", "arguments": [ { - "name": "inputData", + "name": "inputData", "memory": "DDR[0]" - }, + }, { - "name": "outputData", + "name": "outputData", "memory": "DDR[0]" } ] } ] } - ], - "frequency": 300.0, + ], + "frequency": 300.0, "name": "aes256CbcEncryptKernel" } - ], + ], "testinfo": { - "disable": false, + "disable": false, "jobs": [ { - "index": 0, - "dependency": [], - "env": "", - "cmd": "", + "index": 0, + "dependency": [], + "env": "", + "cmd": "", "max_memory_MB": { - "vitis_hw_build": 40960, - "vitis_hw_emu": 28672, - "vitis_sw_emu": 10240, + "vitis_hw_build": 40960, + "vitis_hw_emu": 28672, + "vitis_sw_emu": 10240, "vitis_hw_run": 10240 - }, + }, "max_time_min": { - "vitis_hw_build": 470, - "vitis_hw_emu": 420, - "vitis_sw_emu": 60, + "vitis_hw_build": 470, + "vitis_hw_emu": 420, + "vitis_sw_emu": 60, "vitis_hw_run": 10 } } - ], + ], "targets": [ - "vitis_sw_emu", - "vitis_hw_emu", + "vitis_sw_emu", + "vitis_hw_emu", "vitis_hw_run" - ], + ], "category": "canary" } } diff --git a/security/L1/benchmarks/aes256CbcEncrypt/utils.mk b/security/L1/benchmarks/aes256CbcEncrypt/utils.mk index 3892ff1942..0ee80e90da 100644 --- a/security/L1/benchmarks/aes256CbcEncrypt/utils.mk +++ b/security/L1/benchmarks/aes256CbcEncrypt/utils.mk @@ -1,5 +1,5 @@ # -# Copyright 2019-2021 Xilinx, Inc. +# Copyright 2019-2022 Xilinx, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -12,6 +12,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. +# vitis makefile-generator v2.0.6 # #+------------------------------------------------------------------------------- # The following parameters are assigned with default values. These parameters can @@ -39,17 +40,59 @@ ifeq ($(DEBUG), yes) VPP_LDFLAGS += --dk protocol:all:all:all endif -#Checks for XILINX_XRT -ifeq ($(HOST_ARCH), x86) +#Check environment setup +ifndef XILINX_VITIS + XILINX_VITIS = /opt/xilinx/Vitis/$(TOOL_VERSION) + export XILINX_VITIS +endif ifndef XILINX_XRT XILINX_XRT = /opt/xilinx/xrt export XILINX_XRT endif + +check_device: + @set -eu; \ + inallowlist=False; \ + inblocklist=False; \ + for dev in $(PLATFORM_ALLOWLIST); \ + do if [[ $$(echo $(PLATFORM_NAME) | grep $$dev) != "" ]]; \ + then inallowlist=True; fi; \ + done ;\ + for dev in $(PLATFORM_BLOCKLIST); \ + do if [[ $$(echo $(PLATFORM_NAME) | grep $$dev) != "" ]]; \ + then inblocklist=True; fi; \ + done ;\ + if [[ $$inallowlist == False ]]; \ + then echo "[Warning]: The device $(PLATFORM_NAME) not in allowlist."; \ + fi; \ + if [[ $$inblocklist == True ]]; \ + then echo "[ERROR]: The device $(PLATFORM_NAME) in blocklist."; exit 1;\ + fi; + +#get HOST_ARCH by PLATFORM +ifneq (,$(PLATFORM)) +HOST_ARCH_temp = $(shell platforminfo -p $(PLATFORM) | grep 'CPU Type' | sed 's/.*://' | sed '/ai_engine/d' | sed 's/^[[:space:]]*//') +ifeq ($(HOST_ARCH_temp), x86) +HOST_ARCH := x86 +else ifeq ($(HOST_ARCH_temp), cortex-a9) +HOST_ARCH := aarch32 +else ifneq (,$(findstring cortex-a, $(HOST_ARCH_temp))) +HOST_ARCH := aarch64 +endif +endif + + +#get suffix of kernel by PLATFORM +VITIS_VER = $(shell v++ --version | grep 'v++' | sed 's/^[[:space:]]*//' | sed -e 's/^[*]* v++ v//g' | cut -d " " -f1) +DEVICE_TYPE = $(shell platforminfo -p $(PLATFORM) | grep 'FPGA Family' | sed 's/.*://' | sed '/ai_engine/d' | sed 's/^[[:space:]]*//') +ifeq ($(DEVICE_TYPE), versal) +ifeq ($(shell expr $(VITIS_VER) \>= 2022.1), 1) +LINK_TARGET_FMT := xsa else -ifndef XILINX_VITIS - XILINX_VITIS = /opt/xilinx/Vitis/$(TOOL_VERSION) - export XILINX_VITIS +LINK_TARGET_FMT := xclbin endif +else +LINK_TARGET_FMT := xclbin endif #Checks for Device Family @@ -59,13 +102,18 @@ else ifeq ($(HOST_ARCH), aarch64) DEV_FAM = Ultrascale endif -B_NAME = $(shell dirname $(XPLATFORM)) - #Checks for Correct architecture ifneq ($(HOST_ARCH), $(filter $(HOST_ARCH),aarch64 aarch32 x86)) $(error HOST_ARCH variable not set, please set correctly and rerun) endif +check_version: +ifneq (, $(shell which git)) +ifneq (,$(wildcard $(XFLIB_DIR)/.git)) + @cd $(XFLIB_DIR) && git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit -n 1 && cd - +endif +endif + #Checks for SYSROOT check_sysroot: ifneq ($(HOST_ARCH), x86) @@ -74,25 +122,24 @@ ifndef SYSROOT endif endif -check_version: -ifneq (, $(shell which git)) -ifneq (,$(wildcard $(XFLIB_DIR)/.git)) - @cd $(XFLIB_DIR) && git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit -n 1 && cd - -endif -endif - #Checks for g++ CXX := g++ ifeq ($(HOST_ARCH), x86) -ifneq ($(shell expr $(shell g++ -dumpversion) \>= 5), 1) +ifeq ($(shell expr $(VITIS_VER) \>= 2022.1), 1) +CXX_VER := 8.3.0 +else +CXX_VER := 6.2.0 +endif +CXX_V := $(shell echo $(CXX_VER) | awk -F. '{print tolower($$1)}') +ifneq ($(shell expr $(shell echo "__GNUG__" | g++ -E -x c++ - | tail -1) \>= $(CXX_V)), 1) ifndef XILINX_VIVADO -$(error [ERROR]: g++ version too old. Please use 5.0 or above) +$(error [ERROR]: g++ version too old. Please use $(CXX_VER) or above) else -CXX := $(XILINX_VIVADO)/tps/lnx64/gcc-6.2.0/bin/g++ +CXX := $(XILINX_VIVADO)/tps/lnx64/gcc-$(CXX_VER)/bin/g++ ifeq ($(LD_LIBRARY_PATH),) -export LD_LIBRARY_PATH := $(XILINX_VIVADO)/tps/lnx64/gcc-6.2.0/lib64 +export LD_LIBRARY_PATH := $(XILINX_VIVADO)/tps/lnx64/gcc-$(CXX_VER)/lib64 else -export LD_LIBRARY_PATH := $(XILINX_VIVADO)/tps/lnx64/gcc-6.2.0/lib64:$(LD_LIBRARY_PATH) +export LD_LIBRARY_PATH := $(XILINX_VIVADO)/tps/lnx64/gcc-$(CXX_VER)/lib64:$(LD_LIBRARY_PATH) endif $(warning [WARNING]: g++ version too old. Using g++ provided by the tool: $(CXX)) endif @@ -103,13 +150,22 @@ else ifeq ($(HOST_ARCH), aarch32) CXX := $(XILINX_VITIS)/gnu/aarch32/lin/gcc-arm-linux-gnueabi/bin/arm-linux-gnueabihf-g++ endif -#Check OS and setting env +#Check OS and setting env for xrt c++ api OSDIST = $(shell lsb_release -i |awk -F: '{print tolower($$2)}' | tr -d ' \t' ) OSREL = $(shell lsb_release -r |awk -F: '{print tolower($$2)}' |tr -d ' \t') -ifeq ($(OSDIST), centos) +# for centos and redhat +ifneq ($(findstring centos,$(OSDIST)),) +ifeq (7,$(shell echo $(OSREL) | awk -F. '{print tolower($$1)}' )) +ifeq ($(HOST_ARCH), x86) +XRT_CXXFLAGS += -D_GLIBCXX_USE_CXX11_ABI=0 +endif +endif +else ifneq ($(findstring redhat,$(OSDIST)),) ifeq (7,$(shell echo $(OSREL) | awk -F. '{print tolower($$1)}' )) -CXXFLAGS += -D_GLIBCXX_USE_CXX11_ABI=0 +ifeq ($(HOST_ARCH), x86) +XRT_CXXFLAGS += -D_GLIBCXX_USE_CXX11_ABI=0 +endif endif endif @@ -117,6 +173,9 @@ endif VPP := v++ #Cheks for aiecompiler +AIECXX := aiecompiler +AIESIMULATOR := aiesimulator +X86SIMULATOR := x86simulator .PHONY: check_vivado check_vivado: @@ -132,11 +191,9 @@ endif .PHONY: check_xrt check_xrt: -ifeq ($(HOST_ARCH), x86) ifeq (,$(wildcard $(XILINX_XRT)/lib/libxilinxopencl.so)) @echo "Cannot locate XRT installation. Please set XILINX_XRT variable." && false endif -endif export PATH := $(XILINX_VITIS)/bin:$(XILINX_XRT)/bin:$(PATH) ifeq ($(HOST_ARCH), x86) @@ -145,82 +202,64 @@ LD_LIBRARY_PATH := $(XILINX_XRT)/lib else LD_LIBRARY_PATH := $(XILINX_XRT)/lib:$(LD_LIBRARY_PATH) endif -else # aarch64 -ifeq (,$(LD_LIBRARY_PATH)) -LD_LIBRARY_PATH := $(SYSROOT)/usr/lib -else -LD_LIBRARY_PATH := $(SYSROOT)/usr/lib:$(LD_LIBRARY_PATH) -endif -endif - -# check target -ifeq ($(filter $(TARGET),sw_emu hw_emu hw),) -$(error TARGET is not sw_emu, hw_emu or hw) endif -ifneq (,$(wildcard $(DEVICE))) -# Use DEVICE as a file path -XPLATFORM := $(DEVICE) +ifneq (,$(wildcard $(PLATFORM))) +# Use PLATFORM as a file path +XPLATFORM := $(PLATFORM) else -# Use DEVICE as a file name pattern +# Use PLATFORM as a file name pattern # 1. search paths specified by variable ifneq (,$(PLATFORM_REPO_PATHS)) # 1.1 as exact name -XPLATFORM := $(strip $(foreach p, $(subst :, ,$(PLATFORM_REPO_PATHS)), $(wildcard $(p)/$(DEVICE)/$(DEVICE).xpfm))) +XPLATFORM := $(strip $(foreach p, $(subst :, ,$(PLATFORM_REPO_PATHS)), $(wildcard $(p)/$(PLATFORM)/$(PLATFORM).xpfm))) # 1.2 as a pattern ifeq (,$(XPLATFORM)) XPLATFORMS := $(foreach p, $(subst :, ,$(PLATFORM_REPO_PATHS)), $(wildcard $(p)/*/*.xpfm)) -XPLATFORM := $(strip $(foreach p, $(XPLATFORMS), $(shell echo $(p) | awk '$$1 ~ /$(DEVICE)/'))) +XPLATFORM := $(strip $(foreach p, $(XPLATFORMS), $(shell echo $(p) | awk '$$1 ~ /$(PLATFORM)/'))) endif # 1.2 endif # 1 # 2. search Vitis installation ifeq (,$(XPLATFORM)) # 2.1 as exact name -XPLATFORM := $(strip $(wildcard $(XILINX_VITIS)/platforms/$(DEVICE)/$(DEVICE).xpfm)) +XPLATFORM := $(strip $(wildcard $(XILINX_VITIS)/platforms/$(PLATFORM)/$(PLATFORM).xpfm)) # 2.2 as a pattern ifeq (,$(XPLATFORM)) XPLATFORMS := $(wildcard $(XILINX_VITIS)/platforms/*/*.xpfm) -XPLATFORM := $(strip $(foreach p, $(XPLATFORMS), $(shell echo $(p) | awk '$$1 ~ /$(DEVICE)/'))) +XPLATFORM := $(strip $(foreach p, $(XPLATFORMS), $(shell echo $(p) | awk '$$1 ~ /$(PLATFORM)/'))) endif # 2.2 endif # 2 # 3. search default locations ifeq (,$(XPLATFORM)) # 3.1 as exact name -XPLATFORM := $(strip $(wildcard /opt/xilinx/platforms/$(DEVICE)/$(DEVICE).xpfm)) +XPLATFORM := $(strip $(wildcard /opt/xilinx/platforms/$(PLATFORM)/$(PLATFORM).xpfm)) # 3.2 as a pattern ifeq (,$(XPLATFORM)) XPLATFORMS := $(wildcard /opt/xilinx/platforms/*/*.xpfm) -XPLATFORM := $(strip $(foreach p, $(XPLATFORMS), $(shell echo $(p) | awk '$$1 ~ /$(DEVICE)/'))) +XPLATFORM := $(strip $(foreach p, $(XPLATFORMS), $(shell echo $(p) | awk '$$1 ~ /$(PLATFORM)/'))) endif # 3.2 endif # 3 endif define MSG_PLATFORM -No platform matched pattern '$(DEVICE)'. +No platform matched pattern '$(PLATFORM)'. Available platforms are: $(XPLATFORMS) -To add more platform directories, set the PLATFORM_REPO_PATHS variable or point DEVICE variable to the full path of platform .xpfm file. +To add more platform directories, set the PLATFORM_REPO_PATHS variable or point PLATFORM variable to the full path of platform .xpfm file. endef export MSG_PLATFORM -define MSG_DEVICE -More than one platform matched: $(XPLATFORM) -Please set DEVICE variable more accurately to select only one platform file, or set DEVICE variable to the full path of the platform .xpfm file. -endef -export MSG_DEVICE .PHONY: check_platform check_platform: ifeq (,$(XPLATFORM)) @echo "$${MSG_PLATFORM}" && false endif -ifneq (,$(word 2,$(XPLATFORM))) - @echo "$${MSG_DEVICE}" && false -endif #Check ends # device2xsa - create a filesystem friendly name from device name # $(1) - full name of device -device2xsa = $(strip $(patsubst %.xpfm, % , $(shell basename $(DEVICE)))) +PLATFORM_NAME = $(strip $(patsubst %.xpfm, % , $(shell basename $(PLATFORM)))) + # Cleaning stuff RM = rm -f diff --git a/security/L1/benchmarks/aes256CbcEncrypt_sc/Makefile b/security/L1/benchmarks/aes256CbcEncrypt_sc/Makefile index 8de3e576b9..78be0d5921 100644 --- a/security/L1/benchmarks/aes256CbcEncrypt_sc/Makefile +++ b/security/L1/benchmarks/aes256CbcEncrypt_sc/Makefile @@ -1,4 +1,3 @@ -# # Copyright 2019-2021 Xilinx, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -12,83 +11,258 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -# +# sc makefile-generator v1.0.0 -# ####################################### Help Section ##################################### +############################## Help Section ############################## .PHONY: help help:: $(ECHO) "Makefile Usage:" - $(ECHO) " make all TARGET= DEVICE= HOST_ARCH=" + $(ECHO) " make all TARGET= PLATFORM= HOST_ARCH=" $(ECHO) " Command to generate the design for specified Target and Shell." + $(ECHO) " By default, HOST_ARCH=x86. HOST_ARCH is required for SoC shells" + $(ECHO) "" + $(ECHO) " make run TARGET= PLATFORM= HOST_ARCH=" + $(ECHO) " Command to run application in emulation." + $(ECHO) " By default, HOST_ARCH=x86. HOST_ARCH required for SoC shells" + $(ECHO) "" + $(ECHO) " make host HOST_ARCH=" + $(ECHO) " Command to build host application." + $(ECHO) " By default, HOST_ARCH=x86. HOST_ARCH is required for SoC shells" $(ECHO) "" $(ECHO) " make clean " $(ECHO) " Command to remove the generated non-hardware files." $(ECHO) "" - $(ECHO) " make ultraclean" + $(ECHO) " make cleanall" $(ECHO) " Command to remove all the generated files." $(ECHO) "" - $(ECHO) " make sd_card TARGET= DEVICE= HOST_ARCH=" - $(ECHO) " Command to prepare sd_card files." - $(ECHO) " This target is only used in embedded device." - $(ECHO) "" - $(ECHO) " make run TARGET= DEVICE= HOST_ARCH=" - $(ECHO) " Command to run application in emulation or on board." - $(ECHO) "" - $(ECHO) " make build TARGET= DEVICE= HOST_ARCH=" - $(ECHO) " Command to build xclbin application." - $(ECHO) "" - $(ECHO) " NOTE: For embedded devices, e.g. zcu102/zcu104/vck190, env variable SYSROOT, EDGE_COMMON_SW and PERL need to be set first, and HOST_ARCH is either aarch32 or aarch64. For example," - $(ECHO) " export SYSROOT=< path-to-platform-sysroot >" - $(ECHO) " export EDGE_COMMON_SW=< path-to-rootfs-and-Image-files >" - $(ECHO) " export PERL=" - $(ECHO) "" -# ##################### Setting up default value of TARGET ########################## -TARGET ?= sw_emu +############################## Setting up Project Variables ############################## -# ###################### Setting up default value of HOST_ARCH ####################### +MK_PATH := $(abspath $(lastword $(MAKEFILE_LIST))) +XF_PROJ_ROOT ?= $(shell bash -c 'export MK_PATH=$(MK_PATH); echo $${MK_PATH%/L1/*}') +CUR_DIR := $(patsubst %/,%,$(dir $(MK_PATH))) +XFLIB_DIR = $(XF_PROJ_ROOT) + +# setting devault value +TARGET ?= sw_emu HOST_ARCH ?= x86 -# ################### Setting up default value of DEVICE ############################## -DEVICE ?= xilinx_u250_gen3x16_xdma_3_1_202020_1 +#setting PLATFORM +ifeq ($(PLATFORM),) +PLATFORM := $(DEVICE) +endif +ifeq ($(PLATFORM),) +PLATFORM := xilinx_u250_gen3x16_xdma_3_1_202020_1 +endif -# #################### Checking if DEVICE in blacklist ############################# -ifeq ($(findstring zc, $(DEVICE)), zc) -$(error [ERROR]: This project is not supported for $(DEVICE).) +# #################### Checking if PLATFORM in whitelist ############################ +PLATFORM_ALLOWLIST += u250 u200 +PLATFORM_BLOCKLIST += xilinx_u250_xdma_201830_2 xilinx_u200_xdma_201830_2 zc aws-vu9p-f1 + +GCC_INTOOL := 8.3.0 +BINUTILS_INTOOL := 2.37 +include ./utils.mk +TEMP_DIR := _x_temp.$(TARGET).$(PLATFORM_NAME) +TEMP_REPORT_DIR := $(CUR_DIR)/reports/_x.$(TARGET).$(PLATFORM_NAME) +BUILD_DIR := build_dir.$(TARGET).$(PLATFORM_NAME) +BUILD_REPORT_DIR := $(CUR_DIR)/reports/_build.$(TARGET).$(PLATFORM_NAME) +EMCONFIG := $(BUILD_DIR)/emconfig.json +XCLBIN_DIR := $(CUR_DIR)/$(BUILD_DIR) +export XCL_BINDIR = $(XCLBIN_DIR) + +EXE_FILE_DEPS := +BINARY_CONTAINERS_DEPS := +RUN_DEPS := + +# set debug switch +ifneq ($(debug),yes) +CXXFLAGS += -O3 endif -# #################### Checking if DEVICE in whitelist ############################ -ifneq ($(findstring u250, $(DEVICE)), u250) -ifneq ($(findstring u200, $(DEVICE)), u200) -$(warning [WARNING]: This project has not been tested for $(DEVICE). It may or may not work.) +# get global setting +ifdef XILINX_SC_PFM_CONFIG +CXXFLAGS += -DXILINX_SC_PFM_CONFIG=$(XILINX_SC_PFM_CONFIG) +endif +ifdef XILINX_SC_PFM_EXT +CXXFLAGS += -DXILINX_SC_PFM_EXT=$(XILINX_SC_PFM_EXT) endif +ifeq ($(HOST_ARCH), x86) +CXXFLAGS += -I $(XILINX_VITIS)/system_compiler/include -I $(XILINX_HLS)/include +LDFLAGS += -L$(XILINX_XRT)/lib -L$(XILINX_VITIS)/system_compiler/lib/x86 -lvpp_acc -l$(LIB_XRT) -lxrt_coreutil -Wl,-rpath=$(XILINX_VITIS)/system_compiler/lib/x86:$(XILINX_XRT)/lib:$(GCC_HOME)/lib64 -Wl,--enable-new-dtags -lpthread +VPP_FLAGS += -t $(TARGET) --platform $(XPLATFORM) --temp_dir $(TEMP_DIR) --save-temps -g -I $(XILINX_VITIS)/system_compiler/include +VPP_LDFLAGS += +else ifeq ($(HOST_ARCH), aarch64) +CXXFLAGS += +LDFLAGS += +VPP_FLAGS += +VPP_LDFLAGS += endif +CXXFLAGS += $(EXTRA_CXXFLAGS) +VPP_FLAGS += $(EXTRA_VPP_FLAGS) -include ./utils.mk -override DEVICE := $(call device2xsa, $(DEVICE)) +ifeq ($(TARGET),sw) + $(error Error: The sw target is not supported anymore. Please use sw_emu instead) +else ifeq ($(TARGET),sw_emu) + LIB_XRT := xrt_swemu + HOST_PREAMBLE := XCL_EMULATION_MODE=sw_emu +else ifeq ($(TARGET),hw_emu) + LIB_XRT := xrt_hwemu + HOST_PREAMBLE := XCL_EMULATION_MODE=hw_emu + ifneq (,$(findstring -g,$(EXTRA_VPPFLAGS) $(CXXFLAGS))) + # for sourcing pre/post xsim scripts + ifneq ($(XILINX_SC_HW_EMU),0) + HOST_PREAMBLE += XILINX_SC_HW_EMU=1 XILINX_SC_BUILD_DIR=$(PWD)/$(BUILD_DIR) + endif + endif +else ifeq ($(TARGET),hw) + LIB_XRT := xrt_core +endif -KERNEL ?= aes256CbcEncrypt -PLATFORM_PATH = $(PLATFORM_REPO_PATHS) +########################## Setting up Host Variables ########################## -# source files which have any accelerator code (ie. hls_kernel or vpp_acc code) -# must be specified here: -ACC_SRCS := kernel/$(KERNEL)_acc.cpp kernel/$(KERNEL)_kernel.cpp +#Inclue Required Host Source Files +HOST_SRCS += $(CUR_DIR)/host/main.cpp +CXXFLAGS += -I $(XFLIB_DIR)/L1/include -I $(CUR_DIR)/kernel -I $(XFLIB_DIR)/ext/xcl2 +CXXFLAGS += -O3 -# source files with only host code can go here: -HOST_SRCS := host/main.cpp -MK_PATH := $(abspath $(lastword $(MAKEFILE_LIST))) -XF_PROJ_ROOT ?= $(shell bash -c 'export MK_PATH=$(MK_PATH); echo $${MK_PATH%/L1/*}') -CUR_DIR := $(patsubst %/,%,$(dir $(MK_PATH))) +EXE_NAME := host.exe +EXE_OBJS := $(addprefix $(TEMP_DIR)/, $(addsuffix .o,$(basename $(HOST_SRCS)))) +EXE_FILE := $(BUILD_DIR)/$(EXE_NAME) +EXE_FILE_DEPS := $(EXE_OBJS) +MAKEDEPEND = $(CXX) $< -MM -MP -MF $(basename $@).d -MT $@ $(CXXFLAGS) + +HOST_ARGS := -len 1024 -num 16 -gld $(XFLIB_DIR)/L1/benchmarks/aes256CbcEncrypt_sc/data/gld.dat +ifneq ($(HOST_ARCH), x86) +PKG_HOST_ARGS = $(foreach args,$(HOST_ARGS),$(subst $(dir $(patsubst %/,%,$(args))),,$(args))) +endif + +########################## Kernel compiler global settings ########################## +VPP_FLAGS += -I $(XFLIB_DIR)/L1/include -I $(CUR_DIR)/kernel -I $(CUR_DIR)/host -I $(XFLIB_DIR)/L1/include + +######################### binary container global settings ########################## +VPP_FLAGS_hls_kernel += --hls.clock 300000000:hls_kernel +ifneq ($(HOST_ARCH), x86) +VPP_LDFLAGS_hls_kernel += --clock.defaultFreqHz 300000000 +else +VPP_LDFLAGS_hls_kernel += --kernel_frequency 300 +endif + +ifeq ($(HOST_ARCH), x86) +BINARY_CONTAINERS_TMP := $(BUILD_DIR)/$(TARGET).o +BINARY_CONTAINERS := $(BUILD_DIR)/$(TARGET).xclbin +ifeq ($(TARGET),sw_emu) + BINARY_CONTAINERS_TMP := +endif +else +# placeholder for non_x86 +endif + +.SECONDEXPANSION: +# ################ Setting Rules for Binary Containers (Building Kernels) ################ +ACC_SRCS_hls_kernel += $(CUR_DIR)/kernel/aes256CbcEncrypt_acc.cpp +ACC_OBJS_hls_kernel := $(addprefix $(TEMP_DIR)/, $(addsuffix .o,$(basename $(ACC_SRCS_hls_kernel)))) +$(ACC_OBJS_hls_kernel): $(TEMP_DIR)/%.o : %.cpp $$(@D)/.f + @echo "--> Making $@ from: $?" + $(MAKEDEPEND) + $(VPP) $(VPP_FLAGS) $(VPP_FLAGS_hls_kernel) -o $@ -c $< +BINARY_CONTAINERS_DEPS += $(ACC_OBJS_hls_kernel) +$(BINARY_CONTAINERS_TMP) : $(BINARY_CONTAINERS_DEPS) + @echo "--> Making $@ from: $?" + $(VPP) $(VPP_FLAGS) $(VPP_LDFLAGS) -o $(BINARY_CONTAINERS) -l $^ +EXE_FILE_DEPS += $(BINARY_CONTAINERS_TMP) +EXE_FILE_DEPS += $(BINARY_CONTAINERS_DEPS) + +############################## Setting Rules for Host (Building Host Executable) ############################## +ifeq ($(HOST_ARCH), x86) +$(TEMP_DIR)/%.o : %.cpp $$(@D)/.f + @echo "--> Making $@ from: $?" + mkdir -p $(BUILD_DIR) + $(MAKEDEPEND) + $(CXX) -o $@ $(CXXFLAGS) -I . -c $< +$(EXE_FILE): $(EXE_FILE_DEPS) + mkdir -p $(BUILD_DIR) + $(CXX) -o $@ $^ $(CXXFLAGS) $(LDFLAGS) +else +# place holder for arch64 +endif + +$(EMCONFIG): + emconfigutil --platform $(XPLATFORM) --od $(BUILD_DIR) + +%/.f: + mkdir -p $(dir $@) + touch $@ + +.PRECIOUS: %/.f + +RUN_DEPS += $(EXE_FILE) $(EMCONFIG) + +run: check_device $(RUN_DEPS) +#sw_emu +ifneq (,$(filter sw_emu, $(TARGET))) +ifeq ($(HOST_ARCH), x86) + LD_LIBRARY_PATH=$(LIBRARY_PATH):$$LD_LIBRARY_PATH \ + $(HOST_PREAMBLE) $(EXE_FILE) $(HOST_ARGS) + +else +# place holder for arch64 +endif +endif + +#hw_emu +ifneq (,$(filter hw_emu, $(TARGET))) +ifeq ($(HOST_ARCH), x86) + LD_LIBRARY_PATH=$(LIBRARY_PATH):$$LD_LIBRARY_PATH \ + $(HOST_PREAMBLE) $(EXE_FILE) $(HOST_ARGS) + +else +# place holder for arch64 +endif +endif + +#hw +ifeq ($(TARGET), hw) +ifeq ($(HOST_ARCH), x86) + LD_LIBRARY_PATH=$(LIBRARY_PATH):$$LD_LIBRARY_PATH \ + $(HOST_PREAMBLE) $(EXE_FILE) $(HOST_ARGS) + +else +# place holder for arch64 +endif +endif + +############################## Setting Targets ############################## + +.PHONY: all clean cleanall emconfig +emconfig: $(EMCONFIG) +ifeq ($(HOST_ARCH), x86) +all: check_vpp check_platform check_xrt $(EXE_FILE) $(BINARY_CONTAINERS) emconfig +else +all: check_vpp check_platform check_sysroot $(EXE_FILE) $(BINARY_CONTAINERS) emconfig sd_card +endif + +.PHONY: host xclbin +ifeq ($(HOST_ARCH), x86) +host: check_xrt $(EXE_FILE) +else +host: check_sysroot $(EXE_FILE) +endif +xclbin: $(BINARY_CONTAINERS_TMP) -# potential additional compile options, eg. adding extra -I directories -EXTRA_CFLAGS += -I kernel -I host -EXTRA_CFLAGS += -I$(XF_PROJ_ROOT)/L1/include +############################## Cleaning Rules ############################## +cleanh: + -$(RMDIR) $(EXE_FILE) vitis_* TempConfig system_estimate.xtxt *.rpt .run/ + -$(RMDIR) src/*.ll _xocc_* .Xil dltmp* xmltmp* *.log *.jou *.wcfg *.wdb sample_link.ini sample_compile.ini obj* bin* *.csv *.jpg *.jpeg *.png -EXTRA_VPPFLAGS = -g +cleank: + -$(RMDIR) $(BUILD_DIR)/*.xclbin _vimage *xclbin.run_summary qemu-memory-_* emulation/ _vimage/ pl*start_simulation. sh *.xclbin + -$(RMDIR) _x_temp.*/_x.* _x_temp.*/.Xil _x_temp.*/profile_summary.* xo_* _x* + -$(RMDIR) _x_temp.*/dltmp* _x_temp.*/kernel_info.dat _x_temp.*/*.log + -$(RMDIR) _x_temp.* -LIB_VPP := vpp_acc -include $(XILINX_VITIS)/data/system_compiler/examples/vpp_sc.mk +cleanall: cleanh cleank + -$(RMDIR) $(BUILD_DIR) build_dir.* emconfig.json *.html $(TEMP_DIR) $(CUR_DIR)/reports *.csv *.run_summary $(CUR_DIR)/*.raw package_* $(BUILD_DIR)/run_script.sh .ipcache *.str + -$(RMDIR) $(XFLIB_DIR)/common/data/*.xe2xd* $(XFLIB_DIR)/common/data/*.orig* -HOST_ARGS := -len 1024 -num 16 -gld $(CUR_DIR)/data/gld.dat -xclbin : build +clean: cleanh \ No newline at end of file diff --git a/security/L1/benchmarks/aes256CbcEncrypt_sc/description.json b/security/L1/benchmarks/aes256CbcEncrypt_sc/description.json index c8188a2717..684586e811 100644 --- a/security/L1/benchmarks/aes256CbcEncrypt_sc/description.json +++ b/security/L1/benchmarks/aes256CbcEncrypt_sc/description.json @@ -1,46 +1,88 @@ { - "gui": false, - "name": "Xilinx AES256CBC Encryption SC Benchmark", - "description": "AES256 CBC Mode Encryption Benchmark with System Compiler", - "flow": "vitis", - "platform_type": "", - "platform_whitelist": [ - "u250", + "gui": false, + "name": "Xilinx AES256CBC Encryption SC Benchmark", + "description": "AES256 CBC Mode Encryption Benchmark with System Compiler", + "flow": "vitis", + "platform_type": "", + "platform_allowlist": [ + "u250", "u200" - ], - "platform_blacklist": [ + ], + "platform_blocklist": [ "xilinx_u250_xdma_201830_2", "xilinx_u200_xdma_201830_2", - "zc" + "zc", + "aws-vu9p-f1" + ], + "launch": [ + { + "cmd_args": "-len 1024 -num 16 -gld LIB_DIR/L1/benchmarks/aes256CbcEncrypt_sc/data/gld.dat", + "name": "generic launch for all flows" + } + ], + "host": { + "host_exe": "host.exe", + "compiler": { + "sources": [ + "host/main.cpp" + ], + "includepaths": [ + "LIB_DIR/L1/include", + "kernel" + ], + "options": "-O3" + } + }, + "v++": { + "compiler": { + "includepaths": [ + "LIB_DIR/L1/include", + "kernel", + "host" + ] + } + }, + "containers": [ + { + "accelerators": [ + { + "location": "kernel/aes256CbcEncrypt_acc.cpp", + "frequency": 300.0, + "name": "hls_kernel" + } + ], + "frequency": 300.0, + "name": "hls_kernel" + } ], "testinfo": { - "disable": false, + "disable": false, "jobs": [ { - "index": 0, - "dependency": [], - "env": "", - "cmd": "", + "index": 0, + "dependency": [], + "env": "", + "cmd": "", "max_memory_MB": { - "vitis_hw_build": 40960, - "vitis_hw_emu": 28672, - "vitis_sw_emu": 10240, + "vitis_hw_build": 40960, + "vitis_hw_emu": 28672, + "vitis_sw_emu": 10240, "vitis_hw_run": 10240 - }, + }, "max_time_min": { - "vitis_hw_build": 470, - "vitis_hw_emu": 470, - "vitis_sw_emu": 60, + "vitis_hw_build": 470, + "vitis_hw_emu": 470, + "vitis_sw_emu": 60, "vitis_hw_run": 10 } } - ], + ], "targets": [ - "vitis_sw_emu", - "vitis_hw_emu", - "vitis_hw_build", + "vitis_sw_emu", + "vitis_hw_emu", + "vitis_hw_build", "vitis_hw_run" - ], + ], "category": "canary" } } diff --git a/security/L1/benchmarks/aes256CbcEncrypt_sc/kernel/aes256CbcEncrypt_acc.cpp b/security/L1/benchmarks/aes256CbcEncrypt_sc/kernel/aes256CbcEncrypt_acc.cpp index 08a6414876..b0acf11f87 100755 --- a/security/L1/benchmarks/aes256CbcEncrypt_sc/kernel/aes256CbcEncrypt_acc.cpp +++ b/security/L1/benchmarks/aes256CbcEncrypt_sc/kernel/aes256CbcEncrypt_acc.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2019 Xilinx, Inc. + * Copyright 2019-2022 Xilinx, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,8 +14,75 @@ * limitations under the License. */ +#include +#include +#include "xf_security/cbc.hpp" +#include "xf_security/msgpack.hpp" #include "aes256CbcEncrypt_acc.hpp" +#ifndef __SYNTHESIS +#include +#endif + void aes256CbcEncrypt::compute(int hb_in_size, int hb_out_size, ap_uint<128>* hb_in, ap_uint<128>* hb_out) { hls_kernel(hb_in_size, hb_out_size, hb_in, hb_out); } + +void cbcWrapper(hls::stream >& plaintext, + hls::stream& plaintext_e, + hls::stream >& key, + hls::stream >& iv, + hls::stream >& res, + hls::stream& endRes, + ap_uint<64> msgNum) { + for (ap_uint<64> i = 0; i < msgNum; i++) { + xf::security::aes256CbcEncrypt(plaintext, plaintext_e, key, iv, res, endRes); + } +} + +void wrapper(ap_uint<128>* input, ap_uint<128>* output, ap_uint<64> msg_num, ap_uint<64> row_num) { +#pragma HLS dataflow + + hls::stream > textStrm; +#pragma HLS stream variable = textStrm depth = 128 +#pragma HLS resource variable = textStrm core = FIFO_LUTRAM + hls::stream endTextStrm; +#pragma HLS stream variable = endTextStrm depth = 128 +#pragma HLS resource variable = endTextStrm core = FIFO_LUTRAM + + hls::stream > keyStrm; +#pragma HLS stream variable = keyStrm depth = 4 +#pragma HLS resource variable = keyStrm core = FIFO_LUTRAM + + hls::stream > ivStrm; +#pragma HLS stream variable = ivStrm depth = 4 +#pragma HLS resource variable = ivStrm core = FIFO_LUTRAM + + hls::stream > lenStrm; +#pragma HLS stream variable = lenStrm depth = 4 +#pragma HLS resource variable = lenStrm core = FIFO_LUTRAM + + xf::security::internal::aesCbcPack<256> packer; + packer.scanPack(input, msg_num, row_num, textStrm, endTextStrm, keyStrm, ivStrm, lenStrm); + + hls::stream > resStrm; +#pragma HLS stream variable = resStrm depth = 128 +#pragma HLS resource variable = resStrm core = FIFO_LUTRAM + + hls::stream endResStrm; +#pragma HLS stream variable = endResStrm depth = 128 +#pragma HLS resource variable = endResStrm core = FIFO_LUTRAM + + cbcWrapper(textStrm, endTextStrm, keyStrm, ivStrm, resStrm, endResStrm, msg_num); + + packer.writeOutMsgPack(output, msg_num, resStrm, endResStrm, lenStrm); +} + +// @brief top of kernel +void aes256CbcEncrypt::hls_kernel(int hb_in_size, int hb_out_size, ap_uint<128>* hb_in, ap_uint<128>* hb_out) { + ap_uint<128> tmp = hb_in[0]; + ap_uint<64> msg_num = tmp.range(63, 0); + ap_uint<64> row_num = tmp.range(127, 64); + wrapper(hb_in, hb_out, msg_num, row_num); + +} // end aes256CbcDecryptKernel diff --git a/security/L1/benchmarks/aes256CbcEncrypt_sc/kernel/aes256CbcEncrypt_kernel.cpp b/security/L1/benchmarks/aes256CbcEncrypt_sc/kernel/aes256CbcEncrypt_kernel.cpp deleted file mode 100644 index f564925729..0000000000 --- a/security/L1/benchmarks/aes256CbcEncrypt_sc/kernel/aes256CbcEncrypt_kernel.cpp +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Copyright 2019 Xilinx, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * - * @file aes256CbcEncrypt_kernel.cpp - * @brief kernel code of Cipher Block Chaining (CBC) block cipher mode of operation. - * This file is part of Vitis Security Library. - * - * @detail Containing scan, distribute, encrypt, merge, and write-out functions. - * - */ - -#include -#include -#include "xf_security/cbc.hpp" -#include "xf_security/msgpack.hpp" -#include "aes256CbcEncrypt_acc.hpp" - -#ifndef __SYNTHESIS -#include -#endif - -void cbcWrapper(hls::stream >& plaintext, - hls::stream& plaintext_e, - hls::stream >& key, - hls::stream >& iv, - hls::stream >& res, - hls::stream& endRes, - ap_uint<64> msgNum) { - for (ap_uint<64> i = 0; i < msgNum; i++) { - xf::security::aes256CbcEncrypt(plaintext, plaintext_e, key, iv, res, endRes); - } -} - -void wrapper(ap_uint<128>* input, ap_uint<128>* output, ap_uint<64> msg_num, ap_uint<64> row_num) { -#pragma HLS dataflow - - hls::stream > textStrm; -#pragma HLS stream variable = textStrm depth = 128 -#pragma HLS resource variable = textStrm core = FIFO_LUTRAM - hls::stream endTextStrm; -#pragma HLS stream variable = endTextStrm depth = 128 -#pragma HLS resource variable = endTextStrm core = FIFO_LUTRAM - - hls::stream > keyStrm; -#pragma HLS stream variable = keyStrm depth = 4 -#pragma HLS resource variable = keyStrm core = FIFO_LUTRAM - - hls::stream > ivStrm; -#pragma HLS stream variable = ivStrm depth = 4 -#pragma HLS resource variable = ivStrm core = FIFO_LUTRAM - - hls::stream > lenStrm; -#pragma HLS stream variable = lenStrm depth = 4 -#pragma HLS resource variable = lenStrm core = FIFO_LUTRAM - - xf::security::internal::aesCbcPack<256> packer; - packer.scanPack(input, msg_num, row_num, textStrm, endTextStrm, keyStrm, ivStrm, lenStrm); - - hls::stream > resStrm; -#pragma HLS stream variable = resStrm depth = 128 -#pragma HLS resource variable = resStrm core = FIFO_LUTRAM - - hls::stream endResStrm; -#pragma HLS stream variable = endResStrm depth = 128 -#pragma HLS resource variable = endResStrm core = FIFO_LUTRAM - - cbcWrapper(textStrm, endTextStrm, keyStrm, ivStrm, resStrm, endResStrm, msg_num); - - packer.writeOutMsgPack(output, msg_num, resStrm, endResStrm, lenStrm); -} - -// @brief top of kernel -void aes256CbcEncrypt::hls_kernel(int hb_in_size, int hb_out_size, ap_uint<128>* hb_in, ap_uint<128>* hb_out) { - ap_uint<128> tmp = hb_in[0]; - ap_uint<64> msg_num = tmp.range(63, 0); - ap_uint<64> row_num = tmp.range(127, 64); - wrapper(hb_in, hb_out, msg_num, row_num); - -} // end aes256CbcDecryptKernel diff --git a/security/L1/benchmarks/aes256CbcEncrypt_sc/utils.mk b/security/L1/benchmarks/aes256CbcEncrypt_sc/utils.mk index 3a6a92a467..17354308c6 100644 --- a/security/L1/benchmarks/aes256CbcEncrypt_sc/utils.mk +++ b/security/L1/benchmarks/aes256CbcEncrypt_sc/utils.mk @@ -12,6 +12,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. +# vitis makefile-generator v2.0.4 # #+------------------------------------------------------------------------------- # The following parameters are assigned with default values. These parameters can @@ -39,17 +40,44 @@ ifeq ($(DEBUG), yes) VPP_LDFLAGS += --dk protocol:all:all:all endif -#Checks for XILINX_XRT -ifeq ($(HOST_ARCH), x86) -ifndef XILINX_XRT - XILINX_XRT = /opt/xilinx/xrt - export XILINX_XRT -endif -else +#Check environment setup ifndef XILINX_VITIS XILINX_VITIS = /opt/xilinx/Vitis/$(TOOL_VERSION) export XILINX_VITIS endif +ifndef XILINX_XRT + XILINX_XRT = /opt/xilinx/xrt + export XILINX_XRT +endif + +check_device: + @set -eu; \ + inallowlist=False; \ + inblocklist=False; \ + for dev in $(PLATFORM_ALLOWLIST); \ + do if [[ $$(echo $(PLATFORM_NAME) | grep $$dev) != "" ]]; \ + then inallowlist=True; fi; \ + done ;\ + for dev in $(PLATFORM_BLOCKLIST); \ + do if [[ $$(echo $(PLATFORM_NAME) | grep $$dev) != "" ]]; \ + then inblocklist=True; fi; \ + done ;\ + if [[ $$inallowlist == False ]]; \ + then echo "[Warning]: The device $(PLATFORM_NAME) not in allowlist."; \ + fi; \ + if [[ $$inblocklist == True ]]; \ + then echo "[ERROR]: The device $(PLATFORM_NAME) in blocklist."; exit 1;\ + fi; + +#get HOST_ARCH by PLATFORM +HOST_ARCH_temp = $(shell platforminfo -p $(PLATFORM) | grep 'CPU Type' | sed 's/.*://' | sed '/ai_engine/d' | sed 's/^[[:space:]]*//') +$(warning HOST_ARCH_temp:$(HOST_ARCH_temp)) +ifeq ($(HOST_ARCH_temp), x86) +HOST_ARCH := x86 +else ifeq ($(HOST_ARCH_temp), cortex-a9) +HOST_ARCH := aarch32 +else ifeq ($(HOST_ARCH_temp), cortex-a*) +HOST_ARCH := aarch64 endif #Checks for Device Family @@ -59,13 +87,18 @@ else ifeq ($(HOST_ARCH), aarch64) DEV_FAM = Ultrascale endif -B_NAME = $(shell dirname $(XPLATFORM)) - #Checks for Correct architecture ifneq ($(HOST_ARCH), $(filter $(HOST_ARCH),aarch64 aarch32 x86)) $(error HOST_ARCH variable not set, please set correctly and rerun) endif +check_version: +ifneq (, $(shell which git)) +ifneq (,$(wildcard $(XFLIB_DIR)/.git)) + @cd $(XFLIB_DIR) && git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit -n 1 && cd - +endif +endif + #Checks for SYSROOT check_sysroot: ifneq ($(HOST_ARCH), x86) @@ -74,25 +107,19 @@ ifndef SYSROOT endif endif -check_version: -ifneq (, $(shell which git)) -ifneq (,$(wildcard $(XFLIB_DIR)/.git)) - @cd $(XFLIB_DIR) && git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit -n 1 && cd - -endif -endif - #Checks for g++ CXX := g++ +CXX_REQ := $(shell echo $(GCC_INTOOL) | cut -f 1 -d ".") ifeq ($(HOST_ARCH), x86) -ifneq ($(shell expr $(shell g++ -dumpversion) \>= 5), 1) +ifneq ($(shell expr $(shell echo "__GNUG__" | g++ -E -x c++ - | tail -1) \>= $(CXX_REQ)), 1) ifndef XILINX_VIVADO -$(error [ERROR]: g++ version too old. Please use 5.0 or above) +$(error [ERROR]: g++ version too old. Please use $(CXX_REQ) or above) else -CXX := $(XILINX_VIVADO)/tps/lnx64/gcc-6.2.0/bin/g++ +CXX := $(XILINX_VIVADO)/tps/lnx64/gcc-$(GCC_INTOOL)/bin/g++ ifeq ($(LD_LIBRARY_PATH),) -export LD_LIBRARY_PATH := $(XILINX_VIVADO)/tps/lnx64/gcc-6.2.0/lib64 +export LD_LIBRARY_PATH := $(XILINX_VIVADO)/tps/lnx64/gcc-$(GCC_INTOOL)/lib64 else -export LD_LIBRARY_PATH := $(XILINX_VIVADO)/tps/lnx64/gcc-6.2.0/lib64:$(LD_LIBRARY_PATH) +export LD_LIBRARY_PATH := $(XILINX_VIVADO)/tps/lnx64/gcc-$(GCC_INTOOL)/lib64:$(LD_LIBRARY_PATH) endif $(warning [WARNING]: g++ version too old. Using g++ provided by the tool: $(CXX)) endif @@ -103,10 +130,20 @@ else ifeq ($(HOST_ARCH), aarch32) CXX := $(XILINX_VITIS)/gnu/aarch32/lin/gcc-arm-linux-gnueabi/bin/arm-linux-gnueabihf-g++ endif +#check binutils +BINUTILS := $(shell ld -v | cut -f 4 -d " " | cut -f 1 -d "-") +BINUTILS_REQ := $(BINUTILS_INTOOL) +ifneq ($(shell expr $(BINUTILS) \>= $(BINUTILS_REQ)), 1) +export PATH := $(XILINX_VIVADO)/tps/lnx64/binutils-$(BINUTILS_INTOOL)/bin:$(PATH) +endif + #Setting VPP VPP := v++ #Cheks for aiecompiler +AIECXX := aiecompiler +AIESIMULATOR := aiesimulator +X86SIMULATOR := x86simulator .PHONY: check_vivado check_vivado: @@ -122,11 +159,9 @@ endif .PHONY: check_xrt check_xrt: -ifeq ($(HOST_ARCH), x86) ifeq (,$(wildcard $(XILINX_XRT)/lib/libxilinxopencl.so)) @echo "Cannot locate XRT installation. Please set XILINX_XRT variable." && false endif -endif export PATH := $(XILINX_VITIS)/bin:$(XILINX_XRT)/bin:$(PATH) ifeq ($(HOST_ARCH), x86) @@ -135,82 +170,64 @@ LD_LIBRARY_PATH := $(XILINX_XRT)/lib else LD_LIBRARY_PATH := $(XILINX_XRT)/lib:$(LD_LIBRARY_PATH) endif -else # aarch64 -ifeq (,$(LD_LIBRARY_PATH)) -LD_LIBRARY_PATH := $(SYSROOT)/usr/lib -else -LD_LIBRARY_PATH := $(SYSROOT)/usr/lib:$(LD_LIBRARY_PATH) -endif endif -# check target -ifeq ($(filter $(TARGET),sw_emu hw_emu hw),) -$(error TARGET is not sw_emu, hw_emu or hw) -endif - -ifneq (,$(wildcard $(DEVICE))) -# Use DEVICE as a file path -XPLATFORM := $(DEVICE) +ifneq (,$(wildcard $(PLATFORM))) +# Use PLATFORM as a file path +XPLATFORM := $(PLATFORM) else -# Use DEVICE as a file name pattern +# Use PLATFORM as a file name pattern # 1. search paths specified by variable ifneq (,$(PLATFORM_REPO_PATHS)) # 1.1 as exact name -XPLATFORM := $(strip $(foreach p, $(subst :, ,$(PLATFORM_REPO_PATHS)), $(wildcard $(p)/$(DEVICE)/$(DEVICE).xpfm))) +XPLATFORM := $(strip $(foreach p, $(subst :, ,$(PLATFORM_REPO_PATHS)), $(wildcard $(p)/$(PLATFORM)/$(PLATFORM).xpfm))) # 1.2 as a pattern ifeq (,$(XPLATFORM)) XPLATFORMS := $(foreach p, $(subst :, ,$(PLATFORM_REPO_PATHS)), $(wildcard $(p)/*/*.xpfm)) -XPLATFORM := $(strip $(foreach p, $(XPLATFORMS), $(shell echo $(p) | awk '$$1 ~ /$(DEVICE)/'))) +XPLATFORM := $(strip $(foreach p, $(XPLATFORMS), $(shell echo $(p) | awk '$$1 ~ /$(PLATFORM)/'))) endif # 1.2 endif # 1 # 2. search Vitis installation ifeq (,$(XPLATFORM)) # 2.1 as exact name -XPLATFORM := $(strip $(wildcard $(XILINX_VITIS)/platforms/$(DEVICE)/$(DEVICE).xpfm)) +XPLATFORM := $(strip $(wildcard $(XILINX_VITIS)/platforms/$(PLATFORM)/$(PLATFORM).xpfm)) # 2.2 as a pattern ifeq (,$(XPLATFORM)) XPLATFORMS := $(wildcard $(XILINX_VITIS)/platforms/*/*.xpfm) -XPLATFORM := $(strip $(foreach p, $(XPLATFORMS), $(shell echo $(p) | awk '$$1 ~ /$(DEVICE)/'))) +XPLATFORM := $(strip $(foreach p, $(XPLATFORMS), $(shell echo $(p) | awk '$$1 ~ /$(PLATFORM)/'))) endif # 2.2 endif # 2 # 3. search default locations ifeq (,$(XPLATFORM)) # 3.1 as exact name -XPLATFORM := $(strip $(wildcard /opt/xilinx/platforms/$(DEVICE)/$(DEVICE).xpfm)) +XPLATFORM := $(strip $(wildcard /opt/xilinx/platforms/$(PLATFORM)/$(PLATFORM).xpfm)) # 3.2 as a pattern ifeq (,$(XPLATFORM)) XPLATFORMS := $(wildcard /opt/xilinx/platforms/*/*.xpfm) -XPLATFORM := $(strip $(foreach p, $(XPLATFORMS), $(shell echo $(p) | awk '$$1 ~ /$(DEVICE)/'))) +XPLATFORM := $(strip $(foreach p, $(XPLATFORMS), $(shell echo $(p) | awk '$$1 ~ /$(PLATFORM)/'))) endif # 3.2 endif # 3 endif define MSG_PLATFORM -No platform matched pattern '$(DEVICE)'. +No platform matched pattern '$(PLATFORM)'. Available platforms are: $(XPLATFORMS) -To add more platform directories, set the PLATFORM_REPO_PATHS variable or point DEVICE variable to the full path of platform .xpfm file. +To add more platform directories, set the PLATFORM_REPO_PATHS variable or point PLATFORM variable to the full path of platform .xpfm file. endef export MSG_PLATFORM -define MSG_DEVICE -More than one platform matched: $(XPLATFORM) -Please set DEVICE variable more accurately to select only one platform file, or set DEVICE variable to the full path of the platform .xpfm file. -endef -export MSG_DEVICE .PHONY: check_platform check_platform: ifeq (,$(XPLATFORM)) @echo "$${MSG_PLATFORM}" && false endif -ifneq (,$(word 2,$(XPLATFORM))) - @echo "$${MSG_DEVICE}" && false -endif #Check ends # device2xsa - create a filesystem friendly name from device name # $(1) - full name of device -device2xsa = $(strip $(patsubst %.xpfm, % , $(shell basename $(DEVICE)))) +PLATFORM_NAME = $(strip $(patsubst %.xpfm, % , $(shell basename $(PLATFORM)))) + # Cleaning stuff RM = rm -f diff --git a/security/L1/benchmarks/crc32/Makefile b/security/L1/benchmarks/crc32/Makefile index 5e1a89ecbe..54bcfb0ca3 100644 --- a/security/L1/benchmarks/crc32/Makefile +++ b/security/L1/benchmarks/crc32/Makefile @@ -1,5 +1,4 @@ -# -# Copyright 2019-2021 Xilinx, Inc. +# Copyright 2019-2022 Xilinx, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -12,308 +11,327 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -# makefile-generator v1.0.4 -# +# vitis makefile-generator v2.0.6 -# ####################################### Help Section ##################################### +############################## Help Section ############################## .PHONY: help help:: $(ECHO) "Makefile Usage:" - $(ECHO) " make all TARGET= DEVICE= HOST_ARCH=" + $(ECHO) " make all TARGET= PLATFORM= HOST_ARCH=" $(ECHO) " Command to generate the design for specified Target and Shell." + $(ECHO) " By default, HOST_ARCH=x86. HOST_ARCH is required for SoC shells" $(ECHO) "" - $(ECHO) " make clean " - $(ECHO) " Command to remove the generated non-hardware files." - $(ECHO) "" - $(ECHO) " make cleanall" - $(ECHO) " Command to remove all the generated files." - $(ECHO) "" - $(ECHO) " make sd_card TARGET= DEVICE= HOST_ARCH=" - $(ECHO) " Command to prepare sd_card files." - $(ECHO) " This target is only used in embedded device." + $(ECHO) " make run TARGET= PLATFORM= HOST_ARCH=" + $(ECHO) " Command to run application in emulation." + $(ECHO) " By default, HOST_ARCH=x86. HOST_ARCH required for SoC shells" $(ECHO) "" - $(ECHO) " make run TARGET= DEVICE= HOST_ARCH=" - $(ECHO) " Command to run application in emulation or on board." - $(ECHO) "" - $(ECHO) " make build TARGET= DEVICE= HOST_ARCH=" + $(ECHO) " make xclbin TARGET= PLATFORM= HOST_ARCH=" $(ECHO) " Command to build xclbin application." + $(ECHO) " By default, HOST_ARCH=x86. HOST_ARCH is required for SoC shells" $(ECHO) "" - $(ECHO) " make host HOST_ARCH=" + $(ECHO) " make host TARGET=" $(ECHO) " Command to build host application." - $(ECHO) " By default, HOST_ARCH=x86. HOST_ARCH is required for embedded devices" + $(ECHO) " By default, HOST_ARCH=x86. HOST_ARCH is required for SoC shells" $(ECHO) "" - $(ECHO) " NOTE: For embedded devices, e.g. zcu102/zcu104/vck190, env variable SYSROOT, EDGE_COMMON_SW and PERL need to be set first, and HOST_ARCH is either aarch32 or aarch64. For example," + $(ECHO) " NOTE: For embedded devices, e.g. zcu102/zcu104/vck190, env variable SYSROOT and EDGE_COMMON_SW need to be set first, and HOST_ARCH is either aarch32 or aarch64. For example," $(ECHO) " export SYSROOT=< path-to-platform-sysroot >" $(ECHO) " export EDGE_COMMON_SW=< path-to-rootfs-and-Image-files >" - $(ECHO) " export PERL=" + $(ECHO) "" + $(ECHO) " make clean " + $(ECHO) " Command to remove the generated non-hardware files." + $(ECHO) "" + $(ECHO) " make cleanall" + $(ECHO) " Command to remove all the generated files." $(ECHO) "" -# ##################### Setting up default value of TARGET ########################## -TARGET ?= sw_emu +############################## Setting up Project Variables ############################## -# ################### Setting up default value of DEVICE ############################## -DEVICE ?= xilinx_u50_gen3x16_xdma_201920_3 +MK_PATH := $(abspath $(lastword $(MAKEFILE_LIST))) +XF_PROJ_ROOT ?= $(shell bash -c 'export MK_PATH=$(MK_PATH); echo $${MK_PATH%/L1/*}') +CUR_DIR := $(patsubst %/,%,$(dir $(MK_PATH))) +XFLIB_DIR = $(XF_PROJ_ROOT) -# ###################### Setting up default value of HOST_ARCH ####################### +# setting devault value +TARGET ?= sw_emu HOST_ARCH ?= x86 -# #################### Checking if DEVICE in blacklist ############################# -ifeq ($(findstring zc, $(DEVICE)), zc) -$(error [ERROR]: This project is not supported for $(DEVICE).) -endif - -# #################### Checking if DEVICE in whitelist ############################ -ifneq ($(findstring u50, $(DEVICE)), u50) -ifneq ($(findstring aws-vu9p-f1, $(DEVICE)), aws-vu9p-f1) -ifneq ($(findstring vck190, $(DEVICE)), vck190) -$(warning [WARNING]: This project has not been tested for $(DEVICE). It may or may not work.) -endif +#setting PLATFORM +ifeq ($(PLATFORM),) +PLATFORM := $(DEVICE) endif +ifeq ($(PLATFORM),) +PLATFORM := xilinx_u50_gen3x16_xdma_5_202210_1 endif -# ######################## Setting up Project Variables ################################# -MK_PATH := $(abspath $(lastword $(MAKEFILE_LIST))) -XF_PROJ_ROOT ?= $(shell bash -c 'export MK_PATH=$(MK_PATH); echo $${MK_PATH%/L1/*}') -CUR_DIR := $(patsubst %/,%,$(dir $(MK_PATH))) -XFLIB_DIR = $(XF_PROJ_ROOT) +# #################### Checking if PLATFORM in whitelist ############################ +PLATFORM_ALLOWLIST += u50 aws-vu9p-f1 vck190 +PLATFORM_BLOCKLIST += zc -# ######################### Include environment variables in utils.mk #################### include ./utils.mk -XDEVICE := $(call device2xsa, $(DEVICE)) -TEMP_DIR := _x_temp.$(TARGET).$(XDEVICE) -TEMP_REPORT_DIR := $(CUR_DIR)/reports/_x.$(TARGET).$(XDEVICE) -BUILD_DIR := build_dir.$(TARGET).$(XDEVICE) -BUILD_REPORT_DIR := $(CUR_DIR)/reports/_build.$(TARGET).$(XDEVICE) -EMCONFIG_DIR := $(BUILD_DIR) +TEMP_DIR := _x_temp.$(TARGET).$(PLATFORM_NAME) +TEMP_REPORT_DIR := $(CUR_DIR)/reports/_x.$(TARGET).$(PLATFORM_NAME) +BUILD_DIR := build_dir.$(TARGET).$(PLATFORM_NAME) +ifneq ($(RESULT_DIR),) +BUILD_DIR = $(RESULT_DIR) +endif +BUILD_REPORT_DIR := $(CUR_DIR)/reports/_build.$(TARGET).$(PLATFORM_NAME) +EMCONFIG := $(BUILD_DIR)/emconfig.json XCLBIN_DIR := $(CUR_DIR)/$(BUILD_DIR) export XCL_BINDIR = $(XCLBIN_DIR) -# ####################### Setting environment variables for embedded ##################### -ifneq ($(HOST_ARCH), x86) -SYSROOT := $(SYSROOT) -PERL ?= perl -SDCARD := sd_card -EMU_DIR := $(SDCARD)/data/emulation -endif - -# ######################### Setting up Host Variables ######################### -#Include Required Host Source Files -HOST_SRCS += $(XFLIB_DIR)/L1/benchmarks/crc32/host/main.cpp -HOST_SRCS += $(XFLIB_DIR)/ext/xcl2/xcl2.cpp -CXXFLAGS += -I$(XFLIB_DIR)/L1/include -CXXFLAGS += -I$(XFLIB_DIR)/L1/benchmarks/crc32/host -CXXFLAGS += -I$(XFLIB_DIR)/L1/benchmarks/crc32/kernel -CXXFLAGS += -I$(XFLIB_DIR)/ext/xcl2 -CXXFLAGS += -I$(XFLIB_DIR)/../utils/L1/include -CXXFLAGS += -I$(XFLIB_DIR)/ext/xcl2 - +EXE_FILE_DEPS := +BINARY_CONTAINERS_DEPS := +RUN_DEPS := +# get global setting +ifeq ($(HOST_ARCH), x86) +CXXFLAGS += -fmessage-length=0 -I$(CUR_DIR)/src/ -I$(XILINX_XRT)/include -I$(XILINX_HLS)/include -std=c++14 -O3 -Wall -Wno-unknown-pragmas -Wno-unused-label +LDFLAGS += -pthread -L$(XILINX_XRT)/lib -L$(XILINX_HLS)/lnx64/tools/fpo_v7_0 -Wl,--as-needed -lOpenCL -lxrt_coreutil -lgmp -lmpfr -lIp_floating_point_v7_0_bitacc_cmodel +VPP_FLAGS += -t $(TARGET) --platform $(XPLATFORM) --save-temps +VPP_LDFLAGS += --optimize 2 -R 2 +else ifeq ($(HOST_ARCH), aarch64) +CXXFLAGS += -I$(CUR_DIR)/src/ -fmessage-length=0 --sysroot=$(SYSROOT) -I$(SYSROOT)/usr/include/xrt -I$(XILINX_HLS)/include -std=c++14 -O3 -Wall -Wno-unknown-pragmas -Wno-unused-label +LDFLAGS += -pthread -L$(SYSROOT)/usr/lib -L$(XILINX_VITIS_AIETOOLS)/lib/aarch64.o -Wl,--as-needed -lxilinxopencl -lxrt_coreutil +VPP_FLAGS += -t $(TARGET) --platform $(XPLATFORM) --save-temps +VPP_LDFLAGS += --optimize 2 -R 2 +endif +CXXFLAGS += $(EXTRA_CXXFLAGS) +VPP_FLAGS += $(EXTRA_VPP_FLAGS) +########################## Setting up Host Variables ########################## ifeq ($(TARGET),sw_emu) CXXFLAGS += -D SW_EMU_TEST endif - ifeq ($(TARGET),hw_emu) CXXFLAGS += -D HW_EMU_TEST endif -# ######################### Host compiler global settings ############################ -ifneq ($(HOST_ARCH), x86) -CXXFLAGS += --sysroot=$(SYSROOT) -CXXFLAGS += -I$(SYSROOT)/usr/include/xrt -I$(XILINX_HLS)/include -std=c++14 -O3 -Wall -Wno-unknown-pragmas -Wno-unused-label -else -CXXFLAGS += -I$(XILINX_XRT)/include -I$(XILINX_HLS)/include -std=c++11 -O3 -Wall -Wno-unknown-pragmas -Wno-unused-label +ifeq (,$(findstring opencv,$(CXXFLAGS))) +CXXFLAGS += $(XRT_CXXFLAGS) endif -LDFLAGS += -L$(XILINX_XRT)/lib -lOpenCL -lpthread -lrt -Wno-unused-label -Wno-narrowing -DVERBOSE -CXXFLAGS += -fmessage-length=0 -O3 -CXXFLAGS += -I$(CUR_DIR)/src/ -ifeq ($(HOST_ARCH), x86) -LDFLAGS += -L$(XILINX_HLS)/lnx64/tools/fpo_v7_0 -Wl,--as-needed -lgmp -lmpfr -lIp_floating_point_v7_0_bitacc_cmodel -endif +#Inclue Required Host Source Files ifneq (,$(shell echo $(XPLATFORM) | awk '/vck190/')) -CXXFLAGS += -I$(SYSROOT)/usr/include +HOST_SRCS += $(XFLIB_DIR)/L1/benchmarks/crc32/host/main.cpp $(XFLIB_DIR)/ext/xcl2/xcl2.cpp +CXXFLAGS += -I $(SYSROOT)/usr/include -I $(XFLIB_DIR)/L1/include -I $(XFLIB_DIR)/L1/benchmarks/crc32/host -I $(XFLIB_DIR)/L1/benchmarks/crc32/kernel -I $(XFLIB_DIR)/ext/xcl2 -I $(XFLIB_DIR)/../utils/L1/include -I $(XFLIB_DIR)/ext/xcl2 CXXFLAGS += --sysroot=$(SYSROOT) -LDFLAGS += -L$(SYSROOT)/usr/lib -LDFLAGS += -L${SYSROOT}/opt/xilinx/xrt/lib -endif +LDFLAGS += -L $(SYSROOT)/usr/lib -L ${SYSROOT}/opt/xilinx/xrt/lib -# ################### Setting package and image directory ####################### -EMBEDDED_PACKAGE_OUT = package_$(TARGET) -ifneq (,$(findstring zc706, $(XDEVICE))) -K_IMAGE := $(EDGE_COMMON_SW)/uImage -else -K_IMAGE := $(EDGE_COMMON_SW)/Image -endif +else +HOST_SRCS += $(XFLIB_DIR)/L1/benchmarks/crc32/host/main.cpp $(XFLIB_DIR)/ext/xcl2/xcl2.cpp +CXXFLAGS += -I $(XFLIB_DIR)/L1/include -I $(XFLIB_DIR)/L1/benchmarks/crc32/host -I $(XFLIB_DIR)/L1/benchmarks/crc32/kernel -I $(XFLIB_DIR)/ext/xcl2 -I $(XFLIB_DIR)/../utils/L1/include -I $(XFLIB_DIR)/ext/xcl2 +CXXFLAGS += -O3 +endif EXE_NAME := host.exe EXE_FILE := $(BUILD_DIR)/$(EXE_NAME) -HOST_ARGS := -xclbin $(BUILD_DIR)/CRC32Kernel.xclbin -data $(CUR_DIR)/test.dat -num 16 +EXE_FILE_DEPS := $(HOST_SRCS) $(EXE_FILE_DEPS) +HOST_ARGS := -xclbin $(BUILD_DIR)/CRC32Kernel.xclbin -data $(CUR_DIR)/test.dat -num 16 +ifneq ($(HOST_ARCH), x86) PKG_HOST_ARGS = $(foreach args,$(HOST_ARGS),$(subst $(dir $(patsubst %/,%,$(args))),,$(args))) +endif -# ##################### Kernel compiler global settings ########################## -VPP_FLAGS += -t $(TARGET) --platform $(XPLATFORM) --save-temps --optimize 2 -VPP_FLAGS += --hls.jobs 8 -VPP_LDFLAGS += --vivado.synth.jobs 8 --vivado.impl.jobs 8 +########################## Kernel compiler global settings ########################## ifneq (,$(shell echo $(XPLATFORM) | awk '/u50/')) -VPP_FLAGS += --config $(CUR_DIR)/conn_u50.cfg -endif +VPP_FLAGS += --config $(CUR_DIR)/conn_u50.cfg +VPP_FLAGS += -I $(XFLIB_DIR)/L1/include -I $(XFLIB_DIR)/L1/benchmarks/crc32/kernel -I $(XFLIB_DIR)/L1/include -VPP_FLAGS += -I$(XFLIB_DIR)/L1/include +else +VPP_FLAGS += -I $(XFLIB_DIR)/L1/include -I $(XFLIB_DIR)/L1/benchmarks/crc32/kernel -I $(XFLIB_DIR)/L1/include -VPP_FLAGS += -I$(XFLIB_DIR)/L1/include -VPP_FLAGS += -I$(XFLIB_DIR)/L1/benchmarks/crc32/kernel +endif -CRC32Kernel_VPP_FLAGS += --hls.clock 300000000:CRC32Kernel +######################### binary container global settings ########################## +VPP_FLAGS_CRC32Kernel += --hls.clock 300000000:CRC32Kernel ifneq ($(HOST_ARCH), x86) VPP_LDFLAGS_CRC32Kernel += --clock.defaultFreqHz 300000000 else VPP_LDFLAGS_CRC32Kernel += --kernel_frequency 300 endif - -# Kernel args - -# ############################ Declaring Binary Containers ########################## - ifeq ($(HOST_ARCH), x86) BINARY_CONTAINERS += $(BUILD_DIR)/CRC32Kernel.xclbin -BINARY_CONTAINERS_PKG += $(BUILD_DIR)/CRC32Kernel.xclbin else -BINARY_CONTAINERS += $(BUILD_DIR)/CRC32Kernel_xo.xclbin +BINARY_CONTAINERS += $(BUILD_DIR)/CRC32Kernel_pkg.$(LINK_TARGET_FMT) BINARY_CONTAINERS_PKG += $(BUILD_DIR)/CRC32Kernel.xclbin endif -BINARY_CONTAINER_CRC32Kernel_OBJS += $(TEMP_DIR)/CRC32Kernel.xo - -# ######################### Setting Targets of Makefile ################################ -DATA_FILE += $(XFLIB_DIR)/L1/benchmarks/crc32/test.dat - -.PHONY: all clean cleanall docs emconfig -ifeq ($(HOST_ARCH), x86) -all: check_version check_vpp check_platform check_xrt $(EXE_FILE) $(BINARY_CONTAINERS) emconfig -else -all: check_version check_vpp check_platform check_sysroot $(EXE_FILE) $(BINARY_CONTAINERS) emconfig sd_card -endif - -.PHONY: host -ifeq ($(HOST_ARCH), x86) -host: check_xrt $(EXE_FILE) -else -host: check_sysroot $(EXE_FILE) -endif - -.PHONY: xclbin -ifeq ($(HOST_ARCH), x86) -xclbin: check_vpp check_xrt $(BINARY_CONTAINERS) -else -xclbin: check_vpp check_sysroot $(BINARY_CONTAINERS) -endif - -.PHONY: build -build: xclbin # ################ Setting Rules for Binary Containers (Building Kernels) ################ -$(TEMP_DIR)/CRC32Kernel.xo: $(XFLIB_DIR)/L1/benchmarks/crc32/kernel/crc32_kernel.cpp +$(TEMP_DIR)/CRC32Kernel.xo: $(XFLIB_DIR)/L1/benchmarks/crc32/kernel/crc32_kernel.cpp $(ECHO) "Compiling Kernel: CRC32Kernel" mkdir -p $(TEMP_DIR) - $(VPP) -c $(CRC32Kernel_VPP_FLAGS) $(VPP_FLAGS) -k CRC32Kernel -I'$(> $(RUN_SCRIPT) +ifneq ($(filter sw_emu hw_emu, $(TARGET)),) + @echo 'export XCL_EMULATION_MODE=$(TARGET)' >> $(RUN_SCRIPT) +endif + @echo 'export XILINX_VITIS=/mnt' >> $(RUN_SCRIPT) + @echo 'export XILINX_XRT=/usr' >> $(RUN_SCRIPT) + @echo 'if [ -f platform_desc.txt ]; then' >> $(RUN_SCRIPT) + @echo ' cp platform_desc.txt /etc/xocl.txt' >> $(RUN_SCRIPT) + @echo 'fi' >> $(RUN_SCRIPT) + @echo './$(EXE_NAME) $(PKG_HOST_ARGS)' >> $(RUN_SCRIPT) + @echo 'return_code=$$?' >> $(RUN_SCRIPT) + @echo 'if [ $$return_code -ne 0 ]; then' >> $(RUN_SCRIPT) + @echo ' echo "ERROR: Embedded host run failed, RC=$$return_code"' >> $(RUN_SCRIPT) + @echo 'else' >> $(RUN_SCRIPT) + @echo ' echo "INFO: TEST PASSED, RC=0"' >> $(RUN_SCRIPT) + @echo 'fi' >> $(RUN_SCRIPT) + @echo 'echo "INFO: Embedded host run completed."' >> $(RUN_SCRIPT) + @echo 'exit $$return_code' >> $(RUN_SCRIPT) +DATA_FILE := $(XFLIB_DIR)/L1/benchmarks/crc32/test.dat +DATA_DIR := +SD_FILES += $(RUN_SCRIPT) +SD_FILES += $(EXE_FILE) +SD_FILES += $(EMCONFIG) +SD_FILES += xrt.ini +SD_FILES += $(DATA_FILE)# where define DATAFILE in json +SD_FILES_WITH_PREFIX = $(foreach sd_file,$(SD_FILES), $(if $(filter $(sd_file),$(wildcard $(sd_file))), --package.sd_file $(sd_file))) +SD_DIRS_WITH_PREFIX = $(foreach sd_dir,$(DATA_DIR),--package.sd_dir $(sd_dir)) +PACKAGE_FILES := $(BINARY_CONTAINERS) +PACKAGE_FILES += $(AIE_CONTAINER) +SD_CARD := $(CUR_DIR)/package_$(TARGET) +vck190_dfx_hw := false +$(SD_CARD): $(EXE_FILE) $(BINARY_CONTAINERS) $(RUN_SCRIPT) $(EMCONFIG) + @echo "Generating sd_card folder...." + mkdir -p $(SD_CARD) + chmod a+rx $(BUILD_DIR)/run_script.sh +ifneq (,$(findstring vck190_base_dfx, $(PLATFORM_NAME))) +ifeq ($(TARGET),hw) + $(VPP) -t $(TARGET) --platform $(XPLATFORM) -p $(PACKAGE_FILES) -o $(BINARY_CONTAINERS_PKG) + $(VPP) -t $(TARGET) --platform $(XPLATFORM) -p --package.out_dir $(SD_CARD) --package.rootfs $(SYSROOT)/../../rootfs.ext4 --package.kernel_image $(K_IMAGE) $(SD_FILES_WITH_PREFIX) $(SD_DIRS_WITH_PREFIX) --package.sd_file $(BINARY_CONTAINERS_PKG) + @echo "### ***** sd_card generation done! ***** ###" +vck190_dfx_hw := true +endif +endif +ifeq ($(vck190_dfx_hw), false) + $(VPP) -t $(TARGET) --platform $(XPLATFORM) -o $(BINARY_CONTAINERS_PKG) -p $(PACKAGE_FILES) $(VPP_PACKAGE) --package.out_dir $(SD_CARD) --package.rootfs $(SYSROOT)/../../rootfs.ext4 --package.kernel_image $(K_IMAGE) $(SD_FILES_WITH_PREFIX) $(SD_DIRS_WITH_PREFIX) + @echo "### ***** sd_card generation done! ***** ###" +endif +.PHONY: sd_card +sd_card: $(SD_CARD) +endif +############################## Setting Essential Checks and Building Rules ############################## +RUN_DEPS += $(EXE_FILE) $(BINARY_CONTAINERS) $(EMCONFIG) +RUN_DEPS += $(SD_CARD) -# ###############Setting Essential Checks And Running Rules For Vitis Flow ############# -# Setting default value for vitis flow -RESULT_VAL ?= -RUN_LEVEL ?= 7 +.PHONY: mkflag all run +mkflag: + mkdir -p $(BUILD_DIR) + rm -rf $(BUILD_DIR)/makefile_args.txt + @for var in $(MAKEFLAGS); do echo $$var >> $(BUILD_DIR)/makefile_args.txt; done +all: check_device check_vpp check_platform mkflag $(RUN_DEPS) run: all -ifeq ($(TARGET),$(filter $(TARGET),sw_emu hw_emu)) +#hw_emu +ifneq (,$(filter hw_emu, $(TARGET))) ifeq ($(HOST_ARCH), x86) - $(CP) $(EMCONFIG_DIR)/emconfig.json . + LD_LIBRARY_PATH=$(LIBRARY_PATH):$$LD_LIBRARY_PATH \ XCL_EMULATION_MODE=$(TARGET) $(EXE_FILE) $(HOST_ARGS) + else -ifeq ($(findstring vck190, $(DEVICE)), vck190) - export XCL_EMULATION_MODE=$(TARGET) - $(PERL) $(XF_PROJ_ROOT)/ext/make_utility/embedded_run_emulation.pl "./$(EMBEDDED_PACKAGE_OUT)/launch_$(TARGET).sh -noc-memory-config qemu-memory-_ddr@0x00000000 -no-reboot" "./run_script.sh" "$(RESULT_STRING)" "$(RUN_LEVEL)" | tee embedded_run.log + @echo $(RUN_DEPS) + $(SD_CARD)/launch_$(TARGET).sh -no-reboot -run-app $(notdir $(RUN_SCRIPT)) + grep "TEST PASSED, RC=0" $(SD_CARD)/qemu_output.log || exit 1 + endif endif -else +#sw_emu +ifneq (,$(filter sw_emu, $(TARGET))) ifeq ($(HOST_ARCH), x86) + LD_LIBRARY_PATH=$(LIBRARY_PATH):$$LD_LIBRARY_PATH \ + XCL_EMULATION_MODE=$(TARGET) $(EXE_FILE) $(HOST_ARGS) + +else + @echo $(RUN_DEPS) + $(SD_CARD)/launch_$(TARGET).sh -no-reboot -run-app $(notdir $(RUN_SCRIPT)) + grep "TEST PASSED, RC=0" $(SD_CARD)/qemu_output.log || exit 1 + +endif +endif +#hw +ifeq ($(TARGET), hw) +ifneq (,$(findstring aws-vu9p-f1, $(PLATFORM_NAME))) +ifneq ($(JENKINS_INTERNAL_BUILD), 1) + $(ECHO) "This makefile does not directly support converting .xclbin to .awsxclbin, please refer https://github.com/aws/aws-fpga/blob/master/Vitis/README.md for next operations" +else + $(ECHO) "Running inside Xilinx regression without converting to .awsxclbin" + $(EXE_FILE) $(HOST_ARGS) + +endif +else ifeq ($(HOST_ARCH), x86) $(EXE_FILE) $(HOST_ARGS) + else $(ECHO) "Please copy the content of sd_card folder and data to an SD Card and run on the board" endif endif -# ######################### Preparing sdcard folder ############################## -EMBEDDED_EXEC_SCRIPT = run_script.sh -PACKAGE_FILES += $(EMBEDDED_EXEC_SCRIPT) -PACKAGE_FILES += $(EXE_FILE) -PACKAGE_FILES += emconfig.json -PACKAGE_FILES += $(DATA_FILE) -SD_FILES_WITH_PREFIX = $(foreach sd_file,$(PACKAGE_FILES),--package.sd_file $(sd_file)) -SD_DIRS_WITH_PREFIX = $(foreach sd_dir,$(DATA_DIR),--package.sd_dir $(sd_dir)) -sd_card: host xclbin emconfig -ifneq ($(HOST_ARCH), x86) - @echo "Generating sd_card folder...." - mkdir -p $(EMBEDDED_PACKAGE_OUT) - rm -rf run_script.sh - @echo 'export LD_LIBRARY_PATH=/mnt:/tmp:$$LD_LIBRARY_PATH' >> run_script.sh -ifeq ($(TARGET), $(filter $(TARGET),sw_emu hw_emu)) - @echo 'export XCL_EMULATION_MODE=$(TARGET)' >> run_script.sh +############################## Setting Targets ############################## + +.PHONY: clean cleanall emconfig +emconfig: $(EMCONFIG) + +.PHONY: host +ifeq ($(HOST_ARCH), x86) +host: check_xrt $(EXE_FILE) +else +host: check_sysroot $(EXE_FILE) endif - @echo 'export XILINX_VITIS=/mnt' >> run_script.sh - @echo 'export XILINX_XRT=/usr' >> run_script.sh - @echo 'if [ -f platform_desc.txt ]; then' >> run_script.sh - @echo ' cp platform_desc.txt /etc/xocl.txt' >> run_script.sh - @echo 'fi' >> run_script.sh - emconfigutil --platform $(DEVICE) --nd 1; - @echo './$(EXE_NAME) $(PKG_HOST_ARGS)' >> run_script.sh - @echo 'return_code=$$?' >> run_script.sh - @echo 'if [ $$return_code -ne 0 ]; then' >> run_script.sh - @echo ' echo "ERROR: Embedded host run failed, RC=$$return_code"' >> run_script.sh - @echo 'fi' >> run_script.sh - @echo 'echo "INFO: Embedded host run completed."' >> run_script.sh - @echo 'exit $$return_code' >> run_script.sh - chmod a+rx run_script.sh - $(VPP) -t $(TARGET) --platform $(DEVICE) -o $(BINARY_CONTAINERS_PKG) -p $(BINARY_CONTAINERS) --package.out_dir $(EMBEDDED_PACKAGE_OUT) --package.rootfs $(EDGE_COMMON_SW)/rootfs.ext4 --package.sd_file $(K_IMAGE) $(SD_FILES_WITH_PREFIX) $(SD_DIRS_WITH_PREFIX) - @echo "### ***** sd_card generation done! ***** ###" + +.PHONY: xclbin +ifeq ($(HOST_ARCH), x86) +xclbin: check_vpp check_xrt $(BINARY_CONTAINERS) +else +xclbin: check_vpp check_sysroot $(BINARY_CONTAINERS) endif -# ################################# Cleaning Rules ################################## +############################## Cleaning Rules ############################## cleanh: -$(RMDIR) $(EXE_FILE) vitis_* TempConfig system_estimate.xtxt *.rpt .run/ - -$(RMDIR) src/*.ll _xocc_* .Xil dltmp* xmltmp* *.log *.jou *.wcfg *.wdb sample_link.ini sample_compile.ini obj* bin* *.csv *.jpg *.jpeg *.png + -$(RMDIR) src/*.ll _xocc_* .Xil dltmp* xmltmp* *.log *.jou *.wcfg *.wdb sample_link.ini sample_compile.ini obj* bin* *.csv *.jpg *.jpeg *.png cleank: - -$(RMDIR) $(BUILD_DIR)/*.xclbin _vimage *xclbin.run_summary qemu-memory-_* emulation/ _vimage/ start_simulation.sh *.xclbin + -$(RMDIR) $(BUILD_DIR)/*.xclbin _vimage *xclbin.run_summary qemu-memory-_* emulation/ _vimage/ pl*start_simulation. sh *.xclbin -$(RMDIR) _x_temp.*/_x.* _x_temp.*/.Xil _x_temp.*/profile_summary.* xo_* _x* - -$(RMDIR) _x_temp.*/dltmp* _x_temp.*/kernel_info.dat _x_temp.*/*.log + -$(RMDIR) _x_temp.*/dltmp* _x_temp.*/kernel_info.dat _x_temp.*/*.log -$(RMDIR) _x_temp.* cleanall: cleanh cleank - -$(RMDIR) $(BUILD_DIR) sd_card* build_dir.* emconfig.json *.html $(TEMP_DIR) $(CUR_DIR)/reports *.csv *.run_summary $(CUR_DIR)/*.raw package_* run_script.sh .ipcache *.str - -$(RMDIR) $(XFLIB_DIR)/common/data/*.xe2xd* $(XFLIB_DIR)/common/data/*.orig* - - -$(RMDIR) $(AIE_CONTAINERS) $(CUR_DIR)/Work $(CUR_DIR)/*.xpe $(CUR_DIR)/hw.o $(CUR_DIR)/*.xsa $(CUR_DIR)/xnwOut aiesimulator_output .AIE_SIM_CMD_LINE_OPTIONS + -$(RMDIR) $(BUILD_DIR) emconfig.json *.html $(TEMP_DIR) $(CUR_DIR)/reports *.csv *.run_summary $(CUR_DIR)/*.raw package_* $(BUILD_DIR)/run_script.sh .ipcache *.str + -$(RMDIR) $(CUR_DIR)/Work $(CUR_DIR)/*.xpe $(CUR_DIR)/hw.o $(CUR_DIR)/*.xsa $(CUR_DIR)/xnwOut -clean: cleanh +clean: cleanh \ No newline at end of file diff --git a/security/L1/benchmarks/crc32/README.md b/security/L1/benchmarks/crc32/README.md index e0f631b938..14ddb3000d 100644 --- a/security/L1/benchmarks/crc32/README.md +++ b/security/L1/benchmarks/crc32/README.md @@ -18,12 +18,6 @@ The steps for library download and environment setup can be found in :ref:`l1_vi * **Build kernel(Step 2)** -Please check you've installed openSSL and make sure that its version is 1.0.2 or higher. Command to check openSSL version: - -``` - openssl version -``` - Run the following make command to build your XCLBIN and host binary targeting a specific device. Please be noticed that this process will take a long time, maybe couple of hours. ``` diff --git a/security/L1/benchmarks/crc32/description.json b/security/L1/benchmarks/crc32/description.json index 9b06beec55..114c178907 100644 --- a/security/L1/benchmarks/crc32/description.json +++ b/security/L1/benchmarks/crc32/description.json @@ -3,19 +3,19 @@ "name": "Xilinx CRC32 Benchmark", "description": "CRC32 Checksum Algorithm Benchmarking", "flow": "vitis", - "platform_whitelist": [ + "platform_allowlist": [ "u50", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [ + "platform_blocklist": [ "zc" ], "platform_properties": { "u50": { "v++": { "compiler": { - "cflags": [ + "clflags": [ "--config PROJECT/conn_u50.cfg" ] } diff --git a/security/L1/benchmarks/crc32/utils.mk b/security/L1/benchmarks/crc32/utils.mk index 3892ff1942..0ee80e90da 100644 --- a/security/L1/benchmarks/crc32/utils.mk +++ b/security/L1/benchmarks/crc32/utils.mk @@ -1,5 +1,5 @@ # -# Copyright 2019-2021 Xilinx, Inc. +# Copyright 2019-2022 Xilinx, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -12,6 +12,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. +# vitis makefile-generator v2.0.6 # #+------------------------------------------------------------------------------- # The following parameters are assigned with default values. These parameters can @@ -39,17 +40,59 @@ ifeq ($(DEBUG), yes) VPP_LDFLAGS += --dk protocol:all:all:all endif -#Checks for XILINX_XRT -ifeq ($(HOST_ARCH), x86) +#Check environment setup +ifndef XILINX_VITIS + XILINX_VITIS = /opt/xilinx/Vitis/$(TOOL_VERSION) + export XILINX_VITIS +endif ifndef XILINX_XRT XILINX_XRT = /opt/xilinx/xrt export XILINX_XRT endif + +check_device: + @set -eu; \ + inallowlist=False; \ + inblocklist=False; \ + for dev in $(PLATFORM_ALLOWLIST); \ + do if [[ $$(echo $(PLATFORM_NAME) | grep $$dev) != "" ]]; \ + then inallowlist=True; fi; \ + done ;\ + for dev in $(PLATFORM_BLOCKLIST); \ + do if [[ $$(echo $(PLATFORM_NAME) | grep $$dev) != "" ]]; \ + then inblocklist=True; fi; \ + done ;\ + if [[ $$inallowlist == False ]]; \ + then echo "[Warning]: The device $(PLATFORM_NAME) not in allowlist."; \ + fi; \ + if [[ $$inblocklist == True ]]; \ + then echo "[ERROR]: The device $(PLATFORM_NAME) in blocklist."; exit 1;\ + fi; + +#get HOST_ARCH by PLATFORM +ifneq (,$(PLATFORM)) +HOST_ARCH_temp = $(shell platforminfo -p $(PLATFORM) | grep 'CPU Type' | sed 's/.*://' | sed '/ai_engine/d' | sed 's/^[[:space:]]*//') +ifeq ($(HOST_ARCH_temp), x86) +HOST_ARCH := x86 +else ifeq ($(HOST_ARCH_temp), cortex-a9) +HOST_ARCH := aarch32 +else ifneq (,$(findstring cortex-a, $(HOST_ARCH_temp))) +HOST_ARCH := aarch64 +endif +endif + + +#get suffix of kernel by PLATFORM +VITIS_VER = $(shell v++ --version | grep 'v++' | sed 's/^[[:space:]]*//' | sed -e 's/^[*]* v++ v//g' | cut -d " " -f1) +DEVICE_TYPE = $(shell platforminfo -p $(PLATFORM) | grep 'FPGA Family' | sed 's/.*://' | sed '/ai_engine/d' | sed 's/^[[:space:]]*//') +ifeq ($(DEVICE_TYPE), versal) +ifeq ($(shell expr $(VITIS_VER) \>= 2022.1), 1) +LINK_TARGET_FMT := xsa else -ifndef XILINX_VITIS - XILINX_VITIS = /opt/xilinx/Vitis/$(TOOL_VERSION) - export XILINX_VITIS +LINK_TARGET_FMT := xclbin endif +else +LINK_TARGET_FMT := xclbin endif #Checks for Device Family @@ -59,13 +102,18 @@ else ifeq ($(HOST_ARCH), aarch64) DEV_FAM = Ultrascale endif -B_NAME = $(shell dirname $(XPLATFORM)) - #Checks for Correct architecture ifneq ($(HOST_ARCH), $(filter $(HOST_ARCH),aarch64 aarch32 x86)) $(error HOST_ARCH variable not set, please set correctly and rerun) endif +check_version: +ifneq (, $(shell which git)) +ifneq (,$(wildcard $(XFLIB_DIR)/.git)) + @cd $(XFLIB_DIR) && git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit -n 1 && cd - +endif +endif + #Checks for SYSROOT check_sysroot: ifneq ($(HOST_ARCH), x86) @@ -74,25 +122,24 @@ ifndef SYSROOT endif endif -check_version: -ifneq (, $(shell which git)) -ifneq (,$(wildcard $(XFLIB_DIR)/.git)) - @cd $(XFLIB_DIR) && git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit -n 1 && cd - -endif -endif - #Checks for g++ CXX := g++ ifeq ($(HOST_ARCH), x86) -ifneq ($(shell expr $(shell g++ -dumpversion) \>= 5), 1) +ifeq ($(shell expr $(VITIS_VER) \>= 2022.1), 1) +CXX_VER := 8.3.0 +else +CXX_VER := 6.2.0 +endif +CXX_V := $(shell echo $(CXX_VER) | awk -F. '{print tolower($$1)}') +ifneq ($(shell expr $(shell echo "__GNUG__" | g++ -E -x c++ - | tail -1) \>= $(CXX_V)), 1) ifndef XILINX_VIVADO -$(error [ERROR]: g++ version too old. Please use 5.0 or above) +$(error [ERROR]: g++ version too old. Please use $(CXX_VER) or above) else -CXX := $(XILINX_VIVADO)/tps/lnx64/gcc-6.2.0/bin/g++ +CXX := $(XILINX_VIVADO)/tps/lnx64/gcc-$(CXX_VER)/bin/g++ ifeq ($(LD_LIBRARY_PATH),) -export LD_LIBRARY_PATH := $(XILINX_VIVADO)/tps/lnx64/gcc-6.2.0/lib64 +export LD_LIBRARY_PATH := $(XILINX_VIVADO)/tps/lnx64/gcc-$(CXX_VER)/lib64 else -export LD_LIBRARY_PATH := $(XILINX_VIVADO)/tps/lnx64/gcc-6.2.0/lib64:$(LD_LIBRARY_PATH) +export LD_LIBRARY_PATH := $(XILINX_VIVADO)/tps/lnx64/gcc-$(CXX_VER)/lib64:$(LD_LIBRARY_PATH) endif $(warning [WARNING]: g++ version too old. Using g++ provided by the tool: $(CXX)) endif @@ -103,13 +150,22 @@ else ifeq ($(HOST_ARCH), aarch32) CXX := $(XILINX_VITIS)/gnu/aarch32/lin/gcc-arm-linux-gnueabi/bin/arm-linux-gnueabihf-g++ endif -#Check OS and setting env +#Check OS and setting env for xrt c++ api OSDIST = $(shell lsb_release -i |awk -F: '{print tolower($$2)}' | tr -d ' \t' ) OSREL = $(shell lsb_release -r |awk -F: '{print tolower($$2)}' |tr -d ' \t') -ifeq ($(OSDIST), centos) +# for centos and redhat +ifneq ($(findstring centos,$(OSDIST)),) +ifeq (7,$(shell echo $(OSREL) | awk -F. '{print tolower($$1)}' )) +ifeq ($(HOST_ARCH), x86) +XRT_CXXFLAGS += -D_GLIBCXX_USE_CXX11_ABI=0 +endif +endif +else ifneq ($(findstring redhat,$(OSDIST)),) ifeq (7,$(shell echo $(OSREL) | awk -F. '{print tolower($$1)}' )) -CXXFLAGS += -D_GLIBCXX_USE_CXX11_ABI=0 +ifeq ($(HOST_ARCH), x86) +XRT_CXXFLAGS += -D_GLIBCXX_USE_CXX11_ABI=0 +endif endif endif @@ -117,6 +173,9 @@ endif VPP := v++ #Cheks for aiecompiler +AIECXX := aiecompiler +AIESIMULATOR := aiesimulator +X86SIMULATOR := x86simulator .PHONY: check_vivado check_vivado: @@ -132,11 +191,9 @@ endif .PHONY: check_xrt check_xrt: -ifeq ($(HOST_ARCH), x86) ifeq (,$(wildcard $(XILINX_XRT)/lib/libxilinxopencl.so)) @echo "Cannot locate XRT installation. Please set XILINX_XRT variable." && false endif -endif export PATH := $(XILINX_VITIS)/bin:$(XILINX_XRT)/bin:$(PATH) ifeq ($(HOST_ARCH), x86) @@ -145,82 +202,64 @@ LD_LIBRARY_PATH := $(XILINX_XRT)/lib else LD_LIBRARY_PATH := $(XILINX_XRT)/lib:$(LD_LIBRARY_PATH) endif -else # aarch64 -ifeq (,$(LD_LIBRARY_PATH)) -LD_LIBRARY_PATH := $(SYSROOT)/usr/lib -else -LD_LIBRARY_PATH := $(SYSROOT)/usr/lib:$(LD_LIBRARY_PATH) -endif -endif - -# check target -ifeq ($(filter $(TARGET),sw_emu hw_emu hw),) -$(error TARGET is not sw_emu, hw_emu or hw) endif -ifneq (,$(wildcard $(DEVICE))) -# Use DEVICE as a file path -XPLATFORM := $(DEVICE) +ifneq (,$(wildcard $(PLATFORM))) +# Use PLATFORM as a file path +XPLATFORM := $(PLATFORM) else -# Use DEVICE as a file name pattern +# Use PLATFORM as a file name pattern # 1. search paths specified by variable ifneq (,$(PLATFORM_REPO_PATHS)) # 1.1 as exact name -XPLATFORM := $(strip $(foreach p, $(subst :, ,$(PLATFORM_REPO_PATHS)), $(wildcard $(p)/$(DEVICE)/$(DEVICE).xpfm))) +XPLATFORM := $(strip $(foreach p, $(subst :, ,$(PLATFORM_REPO_PATHS)), $(wildcard $(p)/$(PLATFORM)/$(PLATFORM).xpfm))) # 1.2 as a pattern ifeq (,$(XPLATFORM)) XPLATFORMS := $(foreach p, $(subst :, ,$(PLATFORM_REPO_PATHS)), $(wildcard $(p)/*/*.xpfm)) -XPLATFORM := $(strip $(foreach p, $(XPLATFORMS), $(shell echo $(p) | awk '$$1 ~ /$(DEVICE)/'))) +XPLATFORM := $(strip $(foreach p, $(XPLATFORMS), $(shell echo $(p) | awk '$$1 ~ /$(PLATFORM)/'))) endif # 1.2 endif # 1 # 2. search Vitis installation ifeq (,$(XPLATFORM)) # 2.1 as exact name -XPLATFORM := $(strip $(wildcard $(XILINX_VITIS)/platforms/$(DEVICE)/$(DEVICE).xpfm)) +XPLATFORM := $(strip $(wildcard $(XILINX_VITIS)/platforms/$(PLATFORM)/$(PLATFORM).xpfm)) # 2.2 as a pattern ifeq (,$(XPLATFORM)) XPLATFORMS := $(wildcard $(XILINX_VITIS)/platforms/*/*.xpfm) -XPLATFORM := $(strip $(foreach p, $(XPLATFORMS), $(shell echo $(p) | awk '$$1 ~ /$(DEVICE)/'))) +XPLATFORM := $(strip $(foreach p, $(XPLATFORMS), $(shell echo $(p) | awk '$$1 ~ /$(PLATFORM)/'))) endif # 2.2 endif # 2 # 3. search default locations ifeq (,$(XPLATFORM)) # 3.1 as exact name -XPLATFORM := $(strip $(wildcard /opt/xilinx/platforms/$(DEVICE)/$(DEVICE).xpfm)) +XPLATFORM := $(strip $(wildcard /opt/xilinx/platforms/$(PLATFORM)/$(PLATFORM).xpfm)) # 3.2 as a pattern ifeq (,$(XPLATFORM)) XPLATFORMS := $(wildcard /opt/xilinx/platforms/*/*.xpfm) -XPLATFORM := $(strip $(foreach p, $(XPLATFORMS), $(shell echo $(p) | awk '$$1 ~ /$(DEVICE)/'))) +XPLATFORM := $(strip $(foreach p, $(XPLATFORMS), $(shell echo $(p) | awk '$$1 ~ /$(PLATFORM)/'))) endif # 3.2 endif # 3 endif define MSG_PLATFORM -No platform matched pattern '$(DEVICE)'. +No platform matched pattern '$(PLATFORM)'. Available platforms are: $(XPLATFORMS) -To add more platform directories, set the PLATFORM_REPO_PATHS variable or point DEVICE variable to the full path of platform .xpfm file. +To add more platform directories, set the PLATFORM_REPO_PATHS variable or point PLATFORM variable to the full path of platform .xpfm file. endef export MSG_PLATFORM -define MSG_DEVICE -More than one platform matched: $(XPLATFORM) -Please set DEVICE variable more accurately to select only one platform file, or set DEVICE variable to the full path of the platform .xpfm file. -endef -export MSG_DEVICE .PHONY: check_platform check_platform: ifeq (,$(XPLATFORM)) @echo "$${MSG_PLATFORM}" && false endif -ifneq (,$(word 2,$(XPLATFORM))) - @echo "$${MSG_DEVICE}" && false -endif #Check ends # device2xsa - create a filesystem friendly name from device name # $(1) - full name of device -device2xsa = $(strip $(patsubst %.xpfm, % , $(shell basename $(DEVICE)))) +PLATFORM_NAME = $(strip $(patsubst %.xpfm, % , $(shell basename $(PLATFORM)))) + # Cleaning stuff RM = rm -f diff --git a/security/L1/benchmarks/hmac_sha1/Makefile b/security/L1/benchmarks/hmac_sha1/Makefile index dee2a4d125..78a77d50fd 100644 --- a/security/L1/benchmarks/hmac_sha1/Makefile +++ b/security/L1/benchmarks/hmac_sha1/Makefile @@ -1,5 +1,4 @@ -# -# Copyright 2019-2021 Xilinx, Inc. +# Copyright 2019-2022 Xilinx, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -12,16 +11,32 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -# makefile-generator v1.0.4 -# +# vitis makefile-generator v2.0.6 -# ####################################### Help Section ##################################### +############################## Help Section ############################## .PHONY: help help:: $(ECHO) "Makefile Usage:" - $(ECHO) " make all TARGET= DEVICE= HOST_ARCH=" + $(ECHO) " make all TARGET= PLATFORM= HOST_ARCH=" $(ECHO) " Command to generate the design for specified Target and Shell." + $(ECHO) " By default, HOST_ARCH=x86. HOST_ARCH is required for SoC shells" + $(ECHO) "" + $(ECHO) " make run TARGET= PLATFORM= HOST_ARCH=" + $(ECHO) " Command to run application in emulation." + $(ECHO) " By default, HOST_ARCH=x86. HOST_ARCH required for SoC shells" + $(ECHO) "" + $(ECHO) " make xclbin TARGET= PLATFORM= HOST_ARCH=" + $(ECHO) " Command to build xclbin application." + $(ECHO) " By default, HOST_ARCH=x86. HOST_ARCH is required for SoC shells" + $(ECHO) "" + $(ECHO) " make host TARGET=" + $(ECHO) " Command to build host application." + $(ECHO) " By default, HOST_ARCH=x86. HOST_ARCH is required for SoC shells" + $(ECHO) "" + $(ECHO) " NOTE: For embedded devices, e.g. zcu102/zcu104/vck190, env variable SYSROOT and EDGE_COMMON_SW need to be set first, and HOST_ARCH is either aarch32 or aarch64. For example," + $(ECHO) " export SYSROOT=< path-to-platform-sysroot >" + $(ECHO) " export EDGE_COMMON_SW=< path-to-rootfs-and-Image-files >" $(ECHO) "" $(ECHO) " make clean " $(ECHO) " Command to remove the generated non-hardware files." @@ -29,216 +44,316 @@ help:: $(ECHO) " make cleanall" $(ECHO) " Command to remove all the generated files." $(ECHO) "" - $(ECHO) " make run TARGET= DEVICE= HOST_ARCH=" - $(ECHO) " Command to run application in emulation or on board." - $(ECHO) "" - $(ECHO) " make build TARGET= DEVICE= HOST_ARCH=" - $(ECHO) " Command to build xclbin application." - $(ECHO) "" - $(ECHO) " make host HOST_ARCH=" - $(ECHO) " Command to build host application." - $(ECHO) "" -# ##################### Setting up default value of TARGET ########################## -TARGET ?= sw_emu +############################## Setting up Project Variables ############################## -# ################### Setting up default value of DEVICE ############################## -DEVICE ?= xilinx_u250_gen3x16_xdma_3_1_202020_1 +MK_PATH := $(abspath $(lastword $(MAKEFILE_LIST))) +XF_PROJ_ROOT ?= $(shell bash -c 'export MK_PATH=$(MK_PATH); echo $${MK_PATH%/L1/*}') +CUR_DIR := $(patsubst %/,%,$(dir $(MK_PATH))) +XFLIB_DIR = $(XF_PROJ_ROOT) -# ###################### Setting up default value of HOST_ARCH ####################### +# setting devault value +TARGET ?= sw_emu HOST_ARCH ?= x86 -# #################### Checking if DEVICE in blacklist ############################# -ifeq ($(findstring zc, $(DEVICE)), zc) -$(error [ERROR]: This project is not supported for $(DEVICE).) +#setting PLATFORM +ifeq ($(PLATFORM),) +PLATFORM := $(DEVICE) endif - -# #################### Checking if DEVICE in whitelist ############################ -ifneq ($(findstring xilinx_u250_xdma_201830_2, $(DEVICE)), xilinx_u250_xdma_201830_2) -$(warning [WARNING]: This project has not been tested for $(DEVICE). It may or may not work.) +ifeq ($(PLATFORM),) +PLATFORM := xilinx_u250_gen3x16_xdma_4_1_202210_1 endif -# ######################## Setting up Project Variables ################################# -MK_PATH := $(abspath $(lastword $(MAKEFILE_LIST))) -XF_PROJ_ROOT ?= $(shell bash -c 'export MK_PATH=$(MK_PATH); echo $${MK_PATH%/L1/*}') -CUR_DIR := $(patsubst %/,%,$(dir $(MK_PATH))) -XFLIB_DIR = $(XF_PROJ_ROOT) +# #################### Checking if PLATFORM in whitelist ############################ +PLATFORM_ALLOWLIST += u250 +PLATFORM_BLOCKLIST += zc aws-vu9p-f1 -# ######################### Include environment variables in utils.mk #################### include ./utils.mk -XDEVICE := $(call device2xsa, $(DEVICE)) -TEMP_DIR := _x_temp.$(TARGET).$(XDEVICE) -TEMP_REPORT_DIR := $(CUR_DIR)/reports/_x.$(TARGET).$(XDEVICE) -BUILD_DIR := build_dir.$(TARGET).$(XDEVICE) -BUILD_REPORT_DIR := $(CUR_DIR)/reports/_build.$(TARGET).$(XDEVICE) -EMCONFIG_DIR := $(BUILD_DIR) +TEMP_DIR := _x_temp.$(TARGET).$(PLATFORM_NAME) +TEMP_REPORT_DIR := $(CUR_DIR)/reports/_x.$(TARGET).$(PLATFORM_NAME) +BUILD_DIR := build_dir.$(TARGET).$(PLATFORM_NAME) +ifneq ($(RESULT_DIR),) +BUILD_DIR = $(RESULT_DIR) +endif +BUILD_REPORT_DIR := $(CUR_DIR)/reports/_build.$(TARGET).$(PLATFORM_NAME) +EMCONFIG := $(BUILD_DIR)/emconfig.json XCLBIN_DIR := $(CUR_DIR)/$(BUILD_DIR) export XCL_BINDIR = $(XCLBIN_DIR) -# ######################### Setting up Host Variables ######################### -#Include Required Host Source Files -HOST_SRCS += $(CUR_DIR)/host/main.cpp -HOST_SRCS += $(XFLIB_DIR)/ext/xcl2/xcl2.cpp -CXXFLAGS += -I$(XFLIB_DIR)/L1/include -CXXFLAGS += -I$(CUR_DIR)/host -CXXFLAGS += -I$(CUR_DIR)/kernel -CXXFLAGS += -I$(XFLIB_DIR)/ext/xcl2 -CXXFLAGS += -I$(XFLIB_DIR)/../utils/L1/include -CXXFLAGS += -I$(XFLIB_DIR)/ext/xcl2 - +EXE_FILE_DEPS := +BINARY_CONTAINERS_DEPS := +RUN_DEPS := +# get global setting +ifeq ($(HOST_ARCH), x86) +CXXFLAGS += -fmessage-length=0 -I$(CUR_DIR)/src/ -I$(XILINX_XRT)/include -I$(XILINX_HLS)/include -std=c++14 -O3 -Wall -Wno-unknown-pragmas -Wno-unused-label +LDFLAGS += -pthread -L$(XILINX_XRT)/lib -L$(XILINX_HLS)/lnx64/tools/fpo_v7_0 -Wl,--as-needed -lOpenCL -lxrt_coreutil -lgmp -lmpfr -lIp_floating_point_v7_0_bitacc_cmodel +VPP_FLAGS += -t $(TARGET) --platform $(XPLATFORM) --save-temps +VPP_LDFLAGS += --optimize 2 -R 2 +else ifeq ($(HOST_ARCH), aarch64) +CXXFLAGS += -I$(CUR_DIR)/src/ -fmessage-length=0 --sysroot=$(SYSROOT) -I$(SYSROOT)/usr/include/xrt -I$(XILINX_HLS)/include -std=c++14 -O3 -Wall -Wno-unknown-pragmas -Wno-unused-label +LDFLAGS += -pthread -L$(SYSROOT)/usr/lib -L$(XILINX_VITIS_AIETOOLS)/lib/aarch64.o -Wl,--as-needed -lxilinxopencl -lxrt_coreutil +VPP_FLAGS += -t $(TARGET) --platform $(XPLATFORM) --save-temps +VPP_LDFLAGS += --optimize 2 -R 2 +endif +CXXFLAGS += $(EXTRA_CXXFLAGS) +VPP_FLAGS += $(EXTRA_VPP_FLAGS) +########################## Setting up Host Variables ########################## ifeq ($(TARGET),sw_emu) CXXFLAGS += -D SW_EMU_TEST endif - ifeq ($(TARGET),hw_emu) CXXFLAGS += -D HW_EMU_TEST endif -# ######################### Host compiler global settings ############################ -CXXFLAGS += -I$(XILINX_XRT)/include -I$(XILINX_HLS)/include -std=c++11 -O3 -Wall -Wno-unknown-pragmas -Wno-unused-label -LDFLAGS += -L$(XILINX_XRT)/lib -lOpenCL -lpthread -lrt -Wno-unused-label -Wno-narrowing -DVERBOSE -CXXFLAGS += -fmessage-length=0 -CXXFLAGS += -I$(CUR_DIR)/src/ - -ifeq ($(HOST_ARCH), x86) -LDFLAGS += -L$(XILINX_HLS)/lnx64/tools/fpo_v7_0 -Wl,--as-needed -lgmp -lmpfr -lIp_floating_point_v7_0_bitacc_cmodel +ifeq (,$(findstring opencv,$(CXXFLAGS))) +CXXFLAGS += $(XRT_CXXFLAGS) endif + +#Inclue Required Host Source Files ifneq (,$(shell echo $(XPLATFORM) | awk '/u250/')) -CXXFLAGS += -D USE_DDR +HOST_SRCS += $(CUR_DIR)/host/main.cpp $(XFLIB_DIR)/ext/xcl2/xcl2.cpp +CXXFLAGS += -D USE_DDR +CXXFLAGS += -I $(XFLIB_DIR)/L1/include -I $(CUR_DIR)/host -I $(CUR_DIR)/kernel -I $(XFLIB_DIR)/ext/xcl2 -I $(XFLIB_DIR)/../utils/L1/include -I $(XFLIB_DIR)/ext/xcl2 + else ifneq (,$(shell echo $(XPLATFORM) | awk '/vck190/')) -CXXFLAGS += -I$(SYSROOT)/usr/include +HOST_SRCS += $(CUR_DIR)/host/main.cpp $(XFLIB_DIR)/ext/xcl2/xcl2.cpp +CXXFLAGS += -I $(SYSROOT)/usr/include -I $(XFLIB_DIR)/L1/include -I $(CUR_DIR)/host -I $(CUR_DIR)/kernel -I $(XFLIB_DIR)/ext/xcl2 -I $(XFLIB_DIR)/../utils/L1/include -I $(XFLIB_DIR)/ext/xcl2 CXXFLAGS += --sysroot=$(SYSROOT) -LDFLAGS += -L$(SYSROOT)/usr/lib -LDFLAGS += -L${SYSROOT}/opt/xilinx/xrt/lib -endif +LDFLAGS += -L $(SYSROOT)/usr/lib -L ${SYSROOT}/opt/xilinx/xrt/lib -# ################### Setting package and image directory ####################### +else +HOST_SRCS += $(CUR_DIR)/host/main.cpp $(XFLIB_DIR)/ext/xcl2/xcl2.cpp +CXXFLAGS += -I $(XFLIB_DIR)/L1/include -I $(CUR_DIR)/host -I $(CUR_DIR)/kernel -I $(XFLIB_DIR)/ext/xcl2 -I $(XFLIB_DIR)/../utils/L1/include -I $(XFLIB_DIR)/ext/xcl2 +endif EXE_NAME := hmacSha1Benchmark.exe EXE_FILE := $(BUILD_DIR)/$(EXE_NAME) -HOST_ARGS := -mode fpga -xclbin $(BUILD_DIR)/hmacSha1Kernel.xclbin -gld $(CUR_DIR)/data/gld.dat +EXE_FILE_DEPS := $(HOST_SRCS) $(EXE_FILE_DEPS) -# ##################### Kernel compiler global settings ########################## -VPP_FLAGS += -t $(TARGET) --platform $(XPLATFORM) --save-temps --optimize 2 -VPP_FLAGS += --hls.jobs 8 -VPP_LDFLAGS += --vivado.synth.jobs 8 --vivado.impl.jobs 8 -ifneq (,$(shell echo $(XPLATFORM) | awk '/u250/')) -VPP_FLAGS += --config $(CUR_DIR)/conn_u250.cfg +HOST_ARGS := -mode fpga -xclbin $(BUILD_DIR)/hmacSha1Kernel.xclbin -gld $(CUR_DIR)/data/gld.dat +ifneq ($(HOST_ARCH), x86) +PKG_HOST_ARGS = $(foreach args,$(HOST_ARGS),$(subst $(dir $(patsubst %/,%,$(args))),,$(args))) endif -VPP_FLAGS += -I$(XFLIB_DIR)/L1/include - -VPP_FLAGS += -I$(XFLIB_DIR)/L1/include -VPP_FLAGS += -I$(CUR_DIR)/kernel - -hmacSha1Kernel_1_VPP_FLAGS += --hls.clock 300000000:hmacSha1Kernel_1 -hmacSha1Kernel_2_VPP_FLAGS += --hls.clock 300000000:hmacSha1Kernel_2 -hmacSha1Kernel_3_VPP_FLAGS += --hls.clock 300000000:hmacSha1Kernel_3 -hmacSha1Kernel_4_VPP_FLAGS += --hls.clock 300000000:hmacSha1Kernel_4 -VPP_LDFLAGS_hmacSha1Kernel += --kernel_frequency 300 - - -# Kernel args - -# ############################ Declaring Binary Containers ########################## - -BINARY_CONTAINERS += $(BUILD_DIR)/hmacSha1Kernel.xclbin -BINARY_CONTAINER_hmacSha1Kernel_OBJS += $(TEMP_DIR)/hmacSha1Kernel_1.xo -BINARY_CONTAINER_hmacSha1Kernel_OBJS += $(TEMP_DIR)/hmacSha1Kernel_2.xo -BINARY_CONTAINER_hmacSha1Kernel_OBJS += $(TEMP_DIR)/hmacSha1Kernel_3.xo -BINARY_CONTAINER_hmacSha1Kernel_OBJS += $(TEMP_DIR)/hmacSha1Kernel_4.xo +########################## Kernel compiler global settings ########################## +ifneq (,$(shell echo $(XPLATFORM) | awk '/u250/')) +VPP_FLAGS += --config $(CUR_DIR)/conn_u250.cfg +VPP_FLAGS += -I $(XFLIB_DIR)/L1/include -I $(CUR_DIR)/kernel -I $(XFLIB_DIR)/L1/include -# ######################### Setting Targets of Makefile ################################ +else +VPP_FLAGS += -I $(XFLIB_DIR)/L1/include -I $(CUR_DIR)/kernel -I $(XFLIB_DIR)/L1/include -.PHONY: all clean cleanall docs emconfig -ifeq ($(HOST_ARCH), x86) -all: check_version check_vpp check_platform check_xrt $(EXE_FILE) $(BINARY_CONTAINERS) emconfig -else -all: check_version check_vpp check_platform check_sysroot $(EXE_FILE) $(BINARY_CONTAINERS) emconfig sd_card endif -.PHONY: host -ifeq ($(HOST_ARCH), x86) -host: check_xrt $(EXE_FILE) +######################### binary container global settings ########################## +VPP_FLAGS_hmacSha1Kernel_1 += --hls.clock 300000000:hmacSha1Kernel_1 +VPP_FLAGS_hmacSha1Kernel_2 += --hls.clock 300000000:hmacSha1Kernel_2 +VPP_FLAGS_hmacSha1Kernel_3 += --hls.clock 300000000:hmacSha1Kernel_3 +VPP_FLAGS_hmacSha1Kernel_4 += --hls.clock 300000000:hmacSha1Kernel_4 +ifneq ($(HOST_ARCH), x86) +VPP_LDFLAGS_hmacSha1Kernel += --clock.defaultFreqHz 300000000 else -host: check_sysroot $(EXE_FILE) +VPP_LDFLAGS_hmacSha1Kernel += --kernel_frequency 300 endif -.PHONY: xclbin ifeq ($(HOST_ARCH), x86) -xclbin: check_vpp check_xrt $(BINARY_CONTAINERS) +BINARY_CONTAINERS += $(BUILD_DIR)/hmacSha1Kernel.xclbin else -xclbin: check_vpp check_sysroot $(BINARY_CONTAINERS) +BINARY_CONTAINERS += $(BUILD_DIR)/hmacSha1Kernel_pkg.$(LINK_TARGET_FMT) +BINARY_CONTAINERS_PKG += $(BUILD_DIR)/hmacSha1Kernel.xclbin endif -.PHONY: build -build: xclbin - # ################ Setting Rules for Binary Containers (Building Kernels) ################ -$(TEMP_DIR)/hmacSha1Kernel_1.xo: $(CUR_DIR)/kernel/hmacSha1Kernel1.cpp +$(TEMP_DIR)/hmacSha1Kernel_1.xo: $(CUR_DIR)/kernel/hmacSha1Kernel1.cpp $(ECHO) "Compiling Kernel: hmacSha1Kernel_1" mkdir -p $(TEMP_DIR) - $(VPP) -c $(hmacSha1Kernel_1_VPP_FLAGS) $(VPP_FLAGS) -k hmacSha1Kernel_1 -I'$(> $(RUN_SCRIPT) +ifneq ($(filter sw_emu hw_emu, $(TARGET)),) + @echo 'export XCL_EMULATION_MODE=$(TARGET)' >> $(RUN_SCRIPT) +endif + @echo 'export XILINX_VITIS=/mnt' >> $(RUN_SCRIPT) + @echo 'export XILINX_XRT=/usr' >> $(RUN_SCRIPT) + @echo 'if [ -f platform_desc.txt ]; then' >> $(RUN_SCRIPT) + @echo ' cp platform_desc.txt /etc/xocl.txt' >> $(RUN_SCRIPT) + @echo 'fi' >> $(RUN_SCRIPT) + @echo './$(EXE_NAME) $(PKG_HOST_ARGS)' >> $(RUN_SCRIPT) + @echo 'return_code=$$?' >> $(RUN_SCRIPT) + @echo 'if [ $$return_code -ne 0 ]; then' >> $(RUN_SCRIPT) + @echo ' echo "ERROR: Embedded host run failed, RC=$$return_code"' >> $(RUN_SCRIPT) + @echo 'else' >> $(RUN_SCRIPT) + @echo ' echo "INFO: TEST PASSED, RC=0"' >> $(RUN_SCRIPT) + @echo 'fi' >> $(RUN_SCRIPT) + @echo 'echo "INFO: Embedded host run completed."' >> $(RUN_SCRIPT) + @echo 'exit $$return_code' >> $(RUN_SCRIPT) +DATA_FILE := $(CUR_DIR)//data/gld.dat +DATA_DIR := +SD_FILES += $(RUN_SCRIPT) +SD_FILES += $(EXE_FILE) +SD_FILES += $(EMCONFIG) +SD_FILES += xrt.ini +SD_FILES += $(DATA_FILE)# where define DATAFILE in json +SD_FILES_WITH_PREFIX = $(foreach sd_file,$(SD_FILES), $(if $(filter $(sd_file),$(wildcard $(sd_file))), --package.sd_file $(sd_file))) +SD_DIRS_WITH_PREFIX = $(foreach sd_dir,$(DATA_DIR),--package.sd_dir $(sd_dir)) +PACKAGE_FILES := $(BINARY_CONTAINERS) +PACKAGE_FILES += $(AIE_CONTAINER) +SD_CARD := $(CUR_DIR)/package_$(TARGET) +vck190_dfx_hw := false +$(SD_CARD): $(EXE_FILE) $(BINARY_CONTAINERS) $(RUN_SCRIPT) $(EMCONFIG) + @echo "Generating sd_card folder...." + mkdir -p $(SD_CARD) + chmod a+rx $(BUILD_DIR)/run_script.sh +ifneq (,$(findstring vck190_base_dfx, $(PLATFORM_NAME))) +ifeq ($(TARGET),hw) + $(VPP) -t $(TARGET) --platform $(XPLATFORM) -p $(PACKAGE_FILES) -o $(BINARY_CONTAINERS_PKG) + $(VPP) -t $(TARGET) --platform $(XPLATFORM) -p --package.out_dir $(SD_CARD) --package.rootfs $(SYSROOT)/../../rootfs.ext4 --package.kernel_image $(K_IMAGE) $(SD_FILES_WITH_PREFIX) $(SD_DIRS_WITH_PREFIX) --package.sd_file $(BINARY_CONTAINERS_PKG) + @echo "### ***** sd_card generation done! ***** ###" +vck190_dfx_hw := true +endif +endif +ifeq ($(vck190_dfx_hw), false) + $(VPP) -t $(TARGET) --platform $(XPLATFORM) -o $(BINARY_CONTAINERS_PKG) -p $(PACKAGE_FILES) $(VPP_PACKAGE) --package.out_dir $(SD_CARD) --package.rootfs $(SYSROOT)/../../rootfs.ext4 --package.kernel_image $(K_IMAGE) $(SD_FILES_WITH_PREFIX) $(SD_DIRS_WITH_PREFIX) + @echo "### ***** sd_card generation done! ***** ###" +endif + +.PHONY: sd_card +sd_card: $(SD_CARD) +endif +############################## Setting Essential Checks and Building Rules ############################## +RUN_DEPS += $(EXE_FILE) $(BINARY_CONTAINERS) $(EMCONFIG) +RUN_DEPS += $(SD_CARD) -# ###############Setting Essential Checks And Running Rules For Vitis Flow ############# +.PHONY: mkflag all run +mkflag: + mkdir -p $(BUILD_DIR) + rm -rf $(BUILD_DIR)/makefile_args.txt + @for var in $(MAKEFLAGS); do echo $$var >> $(BUILD_DIR)/makefile_args.txt; done +all: check_device check_vpp check_platform mkflag $(RUN_DEPS) run: all -ifeq ($(TARGET),$(filter $(TARGET),sw_emu hw_emu)) - $(CP) $(EMCONFIG_DIR)/emconfig.json . +#hw_emu +ifneq (,$(filter hw_emu, $(TARGET))) +ifeq ($(HOST_ARCH), x86) + LD_LIBRARY_PATH=$(LIBRARY_PATH):$$LD_LIBRARY_PATH \ XCL_EMULATION_MODE=$(TARGET) $(EXE_FILE) $(HOST_ARGS) + else + @echo $(RUN_DEPS) + $(SD_CARD)/launch_$(TARGET).sh -no-reboot -run-app $(notdir $(RUN_SCRIPT)) + grep "TEST PASSED, RC=0" $(SD_CARD)/qemu_output.log || exit 1 + +endif +endif +#sw_emu +ifneq (,$(filter sw_emu, $(TARGET))) +ifeq ($(HOST_ARCH), x86) + LD_LIBRARY_PATH=$(LIBRARY_PATH):$$LD_LIBRARY_PATH \ + XCL_EMULATION_MODE=$(TARGET) $(EXE_FILE) $(HOST_ARGS) + +else + @echo $(RUN_DEPS) + $(SD_CARD)/launch_$(TARGET).sh -no-reboot -run-app $(notdir $(RUN_SCRIPT)) + grep "TEST PASSED, RC=0" $(SD_CARD)/qemu_output.log || exit 1 + +endif +endif +#hw +ifeq ($(TARGET), hw) +ifneq (,$(findstring aws-vu9p-f1, $(PLATFORM_NAME))) +ifneq ($(JENKINS_INTERNAL_BUILD), 1) + $(ECHO) "This makefile does not directly support converting .xclbin to .awsxclbin, please refer https://github.com/aws/aws-fpga/blob/master/Vitis/README.md for next operations" +else + $(ECHO) "Running inside Xilinx regression without converting to .awsxclbin" + $(EXE_FILE) $(HOST_ARGS) + +endif +else ifeq ($(HOST_ARCH), x86) $(EXE_FILE) $(HOST_ARGS) + +else + $(ECHO) "Please copy the content of sd_card folder and data to an SD Card and run on the board" +endif endif -# ################################# Cleaning Rules ################################## +############################## Setting Targets ############################## + +.PHONY: clean cleanall emconfig +emconfig: $(EMCONFIG) + +.PHONY: host +ifeq ($(HOST_ARCH), x86) +host: check_xrt $(EXE_FILE) +else +host: check_sysroot $(EXE_FILE) +endif + +.PHONY: xclbin +ifeq ($(HOST_ARCH), x86) +xclbin: check_vpp check_xrt $(BINARY_CONTAINERS) +else +xclbin: check_vpp check_sysroot $(BINARY_CONTAINERS) +endif + +############################## Cleaning Rules ############################## cleanh: -$(RMDIR) $(EXE_FILE) vitis_* TempConfig system_estimate.xtxt *.rpt .run/ - -$(RMDIR) src/*.ll _xocc_* .Xil dltmp* xmltmp* *.log *.jou *.wcfg *.wdb sample_link.ini sample_compile.ini obj* bin* *.csv *.jpg *.jpeg *.png + -$(RMDIR) src/*.ll _xocc_* .Xil dltmp* xmltmp* *.log *.jou *.wcfg *.wdb sample_link.ini sample_compile.ini obj* bin* *.csv *.jpg *.jpeg *.png cleank: - -$(RMDIR) $(BUILD_DIR)/*.xclbin _vimage *xclbin.run_summary qemu-memory-_* emulation/ _vimage/ start_simulation.sh *.xclbin + -$(RMDIR) $(BUILD_DIR)/*.xclbin _vimage *xclbin.run_summary qemu-memory-_* emulation/ _vimage/ pl*start_simulation. sh *.xclbin -$(RMDIR) _x_temp.*/_x.* _x_temp.*/.Xil _x_temp.*/profile_summary.* xo_* _x* - -$(RMDIR) _x_temp.*/dltmp* _x_temp.*/kernel_info.dat _x_temp.*/*.log + -$(RMDIR) _x_temp.*/dltmp* _x_temp.*/kernel_info.dat _x_temp.*/*.log -$(RMDIR) _x_temp.* cleanall: cleanh cleank - -$(RMDIR) $(BUILD_DIR) build_dir.* emconfig.json *.html $(TEMP_DIR) $(CUR_DIR)/reports *.csv *.run_summary $(CUR_DIR)/*.raw package_* run_script.sh .ipcache *.str - -$(RMDIR) $(XFLIB_DIR)/common/data/*.xe2xd* $(XFLIB_DIR)/common/data/*.orig* - - -$(RMDIR) $(AIE_CONTAINERS) $(CUR_DIR)/Work $(CUR_DIR)/*.xpe $(CUR_DIR)/hw.o $(CUR_DIR)/*.xsa $(CUR_DIR)/xnwOut aiesimulator_output .AIE_SIM_CMD_LINE_OPTIONS + -$(RMDIR) $(BUILD_DIR) emconfig.json *.html $(TEMP_DIR) $(CUR_DIR)/reports *.csv *.run_summary $(CUR_DIR)/*.raw package_* $(BUILD_DIR)/run_script.sh .ipcache *.str + -$(RMDIR) $(CUR_DIR)/Work $(CUR_DIR)/*.xpe $(CUR_DIR)/hw.o $(CUR_DIR)/*.xsa $(CUR_DIR)/xnwOut -clean: cleanh +clean: cleanh \ No newline at end of file diff --git a/security/L1/benchmarks/hmac_sha1/README.md b/security/L1/benchmarks/hmac_sha1/README.md index ce86a7fe53..d3b0a144f6 100644 --- a/security/L1/benchmarks/hmac_sha1/README.md +++ b/security/L1/benchmarks/hmac_sha1/README.md @@ -18,12 +18,6 @@ The steps for library download and environment setup can be found in :ref:`l1_vi * **Build kernel(Step 2)** -Please check you've installed openSSL and make sure that its version is 1.0.2 or higher. Command to check openSSL version: - -``` - openssl version -``` - Run the following make command to build your XCLBIN and host binary targeting a specific device. Please be noticed that this process will take a long time, maybe couple of hours. ``` diff --git a/security/L1/benchmarks/hmac_sha1/description.json b/security/L1/benchmarks/hmac_sha1/description.json index 422d5b52f3..594a398830 100644 --- a/security/L1/benchmarks/hmac_sha1/description.json +++ b/security/L1/benchmarks/hmac_sha1/description.json @@ -1,15 +1,16 @@ { - "gui": true, - "name": "Xilinx HMAC-SHA1 Benchmark", - "description": "HMAC-SHA1 Algorithm Benchmarking", - "flow": "vitis", - "platform_type": "", - "platform_whitelist": [ - "xilinx_u250_xdma_201830_2" - ], - "platform_blacklist": [ - "zc" - ], + "gui": true, + "name": "Xilinx HMAC-SHA1 Benchmark", + "description": "HMAC-SHA1 Algorithm Benchmarking", + "flow": "vitis", + "platform_type": "", + "platform_allowlist": [ + "u250" + ], + "platform_blocklist": [ + "zc", + "aws-vu9p-f1" + ], "platform_properties": { "u250": { "host": { @@ -18,35 +19,35 @@ "USE_DDR" ] } - }, + }, "v++": { "compiler": { - "cflags": [ + "clflags": [ "--config PROJECT/conn_u250.cfg" ] } } - }, + }, "vck190": { "host": { "linker": { "librarypaths": [ - "$(SYSROOT)/usr/lib", + "$(SYSROOT)/usr/lib", "${SYSROOT}/opt/xilinx/xrt/lib" ] - }, + }, "compiler": { "includepaths": [ "$(SYSROOT)/usr/include" - ], + ], "options": "--sysroot=$(SYSROOT)" } - } + } } - }, + }, "launch": [ { - "cmd_args": " -mode fpga -xclbin BUILD/hmacSha1Kernel.xclbin -gld PROJECT/data/gld.dat", + "cmd_args": " -mode fpga -xclbin BUILD/hmacSha1Kernel.xclbin -gld PROJECT/data/gld.dat", "name": "generic launch for all flows" } ], @@ -54,153 +55,153 @@ "PROJECT/data/gld.dat" ], "host": { - "host_exe": "hmacSha1Benchmark.exe", + "host_exe": "hmacSha1Benchmark.exe", "compiler": { "sources": [ - "host/main.cpp", + "host/main.cpp", "LIB_DIR/ext/xcl2/xcl2.cpp" - ], + ], "includepaths": [ - "LIB_DIR/L1/include", - "host", - "kernel", + "LIB_DIR/L1/include", + "host", + "kernel", "LIB_DIR/ext/xcl2", "LIB_DIR/../utils/L1/include" ] } - }, + }, "v++": { "compiler": { "includepaths": [ - "LIB_DIR/L1/include", + "LIB_DIR/L1/include", "kernel" ] } - }, + }, "containers": [ { "accelerators": [ { - "location": "kernel/hmacSha1Kernel1.cpp", - "frequency": 300.0, - "name": "hmacSha1Kernel_1", - "num_compute_units": 1, + "location": "kernel/hmacSha1Kernel1.cpp", + "frequency": 300.0, + "name": "hmacSha1Kernel_1", + "num_compute_units": 1, "compute_units": [ { - "name": "hmacSha1Kernel_1", - "slr": "SLR0", + "name": "hmacSha1Kernel_1", + "slr": "SLR0", "arguments": [ { - "name": "inputData", + "name": "inputData", "memory": "DDR[0]" - }, + }, { - "name": "outputData", + "name": "outputData", "memory": "DDR[0]" } ] } ] - }, + }, { - "location": "kernel/hmacSha1Kernel2.cpp", - "frequency": 300.0, - "name": "hmacSha1Kernel_2", - "num_compute_units": 1, + "location": "kernel/hmacSha1Kernel2.cpp", + "frequency": 300.0, + "name": "hmacSha1Kernel_2", + "num_compute_units": 1, "compute_units": [ { - "name": "hmacSha1Kernel_2", - "slr": "SLR1", + "name": "hmacSha1Kernel_2", + "slr": "SLR1", "arguments": [ { - "name": "inputData", + "name": "inputData", "memory": "DDR[1]" - }, + }, { - "name": "outputData", + "name": "outputData", "memory": "DDR[1]" } ] } ] - }, + }, { - "location": "kernel/hmacSha1Kernel3.cpp", - "frequency": 300.0, - "name": "hmacSha1Kernel_3", - "num_compute_units": 1, + "location": "kernel/hmacSha1Kernel3.cpp", + "frequency": 300.0, + "name": "hmacSha1Kernel_3", + "num_compute_units": 1, "compute_units": [ { - "name": "hmacSha1Kernel_3", - "slr": "SLR2", + "name": "hmacSha1Kernel_3", + "slr": "SLR2", "arguments": [ { - "name": "inputData", + "name": "inputData", "memory": "DDR[2]" - }, + }, { - "name": "outputData", + "name": "outputData", "memory": "DDR[2]" } ] } ] - }, + }, { - "location": "kernel/hmacSha1Kernel4.cpp", - "frequency": 300.0, - "name": "hmacSha1Kernel_4", - "num_compute_units": 1, + "location": "kernel/hmacSha1Kernel4.cpp", + "frequency": 300.0, + "name": "hmacSha1Kernel_4", + "num_compute_units": 1, "compute_units": [ { - "name": "hmacSha1Kernel_4", - "slr": "SLR3", + "name": "hmacSha1Kernel_4", + "slr": "SLR3", "arguments": [ { - "name": "inputData", + "name": "inputData", "memory": "DDR[3]" - }, + }, { - "name": "outputData", + "name": "outputData", "memory": "DDR[3]" } ] } ] } - ], - "frequency": 300.0, + ], + "frequency": 300.0, "name": "hmacSha1Kernel" } - ], + ], "testinfo": { - "disable": false, + "disable": false, "jobs": [ { - "index": 0, - "dependency": [], - "env": "", - "cmd": "", + "index": 0, + "dependency": [], + "env": "", + "cmd": "", "max_memory_MB": { - "vitis_hw_build": 57344, - "vitis_hw_emu": 28672, - "vitis_sw_emu": 10240, + "vitis_hw_build": 57344, + "vitis_hw_emu": 28672, + "vitis_sw_emu": 10240, "vitis_hw_run": 10240 - }, + }, "max_time_min": { - "vitis_hw_build": 1440, - "vitis_hw_emu": 420, - "vitis_sw_emu": 60, + "vitis_hw_build": 1440, + "vitis_hw_emu": 420, + "vitis_sw_emu": 60, "vitis_hw_run": 10 } } - ], + ], "targets": [ - "vitis_sw_emu", - "vitis_hw_emu", - "vitis_hw_build", + "vitis_sw_emu", + "vitis_hw_emu", + "vitis_hw_build", "vitis_hw_run" - ], + ], "category": "canary" } } diff --git a/security/L1/benchmarks/hmac_sha1/utils.mk b/security/L1/benchmarks/hmac_sha1/utils.mk index 3892ff1942..0ee80e90da 100644 --- a/security/L1/benchmarks/hmac_sha1/utils.mk +++ b/security/L1/benchmarks/hmac_sha1/utils.mk @@ -1,5 +1,5 @@ # -# Copyright 2019-2021 Xilinx, Inc. +# Copyright 2019-2022 Xilinx, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -12,6 +12,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. +# vitis makefile-generator v2.0.6 # #+------------------------------------------------------------------------------- # The following parameters are assigned with default values. These parameters can @@ -39,17 +40,59 @@ ifeq ($(DEBUG), yes) VPP_LDFLAGS += --dk protocol:all:all:all endif -#Checks for XILINX_XRT -ifeq ($(HOST_ARCH), x86) +#Check environment setup +ifndef XILINX_VITIS + XILINX_VITIS = /opt/xilinx/Vitis/$(TOOL_VERSION) + export XILINX_VITIS +endif ifndef XILINX_XRT XILINX_XRT = /opt/xilinx/xrt export XILINX_XRT endif + +check_device: + @set -eu; \ + inallowlist=False; \ + inblocklist=False; \ + for dev in $(PLATFORM_ALLOWLIST); \ + do if [[ $$(echo $(PLATFORM_NAME) | grep $$dev) != "" ]]; \ + then inallowlist=True; fi; \ + done ;\ + for dev in $(PLATFORM_BLOCKLIST); \ + do if [[ $$(echo $(PLATFORM_NAME) | grep $$dev) != "" ]]; \ + then inblocklist=True; fi; \ + done ;\ + if [[ $$inallowlist == False ]]; \ + then echo "[Warning]: The device $(PLATFORM_NAME) not in allowlist."; \ + fi; \ + if [[ $$inblocklist == True ]]; \ + then echo "[ERROR]: The device $(PLATFORM_NAME) in blocklist."; exit 1;\ + fi; + +#get HOST_ARCH by PLATFORM +ifneq (,$(PLATFORM)) +HOST_ARCH_temp = $(shell platforminfo -p $(PLATFORM) | grep 'CPU Type' | sed 's/.*://' | sed '/ai_engine/d' | sed 's/^[[:space:]]*//') +ifeq ($(HOST_ARCH_temp), x86) +HOST_ARCH := x86 +else ifeq ($(HOST_ARCH_temp), cortex-a9) +HOST_ARCH := aarch32 +else ifneq (,$(findstring cortex-a, $(HOST_ARCH_temp))) +HOST_ARCH := aarch64 +endif +endif + + +#get suffix of kernel by PLATFORM +VITIS_VER = $(shell v++ --version | grep 'v++' | sed 's/^[[:space:]]*//' | sed -e 's/^[*]* v++ v//g' | cut -d " " -f1) +DEVICE_TYPE = $(shell platforminfo -p $(PLATFORM) | grep 'FPGA Family' | sed 's/.*://' | sed '/ai_engine/d' | sed 's/^[[:space:]]*//') +ifeq ($(DEVICE_TYPE), versal) +ifeq ($(shell expr $(VITIS_VER) \>= 2022.1), 1) +LINK_TARGET_FMT := xsa else -ifndef XILINX_VITIS - XILINX_VITIS = /opt/xilinx/Vitis/$(TOOL_VERSION) - export XILINX_VITIS +LINK_TARGET_FMT := xclbin endif +else +LINK_TARGET_FMT := xclbin endif #Checks for Device Family @@ -59,13 +102,18 @@ else ifeq ($(HOST_ARCH), aarch64) DEV_FAM = Ultrascale endif -B_NAME = $(shell dirname $(XPLATFORM)) - #Checks for Correct architecture ifneq ($(HOST_ARCH), $(filter $(HOST_ARCH),aarch64 aarch32 x86)) $(error HOST_ARCH variable not set, please set correctly and rerun) endif +check_version: +ifneq (, $(shell which git)) +ifneq (,$(wildcard $(XFLIB_DIR)/.git)) + @cd $(XFLIB_DIR) && git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit -n 1 && cd - +endif +endif + #Checks for SYSROOT check_sysroot: ifneq ($(HOST_ARCH), x86) @@ -74,25 +122,24 @@ ifndef SYSROOT endif endif -check_version: -ifneq (, $(shell which git)) -ifneq (,$(wildcard $(XFLIB_DIR)/.git)) - @cd $(XFLIB_DIR) && git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit -n 1 && cd - -endif -endif - #Checks for g++ CXX := g++ ifeq ($(HOST_ARCH), x86) -ifneq ($(shell expr $(shell g++ -dumpversion) \>= 5), 1) +ifeq ($(shell expr $(VITIS_VER) \>= 2022.1), 1) +CXX_VER := 8.3.0 +else +CXX_VER := 6.2.0 +endif +CXX_V := $(shell echo $(CXX_VER) | awk -F. '{print tolower($$1)}') +ifneq ($(shell expr $(shell echo "__GNUG__" | g++ -E -x c++ - | tail -1) \>= $(CXX_V)), 1) ifndef XILINX_VIVADO -$(error [ERROR]: g++ version too old. Please use 5.0 or above) +$(error [ERROR]: g++ version too old. Please use $(CXX_VER) or above) else -CXX := $(XILINX_VIVADO)/tps/lnx64/gcc-6.2.0/bin/g++ +CXX := $(XILINX_VIVADO)/tps/lnx64/gcc-$(CXX_VER)/bin/g++ ifeq ($(LD_LIBRARY_PATH),) -export LD_LIBRARY_PATH := $(XILINX_VIVADO)/tps/lnx64/gcc-6.2.0/lib64 +export LD_LIBRARY_PATH := $(XILINX_VIVADO)/tps/lnx64/gcc-$(CXX_VER)/lib64 else -export LD_LIBRARY_PATH := $(XILINX_VIVADO)/tps/lnx64/gcc-6.2.0/lib64:$(LD_LIBRARY_PATH) +export LD_LIBRARY_PATH := $(XILINX_VIVADO)/tps/lnx64/gcc-$(CXX_VER)/lib64:$(LD_LIBRARY_PATH) endif $(warning [WARNING]: g++ version too old. Using g++ provided by the tool: $(CXX)) endif @@ -103,13 +150,22 @@ else ifeq ($(HOST_ARCH), aarch32) CXX := $(XILINX_VITIS)/gnu/aarch32/lin/gcc-arm-linux-gnueabi/bin/arm-linux-gnueabihf-g++ endif -#Check OS and setting env +#Check OS and setting env for xrt c++ api OSDIST = $(shell lsb_release -i |awk -F: '{print tolower($$2)}' | tr -d ' \t' ) OSREL = $(shell lsb_release -r |awk -F: '{print tolower($$2)}' |tr -d ' \t') -ifeq ($(OSDIST), centos) +# for centos and redhat +ifneq ($(findstring centos,$(OSDIST)),) +ifeq (7,$(shell echo $(OSREL) | awk -F. '{print tolower($$1)}' )) +ifeq ($(HOST_ARCH), x86) +XRT_CXXFLAGS += -D_GLIBCXX_USE_CXX11_ABI=0 +endif +endif +else ifneq ($(findstring redhat,$(OSDIST)),) ifeq (7,$(shell echo $(OSREL) | awk -F. '{print tolower($$1)}' )) -CXXFLAGS += -D_GLIBCXX_USE_CXX11_ABI=0 +ifeq ($(HOST_ARCH), x86) +XRT_CXXFLAGS += -D_GLIBCXX_USE_CXX11_ABI=0 +endif endif endif @@ -117,6 +173,9 @@ endif VPP := v++ #Cheks for aiecompiler +AIECXX := aiecompiler +AIESIMULATOR := aiesimulator +X86SIMULATOR := x86simulator .PHONY: check_vivado check_vivado: @@ -132,11 +191,9 @@ endif .PHONY: check_xrt check_xrt: -ifeq ($(HOST_ARCH), x86) ifeq (,$(wildcard $(XILINX_XRT)/lib/libxilinxopencl.so)) @echo "Cannot locate XRT installation. Please set XILINX_XRT variable." && false endif -endif export PATH := $(XILINX_VITIS)/bin:$(XILINX_XRT)/bin:$(PATH) ifeq ($(HOST_ARCH), x86) @@ -145,82 +202,64 @@ LD_LIBRARY_PATH := $(XILINX_XRT)/lib else LD_LIBRARY_PATH := $(XILINX_XRT)/lib:$(LD_LIBRARY_PATH) endif -else # aarch64 -ifeq (,$(LD_LIBRARY_PATH)) -LD_LIBRARY_PATH := $(SYSROOT)/usr/lib -else -LD_LIBRARY_PATH := $(SYSROOT)/usr/lib:$(LD_LIBRARY_PATH) -endif -endif - -# check target -ifeq ($(filter $(TARGET),sw_emu hw_emu hw),) -$(error TARGET is not sw_emu, hw_emu or hw) endif -ifneq (,$(wildcard $(DEVICE))) -# Use DEVICE as a file path -XPLATFORM := $(DEVICE) +ifneq (,$(wildcard $(PLATFORM))) +# Use PLATFORM as a file path +XPLATFORM := $(PLATFORM) else -# Use DEVICE as a file name pattern +# Use PLATFORM as a file name pattern # 1. search paths specified by variable ifneq (,$(PLATFORM_REPO_PATHS)) # 1.1 as exact name -XPLATFORM := $(strip $(foreach p, $(subst :, ,$(PLATFORM_REPO_PATHS)), $(wildcard $(p)/$(DEVICE)/$(DEVICE).xpfm))) +XPLATFORM := $(strip $(foreach p, $(subst :, ,$(PLATFORM_REPO_PATHS)), $(wildcard $(p)/$(PLATFORM)/$(PLATFORM).xpfm))) # 1.2 as a pattern ifeq (,$(XPLATFORM)) XPLATFORMS := $(foreach p, $(subst :, ,$(PLATFORM_REPO_PATHS)), $(wildcard $(p)/*/*.xpfm)) -XPLATFORM := $(strip $(foreach p, $(XPLATFORMS), $(shell echo $(p) | awk '$$1 ~ /$(DEVICE)/'))) +XPLATFORM := $(strip $(foreach p, $(XPLATFORMS), $(shell echo $(p) | awk '$$1 ~ /$(PLATFORM)/'))) endif # 1.2 endif # 1 # 2. search Vitis installation ifeq (,$(XPLATFORM)) # 2.1 as exact name -XPLATFORM := $(strip $(wildcard $(XILINX_VITIS)/platforms/$(DEVICE)/$(DEVICE).xpfm)) +XPLATFORM := $(strip $(wildcard $(XILINX_VITIS)/platforms/$(PLATFORM)/$(PLATFORM).xpfm)) # 2.2 as a pattern ifeq (,$(XPLATFORM)) XPLATFORMS := $(wildcard $(XILINX_VITIS)/platforms/*/*.xpfm) -XPLATFORM := $(strip $(foreach p, $(XPLATFORMS), $(shell echo $(p) | awk '$$1 ~ /$(DEVICE)/'))) +XPLATFORM := $(strip $(foreach p, $(XPLATFORMS), $(shell echo $(p) | awk '$$1 ~ /$(PLATFORM)/'))) endif # 2.2 endif # 2 # 3. search default locations ifeq (,$(XPLATFORM)) # 3.1 as exact name -XPLATFORM := $(strip $(wildcard /opt/xilinx/platforms/$(DEVICE)/$(DEVICE).xpfm)) +XPLATFORM := $(strip $(wildcard /opt/xilinx/platforms/$(PLATFORM)/$(PLATFORM).xpfm)) # 3.2 as a pattern ifeq (,$(XPLATFORM)) XPLATFORMS := $(wildcard /opt/xilinx/platforms/*/*.xpfm) -XPLATFORM := $(strip $(foreach p, $(XPLATFORMS), $(shell echo $(p) | awk '$$1 ~ /$(DEVICE)/'))) +XPLATFORM := $(strip $(foreach p, $(XPLATFORMS), $(shell echo $(p) | awk '$$1 ~ /$(PLATFORM)/'))) endif # 3.2 endif # 3 endif define MSG_PLATFORM -No platform matched pattern '$(DEVICE)'. +No platform matched pattern '$(PLATFORM)'. Available platforms are: $(XPLATFORMS) -To add more platform directories, set the PLATFORM_REPO_PATHS variable or point DEVICE variable to the full path of platform .xpfm file. +To add more platform directories, set the PLATFORM_REPO_PATHS variable or point PLATFORM variable to the full path of platform .xpfm file. endef export MSG_PLATFORM -define MSG_DEVICE -More than one platform matched: $(XPLATFORM) -Please set DEVICE variable more accurately to select only one platform file, or set DEVICE variable to the full path of the platform .xpfm file. -endef -export MSG_DEVICE .PHONY: check_platform check_platform: ifeq (,$(XPLATFORM)) @echo "$${MSG_PLATFORM}" && false endif -ifneq (,$(word 2,$(XPLATFORM))) - @echo "$${MSG_DEVICE}" && false -endif #Check ends # device2xsa - create a filesystem friendly name from device name # $(1) - full name of device -device2xsa = $(strip $(patsubst %.xpfm, % , $(shell basename $(DEVICE)))) +PLATFORM_NAME = $(strip $(patsubst %.xpfm, % , $(shell basename $(PLATFORM)))) + # Cleaning stuff RM = rm -f diff --git a/security/L1/benchmarks/rc4Encrypt/Makefile b/security/L1/benchmarks/rc4Encrypt/Makefile index 5752ae516d..1aa34091a5 100644 --- a/security/L1/benchmarks/rc4Encrypt/Makefile +++ b/security/L1/benchmarks/rc4Encrypt/Makefile @@ -1,5 +1,4 @@ -# -# Copyright 2019-2021 Xilinx, Inc. +# Copyright 2019-2022 Xilinx, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -12,16 +11,32 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -# makefile-generator v1.0.4 -# +# vitis makefile-generator v2.0.6 -# ####################################### Help Section ##################################### +############################## Help Section ############################## .PHONY: help help:: $(ECHO) "Makefile Usage:" - $(ECHO) " make all TARGET= DEVICE= HOST_ARCH=" + $(ECHO) " make all TARGET= PLATFORM= HOST_ARCH=" $(ECHO) " Command to generate the design for specified Target and Shell." + $(ECHO) " By default, HOST_ARCH=x86. HOST_ARCH is required for SoC shells" + $(ECHO) "" + $(ECHO) " make run TARGET= PLATFORM= HOST_ARCH=" + $(ECHO) " Command to run application in emulation." + $(ECHO) " By default, HOST_ARCH=x86. HOST_ARCH required for SoC shells" + $(ECHO) "" + $(ECHO) " make xclbin TARGET= PLATFORM= HOST_ARCH=" + $(ECHO) " Command to build xclbin application." + $(ECHO) " By default, HOST_ARCH=x86. HOST_ARCH is required for SoC shells" + $(ECHO) "" + $(ECHO) " make host TARGET=" + $(ECHO) " Command to build host application." + $(ECHO) " By default, HOST_ARCH=x86. HOST_ARCH is required for SoC shells" + $(ECHO) "" + $(ECHO) " NOTE: For embedded devices, e.g. zcu102/zcu104/vck190, env variable SYSROOT and EDGE_COMMON_SW need to be set first, and HOST_ARCH is either aarch32 or aarch64. For example," + $(ECHO) " export SYSROOT=< path-to-platform-sysroot >" + $(ECHO) " export EDGE_COMMON_SW=< path-to-rootfs-and-Image-files >" $(ECHO) "" $(ECHO) " make clean " $(ECHO) " Command to remove the generated non-hardware files." @@ -29,217 +44,298 @@ help:: $(ECHO) " make cleanall" $(ECHO) " Command to remove all the generated files." $(ECHO) "" - $(ECHO) " make run TARGET= DEVICE= HOST_ARCH=" - $(ECHO) " Command to run application in emulation or on board." - $(ECHO) "" - $(ECHO) " make build TARGET= DEVICE= HOST_ARCH=" - $(ECHO) " Command to build xclbin application." - $(ECHO) "" - $(ECHO) " make host HOST_ARCH=" - $(ECHO) " Command to build host application." - $(ECHO) "" -# ##################### Setting up default value of TARGET ########################## -TARGET ?= sw_emu +############################## Setting up Project Variables ############################## -# ################### Setting up default value of DEVICE ############################## -DEVICE ?= xilinx_u250_gen3x16_xdma_3_1_202020_1 +MK_PATH := $(abspath $(lastword $(MAKEFILE_LIST))) +XF_PROJ_ROOT ?= $(shell bash -c 'export MK_PATH=$(MK_PATH); echo $${MK_PATH%/L1/*}') +CUR_DIR := $(patsubst %/,%,$(dir $(MK_PATH))) +XFLIB_DIR = $(XF_PROJ_ROOT) -# ###################### Setting up default value of HOST_ARCH ####################### +# setting devault value +TARGET ?= sw_emu HOST_ARCH ?= x86 -# #################### Checking if DEVICE in blacklist ############################# -ifeq ($(findstring zc, $(DEVICE)), zc) -$(error [ERROR]: This project is not supported for $(DEVICE).) +#setting PLATFORM +ifeq ($(PLATFORM),) +PLATFORM := $(DEVICE) endif - -# #################### Checking if DEVICE in whitelist ############################ -ifneq ($(findstring xilinx_u250_xdma_201830_2, $(DEVICE)), xilinx_u250_xdma_201830_2) -$(warning [WARNING]: This project has not been tested for $(DEVICE). It may or may not work.) +ifeq ($(PLATFORM),) +PLATFORM := xilinx_u250_gen3x16_xdma_4_1_202210_1 endif -# ######################## Setting up Project Variables ################################# -MK_PATH := $(abspath $(lastword $(MAKEFILE_LIST))) -XF_PROJ_ROOT ?= $(shell bash -c 'export MK_PATH=$(MK_PATH); echo $${MK_PATH%/L1/*}') -CUR_DIR := $(patsubst %/,%,$(dir $(MK_PATH))) -XFLIB_DIR = $(XF_PROJ_ROOT) +# #################### Checking if PLATFORM in whitelist ############################ +PLATFORM_ALLOWLIST += u250 +PLATFORM_BLOCKLIST += zc aws-vu9p-f1 -# ######################### Include environment variables in utils.mk #################### include ./utils.mk -XDEVICE := $(call device2xsa, $(DEVICE)) -TEMP_DIR := _x_temp.$(TARGET).$(XDEVICE) -TEMP_REPORT_DIR := $(CUR_DIR)/reports/_x.$(TARGET).$(XDEVICE) -BUILD_DIR := build_dir.$(TARGET).$(XDEVICE) -BUILD_REPORT_DIR := $(CUR_DIR)/reports/_build.$(TARGET).$(XDEVICE) -EMCONFIG_DIR := $(BUILD_DIR) +TEMP_DIR := _x_temp.$(TARGET).$(PLATFORM_NAME) +TEMP_REPORT_DIR := $(CUR_DIR)/reports/_x.$(TARGET).$(PLATFORM_NAME) +BUILD_DIR := build_dir.$(TARGET).$(PLATFORM_NAME) +ifneq ($(RESULT_DIR),) +BUILD_DIR = $(RESULT_DIR) +endif +BUILD_REPORT_DIR := $(CUR_DIR)/reports/_build.$(TARGET).$(PLATFORM_NAME) +EMCONFIG := $(BUILD_DIR)/emconfig.json XCLBIN_DIR := $(CUR_DIR)/$(BUILD_DIR) export XCL_BINDIR = $(XCLBIN_DIR) -# ######################### Setting up Host Variables ######################### -#Include Required Host Source Files -HOST_SRCS += $(CUR_DIR)/host/main.cpp -HOST_SRCS += $(XFLIB_DIR)/ext/xcl2/xcl2.cpp -CXXFLAGS += -I$(XFLIB_DIR)/L1/include -CXXFLAGS += -I$(CUR_DIR)/host -CXXFLAGS += -I$(CUR_DIR)/kernel -CXXFLAGS += -I$(XFLIB_DIR)/ext/xcl2 -CXXFLAGS += -I$(XFLIB_DIR)/../utils/L1/include -CXXFLAGS += -I$(XFLIB_DIR)/ext/xcl2 - +EXE_FILE_DEPS := +BINARY_CONTAINERS_DEPS := +RUN_DEPS := +# get global setting +ifeq ($(HOST_ARCH), x86) +CXXFLAGS += -fmessage-length=0 -I$(CUR_DIR)/src/ -I$(XILINX_XRT)/include -I$(XILINX_HLS)/include -std=c++14 -O3 -Wall -Wno-unknown-pragmas -Wno-unused-label +LDFLAGS += -pthread -L$(XILINX_XRT)/lib -L$(XILINX_HLS)/lnx64/tools/fpo_v7_0 -Wl,--as-needed -lOpenCL -lxrt_coreutil -lgmp -lmpfr -lIp_floating_point_v7_0_bitacc_cmodel +VPP_FLAGS += -t $(TARGET) --platform $(XPLATFORM) --save-temps +VPP_LDFLAGS += --optimize 2 -R 2 +else ifeq ($(HOST_ARCH), aarch64) +CXXFLAGS += -I$(CUR_DIR)/src/ -fmessage-length=0 --sysroot=$(SYSROOT) -I$(SYSROOT)/usr/include/xrt -I$(XILINX_HLS)/include -std=c++14 -O3 -Wall -Wno-unknown-pragmas -Wno-unused-label +LDFLAGS += -pthread -L$(SYSROOT)/usr/lib -L$(XILINX_VITIS_AIETOOLS)/lib/aarch64.o -Wl,--as-needed -lxilinxopencl -lxrt_coreutil +VPP_FLAGS += -t $(TARGET) --platform $(XPLATFORM) --save-temps +VPP_LDFLAGS += --optimize 2 -R 2 +endif +CXXFLAGS += $(EXTRA_CXXFLAGS) +VPP_FLAGS += $(EXTRA_VPP_FLAGS) +########################## Setting up Host Variables ########################## ifeq ($(TARGET),sw_emu) CXXFLAGS += -D SW_EMU_TEST endif - ifeq ($(TARGET),hw_emu) CXXFLAGS += -D HW_EMU_TEST endif -# ######################### Host compiler global settings ############################ -CXXFLAGS += -I$(XILINX_XRT)/include -I$(XILINX_HLS)/include -std=c++11 -O3 -Wall -Wno-unknown-pragmas -Wno-unused-label -LDFLAGS += -L$(XILINX_XRT)/lib -lOpenCL -lpthread -lrt -Wno-unused-label -Wno-narrowing -DVERBOSE -CXXFLAGS += -fmessage-length=0 -CXXFLAGS += -I$(CUR_DIR)/src/ - -ifeq ($(HOST_ARCH), x86) -LDFLAGS += -L$(XILINX_HLS)/lnx64/tools/fpo_v7_0 -Wl,--as-needed -lgmp -lmpfr -lIp_floating_point_v7_0_bitacc_cmodel +ifeq (,$(findstring opencv,$(CXXFLAGS))) +CXXFLAGS += $(XRT_CXXFLAGS) endif + +#Inclue Required Host Source Files ifneq (,$(shell echo $(XPLATFORM) | awk '/u250/')) -CXXFLAGS += -D USE_DDR +HOST_SRCS += $(CUR_DIR)/host/main.cpp $(XFLIB_DIR)/ext/xcl2/xcl2.cpp +CXXFLAGS += -D USE_DDR +CXXFLAGS += -I $(XFLIB_DIR)/L1/include -I $(CUR_DIR)/host -I $(CUR_DIR)/kernel -I $(XFLIB_DIR)/ext/xcl2 -I $(XFLIB_DIR)/../utils/L1/include -I $(XFLIB_DIR)/ext/xcl2 + else ifneq (,$(shell echo $(XPLATFORM) | awk '/vck190/')) -CXXFLAGS += -I$(SYSROOT)/usr/include +HOST_SRCS += $(CUR_DIR)/host/main.cpp $(XFLIB_DIR)/ext/xcl2/xcl2.cpp +CXXFLAGS += -I $(SYSROOT)/usr/include -I $(XFLIB_DIR)/L1/include -I $(CUR_DIR)/host -I $(CUR_DIR)/kernel -I $(XFLIB_DIR)/ext/xcl2 -I $(XFLIB_DIR)/../utils/L1/include -I $(XFLIB_DIR)/ext/xcl2 CXXFLAGS += --sysroot=$(SYSROOT) -LDFLAGS += -L$(SYSROOT)/usr/lib -LDFLAGS += -L${SYSROOT}/opt/xilinx/xrt/lib -endif +LDFLAGS += -L $(SYSROOT)/usr/lib -L ${SYSROOT}/opt/xilinx/xrt/lib -# ################### Setting package and image directory ####################### +else +HOST_SRCS += $(CUR_DIR)/host/main.cpp $(XFLIB_DIR)/ext/xcl2/xcl2.cpp +CXXFLAGS += -I $(XFLIB_DIR)/L1/include -I $(CUR_DIR)/host -I $(CUR_DIR)/kernel -I $(XFLIB_DIR)/ext/xcl2 -I $(XFLIB_DIR)/../utils/L1/include -I $(XFLIB_DIR)/ext/xcl2 +endif EXE_NAME := rc4EncryptBenchmarck.exe EXE_FILE := $(BUILD_DIR)/$(EXE_NAME) -HOST_ARGS := -mode fpga -xclbin $(BUILD_DIR)/rc4EncryptKernel.xclbin -gld $(CUR_DIR)/data/gld.dat +EXE_FILE_DEPS := $(HOST_SRCS) $(EXE_FILE_DEPS) -# ##################### Kernel compiler global settings ########################## -VPP_FLAGS += -t $(TARGET) --platform $(XPLATFORM) --save-temps --optimize 2 -VPP_FLAGS += --hls.jobs 8 -VPP_LDFLAGS += --vivado.synth.jobs 8 --vivado.impl.jobs 8 -ifneq (,$(shell echo $(XPLATFORM) | awk '/u250/')) -VPP_FLAGS += --config $(CUR_DIR)/conn_u250.cfg +HOST_ARGS := -mode fpga -xclbin $(BUILD_DIR)/rc4EncryptKernel.xclbin -gld $(CUR_DIR)/data/gld.dat +ifneq ($(HOST_ARCH), x86) +PKG_HOST_ARGS = $(foreach args,$(HOST_ARGS),$(subst $(dir $(patsubst %/,%,$(args))),,$(args))) endif -VPP_FLAGS += -I$(XFLIB_DIR)/L1/include - -VPP_FLAGS += -I$(XFLIB_DIR)/L1/include -VPP_FLAGS += -I$(CUR_DIR)/kernel - -rc4EncryptKernel_1_VPP_FLAGS += --hls.clock 300000000:rc4EncryptKernel_1 -rc4EncryptKernel_2_VPP_FLAGS += --hls.clock 300000000:rc4EncryptKernel_2 -rc4EncryptKernel_3_VPP_FLAGS += --hls.clock 300000000:rc4EncryptKernel_3 -rc4EncryptKernel_4_VPP_FLAGS += --hls.clock 300000000:rc4EncryptKernel_4 -VPP_LDFLAGS_rc4EncryptKernel += --kernel_frequency 300 - - -# Kernel args - -# ############################ Declaring Binary Containers ########################## - -BINARY_CONTAINERS += $(BUILD_DIR)/rc4EncryptKernel.xclbin -BINARY_CONTAINER_rc4EncryptKernel_OBJS += $(TEMP_DIR)/rc4EncryptKernel_1.xo -BINARY_CONTAINER_rc4EncryptKernel_OBJS += $(TEMP_DIR)/rc4EncryptKernel_2.xo -BINARY_CONTAINER_rc4EncryptKernel_OBJS += $(TEMP_DIR)/rc4EncryptKernel_3.xo -BINARY_CONTAINER_rc4EncryptKernel_OBJS += $(TEMP_DIR)/rc4EncryptKernel_4.xo +########################## Kernel compiler global settings ########################## +ifneq (,$(shell echo $(XPLATFORM) | awk '/u250/')) +VPP_FLAGS += --config $(CUR_DIR)/conn_u250.cfg +VPP_FLAGS += -I $(XFLIB_DIR)/L1/include -I $(CUR_DIR)/kernel -I $(XFLIB_DIR)/L1/include -# ######################### Setting Targets of Makefile ################################ -DATA_FILE += $(CUR_DIR)//data/gld.dat +else +VPP_FLAGS += -I $(XFLIB_DIR)/L1/include -I $(CUR_DIR)/kernel -I $(XFLIB_DIR)/L1/include -.PHONY: all clean cleanall docs emconfig -ifeq ($(HOST_ARCH), x86) -all: check_version check_vpp check_platform check_xrt $(EXE_FILE) $(BINARY_CONTAINERS) emconfig -else -all: check_version check_vpp check_platform check_sysroot $(EXE_FILE) $(BINARY_CONTAINERS) emconfig sd_card endif -.PHONY: host -ifeq ($(HOST_ARCH), x86) -host: check_xrt $(EXE_FILE) +######################### binary container global settings ########################## +VPP_FLAGS_rc4EncryptKernel_1 += --hls.clock 200000000:rc4EncryptKernel_1 +ifneq ($(HOST_ARCH), x86) +VPP_LDFLAGS_rc4EncryptKernel += --clock.defaultFreqHz 200000000 else -host: check_sysroot $(EXE_FILE) +VPP_LDFLAGS_rc4EncryptKernel += --kernel_frequency 150 endif -.PHONY: xclbin ifeq ($(HOST_ARCH), x86) -xclbin: check_vpp check_xrt $(BINARY_CONTAINERS) +BINARY_CONTAINERS += $(BUILD_DIR)/rc4EncryptKernel.xclbin else -xclbin: check_vpp check_sysroot $(BINARY_CONTAINERS) +BINARY_CONTAINERS += $(BUILD_DIR)/rc4EncryptKernel_pkg.$(LINK_TARGET_FMT) +BINARY_CONTAINERS_PKG += $(BUILD_DIR)/rc4EncryptKernel.xclbin endif -.PHONY: build -build: xclbin - # ################ Setting Rules for Binary Containers (Building Kernels) ################ -$(TEMP_DIR)/rc4EncryptKernel_1.xo: $(CUR_DIR)/kernel/rc4EncryptKernel1.cpp +$(TEMP_DIR)/rc4EncryptKernel_1.xo: $(CUR_DIR)/kernel/rc4EncryptKernel1.cpp $(ECHO) "Compiling Kernel: rc4EncryptKernel_1" mkdir -p $(TEMP_DIR) - $(VPP) -c $(rc4EncryptKernel_1_VPP_FLAGS) $(VPP_FLAGS) -k rc4EncryptKernel_1 -I'$(> $(RUN_SCRIPT) +ifneq ($(filter sw_emu hw_emu, $(TARGET)),) + @echo 'export XCL_EMULATION_MODE=$(TARGET)' >> $(RUN_SCRIPT) +endif + @echo 'export XILINX_VITIS=/mnt' >> $(RUN_SCRIPT) + @echo 'export XILINX_XRT=/usr' >> $(RUN_SCRIPT) + @echo 'if [ -f platform_desc.txt ]; then' >> $(RUN_SCRIPT) + @echo ' cp platform_desc.txt /etc/xocl.txt' >> $(RUN_SCRIPT) + @echo 'fi' >> $(RUN_SCRIPT) + @echo './$(EXE_NAME) $(PKG_HOST_ARGS)' >> $(RUN_SCRIPT) + @echo 'return_code=$$?' >> $(RUN_SCRIPT) + @echo 'if [ $$return_code -ne 0 ]; then' >> $(RUN_SCRIPT) + @echo ' echo "ERROR: Embedded host run failed, RC=$$return_code"' >> $(RUN_SCRIPT) + @echo 'else' >> $(RUN_SCRIPT) + @echo ' echo "INFO: TEST PASSED, RC=0"' >> $(RUN_SCRIPT) + @echo 'fi' >> $(RUN_SCRIPT) + @echo 'echo "INFO: Embedded host run completed."' >> $(RUN_SCRIPT) + @echo 'exit $$return_code' >> $(RUN_SCRIPT) +DATA_FILE := $(CUR_DIR)//data/gld.dat +DATA_DIR := +SD_FILES += $(RUN_SCRIPT) +SD_FILES += $(EXE_FILE) +SD_FILES += $(EMCONFIG) +SD_FILES += xrt.ini +SD_FILES += $(DATA_FILE)# where define DATAFILE in json +SD_FILES_WITH_PREFIX = $(foreach sd_file,$(SD_FILES), $(if $(filter $(sd_file),$(wildcard $(sd_file))), --package.sd_file $(sd_file))) +SD_DIRS_WITH_PREFIX = $(foreach sd_dir,$(DATA_DIR),--package.sd_dir $(sd_dir)) +PACKAGE_FILES := $(BINARY_CONTAINERS) +PACKAGE_FILES += $(AIE_CONTAINER) +SD_CARD := $(CUR_DIR)/package_$(TARGET) +vck190_dfx_hw := false +$(SD_CARD): $(EXE_FILE) $(BINARY_CONTAINERS) $(RUN_SCRIPT) $(EMCONFIG) + @echo "Generating sd_card folder...." + mkdir -p $(SD_CARD) + chmod a+rx $(BUILD_DIR)/run_script.sh +ifneq (,$(findstring vck190_base_dfx, $(PLATFORM_NAME))) +ifeq ($(TARGET),hw) + $(VPP) -t $(TARGET) --platform $(XPLATFORM) -p $(PACKAGE_FILES) -o $(BINARY_CONTAINERS_PKG) + $(VPP) -t $(TARGET) --platform $(XPLATFORM) -p --package.out_dir $(SD_CARD) --package.rootfs $(SYSROOT)/../../rootfs.ext4 --package.kernel_image $(K_IMAGE) $(SD_FILES_WITH_PREFIX) $(SD_DIRS_WITH_PREFIX) --package.sd_file $(BINARY_CONTAINERS_PKG) + @echo "### ***** sd_card generation done! ***** ###" +vck190_dfx_hw := true +endif +endif +ifeq ($(vck190_dfx_hw), false) + $(VPP) -t $(TARGET) --platform $(XPLATFORM) -o $(BINARY_CONTAINERS_PKG) -p $(PACKAGE_FILES) $(VPP_PACKAGE) --package.out_dir $(SD_CARD) --package.rootfs $(SYSROOT)/../../rootfs.ext4 --package.kernel_image $(K_IMAGE) $(SD_FILES_WITH_PREFIX) $(SD_DIRS_WITH_PREFIX) + @echo "### ***** sd_card generation done! ***** ###" +endif +.PHONY: sd_card +sd_card: $(SD_CARD) +endif +############################## Setting Essential Checks and Building Rules ############################## +RUN_DEPS += $(EXE_FILE) $(BINARY_CONTAINERS) $(EMCONFIG) +RUN_DEPS += $(SD_CARD) -# ###############Setting Essential Checks And Running Rules For Vitis Flow ############# +.PHONY: mkflag all run +mkflag: + mkdir -p $(BUILD_DIR) + rm -rf $(BUILD_DIR)/makefile_args.txt + @for var in $(MAKEFLAGS); do echo $$var >> $(BUILD_DIR)/makefile_args.txt; done +all: check_device check_vpp check_platform mkflag $(RUN_DEPS) run: all -ifeq ($(TARGET),$(filter $(TARGET),sw_emu hw_emu)) - $(CP) $(EMCONFIG_DIR)/emconfig.json . +#hw_emu +ifneq (,$(filter hw_emu, $(TARGET))) +ifeq ($(HOST_ARCH), x86) + LD_LIBRARY_PATH=$(LIBRARY_PATH):$$LD_LIBRARY_PATH \ XCL_EMULATION_MODE=$(TARGET) $(EXE_FILE) $(HOST_ARGS) + else + @echo $(RUN_DEPS) + $(SD_CARD)/launch_$(TARGET).sh -no-reboot -run-app $(notdir $(RUN_SCRIPT)) + grep "TEST PASSED, RC=0" $(SD_CARD)/qemu_output.log || exit 1 + +endif +endif +#sw_emu +ifneq (,$(filter sw_emu, $(TARGET))) +ifeq ($(HOST_ARCH), x86) + LD_LIBRARY_PATH=$(LIBRARY_PATH):$$LD_LIBRARY_PATH \ + XCL_EMULATION_MODE=$(TARGET) $(EXE_FILE) $(HOST_ARGS) + +else + @echo $(RUN_DEPS) + $(SD_CARD)/launch_$(TARGET).sh -no-reboot -run-app $(notdir $(RUN_SCRIPT)) + grep "TEST PASSED, RC=0" $(SD_CARD)/qemu_output.log || exit 1 + +endif +endif +#hw +ifeq ($(TARGET), hw) +ifneq (,$(findstring aws-vu9p-f1, $(PLATFORM_NAME))) +ifneq ($(JENKINS_INTERNAL_BUILD), 1) + $(ECHO) "This makefile does not directly support converting .xclbin to .awsxclbin, please refer https://github.com/aws/aws-fpga/blob/master/Vitis/README.md for next operations" +else + $(ECHO) "Running inside Xilinx regression without converting to .awsxclbin" + $(EXE_FILE) $(HOST_ARGS) + +endif +else ifeq ($(HOST_ARCH), x86) $(EXE_FILE) $(HOST_ARGS) + +else + $(ECHO) "Please copy the content of sd_card folder and data to an SD Card and run on the board" +endif endif -# ################################# Cleaning Rules ################################## +############################## Setting Targets ############################## + +.PHONY: clean cleanall emconfig +emconfig: $(EMCONFIG) + +.PHONY: host +ifeq ($(HOST_ARCH), x86) +host: check_xrt $(EXE_FILE) +else +host: check_sysroot $(EXE_FILE) +endif + +.PHONY: xclbin +ifeq ($(HOST_ARCH), x86) +xclbin: check_vpp check_xrt $(BINARY_CONTAINERS) +else +xclbin: check_vpp check_sysroot $(BINARY_CONTAINERS) +endif + +############################## Cleaning Rules ############################## cleanh: -$(RMDIR) $(EXE_FILE) vitis_* TempConfig system_estimate.xtxt *.rpt .run/ - -$(RMDIR) src/*.ll _xocc_* .Xil dltmp* xmltmp* *.log *.jou *.wcfg *.wdb sample_link.ini sample_compile.ini obj* bin* *.csv *.jpg *.jpeg *.png + -$(RMDIR) src/*.ll _xocc_* .Xil dltmp* xmltmp* *.log *.jou *.wcfg *.wdb sample_link.ini sample_compile.ini obj* bin* *.csv *.jpg *.jpeg *.png cleank: - -$(RMDIR) $(BUILD_DIR)/*.xclbin _vimage *xclbin.run_summary qemu-memory-_* emulation/ _vimage/ start_simulation.sh *.xclbin + -$(RMDIR) $(BUILD_DIR)/*.xclbin _vimage *xclbin.run_summary qemu-memory-_* emulation/ _vimage/ pl*start_simulation. sh *.xclbin -$(RMDIR) _x_temp.*/_x.* _x_temp.*/.Xil _x_temp.*/profile_summary.* xo_* _x* - -$(RMDIR) _x_temp.*/dltmp* _x_temp.*/kernel_info.dat _x_temp.*/*.log + -$(RMDIR) _x_temp.*/dltmp* _x_temp.*/kernel_info.dat _x_temp.*/*.log -$(RMDIR) _x_temp.* cleanall: cleanh cleank - -$(RMDIR) $(BUILD_DIR) build_dir.* emconfig.json *.html $(TEMP_DIR) $(CUR_DIR)/reports *.csv *.run_summary $(CUR_DIR)/*.raw package_* run_script.sh .ipcache *.str - -$(RMDIR) $(XFLIB_DIR)/common/data/*.xe2xd* $(XFLIB_DIR)/common/data/*.orig* - - -$(RMDIR) $(AIE_CONTAINERS) $(CUR_DIR)/Work $(CUR_DIR)/*.xpe $(CUR_DIR)/hw.o $(CUR_DIR)/*.xsa $(CUR_DIR)/xnwOut aiesimulator_output .AIE_SIM_CMD_LINE_OPTIONS + -$(RMDIR) $(BUILD_DIR) emconfig.json *.html $(TEMP_DIR) $(CUR_DIR)/reports *.csv *.run_summary $(CUR_DIR)/*.raw package_* $(BUILD_DIR)/run_script.sh .ipcache *.str + -$(RMDIR) $(CUR_DIR)/Work $(CUR_DIR)/*.xpe $(CUR_DIR)/hw.o $(CUR_DIR)/*.xsa $(CUR_DIR)/xnwOut clean: cleanh diff --git a/security/L1/benchmarks/rc4Encrypt/README.md b/security/L1/benchmarks/rc4Encrypt/README.md index f781e57b76..ba948d9b9c 100644 --- a/security/L1/benchmarks/rc4Encrypt/README.md +++ b/security/L1/benchmarks/rc4Encrypt/README.md @@ -18,12 +18,6 @@ The steps for library download and environment setup can be found in :ref:`l1_vi * **Build kernel(Step 2)** -Please check you've installed openSSL and make sure that its version is 1.0.2 or higher. Command to check openSSL version: - -``` - openssl version -``` - Run the following make command to build your XCLBIN and host binary targeting a specific device. Please be noticed that this process will take a long time, maybe couple of hours. ``` diff --git a/security/L1/benchmarks/rc4Encrypt/conn_u250.cfg b/security/L1/benchmarks/rc4Encrypt/conn_u250.cfg index 200b9b3ff5..4210e6dd9c 100644 --- a/security/L1/benchmarks/rc4Encrypt/conn_u250.cfg +++ b/security/L1/benchmarks/rc4Encrypt/conn_u250.cfg @@ -1,13 +1,4 @@ [connectivity] sp=rc4EncryptKernel_1_1.inputData:bank0 sp=rc4EncryptKernel_1_1.outputData:bank0 -sp=rc4EncryptKernel_2_1.inputData:bank1 -sp=rc4EncryptKernel_2_1.outputData:bank1 -sp=rc4EncryptKernel_3_1.inputData:bank2 -sp=rc4EncryptKernel_3_1.outputData:bank2 -sp=rc4EncryptKernel_4_1.inputData:bank3 -sp=rc4EncryptKernel_4_1.outputData:bank3 -slr=rc4EncryptKernel_1_1:SLR0 -slr=rc4EncryptKernel_2_1:SLR1 -slr=rc4EncryptKernel_3_1:SLR2 -slr=rc4EncryptKernel_4_1:SLR3 +#slr=rc4EncryptKernel_1_1:SLR0 diff --git a/security/L1/benchmarks/rc4Encrypt/description.json b/security/L1/benchmarks/rc4Encrypt/description.json index 02294b2874..46f30bfcf1 100644 --- a/security/L1/benchmarks/rc4Encrypt/description.json +++ b/security/L1/benchmarks/rc4Encrypt/description.json @@ -1,15 +1,16 @@ { - "gui": true, - "name": "Xilinx RC4 Encryption Benchmark", - "description": "RC4 Encryption Algorithm Benchmarking", - "flow": "vitis", - "platform_type": "", - "platform_whitelist": [ - "xilinx_u250_xdma_201830_2" - ], - "platform_blacklist": [ - "zc" - ], + "gui": true, + "name": "Xilinx RC4 Encryption Benchmark", + "description": "RC4 Encryption Algorithm Benchmarking", + "flow": "vitis", + "platform_type": "", + "platform_allowlist": [ + "u250" + ], + "platform_blocklist": [ + "zc", + "aws-vu9p-f1" + ], "platform_properties": { "u250": { "host": { @@ -18,35 +19,35 @@ "USE_DDR" ] } - }, + }, "v++": { "compiler": { - "cflags": [ + "clflags": [ "--config PROJECT/conn_u250.cfg" ] } } - }, + }, "vck190": { "host": { "linker": { "librarypaths": [ - "$(SYSROOT)/usr/lib", + "$(SYSROOT)/usr/lib", "${SYSROOT}/opt/xilinx/xrt/lib" ] - }, + }, "compiler": { "includepaths": [ "$(SYSROOT)/usr/include" - ], + ], "options": "--sysroot=$(SYSROOT)" } - } + } } - }, + }, "launch": [ { - "cmd_args": " -mode fpga -xclbin BUILD/rc4EncryptKernel.xclbin -gld PROJECT/data/gld.dat", + "cmd_args": " -mode fpga -xclbin BUILD/rc4EncryptKernel.xclbin -gld PROJECT/data/gld.dat", "name": "generic launch for all flows" } ], @@ -54,153 +55,87 @@ "PROJECT/data/gld.dat" ], "host": { - "host_exe": "rc4EncryptBenchmarck.exe", + "host_exe": "rc4EncryptBenchmarck.exe", "compiler": { "sources": [ - "host/main.cpp", + "host/main.cpp", "LIB_DIR/ext/xcl2/xcl2.cpp" - ], + ], "includepaths": [ - "LIB_DIR/L1/include", - "host", - "kernel", + "LIB_DIR/L1/include", + "host", + "kernel", "LIB_DIR/ext/xcl2", "LIB_DIR/../utils/L1/include" ] } - }, + }, "v++": { "compiler": { "includepaths": [ - "LIB_DIR/L1/include", + "LIB_DIR/L1/include", "kernel" ] } - }, + }, "containers": [ { "accelerators": [ { - "location": "kernel/rc4EncryptKernel1.cpp", - "frequency": 300.0, - "name": "rc4EncryptKernel_1", - "num_compute_units": 1, + "location": "kernel/rc4EncryptKernel1.cpp", + "frequency": 200.0, + "name": "rc4EncryptKernel_1", + "num_compute_units": 1, "compute_units": [ { - "name": "rc4EncryptKernel_1", - "slr": "SLR0", + "name": "rc4EncryptKernel_1", + "slr": "SLR0", "arguments": [ { - "name": "inputData", + "name": "inputData", "memory": "DDR[0]" - }, + }, { - "name": "outputData", + "name": "outputData", "memory": "DDR[0]" } ] } ] - }, - { - "location": "kernel/rc4EncryptKernel2.cpp", - "frequency": 300.0, - "name": "rc4EncryptKernel_2", - "num_compute_units": 1, - "compute_units": [ - { - "name": "rc4EncryptKernel_2", - "slr": "SLR1", - "arguments": [ - { - "name": "inputData", - "memory": "DDR[1]" - }, - { - "name": "outputData", - "memory": "DDR[1]" - } - ] - } - ] - }, - { - "location": "kernel/rc4EncryptKernel3.cpp", - "frequency": 300.0, - "name": "rc4EncryptKernel_3", - "num_compute_units": 1, - "compute_units": [ - { - "name": "rc4EncryptKernel_3", - "slr": "SLR2", - "arguments": [ - { - "name": "inputData", - "memory": "DDR[2]" - }, - { - "name": "outputData", - "memory": "DDR[2]" - } - ] - } - ] - }, - { - "location": "kernel/rc4EncryptKernel4.cpp", - "frequency": 300.0, - "name": "rc4EncryptKernel_4", - "num_compute_units": 1, - "compute_units": [ - { - "name": "rc4EncryptKernel_4", - "slr": "SLR3", - "arguments": [ - { - "name": "inputData", - "memory": "DDR[3]" - }, - { - "name": "outputData", - "memory": "DDR[3]" - } - ] - } - ] } - ], - "frequency": 300.0, + ], + "frequency": 150.0, "name": "rc4EncryptKernel" } - ], + ], "testinfo": { - "disable": false, + "disable": false, "jobs": [ { - "index": 0, - "dependency": [], - "env": "", - "cmd": "", + "index": 0, + "dependency": [], + "env": "", + "cmd": "", "max_memory_MB": { - "vitis_hw_build": 65536, - "vitis_hw_emu": 28672, - "vitis_sw_emu": 10240, + "vitis_hw_build": 65536, + "vitis_hw_emu": 28672, + "vitis_sw_emu": 10240, "vitis_hw_run": 10240 - }, + }, "max_time_min": { - "vitis_hw_build": 1440, - "vitis_hw_emu": 470, - "vitis_sw_emu": 60, + "vitis_hw_build": 1440, + "vitis_hw_emu": 470, + "vitis_sw_emu": 60, "vitis_hw_run": 10 } } - ], + ], "targets": [ - "vitis_sw_emu", - "vitis_hw_emu", - "vitis_hw_build", + "vitis_sw_emu", + "vitis_hw_emu", + "vitis_hw_build", "vitis_hw_run" - ], + ], "category": "canary" } } diff --git a/security/L1/benchmarks/rc4Encrypt/host/main.cpp b/security/L1/benchmarks/rc4Encrypt/host/main.cpp index 71319ec765..fc7e56bf5a 100644 --- a/security/L1/benchmarks/rc4Encrypt/host/main.cpp +++ b/security/L1/benchmarks/rc4Encrypt/host/main.cpp @@ -196,15 +196,12 @@ int main(int argc, char* argv[]) { // Host buffers ap_uint<512>* hb_in1 = aligned_alloc >(CH_NM * 4 + N_ROW * N_TASK * CH_NM / 64 + 1); - ap_uint<512>* hb_in2 = aligned_alloc >(CH_NM * 4 + N_ROW * N_TASK * CH_NM / 64 + 1); - ap_uint<512>* hb_in3 = aligned_alloc >(CH_NM * 4 + N_ROW * N_TASK * CH_NM / 64 + 1); - ap_uint<512>* hb_in4 = aligned_alloc >(CH_NM * 4 + N_ROW * N_TASK * CH_NM / 64 + 1); - ap_uint<512>* hb_out_a[4]; - for (int i = 0; i < 4; i++) { + ap_uint<512>* hb_out_a[1]; + for (int i = 0; i < 1; i++) { hb_out_a[i] = aligned_alloc >(N_ROW * N_TASK * CH_NM / 64); } - ap_uint<512>* hb_out_b[4]; - for (int i = 0; i < 4; i++) { + ap_uint<512>* hb_out_b[1]; + for (int i = 0; i < 1; i++) { hb_out_b[i] = aligned_alloc >(N_ROW * N_TASK * CH_NM / 64); } @@ -212,28 +209,13 @@ int main(int argc, char* argv[]) { hb_in1[0].range(127, 0) = N_ROW; hb_in1[0].range(191, 128) = N_TASK; hb_in1[0].range(207, 192) = KEY_SIZE; - hb_in2[0].range(127, 0) = N_ROW; - hb_in2[0].range(191, 128) = N_TASK; - hb_in2[0].range(207, 192) = KEY_SIZE; - hb_in3[0].range(127, 0) = N_ROW; - hb_in3[0].range(191, 128) = N_TASK; - hb_in3[0].range(207, 192) = KEY_SIZE; - hb_in4[0].range(127, 0) = N_ROW; - hb_in4[0].range(191, 128) = N_TASK; - hb_in4[0].range(207, 192) = KEY_SIZE; // generate key blocks for (unsigned int j = 0; j < CH_NM * 4; j++) { hb_in1[j + 1] = keyBlock[j % 4]; - hb_in2[j + 1] = keyBlock[j % 4]; - hb_in3[j + 1] = keyBlock[j % 4]; - hb_in4[j + 1] = keyBlock[j % 4]; } // generate texts for (unsigned int j = 0; j < N_ROW * N_TASK * CH_NM / 64; j++) { hb_in1[j + 1 + 4 * CH_NM] = dataBlock; - hb_in2[j + 1 + 4 * CH_NM] = dataBlock; - hb_in3[j + 1 + 4 * CH_NM] = dataBlock; - hb_in4[j + 1 + 4 * CH_NM] = dataBlock; } std::cout << "Host map buffer has been allocated and set.\n"; @@ -262,40 +244,25 @@ int main(int argc, char* argv[]) { cl::Kernel kernel0(program, "rc4EncryptKernel_1", &err); logger.logCreateKernel(err); - cl::Kernel kernel1(program, "rc4EncryptKernel_2", &err); - logger.logCreateKernel(err); - cl::Kernel kernel2(program, "rc4EncryptKernel_3", &err); - logger.logCreateKernel(err); - cl::Kernel kernel3(program, "rc4EncryptKernel_4", &err); - logger.logCreateKernel(err); - cl_mem_ext_ptr_t mext_in[4]; + cl_mem_ext_ptr_t mext_in[1]; mext_in[0] = {XCL_MEM_DDR_BANK0, hb_in1, 0}; - mext_in[1] = {XCL_MEM_DDR_BANK1, hb_in2, 0}; - mext_in[2] = {XCL_MEM_DDR_BANK2, hb_in3, 0}; - mext_in[3] = {XCL_MEM_DDR_BANK3, hb_in4, 0}; - cl_mem_ext_ptr_t mext_out_a[4]; + cl_mem_ext_ptr_t mext_out_a[1]; mext_out_a[0] = {XCL_MEM_DDR_BANK0, hb_out_a[0], 0}; - mext_out_a[1] = {XCL_MEM_DDR_BANK1, hb_out_a[1], 0}; - mext_out_a[2] = {XCL_MEM_DDR_BANK2, hb_out_a[2], 0}; - mext_out_a[3] = {XCL_MEM_DDR_BANK3, hb_out_a[3], 0}; - cl_mem_ext_ptr_t mext_out_b[4]; + cl_mem_ext_ptr_t mext_out_b[1]; mext_out_b[0] = {XCL_MEM_DDR_BANK0, hb_out_b[0], 0}; - mext_out_b[1] = {XCL_MEM_DDR_BANK1, hb_out_b[1], 0}; - mext_out_b[2] = {XCL_MEM_DDR_BANK2, hb_out_b[2], 0}; - mext_out_b[3] = {XCL_MEM_DDR_BANK3, hb_out_b[3], 0}; // ping buffer - cl::Buffer in_buff_a[4]; - cl::Buffer out_buff_a[4]; + cl::Buffer in_buff_a[1]; + cl::Buffer out_buff_a[1]; // pong buffer - cl::Buffer in_buff_b[4]; - cl::Buffer out_buff_b[4]; + cl::Buffer in_buff_b[1]; + cl::Buffer out_buff_b[1]; // Map buffers - for (int i = 0; i < 4; i++) { + for (int i = 0; i < 1; i++) { in_buff_a[i] = cl::Buffer(context, CL_MEM_EXT_PTR_XILINX | CL_MEM_USE_HOST_PTR | CL_MEM_READ_ONLY, (size_t)(sizeof(ap_uint<512>) * (1 + CH_NM * 4 + N_ROW * N_TASK * CH_NM / 64)), &mext_in[i]); @@ -320,7 +287,7 @@ int main(int argc, char* argv[]) { std::vector > read_events(num_rep); for (int i = 0; i < num_rep; i++) { write_events[i].resize(1); - kernel_events[i].resize(4); + kernel_events[i].resize(1); read_events[i].resize(1); } @@ -336,14 +303,8 @@ int main(int argc, char* argv[]) { std::vector ib; if (use_a) { ib.push_back(in_buff_a[0]); - ib.push_back(in_buff_a[1]); - ib.push_back(in_buff_a[2]); - ib.push_back(in_buff_a[3]); } else { ib.push_back(in_buff_b[0]); - ib.push_back(in_buff_b[1]); - ib.push_back(in_buff_b[2]); - ib.push_back(in_buff_b[3]); } if (i > 1) { @@ -357,46 +318,19 @@ int main(int argc, char* argv[]) { int j = 0; kernel0.setArg(j++, in_buff_a[0]); kernel0.setArg(j++, out_buff_a[0]); - j = 0; - kernel1.setArg(j++, in_buff_a[1]); - kernel1.setArg(j++, out_buff_a[1]); - j = 0; - kernel2.setArg(j++, in_buff_a[2]); - kernel2.setArg(j++, out_buff_a[2]); - j = 0; - kernel3.setArg(j++, in_buff_a[3]); - kernel3.setArg(j++, out_buff_a[3]); } else { int j = 0; kernel0.setArg(j++, in_buff_b[0]); kernel0.setArg(j++, out_buff_b[0]); - j = 0; - kernel1.setArg(j++, in_buff_b[1]); - kernel1.setArg(j++, out_buff_b[1]); - j = 0; - kernel2.setArg(j++, in_buff_b[2]); - kernel2.setArg(j++, out_buff_b[2]); - j = 0; - kernel3.setArg(j++, in_buff_b[3]); - kernel3.setArg(j++, out_buff_b[3]); } q.enqueueTask(kernel0, &write_events[i], &kernel_events[i][0]); - q.enqueueTask(kernel1, &write_events[i], &kernel_events[i][1]); - q.enqueueTask(kernel2, &write_events[i], &kernel_events[i][2]); - q.enqueueTask(kernel3, &write_events[i], &kernel_events[i][3]); // read data from DDR std::vector ob; if (use_a) { ob.push_back(out_buff_a[0]); - ob.push_back(out_buff_a[1]); - ob.push_back(out_buff_a[2]); - ob.push_back(out_buff_a[3]); } else { ob.push_back(out_buff_b[0]); - ob.push_back(out_buff_b[1]); - ob.push_back(out_buff_b[2]); - ob.push_back(out_buff_b[3]); } q.enqueueMigrateMemObjects(ob, CL_MIGRATE_MEM_OBJECT_HOST, &kernel_events[i], &read_events[i][0]); } @@ -411,7 +345,7 @@ int main(int argc, char* argv[]) { // check result bool checked = true; // check ping buffer - for (unsigned int n = 0; n < 4; n++) { + for (unsigned int n = 0; n < 1; n++) { for (unsigned int j = 0; j < N_TASK; j++) { for (unsigned int k = 0; k < CH_NM; k++) { for (unsigned int i = 0; i < N_ROW; i++) { @@ -432,7 +366,7 @@ int main(int argc, char* argv[]) { } // check pong buffer - for (unsigned int n = 0; n < 4; n++) { + for (unsigned int n = 0; n < 1; n++) { for (unsigned int j = 0; j < N_TASK; j++) { for (unsigned int k = 0; k < CH_NM; k++) { for (unsigned int i = 0; i < N_ROW; i++) { diff --git a/security/L1/benchmarks/rc4Encrypt/kernel/rc4EncryptKernel2.cpp b/security/L1/benchmarks/rc4Encrypt/kernel/rc4EncryptKernel2.cpp deleted file mode 100644 index d24adbf7bb..0000000000 --- a/security/L1/benchmarks/rc4Encrypt/kernel/rc4EncryptKernel2.cpp +++ /dev/null @@ -1,546 +0,0 @@ -/* - * Copyright 2019 Xilinx, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * - * @file rc4EncryptKernel.cpp - * @brief kernel code of Rivest Cipher 4 (also known as ARC4 or ARCFOUR). - * This file is part of Vitis Security Library. - * - * @detail Containing scan, distribute, encrypt, merge, and write-out functions. - * - */ - -#include -#include -#include "xf_security/rc4.hpp" - -#ifndef __SYNTHESIS__ -#include -#endif - -// @brief analyze the configurations and scan the text block by block. -// XXX this implementation only support the message length not greater than 2^128 byes. -template -static void readBlock(ap_uint<512>* ptr, - hls::stream >& textBlkStrm, - hls::stream >& msgNumStrm1, - hls::stream >& msgNumStrm2, - hls::stream >& taskNumStrm1, - hls::stream >& taskNumStrm2, - hls::stream >& taskNumStrm3, - hls::stream >& keyBlkStrm, - hls::stream >& keyLenStrm) { -#if !defined(__SYNTHESIS__) && _XF_SECURITY_RC4_DEBUG_ == 1 - std::cout << "Entering readBlock..." << std::endl; -#endif - - // cipherkey - ap_uint<8> key; - - // scan for the configurations data - ap_uint<512> axiBlock = ptr[0]; - - // number of message blocks in byte - ap_uint<128> msgNum = axiBlock.range(127, 0); - // inform other processes - msgNumStrm1.write(msgNum); - msgNumStrm2.write(msgNum); - - // number of tasks in a single PCIe block - ap_uint<64> taskNum = axiBlock.range(191, 128); - // inform other processes - taskNumStrm1.write(taskNum); - taskNumStrm2.write(taskNum); - taskNumStrm3.write(taskNum); - - // key length in byte - ap_uint<16> keyLen = axiBlock.range(207, 192); - keyLenStrm.write(keyLen); - -LOOP_SCAN_KEY: - for (unsigned int i = 0; i < _channelNumber * 4; i++) { -#pragma HLS pipeline II = 1 - axiBlock = ptr[i + 1]; - keyBlkStrm.write(axiBlock); - } - -// scan for the text messages -LOOP_SCAN_TEXT: - for (ap_uint<192> i = 0; i < msgNum * taskNum * _channelNumber / 64; i += _burstLength) { - // set the burst length for each burst read - const int burstLen = ((i + _burstLength) > msgNum * taskNum * _channelNumber / 64) - ? (int)(msgNum * taskNum * _channelNumber / 64 - i) - : _burstLength; - - // do a burst read - for (int j = 0; j < burstLen; ++j) { -#pragma HLS pipeline II = 1 - ap_uint<512> t = ptr[_channelNumber * 4 + 1 + i + j]; - textBlkStrm.write(t); - } - } -#if !defined(__SYNTHESIS__) && _XF_SECURITY_RC4_DEBUG_ == 1 - std::cout << "Exiting readBlock..." << std::endl; -#endif -} // end readBlock - -// @brief split the text block into multi-channel text streams, -// and duplicate the key streams. -template -static void splitText(hls::stream >& textBlkStrm, - hls::stream >& keyBlkStrm, - hls::stream >& keyLenStrm, - hls::stream >& msgNumStrm, - hls::stream > msgNumStrm1n[_channelNumber], - hls::stream > msgNumStrm2n[_channelNumber], - hls::stream >& taskNumStrm, - hls::stream > textStrm[_channelNumber], - hls::stream > cipherkeyStrm[_channelNumber], - hls::stream endCipherkeyStrm[_channelNumber]) { -#if !defined(__SYNTHESIS__) && _XF_SECURITY_RC4_DEBUG_ == 1 - std::cout << "Entering splitText..." << std::endl; -#endif - - // number of message blocks in byte - ap_uint<128> msgNum = msgNumStrm.read(); - - // number of tasks in a single PCIe block - ap_uint<64> taskNum = taskNumStrm.read(); - - // key length in byte - ap_uint<16> keyLen = keyLenStrm.read(); - - // key buffer - ap_uint<512> keyBlock[4 * _channelNumber]; -#pragma HLS array_partition variable = keyBlock complete dim = 1 - -LOOP_BUFF_KEY: - for (unsigned int ch = 0; ch < _channelNumber; ch++) { - LOOP_SINGLE_CH: - for (unsigned char j = 0; j < 4; j++) { -#pragma HLS pipeline II = 1 - keyBlock[ch * 4 + j] = keyBlkStrm.read(); - } - } - - ap_uint<128> iEnd = msgNum * _channelNumber / 64; - -LOOP_MULTI_TASK: - for (ap_uint<64> n = 0; n < taskNum; n++) { - LOOP_SEND_KEY: - for (unsigned char ch = 0; ch < _channelNumber; ch++) { -#pragma HLS unroll - LOOP_KEY_BYTE: - for (ap_uint<16> keyPtr = 0; keyPtr < keyLen; keyPtr++) { -#pragma HLS pipeline II = 1 - cipherkeyStrm[ch].write(keyBlock[keyPtr / 64 + ch * 4].range((keyPtr % 64) * 8 + 7, (keyPtr % 64) * 8)); - endCipherkeyStrm[ch].write(false); - } - } - - LOOP_END_KEY: - for (unsigned char ch = 0; ch < _channelNumber; ch++) { -#pragma HLS unroll - endCipherkeyStrm[ch].write(true); - } - - LOOP_SEND_MSGNUM: - for (unsigned char ch = 0; ch < _channelNumber; ch++) { -#pragma HLS unroll - msgNumStrm1n[ch].write(msgNum); - msgNumStrm2n[ch].write(msgNum); - } - - unsigned char ch = 0; - - LOOP_SPLIT_TEXT: - for (ap_uint<128> i = 0; i < iEnd; i++) { -#pragma HLS pipeline II = 1 - // read a text block - ap_uint<512> textBlk = textBlkStrm.read(); - ap_uint<256> v[2]; -#pragma HLS array_partition variable = v complete - v[1] = textBlk.range(511, 256); - v[0] = textBlk.range(255, 0); - - LOOP_SEND_TEXT: - for (unsigned char n = 0; n < _channelNumber; n++) { -#pragma HLS unroll - if (n >= ch && n < ch + 2) { - textStrm[n].write(v[n & 0x1]); - } - } - if (ch == _channelNumber - 2) { - ch = 0; - } else { - ch += 2; - } - } - } -#if !defined(__SYNTHESIS__) && _XF_SECURITY_RC4_DEBUG_ == 1 - std::cout << "Exiting splitText..." << std::endl; -#endif -} // end splitText - -// @brief top of scan -template -static void scanMultiChannel(ap_uint<512>* ptr, - hls::stream > cipherkeyStrm[_channelNumber], - hls::stream endCipherkeyStrm[_channelNumber], - hls::stream > textStrm[_channelNumber], - hls::stream >& msgNumStrm, - hls::stream >& taskNumStrm, - hls::stream >& taskNumStrm2, - hls::stream > msgNumStrm1n[_channelNumber], - hls::stream > msgNumStrm2n[_channelNumber]) { -#pragma HLS dataflow -#if !defined(__SYNTHESIS__) && _XF_SECURITY_RC4_DEBUG_ == 1 - std::cout << "Entering scanMultiChannel..." << std::endl; -#endif - - enum { textFifoDepth = 2 * _burstLength }; - enum { keyFifoDepth = 2 * 4 * _channelNumber }; - - hls::stream > textBlkStrm("textBlkStrm"); -#pragma HLS stream variable = textBlkStrm depth = textFifoDepth -#pragma HLS RESOURCE variable = textBlkStrm core = FIFO_LUTRAM - hls::stream > msgNumStrm1; -#pragma HLS stream variable = msgNumStrm1 depth = 2 -#pragma HLS RESOURCE variable = msgNumStrm1 core = FIFO_LUTRAM - hls::stream > taskNumStrm1; -#pragma HLS stream variable = taskNumStrm1 depth = 2 -#pragma HLS RESOURCE variable = taskNumStrm1 core = FIFO_LUTRAM - hls::stream > keyBlkStrm; -#pragma HLS stream variable = keyBlkStrm depth = keyFifoDepth -#pragma HLS resource variable = keyBlkStrm core = FIFO_LUTRAM - hls::stream > keyLenStrm; -#pragma HLS stream variable = keyLenStrm depth = 2 -#pragma HLS resource variable = keyLenStrm core = FIFO_LUTRAM - - readBlock<_burstLength, _channelNumber>(ptr, textBlkStrm, msgNumStrm, msgNumStrm1, taskNumStrm, taskNumStrm1, - taskNumStrm2, keyBlkStrm, keyLenStrm); - - splitText<_channelNumber>(textBlkStrm, keyBlkStrm, keyLenStrm, msgNumStrm1, msgNumStrm1n, msgNumStrm2n, - taskNumStrm1, textStrm, cipherkeyStrm, endCipherkeyStrm); -#if !defined(__SYNTHESIS__) && _XF_SECURITY_RC4_DEBUG_ == 1 - std::cout << "Exiting scanMultiChannel..." << std::endl; -#endif -} // end scanMultiChannel - -// @brief downsize the 256-bit stream into 8-bit stream -static void downSizer(hls::stream >& textStrm, - hls::stream >& msgNumStrm, - hls::stream >& byteStrm, - hls::stream& endByteStrm) { -#if !defined(__SYNTHESIS__) && _XF_SECURITY_RC4_DEBUG_ == 1 - std::cout << "Entering downSizer..." << std::endl; -#endif - - ap_uint<128> msgNum = msgNumStrm.read(); -LOOP_DOWNSIZE: - for (ap_uint<128> i = 0; i < msgNum / 32; i++) { - ap_uint<256> text = textStrm.read(); - for (unsigned char n = 0; n < 32; n++) { -#pragma HLS pipeline II = 1 - byteStrm.write(text.range(n * 8 + 7, n * 8)); - endByteStrm.write(false); - } - } - endByteStrm.write(true); -#if !defined(__SYNTHESIS__) && _XF_SECURITY_RC4_DEBUG_ == 1 - std::cout << "Exiting downSizer..." << std::endl; -#endif -} - -// @brief upsize the 8-bit stream into 256-bit stream -static void upSizer(hls::stream >& byteStrm, - hls::stream& endByteStrm, - hls::stream >& msgNumStrm, - hls::stream >& textStrm) { -#if !defined(__SYNTHESIS__) && _XF_SECURITY_RC4_DEBUG_ == 1 - std::cout << "Entering upSizer..." << std::endl; -#endif - - bool e = endByteStrm.read(); - ap_uint<128> msgNum = msgNumStrm.read(); -LOOP_UPSIZE: - for (ap_uint<128> i = 0; i < msgNum / 32; i++) { - ap_uint<256> text; - for (unsigned char n = 0; n < 32; n++) { -#pragma HLS pipeline II = 1 - text.range(n * 8 + 7, n * 8) = byteStrm.read(); - e = endByteStrm.read(); - } - textStrm.write(text); - } -#if !defined(__SYNTHESIS__) && _XF_SECURITY_RC4_DEBUG_ == 1 - std::cout << "Exiting upSizer..." << std::endl; -#endif -} - -// @brief rc4 processing core including rc4, donwsizer, and upsizer -static void rc4Core(hls::stream >& cipherkeyStrm, - hls::stream& endCipherkeyStrm, - hls::stream >& textInStrm, - hls::stream >& msgNumStrm1, - hls::stream >& msgNumStrm2, - hls::stream >& textOutStrm) { -#pragma HLS dataflow -#if !defined(__SYNTHESIS__) && _XF_SECURITY_RC4_DEBUG_ == 1 - std::cout << "Entering rc4Core..." << std::endl; -#endif - - hls::stream > byteInStrm; -#pragma HLS stream variable = byteInStrm depth = 64 -#pragma HLS resource variable = byteInStrm core = FIFO_LUTRAM - hls::stream endByteInStrm; -#pragma HLS stream variable = endByteInStrm depth = 64 -#pragma HLS resource variable = endByteInStrm core = FIFO_LUTRAM - - hls::stream > byteOutStrm; -#pragma HLS stream variable = byteOutStrm depth = 64 -#pragma HLS resource variable = byteOutStrm core = FIFO_LUTRAM - hls::stream endByteOutStrm; -#pragma HLS stream variable = endByteOutStrm depth = 64 -#pragma HLS resource variable = endByteOutStrm core = FIFO_LUTRAM - - // split the 256-bit text block into byte stream - downSizer(textInStrm, msgNumStrm1, byteInStrm, endByteInStrm); - - // perform rc4 algorithm - xf::security::rc4(cipherkeyStrm, endCipherkeyStrm, byteInStrm, endByteInStrm, byteOutStrm, endByteOutStrm); - - // combine the byte stream into 256-bit text block - upSizer(byteOutStrm, endByteOutStrm, msgNumStrm2, textOutStrm); -#if !defined(__SYNTHESIS__) && _XF_SECURITY_RC4_DEBUG_ == 1 - std::cout << "Exiting rc4Core..." << std::endl; -#endif -} - -// @brief cipher mode in parallel -template -static void cipherModeParallel(hls::stream > cipherkeyStrm[_channelNumber], - hls::stream endCipherkeyStrm[_channelNumber], - hls::stream > textInStrm[_channelNumber], - hls::stream > msgNumStrm1[_channelNumber], - hls::stream > msgNumStrm2[_channelNumber], - hls::stream > textOutStrm[_channelNumber]) { -#pragma HLS dataflow -#if !defined(__SYNTHESIS__) && _XF_SECURITY_RC4_DEBUG_ == 1 - std::cout << "Entering cipherModeParallel..." << std::endl; -#endif - -LOOP_UNROLL_CORE: - for (unsigned int m = 0; m < _channelNumber; m++) { -#pragma HLS unroll - // XXX cipher mode core is called here - rc4Core(cipherkeyStrm[m], endCipherkeyStrm[m], textInStrm[m], msgNumStrm1[m], msgNumStrm2[m], textOutStrm[m]); - } -#if !defined(__SYNTHESIS__) && _XF_SECURITY_RC4_DEBUG_ == 1 - std::cout << "Exiting cipherModeParallel..." << std::endl; -#endif -} // end cipherModeParallel - -// @brief run tasks in sequence -template -static void cipherModeProcess(hls::stream >& taskNumStrm, - hls::stream > cipherkeyStrm[_channelNumber], - hls::stream endCipherkeyStrm[_channelNumber], - hls::stream > textInStrm[_channelNumber], - hls::stream > msgNumStrm1[_channelNumber], - hls::stream > msgNumStrm2[_channelNumber], - hls::stream > textOutStrm[_channelNumber]) { -#if !defined(__SYNTHESIS__) && _XF_SECURITY_RC4_DEBUG_ == 1 - std::cout << "Entering cipherModeProcess..." << std::endl; -#endif - // number of tasks - ap_uint<64> taskNum = taskNumStrm.read(); - -// call paralleled cipher mode taskNum times -LOOP_MULTI_TASK: - for (ap_uint<64> i = 0; i < taskNum; i++) { - cipherModeParallel<_channelNumber>(cipherkeyStrm, endCipherkeyStrm, textInStrm, msgNumStrm1, msgNumStrm2, - textOutStrm); - } -#if !defined(__SYNTHESIS__) && _XF_SECURITY_RC4_DEBUG_ == 1 - std::cout << "Exiting cipherModeProcess..." << std::endl; -#endif -} // end cipherModeProcess - -// @brief merge the multi-channel result into block stream -template -static void mergeResult(hls::stream >& msgNumStrm, - hls::stream >& taskNumStrm, - hls::stream > textStrm[_channelNumber], - hls::stream >& outStrm, - hls::stream& burstLenStrm) { -#if !defined(__SYNTHESIS__) && _XF_SECURITY_RC4_DEBUG_ == 1 - std::cout << "Entering mergeResult..." << std::endl; -#endif - - // burst length for each wirte-out operation - unsigned int burstLen = 0; - - // number of message blocks in 128-bit - ap_uint<64> msgNum = msgNumStrm.read(); - - // number of tasks in a single PCIe block - ap_uint<64> taskNum = taskNumStrm.read(); - - bool e[_channelNumber]; -LOOP_TASK: - for (ap_uint<64> n = 0; n < taskNum; n++) { - unsigned char ch = 0; - ap_uint<128> iEnd = msgNum * _channelNumber / 64; - LOOP_MERGE: - for (ap_uint<128> i = 0; i < iEnd; i++) { -#pragma HLS pipeline II = 1 - ap_uint<256> v[2]; -#pragma HLS array_partition variable = v complete - - LOOP_RECV_TEXT: - for (unsigned char n = 0; n < _channelNumber; n++) { -#pragma HLS unroll - if (n >= ch && n < ch + 2) { - v[n & 0x1] = textStrm[n].read(); - } - } - ap_uint<512> axiBlock; - axiBlock.range(511, 256) = v[1]; - axiBlock.range(255, 0) = v[0]; - if (ch == _channelNumber - 2) { - ch = 0; - } else { - ch += 2; - } - - // write-out a AXI block data (4 channels) - outStrm.write(axiBlock); - // set the burst length - if (burstLen == _burstLength - 1) { - burstLenStrm.write(_burstLength); - burstLen = 0; - } else { - burstLen++; - } - } - } - - // deal with the condition that we didn't hit the burst boundary - if (burstLen != 0) { - burstLenStrm.write(burstLen); - } - // end the burst write operation - burstLenStrm.write(0); -#if !defined(__SYNTHESIS__) && _XF_SECURITY_RC4_DEBUG_ == 1 - std::cout << "Exiting mergeResult..." << std::endl; -#endif -} // end mergeResult - -// @brief burst write out to DDR -template -static void writeOut(hls::stream& burstLenStrm, - hls::stream >& blockStrm, - ap_uint<512>* ptr) { -#if !defined(__SYNTHESIS__) && _XF_SECURITY_RC4_DEBUG_ == 1 - std::cout << "Entering writeOut..." << std::endl; -#endif - ap_uint<128> offset = 0; - unsigned int bLen = burstLenStrm.read(); - while (bLen) { - LOOP_BURST_WRITE: - for (unsigned int j = 0; j < bLen; ++j) { -#pragma HLS pipeline II = 1 - ap_uint<512> block = blockStrm.read(); - ptr[offset * _burstLength + j] = block; - } - offset++; - bLen = burstLenStrm.read(); - } -#if !defined(__SYNTHESIS__) && _XF_SECURITY_RC4_DEBUG_ == 1 - std::cout << "Exiting writeOut..." << std::endl; -#endif -} // end writeOut - -// @brief top of kernel -extern "C" void rc4EncryptKernel_2(ap_uint<512> inputData[(1 << 30) + 100], ap_uint<512> outputData[1 << 30]) { -#pragma HLS dataflow - - const unsigned int _channelNumber = 12; - const unsigned int _burstLength = 128; - const unsigned int bufferDepth = _burstLength * 2; - -// clang-format off -#pragma HLS INTERFACE m_axi offset = slave latency = 64 \ - num_write_outstanding = 16 num_read_outstanding = 16 \ - max_write_burst_length = 64 max_read_burst_length = 64 \ - bundle = gmem0_0 port = inputData - -#pragma HLS INTERFACE m_axi offset = slave latency = 64 \ - num_write_outstanding = 16 num_read_outstanding = 16 \ - max_write_burst_length = 64 max_read_burst_length = 64 \ - bundle = gmem0_1 port = outputData -// clang-format on - -#pragma HLS INTERFACE s_axilite port = inputData bundle = control -#pragma HLS INTERFACE s_axilite port = outputData bundle = control -#pragma HLS INTERFACE s_axilite port = return bundle = control - - hls::stream > cipherkeyStrm[_channelNumber]; -#pragma HLS stream variable = cipherkeyStrm depth = 512 -#pragma HLS resource variable = cipherkeyStrm core = FIFO_LUTRAM - hls::stream endCipherkeyStrm[_channelNumber]; -#pragma HLS stream variable = endCipherkeyStrm depth = 512 -#pragma HLS resource variable = endCipherkeyStrm core = FIFO_LUTRAM - hls::stream > textInStrm[_channelNumber]; -#pragma HLS stream variable = textInStrm depth = 2 -#pragma HLS resource variable = textInStrm core = FIFO_LUTRAM - hls::stream > msgNumStrm; -#pragma HLS stream variable = msgNumStrm depth = 4 -#pragma HLS resource variable = msgNumStrm core = FIFO_LUTRAM - hls::stream > msgNumStrm1n[_channelNumber]; -#pragma HLS stream variable = msgNumStrm1n depth = 4 -#pragma HLS resource variable = msgNumStrm1n core = FIFO_LUTRAM - hls::stream > msgNumStrm2n[_channelNumber]; -#pragma HLS stream variable = msgNumStrm2n depth = 4 -#pragma HLS resource variable = msgNumStrm2n core = FIFO_LUTRAM - hls::stream > taskNumStrm; -#pragma HLS stream variable = taskNumStrm depth = 4 -#pragma HLS resource variable = taskNumStrm core = FIFO_LUTRAM - hls::stream > taskNumStrm2; -#pragma HLS stream variable = taskNumStrm2 depth = 4 -#pragma HLS resource variable = taskNumStrm2 core = FIFO_LUTRAM - hls::stream > textOutStrm[_channelNumber]; -#pragma HLS stream variable = textOutStrm depth = 2 -#pragma HLS resource variable = textOutStrm core = FIFO_LUTRAM - hls::stream > outStrm("outStrm"); -#pragma HLS stream variable = outStrm depth = bufferDepth -#pragma HLS resource variable = outStrm core = FIFO_BRAM - hls::stream burstLenStrm; -#pragma HLS stream variable = burstLenStrm depth = 4 - - scanMultiChannel<_channelNumber, _burstLength>(inputData, cipherkeyStrm, endCipherkeyStrm, textInStrm, msgNumStrm, - taskNumStrm, taskNumStrm2, msgNumStrm1n, msgNumStrm2n); - - cipherModeProcess<_channelNumber>(taskNumStrm2, cipherkeyStrm, endCipherkeyStrm, textInStrm, msgNumStrm1n, - msgNumStrm2n, textOutStrm); - - mergeResult<_burstLength, _channelNumber>(msgNumStrm, taskNumStrm, textOutStrm, outStrm, burstLenStrm); - - writeOut<_burstLength>(burstLenStrm, outStrm, outputData); - -} // end rc4EncryptKernel_2 diff --git a/security/L1/benchmarks/rc4Encrypt/kernel/rc4EncryptKernel3.cpp b/security/L1/benchmarks/rc4Encrypt/kernel/rc4EncryptKernel3.cpp deleted file mode 100644 index 6fdce7c571..0000000000 --- a/security/L1/benchmarks/rc4Encrypt/kernel/rc4EncryptKernel3.cpp +++ /dev/null @@ -1,546 +0,0 @@ -/* - * Copyright 2019 Xilinx, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * - * @file rc4EncryptKernel.cpp - * @brief kernel code of Rivest Cipher 4 (also known as ARC4 or ARCFOUR). - * This file is part of Vitis Security Library. - * - * @detail Containing scan, distribute, encrypt, merge, and write-out functions. - * - */ - -#include -#include -#include "xf_security/rc4.hpp" - -#ifndef __SYNTHESIS__ -#include -#endif - -// @brief analyze the configurations and scan the text block by block. -// XXX this implementation only support the message length not greater than 2^128 byes. -template -static void readBlock(ap_uint<512>* ptr, - hls::stream >& textBlkStrm, - hls::stream >& msgNumStrm1, - hls::stream >& msgNumStrm2, - hls::stream >& taskNumStrm1, - hls::stream >& taskNumStrm2, - hls::stream >& taskNumStrm3, - hls::stream >& keyBlkStrm, - hls::stream >& keyLenStrm) { -#if !defined(__SYNTHESIS__) && _XF_SECURITY_RC4_DEBUG_ == 1 - std::cout << "Entering readBlock..." << std::endl; -#endif - - // cipherkey - ap_uint<8> key; - - // scan for the configurations data - ap_uint<512> axiBlock = ptr[0]; - - // number of message blocks in byte - ap_uint<128> msgNum = axiBlock.range(127, 0); - // inform other processes - msgNumStrm1.write(msgNum); - msgNumStrm2.write(msgNum); - - // number of tasks in a single PCIe block - ap_uint<64> taskNum = axiBlock.range(191, 128); - // inform other processes - taskNumStrm1.write(taskNum); - taskNumStrm2.write(taskNum); - taskNumStrm3.write(taskNum); - - // key length in byte - ap_uint<16> keyLen = axiBlock.range(207, 192); - keyLenStrm.write(keyLen); - -LOOP_SCAN_KEY: - for (unsigned int i = 0; i < _channelNumber * 4; i++) { -#pragma HLS pipeline II = 1 - axiBlock = ptr[i + 1]; - keyBlkStrm.write(axiBlock); - } - -// scan for the text messages -LOOP_SCAN_TEXT: - for (ap_uint<192> i = 0; i < msgNum * taskNum * _channelNumber / 64; i += _burstLength) { - // set the burst length for each burst read - const int burstLen = ((i + _burstLength) > msgNum * taskNum * _channelNumber / 64) - ? (int)(msgNum * taskNum * _channelNumber / 64 - i) - : _burstLength; - - // do a burst read - for (int j = 0; j < burstLen; ++j) { -#pragma HLS pipeline II = 1 - ap_uint<512> t = ptr[_channelNumber * 4 + 1 + i + j]; - textBlkStrm.write(t); - } - } -#if !defined(__SYNTHESIS__) && _XF_SECURITY_RC4_DEBUG_ == 1 - std::cout << "Exiting readBlock..." << std::endl; -#endif -} // end readBlock - -// @brief split the text block into multi-channel text streams, -// and duplicate the key streams. -template -static void splitText(hls::stream >& textBlkStrm, - hls::stream >& keyBlkStrm, - hls::stream >& keyLenStrm, - hls::stream >& msgNumStrm, - hls::stream > msgNumStrm1n[_channelNumber], - hls::stream > msgNumStrm2n[_channelNumber], - hls::stream >& taskNumStrm, - hls::stream > textStrm[_channelNumber], - hls::stream > cipherkeyStrm[_channelNumber], - hls::stream endCipherkeyStrm[_channelNumber]) { -#if !defined(__SYNTHESIS__) && _XF_SECURITY_RC4_DEBUG_ == 1 - std::cout << "Entering splitText..." << std::endl; -#endif - - // number of message blocks in byte - ap_uint<128> msgNum = msgNumStrm.read(); - - // number of tasks in a single PCIe block - ap_uint<64> taskNum = taskNumStrm.read(); - - // key length in byte - ap_uint<16> keyLen = keyLenStrm.read(); - - // key buffer - ap_uint<512> keyBlock[4 * _channelNumber]; -#pragma HLS array_partition variable = keyBlock complete dim = 1 - -LOOP_BUFF_KEY: - for (unsigned int ch = 0; ch < _channelNumber; ch++) { - LOOP_SINGLE_CH: - for (unsigned char j = 0; j < 4; j++) { -#pragma HLS pipeline II = 1 - keyBlock[ch * 4 + j] = keyBlkStrm.read(); - } - } - - ap_uint<128> iEnd = msgNum * _channelNumber / 64; - -LOOP_MULTI_TASK: - for (ap_uint<64> n = 0; n < taskNum; n++) { - LOOP_SEND_KEY: - for (unsigned char ch = 0; ch < _channelNumber; ch++) { -#pragma HLS unroll - LOOP_KEY_BYTE: - for (ap_uint<16> keyPtr = 0; keyPtr < keyLen; keyPtr++) { -#pragma HLS pipeline II = 1 - cipherkeyStrm[ch].write(keyBlock[keyPtr / 64 + ch * 4].range((keyPtr % 64) * 8 + 7, (keyPtr % 64) * 8)); - endCipherkeyStrm[ch].write(false); - } - } - - LOOP_END_KEY: - for (unsigned char ch = 0; ch < _channelNumber; ch++) { -#pragma HLS unroll - endCipherkeyStrm[ch].write(true); - } - - LOOP_SEND_MSGNUM: - for (unsigned char ch = 0; ch < _channelNumber; ch++) { -#pragma HLS unroll - msgNumStrm1n[ch].write(msgNum); - msgNumStrm2n[ch].write(msgNum); - } - - unsigned char ch = 0; - - LOOP_SPLIT_TEXT: - for (ap_uint<128> i = 0; i < iEnd; i++) { -#pragma HLS pipeline II = 1 - // read a text block - ap_uint<512> textBlk = textBlkStrm.read(); - ap_uint<256> v[2]; -#pragma HLS array_partition variable = v complete - v[1] = textBlk.range(511, 256); - v[0] = textBlk.range(255, 0); - - LOOP_SEND_TEXT: - for (unsigned char n = 0; n < _channelNumber; n++) { -#pragma HLS unroll - if (n >= ch && n < ch + 2) { - textStrm[n].write(v[n & 0x1]); - } - } - if (ch == _channelNumber - 2) { - ch = 0; - } else { - ch += 2; - } - } - } -#if !defined(__SYNTHESIS__) && _XF_SECURITY_RC4_DEBUG_ == 1 - std::cout << "Exiting splitText..." << std::endl; -#endif -} // end splitText - -// @brief top of scan -template -static void scanMultiChannel(ap_uint<512>* ptr, - hls::stream > cipherkeyStrm[_channelNumber], - hls::stream endCipherkeyStrm[_channelNumber], - hls::stream > textStrm[_channelNumber], - hls::stream >& msgNumStrm, - hls::stream >& taskNumStrm, - hls::stream >& taskNumStrm2, - hls::stream > msgNumStrm1n[_channelNumber], - hls::stream > msgNumStrm2n[_channelNumber]) { -#pragma HLS dataflow -#if !defined(__SYNTHESIS__) && _XF_SECURITY_RC4_DEBUG_ == 1 - std::cout << "Entering scanMultiChannel..." << std::endl; -#endif - - enum { textFifoDepth = 2 * _burstLength }; - enum { keyFifoDepth = 2 * 4 * _channelNumber }; - - hls::stream > textBlkStrm("textBlkStrm"); -#pragma HLS stream variable = textBlkStrm depth = textFifoDepth -#pragma HLS RESOURCE variable = textBlkStrm core = FIFO_LUTRAM - hls::stream > msgNumStrm1; -#pragma HLS stream variable = msgNumStrm1 depth = 2 -#pragma HLS RESOURCE variable = msgNumStrm1 core = FIFO_LUTRAM - hls::stream > taskNumStrm1; -#pragma HLS stream variable = taskNumStrm1 depth = 2 -#pragma HLS RESOURCE variable = taskNumStrm1 core = FIFO_LUTRAM - hls::stream > keyBlkStrm; -#pragma HLS stream variable = keyBlkStrm depth = keyFifoDepth -#pragma HLS resource variable = keyBlkStrm core = FIFO_LUTRAM - hls::stream > keyLenStrm; -#pragma HLS stream variable = keyLenStrm depth = 2 -#pragma HLS resource variable = keyLenStrm core = FIFO_LUTRAM - - readBlock<_burstLength, _channelNumber>(ptr, textBlkStrm, msgNumStrm, msgNumStrm1, taskNumStrm, taskNumStrm1, - taskNumStrm2, keyBlkStrm, keyLenStrm); - - splitText<_channelNumber>(textBlkStrm, keyBlkStrm, keyLenStrm, msgNumStrm1, msgNumStrm1n, msgNumStrm2n, - taskNumStrm1, textStrm, cipherkeyStrm, endCipherkeyStrm); -#if !defined(__SYNTHESIS__) && _XF_SECURITY_RC4_DEBUG_ == 1 - std::cout << "Exiting scanMultiChannel..." << std::endl; -#endif -} // end scanMultiChannel - -// @brief downsize the 256-bit stream into 8-bit stream -static void downSizer(hls::stream >& textStrm, - hls::stream >& msgNumStrm, - hls::stream >& byteStrm, - hls::stream& endByteStrm) { -#if !defined(__SYNTHESIS__) && _XF_SECURITY_RC4_DEBUG_ == 1 - std::cout << "Entering downSizer..." << std::endl; -#endif - - ap_uint<128> msgNum = msgNumStrm.read(); -LOOP_DOWNSIZE: - for (ap_uint<128> i = 0; i < msgNum / 32; i++) { - ap_uint<256> text = textStrm.read(); - for (unsigned char n = 0; n < 32; n++) { -#pragma HLS pipeline II = 1 - byteStrm.write(text.range(n * 8 + 7, n * 8)); - endByteStrm.write(false); - } - } - endByteStrm.write(true); -#if !defined(__SYNTHESIS__) && _XF_SECURITY_RC4_DEBUG_ == 1 - std::cout << "Exiting downSizer..." << std::endl; -#endif -} - -// @brief upsize the 8-bit stream into 256-bit stream -static void upSizer(hls::stream >& byteStrm, - hls::stream& endByteStrm, - hls::stream >& msgNumStrm, - hls::stream >& textStrm) { -#if !defined(__SYNTHESIS__) && _XF_SECURITY_RC4_DEBUG_ == 1 - std::cout << "Entering upSizer..." << std::endl; -#endif - - bool e = endByteStrm.read(); - ap_uint<128> msgNum = msgNumStrm.read(); -LOOP_UPSIZE: - for (ap_uint<128> i = 0; i < msgNum / 32; i++) { - ap_uint<256> text; - for (unsigned char n = 0; n < 32; n++) { -#pragma HLS pipeline II = 1 - text.range(n * 8 + 7, n * 8) = byteStrm.read(); - e = endByteStrm.read(); - } - textStrm.write(text); - } -#if !defined(__SYNTHESIS__) && _XF_SECURITY_RC4_DEBUG_ == 1 - std::cout << "Exiting upSizer..." << std::endl; -#endif -} - -// @brief rc4 processing core including rc4, donwsizer, and upsizer -static void rc4Core(hls::stream >& cipherkeyStrm, - hls::stream& endCipherkeyStrm, - hls::stream >& textInStrm, - hls::stream >& msgNumStrm1, - hls::stream >& msgNumStrm2, - hls::stream >& textOutStrm) { -#pragma HLS dataflow -#if !defined(__SYNTHESIS__) && _XF_SECURITY_RC4_DEBUG_ == 1 - std::cout << "Entering rc4Core..." << std::endl; -#endif - - hls::stream > byteInStrm; -#pragma HLS stream variable = byteInStrm depth = 64 -#pragma HLS resource variable = byteInStrm core = FIFO_LUTRAM - hls::stream endByteInStrm; -#pragma HLS stream variable = endByteInStrm depth = 64 -#pragma HLS resource variable = endByteInStrm core = FIFO_LUTRAM - - hls::stream > byteOutStrm; -#pragma HLS stream variable = byteOutStrm depth = 64 -#pragma HLS resource variable = byteOutStrm core = FIFO_LUTRAM - hls::stream endByteOutStrm; -#pragma HLS stream variable = endByteOutStrm depth = 64 -#pragma HLS resource variable = endByteOutStrm core = FIFO_LUTRAM - - // split the 256-bit text block into byte stream - downSizer(textInStrm, msgNumStrm1, byteInStrm, endByteInStrm); - - // perform rc4 algorithm - xf::security::rc4(cipherkeyStrm, endCipherkeyStrm, byteInStrm, endByteInStrm, byteOutStrm, endByteOutStrm); - - // combine the byte stream into 256-bit text block - upSizer(byteOutStrm, endByteOutStrm, msgNumStrm2, textOutStrm); -#if !defined(__SYNTHESIS__) && _XF_SECURITY_RC4_DEBUG_ == 1 - std::cout << "Exiting rc4Core..." << std::endl; -#endif -} - -// @brief cipher mode in parallel -template -static void cipherModeParallel(hls::stream > cipherkeyStrm[_channelNumber], - hls::stream endCipherkeyStrm[_channelNumber], - hls::stream > textInStrm[_channelNumber], - hls::stream > msgNumStrm1[_channelNumber], - hls::stream > msgNumStrm2[_channelNumber], - hls::stream > textOutStrm[_channelNumber]) { -#pragma HLS dataflow -#if !defined(__SYNTHESIS__) && _XF_SECURITY_RC4_DEBUG_ == 1 - std::cout << "Entering cipherModeParallel..." << std::endl; -#endif - -LOOP_UNROLL_CORE: - for (unsigned int m = 0; m < _channelNumber; m++) { -#pragma HLS unroll - // XXX cipher mode core is called here - rc4Core(cipherkeyStrm[m], endCipherkeyStrm[m], textInStrm[m], msgNumStrm1[m], msgNumStrm2[m], textOutStrm[m]); - } -#if !defined(__SYNTHESIS__) && _XF_SECURITY_RC4_DEBUG_ == 1 - std::cout << "Exiting cipherModeParallel..." << std::endl; -#endif -} // end cipherModeParallel - -// @brief run tasks in sequence -template -static void cipherModeProcess(hls::stream >& taskNumStrm, - hls::stream > cipherkeyStrm[_channelNumber], - hls::stream endCipherkeyStrm[_channelNumber], - hls::stream > textInStrm[_channelNumber], - hls::stream > msgNumStrm1[_channelNumber], - hls::stream > msgNumStrm2[_channelNumber], - hls::stream > textOutStrm[_channelNumber]) { -#if !defined(__SYNTHESIS__) && _XF_SECURITY_RC4_DEBUG_ == 1 - std::cout << "Entering cipherModeProcess..." << std::endl; -#endif - // number of tasks - ap_uint<64> taskNum = taskNumStrm.read(); - -// call paralleled cipher mode taskNum times -LOOP_MULTI_TASK: - for (ap_uint<64> i = 0; i < taskNum; i++) { - cipherModeParallel<_channelNumber>(cipherkeyStrm, endCipherkeyStrm, textInStrm, msgNumStrm1, msgNumStrm2, - textOutStrm); - } -#if !defined(__SYNTHESIS__) && _XF_SECURITY_RC4_DEBUG_ == 1 - std::cout << "Exiting cipherModeProcess..." << std::endl; -#endif -} // end cipherModeProcess - -// @brief merge the multi-channel result into block stream -template -static void mergeResult(hls::stream >& msgNumStrm, - hls::stream >& taskNumStrm, - hls::stream > textStrm[_channelNumber], - hls::stream >& outStrm, - hls::stream& burstLenStrm) { -#if !defined(__SYNTHESIS__) && _XF_SECURITY_RC4_DEBUG_ == 1 - std::cout << "Entering mergeResult..." << std::endl; -#endif - - // burst length for each wirte-out operation - unsigned int burstLen = 0; - - // number of message blocks in 128-bit - ap_uint<64> msgNum = msgNumStrm.read(); - - // number of tasks in a single PCIe block - ap_uint<64> taskNum = taskNumStrm.read(); - - bool e[_channelNumber]; -LOOP_TASK: - for (ap_uint<64> n = 0; n < taskNum; n++) { - unsigned char ch = 0; - ap_uint<128> iEnd = msgNum * _channelNumber / 64; - LOOP_MERGE: - for (ap_uint<128> i = 0; i < iEnd; i++) { -#pragma HLS pipeline II = 1 - ap_uint<256> v[2]; -#pragma HLS array_partition variable = v complete - - LOOP_RECV_TEXT: - for (unsigned char n = 0; n < _channelNumber; n++) { -#pragma HLS unroll - if (n >= ch && n < ch + 2) { - v[n & 0x1] = textStrm[n].read(); - } - } - ap_uint<512> axiBlock; - axiBlock.range(511, 256) = v[1]; - axiBlock.range(255, 0) = v[0]; - if (ch == _channelNumber - 2) { - ch = 0; - } else { - ch += 2; - } - - // write-out a AXI block data (4 channels) - outStrm.write(axiBlock); - // set the burst length - if (burstLen == _burstLength - 1) { - burstLenStrm.write(_burstLength); - burstLen = 0; - } else { - burstLen++; - } - } - } - - // deal with the condition that we didn't hit the burst boundary - if (burstLen != 0) { - burstLenStrm.write(burstLen); - } - // end the burst write operation - burstLenStrm.write(0); -#if !defined(__SYNTHESIS__) && _XF_SECURITY_RC4_DEBUG_ == 1 - std::cout << "Exiting mergeResult..." << std::endl; -#endif -} // end mergeResult - -// @brief burst write out to DDR -template -static void writeOut(hls::stream& burstLenStrm, - hls::stream >& blockStrm, - ap_uint<512>* ptr) { -#if !defined(__SYNTHESIS__) && _XF_SECURITY_RC4_DEBUG_ == 1 - std::cout << "Entering writeOut..." << std::endl; -#endif - ap_uint<128> offset = 0; - unsigned int bLen = burstLenStrm.read(); - while (bLen) { - LOOP_BURST_WRITE: - for (unsigned int j = 0; j < bLen; ++j) { -#pragma HLS pipeline II = 1 - ap_uint<512> block = blockStrm.read(); - ptr[offset * _burstLength + j] = block; - } - offset++; - bLen = burstLenStrm.read(); - } -#if !defined(__SYNTHESIS__) && _XF_SECURITY_RC4_DEBUG_ == 1 - std::cout << "Exiting writeOut..." << std::endl; -#endif -} // end writeOut - -// @brief top of kernel -extern "C" void rc4EncryptKernel_3(ap_uint<512> inputData[(1 << 30) + 100], ap_uint<512> outputData[1 << 30]) { -#pragma HLS dataflow - - const unsigned int _channelNumber = 12; - const unsigned int _burstLength = 128; - const unsigned int bufferDepth = _burstLength * 2; - -// clang-format off -#pragma HLS INTERFACE m_axi offset = slave latency = 64 \ - num_write_outstanding = 16 num_read_outstanding = 16 \ - max_write_burst_length = 64 max_read_burst_length = 64 \ - bundle = gmem0_0 port = inputData - -#pragma HLS INTERFACE m_axi offset = slave latency = 64 \ - num_write_outstanding = 16 num_read_outstanding = 16 \ - max_write_burst_length = 64 max_read_burst_length = 64 \ - bundle = gmem0_1 port = outputData -// clang-format on - -#pragma HLS INTERFACE s_axilite port = inputData bundle = control -#pragma HLS INTERFACE s_axilite port = outputData bundle = control -#pragma HLS INTERFACE s_axilite port = return bundle = control - - hls::stream > cipherkeyStrm[_channelNumber]; -#pragma HLS stream variable = cipherkeyStrm depth = 512 -#pragma HLS resource variable = cipherkeyStrm core = FIFO_LUTRAM - hls::stream endCipherkeyStrm[_channelNumber]; -#pragma HLS stream variable = endCipherkeyStrm depth = 512 -#pragma HLS resource variable = endCipherkeyStrm core = FIFO_LUTRAM - hls::stream > textInStrm[_channelNumber]; -#pragma HLS stream variable = textInStrm depth = 2 -#pragma HLS resource variable = textInStrm core = FIFO_LUTRAM - hls::stream > msgNumStrm; -#pragma HLS stream variable = msgNumStrm depth = 4 -#pragma HLS resource variable = msgNumStrm core = FIFO_LUTRAM - hls::stream > msgNumStrm1n[_channelNumber]; -#pragma HLS stream variable = msgNumStrm1n depth = 4 -#pragma HLS resource variable = msgNumStrm1n core = FIFO_LUTRAM - hls::stream > msgNumStrm2n[_channelNumber]; -#pragma HLS stream variable = msgNumStrm2n depth = 4 -#pragma HLS resource variable = msgNumStrm2n core = FIFO_LUTRAM - hls::stream > taskNumStrm; -#pragma HLS stream variable = taskNumStrm depth = 4 -#pragma HLS resource variable = taskNumStrm core = FIFO_LUTRAM - hls::stream > taskNumStrm2; -#pragma HLS stream variable = taskNumStrm2 depth = 4 -#pragma HLS resource variable = taskNumStrm2 core = FIFO_LUTRAM - hls::stream > textOutStrm[_channelNumber]; -#pragma HLS stream variable = textOutStrm depth = 2 -#pragma HLS resource variable = textOutStrm core = FIFO_LUTRAM - hls::stream > outStrm("outStrm"); -#pragma HLS stream variable = outStrm depth = bufferDepth -#pragma HLS resource variable = outStrm core = FIFO_BRAM - hls::stream burstLenStrm; -#pragma HLS stream variable = burstLenStrm depth = 4 - - scanMultiChannel<_channelNumber, _burstLength>(inputData, cipherkeyStrm, endCipherkeyStrm, textInStrm, msgNumStrm, - taskNumStrm, taskNumStrm2, msgNumStrm1n, msgNumStrm2n); - - cipherModeProcess<_channelNumber>(taskNumStrm2, cipherkeyStrm, endCipherkeyStrm, textInStrm, msgNumStrm1n, - msgNumStrm2n, textOutStrm); - - mergeResult<_burstLength, _channelNumber>(msgNumStrm, taskNumStrm, textOutStrm, outStrm, burstLenStrm); - - writeOut<_burstLength>(burstLenStrm, outStrm, outputData); - -} // end rc4EncryptKernel_3 diff --git a/security/L1/benchmarks/rc4Encrypt/kernel/rc4EncryptKernel4.cpp b/security/L1/benchmarks/rc4Encrypt/kernel/rc4EncryptKernel4.cpp deleted file mode 100644 index 3140fde4a7..0000000000 --- a/security/L1/benchmarks/rc4Encrypt/kernel/rc4EncryptKernel4.cpp +++ /dev/null @@ -1,546 +0,0 @@ -/* - * Copyright 2019 Xilinx, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * - * @file rc4EncryptKernel.cpp - * @brief kernel code of Rivest Cipher 4 (also known as ARC4 or ARCFOUR). - * This file is part of Vitis Security Library. - * - * @detail Containing scan, distribute, encrypt, merge, and write-out functions. - * - */ - -#include -#include -#include "xf_security/rc4.hpp" - -#ifndef __SYNTHESIS__ -#include -#endif - -// @brief analyze the configurations and scan the text block by block. -// XXX this implementation only support the message length not greater than 2^128 byes. -template -static void readBlock(ap_uint<512>* ptr, - hls::stream >& textBlkStrm, - hls::stream >& msgNumStrm1, - hls::stream >& msgNumStrm2, - hls::stream >& taskNumStrm1, - hls::stream >& taskNumStrm2, - hls::stream >& taskNumStrm3, - hls::stream >& keyBlkStrm, - hls::stream >& keyLenStrm) { -#if !defined(__SYNTHESIS__) && _XF_SECURITY_RC4_DEBUG_ == 1 - std::cout << "Entering readBlock..." << std::endl; -#endif - - // cipherkey - ap_uint<8> key; - - // scan for the configurations data - ap_uint<512> axiBlock = ptr[0]; - - // number of message blocks in byte - ap_uint<128> msgNum = axiBlock.range(127, 0); - // inform other processes - msgNumStrm1.write(msgNum); - msgNumStrm2.write(msgNum); - - // number of tasks in a single PCIe block - ap_uint<64> taskNum = axiBlock.range(191, 128); - // inform other processes - taskNumStrm1.write(taskNum); - taskNumStrm2.write(taskNum); - taskNumStrm3.write(taskNum); - - // key length in byte - ap_uint<16> keyLen = axiBlock.range(207, 192); - keyLenStrm.write(keyLen); - -LOOP_SCAN_KEY: - for (unsigned int i = 0; i < _channelNumber * 4; i++) { -#pragma HLS pipeline II = 1 - axiBlock = ptr[i + 1]; - keyBlkStrm.write(axiBlock); - } - -// scan for the text messages -LOOP_SCAN_TEXT: - for (ap_uint<192> i = 0; i < msgNum * taskNum * _channelNumber / 64; i += _burstLength) { - // set the burst length for each burst read - const int burstLen = ((i + _burstLength) > msgNum * taskNum * _channelNumber / 64) - ? (int)(msgNum * taskNum * _channelNumber / 64 - i) - : _burstLength; - - // do a burst read - for (int j = 0; j < burstLen; ++j) { -#pragma HLS pipeline II = 1 - ap_uint<512> t = ptr[_channelNumber * 4 + 1 + i + j]; - textBlkStrm.write(t); - } - } -#if !defined(__SYNTHESIS__) && _XF_SECURITY_RC4_DEBUG_ == 1 - std::cout << "Exiting readBlock..." << std::endl; -#endif -} // end readBlock - -// @brief split the text block into multi-channel text streams, -// and duplicate the key streams. -template -static void splitText(hls::stream >& textBlkStrm, - hls::stream >& keyBlkStrm, - hls::stream >& keyLenStrm, - hls::stream >& msgNumStrm, - hls::stream > msgNumStrm1n[_channelNumber], - hls::stream > msgNumStrm2n[_channelNumber], - hls::stream >& taskNumStrm, - hls::stream > textStrm[_channelNumber], - hls::stream > cipherkeyStrm[_channelNumber], - hls::stream endCipherkeyStrm[_channelNumber]) { -#if !defined(__SYNTHESIS__) && _XF_SECURITY_RC4_DEBUG_ == 1 - std::cout << "Entering splitText..." << std::endl; -#endif - - // number of message blocks in byte - ap_uint<128> msgNum = msgNumStrm.read(); - - // number of tasks in a single PCIe block - ap_uint<64> taskNum = taskNumStrm.read(); - - // key length in byte - ap_uint<16> keyLen = keyLenStrm.read(); - - // key buffer - ap_uint<512> keyBlock[4 * _channelNumber]; -#pragma HLS array_partition variable = keyBlock complete dim = 1 - -LOOP_BUFF_KEY: - for (unsigned int ch = 0; ch < _channelNumber; ch++) { - LOOP_SINGLE_CH: - for (unsigned char j = 0; j < 4; j++) { -#pragma HLS pipeline II = 1 - keyBlock[ch * 4 + j] = keyBlkStrm.read(); - } - } - - ap_uint<128> iEnd = msgNum * _channelNumber / 64; - -LOOP_MULTI_TASK: - for (ap_uint<64> n = 0; n < taskNum; n++) { - LOOP_SEND_KEY: - for (unsigned char ch = 0; ch < _channelNumber; ch++) { -#pragma HLS unroll - LOOP_KEY_BYTE: - for (ap_uint<16> keyPtr = 0; keyPtr < keyLen; keyPtr++) { -#pragma HLS pipeline II = 1 - cipherkeyStrm[ch].write(keyBlock[keyPtr / 64 + ch * 4].range((keyPtr % 64) * 8 + 7, (keyPtr % 64) * 8)); - endCipherkeyStrm[ch].write(false); - } - } - - LOOP_END_KEY: - for (unsigned char ch = 0; ch < _channelNumber; ch++) { -#pragma HLS unroll - endCipherkeyStrm[ch].write(true); - } - - LOOP_SEND_MSGNUM: - for (unsigned char ch = 0; ch < _channelNumber; ch++) { -#pragma HLS unroll - msgNumStrm1n[ch].write(msgNum); - msgNumStrm2n[ch].write(msgNum); - } - - unsigned char ch = 0; - - LOOP_SPLIT_TEXT: - for (ap_uint<128> i = 0; i < iEnd; i++) { -#pragma HLS pipeline II = 1 - // read a text block - ap_uint<512> textBlk = textBlkStrm.read(); - ap_uint<256> v[2]; -#pragma HLS array_partition variable = v complete - v[1] = textBlk.range(511, 256); - v[0] = textBlk.range(255, 0); - - LOOP_SEND_TEXT: - for (unsigned char n = 0; n < _channelNumber; n++) { -#pragma HLS unroll - if (n >= ch && n < ch + 2) { - textStrm[n].write(v[n & 0x1]); - } - } - if (ch == _channelNumber - 2) { - ch = 0; - } else { - ch += 2; - } - } - } -#if !defined(__SYNTHESIS__) && _XF_SECURITY_RC4_DEBUG_ == 1 - std::cout << "Exiting splitText..." << std::endl; -#endif -} // end splitText - -// @brief top of scan -template -static void scanMultiChannel(ap_uint<512>* ptr, - hls::stream > cipherkeyStrm[_channelNumber], - hls::stream endCipherkeyStrm[_channelNumber], - hls::stream > textStrm[_channelNumber], - hls::stream >& msgNumStrm, - hls::stream >& taskNumStrm, - hls::stream >& taskNumStrm2, - hls::stream > msgNumStrm1n[_channelNumber], - hls::stream > msgNumStrm2n[_channelNumber]) { -#pragma HLS dataflow -#if !defined(__SYNTHESIS__) && _XF_SECURITY_RC4_DEBUG_ == 1 - std::cout << "Entering scanMultiChannel..." << std::endl; -#endif - - enum { textFifoDepth = 2 * _burstLength }; - enum { keyFifoDepth = 2 * 4 * _channelNumber }; - - hls::stream > textBlkStrm("textBlkStrm"); -#pragma HLS stream variable = textBlkStrm depth = textFifoDepth -#pragma HLS RESOURCE variable = textBlkStrm core = FIFO_LUTRAM - hls::stream > msgNumStrm1; -#pragma HLS stream variable = msgNumStrm1 depth = 2 -#pragma HLS RESOURCE variable = msgNumStrm1 core = FIFO_LUTRAM - hls::stream > taskNumStrm1; -#pragma HLS stream variable = taskNumStrm1 depth = 2 -#pragma HLS RESOURCE variable = taskNumStrm1 core = FIFO_LUTRAM - hls::stream > keyBlkStrm; -#pragma HLS stream variable = keyBlkStrm depth = keyFifoDepth -#pragma HLS resource variable = keyBlkStrm core = FIFO_LUTRAM - hls::stream > keyLenStrm; -#pragma HLS stream variable = keyLenStrm depth = 2 -#pragma HLS resource variable = keyLenStrm core = FIFO_LUTRAM - - readBlock<_burstLength, _channelNumber>(ptr, textBlkStrm, msgNumStrm, msgNumStrm1, taskNumStrm, taskNumStrm1, - taskNumStrm2, keyBlkStrm, keyLenStrm); - - splitText<_channelNumber>(textBlkStrm, keyBlkStrm, keyLenStrm, msgNumStrm1, msgNumStrm1n, msgNumStrm2n, - taskNumStrm1, textStrm, cipherkeyStrm, endCipherkeyStrm); -#if !defined(__SYNTHESIS__) && _XF_SECURITY_RC4_DEBUG_ == 1 - std::cout << "Exiting scanMultiChannel..." << std::endl; -#endif -} // end scanMultiChannel - -// @brief downsize the 256-bit stream into 8-bit stream -static void downSizer(hls::stream >& textStrm, - hls::stream >& msgNumStrm, - hls::stream >& byteStrm, - hls::stream& endByteStrm) { -#if !defined(__SYNTHESIS__) && _XF_SECURITY_RC4_DEBUG_ == 1 - std::cout << "Entering downSizer..." << std::endl; -#endif - - ap_uint<128> msgNum = msgNumStrm.read(); -LOOP_DOWNSIZE: - for (ap_uint<128> i = 0; i < msgNum / 32; i++) { - ap_uint<256> text = textStrm.read(); - for (unsigned char n = 0; n < 32; n++) { -#pragma HLS pipeline II = 1 - byteStrm.write(text.range(n * 8 + 7, n * 8)); - endByteStrm.write(false); - } - } - endByteStrm.write(true); -#if !defined(__SYNTHESIS__) && _XF_SECURITY_RC4_DEBUG_ == 1 - std::cout << "Exiting downSizer..." << std::endl; -#endif -} - -// @brief upsize the 8-bit stream into 256-bit stream -static void upSizer(hls::stream >& byteStrm, - hls::stream& endByteStrm, - hls::stream >& msgNumStrm, - hls::stream >& textStrm) { -#if !defined(__SYNTHESIS__) && _XF_SECURITY_RC4_DEBUG_ == 1 - std::cout << "Entering upSizer..." << std::endl; -#endif - - bool e = endByteStrm.read(); - ap_uint<128> msgNum = msgNumStrm.read(); -LOOP_UPSIZE: - for (ap_uint<128> i = 0; i < msgNum / 32; i++) { - ap_uint<256> text; - for (unsigned char n = 0; n < 32; n++) { -#pragma HLS pipeline II = 1 - text.range(n * 8 + 7, n * 8) = byteStrm.read(); - e = endByteStrm.read(); - } - textStrm.write(text); - } -#if !defined(__SYNTHESIS__) && _XF_SECURITY_RC4_DEBUG_ == 1 - std::cout << "Exiting upSizer..." << std::endl; -#endif -} - -// @brief rc4 processing core including rc4, donwsizer, and upsizer -static void rc4Core(hls::stream >& cipherkeyStrm, - hls::stream& endCipherkeyStrm, - hls::stream >& textInStrm, - hls::stream >& msgNumStrm1, - hls::stream >& msgNumStrm2, - hls::stream >& textOutStrm) { -#pragma HLS dataflow -#if !defined(__SYNTHESIS__) && _XF_SECURITY_RC4_DEBUG_ == 1 - std::cout << "Entering rc4Core..." << std::endl; -#endif - - hls::stream > byteInStrm; -#pragma HLS stream variable = byteInStrm depth = 64 -#pragma HLS resource variable = byteInStrm core = FIFO_LUTRAM - hls::stream endByteInStrm; -#pragma HLS stream variable = endByteInStrm depth = 64 -#pragma HLS resource variable = endByteInStrm core = FIFO_LUTRAM - - hls::stream > byteOutStrm; -#pragma HLS stream variable = byteOutStrm depth = 64 -#pragma HLS resource variable = byteOutStrm core = FIFO_LUTRAM - hls::stream endByteOutStrm; -#pragma HLS stream variable = endByteOutStrm depth = 64 -#pragma HLS resource variable = endByteOutStrm core = FIFO_LUTRAM - - // split the 256-bit text block into byte stream - downSizer(textInStrm, msgNumStrm1, byteInStrm, endByteInStrm); - - // perform rc4 algorithm - xf::security::rc4(cipherkeyStrm, endCipherkeyStrm, byteInStrm, endByteInStrm, byteOutStrm, endByteOutStrm); - - // combine the byte stream into 256-bit text block - upSizer(byteOutStrm, endByteOutStrm, msgNumStrm2, textOutStrm); -#if !defined(__SYNTHESIS__) && _XF_SECURITY_RC4_DEBUG_ == 1 - std::cout << "Exiting rc4Core..." << std::endl; -#endif -} - -// @brief cipher mode in parallel -template -static void cipherModeParallel(hls::stream > cipherkeyStrm[_channelNumber], - hls::stream endCipherkeyStrm[_channelNumber], - hls::stream > textInStrm[_channelNumber], - hls::stream > msgNumStrm1[_channelNumber], - hls::stream > msgNumStrm2[_channelNumber], - hls::stream > textOutStrm[_channelNumber]) { -#pragma HLS dataflow -#if !defined(__SYNTHESIS__) && _XF_SECURITY_RC4_DEBUG_ == 1 - std::cout << "Entering cipherModeParallel..." << std::endl; -#endif - -LOOP_UNROLL_CORE: - for (unsigned int m = 0; m < _channelNumber; m++) { -#pragma HLS unroll - // XXX cipher mode core is called here - rc4Core(cipherkeyStrm[m], endCipherkeyStrm[m], textInStrm[m], msgNumStrm1[m], msgNumStrm2[m], textOutStrm[m]); - } -#if !defined(__SYNTHESIS__) && _XF_SECURITY_RC4_DEBUG_ == 1 - std::cout << "Exiting cipherModeParallel..." << std::endl; -#endif -} // end cipherModeParallel - -// @brief run tasks in sequence -template -static void cipherModeProcess(hls::stream >& taskNumStrm, - hls::stream > cipherkeyStrm[_channelNumber], - hls::stream endCipherkeyStrm[_channelNumber], - hls::stream > textInStrm[_channelNumber], - hls::stream > msgNumStrm1[_channelNumber], - hls::stream > msgNumStrm2[_channelNumber], - hls::stream > textOutStrm[_channelNumber]) { -#if !defined(__SYNTHESIS__) && _XF_SECURITY_RC4_DEBUG_ == 1 - std::cout << "Entering cipherModeProcess..." << std::endl; -#endif - // number of tasks - ap_uint<64> taskNum = taskNumStrm.read(); - -// call paralleled cipher mode taskNum times -LOOP_MULTI_TASK: - for (ap_uint<64> i = 0; i < taskNum; i++) { - cipherModeParallel<_channelNumber>(cipherkeyStrm, endCipherkeyStrm, textInStrm, msgNumStrm1, msgNumStrm2, - textOutStrm); - } -#if !defined(__SYNTHESIS__) && _XF_SECURITY_RC4_DEBUG_ == 1 - std::cout << "Exiting cipherModeProcess..." << std::endl; -#endif -} // end cipherModeProcess - -// @brief merge the multi-channel result into block stream -template -static void mergeResult(hls::stream >& msgNumStrm, - hls::stream >& taskNumStrm, - hls::stream > textStrm[_channelNumber], - hls::stream >& outStrm, - hls::stream& burstLenStrm) { -#if !defined(__SYNTHESIS__) && _XF_SECURITY_RC4_DEBUG_ == 1 - std::cout << "Entering mergeResult..." << std::endl; -#endif - - // burst length for each wirte-out operation - unsigned int burstLen = 0; - - // number of message blocks in 128-bit - ap_uint<64> msgNum = msgNumStrm.read(); - - // number of tasks in a single PCIe block - ap_uint<64> taskNum = taskNumStrm.read(); - - bool e[_channelNumber]; -LOOP_TASK: - for (ap_uint<64> n = 0; n < taskNum; n++) { - unsigned char ch = 0; - ap_uint<128> iEnd = msgNum * _channelNumber / 64; - LOOP_MERGE: - for (ap_uint<128> i = 0; i < iEnd; i++) { -#pragma HLS pipeline II = 1 - ap_uint<256> v[2]; -#pragma HLS array_partition variable = v complete - - LOOP_RECV_TEXT: - for (unsigned char n = 0; n < _channelNumber; n++) { -#pragma HLS unroll - if (n >= ch && n < ch + 2) { - v[n & 0x1] = textStrm[n].read(); - } - } - ap_uint<512> axiBlock; - axiBlock.range(511, 256) = v[1]; - axiBlock.range(255, 0) = v[0]; - if (ch == _channelNumber - 2) { - ch = 0; - } else { - ch += 2; - } - - // write-out a AXI block data (4 channels) - outStrm.write(axiBlock); - // set the burst length - if (burstLen == _burstLength - 1) { - burstLenStrm.write(_burstLength); - burstLen = 0; - } else { - burstLen++; - } - } - } - - // deal with the condition that we didn't hit the burst boundary - if (burstLen != 0) { - burstLenStrm.write(burstLen); - } - // end the burst write operation - burstLenStrm.write(0); -#if !defined(__SYNTHESIS__) && _XF_SECURITY_RC4_DEBUG_ == 1 - std::cout << "Exiting mergeResult..." << std::endl; -#endif -} // end mergeResult - -// @brief burst write out to DDR -template -static void writeOut(hls::stream& burstLenStrm, - hls::stream >& blockStrm, - ap_uint<512>* ptr) { -#if !defined(__SYNTHESIS__) && _XF_SECURITY_RC4_DEBUG_ == 1 - std::cout << "Entering writeOut..." << std::endl; -#endif - ap_uint<128> offset = 0; - unsigned int bLen = burstLenStrm.read(); - while (bLen) { - LOOP_BURST_WRITE: - for (unsigned int j = 0; j < bLen; ++j) { -#pragma HLS pipeline II = 1 - ap_uint<512> block = blockStrm.read(); - ptr[offset * _burstLength + j] = block; - } - offset++; - bLen = burstLenStrm.read(); - } -#if !defined(__SYNTHESIS__) && _XF_SECURITY_RC4_DEBUG_ == 1 - std::cout << "Exiting writeOut..." << std::endl; -#endif -} // end writeOut - -// @brief top of kernel -extern "C" void rc4EncryptKernel_4(ap_uint<512> inputData[(1 << 30) + 100], ap_uint<512> outputData[1 << 30]) { -#pragma HLS dataflow - - const unsigned int _channelNumber = 12; - const unsigned int _burstLength = 128; - const unsigned int bufferDepth = _burstLength * 2; - -// clang-format off -#pragma HLS INTERFACE m_axi offset = slave latency = 64 \ - num_write_outstanding = 16 num_read_outstanding = 16 \ - max_write_burst_length = 64 max_read_burst_length = 64 \ - bundle = gmem0_0 port = inputData - -#pragma HLS INTERFACE m_axi offset = slave latency = 64 \ - num_write_outstanding = 16 num_read_outstanding = 16 \ - max_write_burst_length = 64 max_read_burst_length = 64 \ - bundle = gmem0_1 port = outputData -// clang-format on - -#pragma HLS INTERFACE s_axilite port = inputData bundle = control -#pragma HLS INTERFACE s_axilite port = outputData bundle = control -#pragma HLS INTERFACE s_axilite port = return bundle = control - - hls::stream > cipherkeyStrm[_channelNumber]; -#pragma HLS stream variable = cipherkeyStrm depth = 512 -#pragma HLS resource variable = cipherkeyStrm core = FIFO_LUTRAM - hls::stream endCipherkeyStrm[_channelNumber]; -#pragma HLS stream variable = endCipherkeyStrm depth = 512 -#pragma HLS resource variable = endCipherkeyStrm core = FIFO_LUTRAM - hls::stream > textInStrm[_channelNumber]; -#pragma HLS stream variable = textInStrm depth = 2 -#pragma HLS resource variable = textInStrm core = FIFO_LUTRAM - hls::stream > msgNumStrm; -#pragma HLS stream variable = msgNumStrm depth = 4 -#pragma HLS resource variable = msgNumStrm core = FIFO_LUTRAM - hls::stream > msgNumStrm1n[_channelNumber]; -#pragma HLS stream variable = msgNumStrm1n depth = 4 -#pragma HLS resource variable = msgNumStrm1n core = FIFO_LUTRAM - hls::stream > msgNumStrm2n[_channelNumber]; -#pragma HLS stream variable = msgNumStrm2n depth = 4 -#pragma HLS resource variable = msgNumStrm2n core = FIFO_LUTRAM - hls::stream > taskNumStrm; -#pragma HLS stream variable = taskNumStrm depth = 4 -#pragma HLS resource variable = taskNumStrm core = FIFO_LUTRAM - hls::stream > taskNumStrm2; -#pragma HLS stream variable = taskNumStrm2 depth = 4 -#pragma HLS resource variable = taskNumStrm2 core = FIFO_LUTRAM - hls::stream > textOutStrm[_channelNumber]; -#pragma HLS stream variable = textOutStrm depth = 2 -#pragma HLS resource variable = textOutStrm core = FIFO_LUTRAM - hls::stream > outStrm("outStrm"); -#pragma HLS stream variable = outStrm depth = bufferDepth -#pragma HLS resource variable = outStrm core = FIFO_BRAM - hls::stream burstLenStrm; -#pragma HLS stream variable = burstLenStrm depth = 4 - - scanMultiChannel<_channelNumber, _burstLength>(inputData, cipherkeyStrm, endCipherkeyStrm, textInStrm, msgNumStrm, - taskNumStrm, taskNumStrm2, msgNumStrm1n, msgNumStrm2n); - - cipherModeProcess<_channelNumber>(taskNumStrm2, cipherkeyStrm, endCipherkeyStrm, textInStrm, msgNumStrm1n, - msgNumStrm2n, textOutStrm); - - mergeResult<_burstLength, _channelNumber>(msgNumStrm, taskNumStrm, textOutStrm, outStrm, burstLenStrm); - - writeOut<_burstLength>(burstLenStrm, outStrm, outputData); - -} // end rc4EncryptKernel_4 diff --git a/security/L1/benchmarks/rc4Encrypt/utils.mk b/security/L1/benchmarks/rc4Encrypt/utils.mk index 3892ff1942..0ee80e90da 100644 --- a/security/L1/benchmarks/rc4Encrypt/utils.mk +++ b/security/L1/benchmarks/rc4Encrypt/utils.mk @@ -1,5 +1,5 @@ # -# Copyright 2019-2021 Xilinx, Inc. +# Copyright 2019-2022 Xilinx, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -12,6 +12,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. +# vitis makefile-generator v2.0.6 # #+------------------------------------------------------------------------------- # The following parameters are assigned with default values. These parameters can @@ -39,17 +40,59 @@ ifeq ($(DEBUG), yes) VPP_LDFLAGS += --dk protocol:all:all:all endif -#Checks for XILINX_XRT -ifeq ($(HOST_ARCH), x86) +#Check environment setup +ifndef XILINX_VITIS + XILINX_VITIS = /opt/xilinx/Vitis/$(TOOL_VERSION) + export XILINX_VITIS +endif ifndef XILINX_XRT XILINX_XRT = /opt/xilinx/xrt export XILINX_XRT endif + +check_device: + @set -eu; \ + inallowlist=False; \ + inblocklist=False; \ + for dev in $(PLATFORM_ALLOWLIST); \ + do if [[ $$(echo $(PLATFORM_NAME) | grep $$dev) != "" ]]; \ + then inallowlist=True; fi; \ + done ;\ + for dev in $(PLATFORM_BLOCKLIST); \ + do if [[ $$(echo $(PLATFORM_NAME) | grep $$dev) != "" ]]; \ + then inblocklist=True; fi; \ + done ;\ + if [[ $$inallowlist == False ]]; \ + then echo "[Warning]: The device $(PLATFORM_NAME) not in allowlist."; \ + fi; \ + if [[ $$inblocklist == True ]]; \ + then echo "[ERROR]: The device $(PLATFORM_NAME) in blocklist."; exit 1;\ + fi; + +#get HOST_ARCH by PLATFORM +ifneq (,$(PLATFORM)) +HOST_ARCH_temp = $(shell platforminfo -p $(PLATFORM) | grep 'CPU Type' | sed 's/.*://' | sed '/ai_engine/d' | sed 's/^[[:space:]]*//') +ifeq ($(HOST_ARCH_temp), x86) +HOST_ARCH := x86 +else ifeq ($(HOST_ARCH_temp), cortex-a9) +HOST_ARCH := aarch32 +else ifneq (,$(findstring cortex-a, $(HOST_ARCH_temp))) +HOST_ARCH := aarch64 +endif +endif + + +#get suffix of kernel by PLATFORM +VITIS_VER = $(shell v++ --version | grep 'v++' | sed 's/^[[:space:]]*//' | sed -e 's/^[*]* v++ v//g' | cut -d " " -f1) +DEVICE_TYPE = $(shell platforminfo -p $(PLATFORM) | grep 'FPGA Family' | sed 's/.*://' | sed '/ai_engine/d' | sed 's/^[[:space:]]*//') +ifeq ($(DEVICE_TYPE), versal) +ifeq ($(shell expr $(VITIS_VER) \>= 2022.1), 1) +LINK_TARGET_FMT := xsa else -ifndef XILINX_VITIS - XILINX_VITIS = /opt/xilinx/Vitis/$(TOOL_VERSION) - export XILINX_VITIS +LINK_TARGET_FMT := xclbin endif +else +LINK_TARGET_FMT := xclbin endif #Checks for Device Family @@ -59,13 +102,18 @@ else ifeq ($(HOST_ARCH), aarch64) DEV_FAM = Ultrascale endif -B_NAME = $(shell dirname $(XPLATFORM)) - #Checks for Correct architecture ifneq ($(HOST_ARCH), $(filter $(HOST_ARCH),aarch64 aarch32 x86)) $(error HOST_ARCH variable not set, please set correctly and rerun) endif +check_version: +ifneq (, $(shell which git)) +ifneq (,$(wildcard $(XFLIB_DIR)/.git)) + @cd $(XFLIB_DIR) && git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit -n 1 && cd - +endif +endif + #Checks for SYSROOT check_sysroot: ifneq ($(HOST_ARCH), x86) @@ -74,25 +122,24 @@ ifndef SYSROOT endif endif -check_version: -ifneq (, $(shell which git)) -ifneq (,$(wildcard $(XFLIB_DIR)/.git)) - @cd $(XFLIB_DIR) && git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit -n 1 && cd - -endif -endif - #Checks for g++ CXX := g++ ifeq ($(HOST_ARCH), x86) -ifneq ($(shell expr $(shell g++ -dumpversion) \>= 5), 1) +ifeq ($(shell expr $(VITIS_VER) \>= 2022.1), 1) +CXX_VER := 8.3.0 +else +CXX_VER := 6.2.0 +endif +CXX_V := $(shell echo $(CXX_VER) | awk -F. '{print tolower($$1)}') +ifneq ($(shell expr $(shell echo "__GNUG__" | g++ -E -x c++ - | tail -1) \>= $(CXX_V)), 1) ifndef XILINX_VIVADO -$(error [ERROR]: g++ version too old. Please use 5.0 or above) +$(error [ERROR]: g++ version too old. Please use $(CXX_VER) or above) else -CXX := $(XILINX_VIVADO)/tps/lnx64/gcc-6.2.0/bin/g++ +CXX := $(XILINX_VIVADO)/tps/lnx64/gcc-$(CXX_VER)/bin/g++ ifeq ($(LD_LIBRARY_PATH),) -export LD_LIBRARY_PATH := $(XILINX_VIVADO)/tps/lnx64/gcc-6.2.0/lib64 +export LD_LIBRARY_PATH := $(XILINX_VIVADO)/tps/lnx64/gcc-$(CXX_VER)/lib64 else -export LD_LIBRARY_PATH := $(XILINX_VIVADO)/tps/lnx64/gcc-6.2.0/lib64:$(LD_LIBRARY_PATH) +export LD_LIBRARY_PATH := $(XILINX_VIVADO)/tps/lnx64/gcc-$(CXX_VER)/lib64:$(LD_LIBRARY_PATH) endif $(warning [WARNING]: g++ version too old. Using g++ provided by the tool: $(CXX)) endif @@ -103,13 +150,22 @@ else ifeq ($(HOST_ARCH), aarch32) CXX := $(XILINX_VITIS)/gnu/aarch32/lin/gcc-arm-linux-gnueabi/bin/arm-linux-gnueabihf-g++ endif -#Check OS and setting env +#Check OS and setting env for xrt c++ api OSDIST = $(shell lsb_release -i |awk -F: '{print tolower($$2)}' | tr -d ' \t' ) OSREL = $(shell lsb_release -r |awk -F: '{print tolower($$2)}' |tr -d ' \t') -ifeq ($(OSDIST), centos) +# for centos and redhat +ifneq ($(findstring centos,$(OSDIST)),) +ifeq (7,$(shell echo $(OSREL) | awk -F. '{print tolower($$1)}' )) +ifeq ($(HOST_ARCH), x86) +XRT_CXXFLAGS += -D_GLIBCXX_USE_CXX11_ABI=0 +endif +endif +else ifneq ($(findstring redhat,$(OSDIST)),) ifeq (7,$(shell echo $(OSREL) | awk -F. '{print tolower($$1)}' )) -CXXFLAGS += -D_GLIBCXX_USE_CXX11_ABI=0 +ifeq ($(HOST_ARCH), x86) +XRT_CXXFLAGS += -D_GLIBCXX_USE_CXX11_ABI=0 +endif endif endif @@ -117,6 +173,9 @@ endif VPP := v++ #Cheks for aiecompiler +AIECXX := aiecompiler +AIESIMULATOR := aiesimulator +X86SIMULATOR := x86simulator .PHONY: check_vivado check_vivado: @@ -132,11 +191,9 @@ endif .PHONY: check_xrt check_xrt: -ifeq ($(HOST_ARCH), x86) ifeq (,$(wildcard $(XILINX_XRT)/lib/libxilinxopencl.so)) @echo "Cannot locate XRT installation. Please set XILINX_XRT variable." && false endif -endif export PATH := $(XILINX_VITIS)/bin:$(XILINX_XRT)/bin:$(PATH) ifeq ($(HOST_ARCH), x86) @@ -145,82 +202,64 @@ LD_LIBRARY_PATH := $(XILINX_XRT)/lib else LD_LIBRARY_PATH := $(XILINX_XRT)/lib:$(LD_LIBRARY_PATH) endif -else # aarch64 -ifeq (,$(LD_LIBRARY_PATH)) -LD_LIBRARY_PATH := $(SYSROOT)/usr/lib -else -LD_LIBRARY_PATH := $(SYSROOT)/usr/lib:$(LD_LIBRARY_PATH) -endif -endif - -# check target -ifeq ($(filter $(TARGET),sw_emu hw_emu hw),) -$(error TARGET is not sw_emu, hw_emu or hw) endif -ifneq (,$(wildcard $(DEVICE))) -# Use DEVICE as a file path -XPLATFORM := $(DEVICE) +ifneq (,$(wildcard $(PLATFORM))) +# Use PLATFORM as a file path +XPLATFORM := $(PLATFORM) else -# Use DEVICE as a file name pattern +# Use PLATFORM as a file name pattern # 1. search paths specified by variable ifneq (,$(PLATFORM_REPO_PATHS)) # 1.1 as exact name -XPLATFORM := $(strip $(foreach p, $(subst :, ,$(PLATFORM_REPO_PATHS)), $(wildcard $(p)/$(DEVICE)/$(DEVICE).xpfm))) +XPLATFORM := $(strip $(foreach p, $(subst :, ,$(PLATFORM_REPO_PATHS)), $(wildcard $(p)/$(PLATFORM)/$(PLATFORM).xpfm))) # 1.2 as a pattern ifeq (,$(XPLATFORM)) XPLATFORMS := $(foreach p, $(subst :, ,$(PLATFORM_REPO_PATHS)), $(wildcard $(p)/*/*.xpfm)) -XPLATFORM := $(strip $(foreach p, $(XPLATFORMS), $(shell echo $(p) | awk '$$1 ~ /$(DEVICE)/'))) +XPLATFORM := $(strip $(foreach p, $(XPLATFORMS), $(shell echo $(p) | awk '$$1 ~ /$(PLATFORM)/'))) endif # 1.2 endif # 1 # 2. search Vitis installation ifeq (,$(XPLATFORM)) # 2.1 as exact name -XPLATFORM := $(strip $(wildcard $(XILINX_VITIS)/platforms/$(DEVICE)/$(DEVICE).xpfm)) +XPLATFORM := $(strip $(wildcard $(XILINX_VITIS)/platforms/$(PLATFORM)/$(PLATFORM).xpfm)) # 2.2 as a pattern ifeq (,$(XPLATFORM)) XPLATFORMS := $(wildcard $(XILINX_VITIS)/platforms/*/*.xpfm) -XPLATFORM := $(strip $(foreach p, $(XPLATFORMS), $(shell echo $(p) | awk '$$1 ~ /$(DEVICE)/'))) +XPLATFORM := $(strip $(foreach p, $(XPLATFORMS), $(shell echo $(p) | awk '$$1 ~ /$(PLATFORM)/'))) endif # 2.2 endif # 2 # 3. search default locations ifeq (,$(XPLATFORM)) # 3.1 as exact name -XPLATFORM := $(strip $(wildcard /opt/xilinx/platforms/$(DEVICE)/$(DEVICE).xpfm)) +XPLATFORM := $(strip $(wildcard /opt/xilinx/platforms/$(PLATFORM)/$(PLATFORM).xpfm)) # 3.2 as a pattern ifeq (,$(XPLATFORM)) XPLATFORMS := $(wildcard /opt/xilinx/platforms/*/*.xpfm) -XPLATFORM := $(strip $(foreach p, $(XPLATFORMS), $(shell echo $(p) | awk '$$1 ~ /$(DEVICE)/'))) +XPLATFORM := $(strip $(foreach p, $(XPLATFORMS), $(shell echo $(p) | awk '$$1 ~ /$(PLATFORM)/'))) endif # 3.2 endif # 3 endif define MSG_PLATFORM -No platform matched pattern '$(DEVICE)'. +No platform matched pattern '$(PLATFORM)'. Available platforms are: $(XPLATFORMS) -To add more platform directories, set the PLATFORM_REPO_PATHS variable or point DEVICE variable to the full path of platform .xpfm file. +To add more platform directories, set the PLATFORM_REPO_PATHS variable or point PLATFORM variable to the full path of platform .xpfm file. endef export MSG_PLATFORM -define MSG_DEVICE -More than one platform matched: $(XPLATFORM) -Please set DEVICE variable more accurately to select only one platform file, or set DEVICE variable to the full path of the platform .xpfm file. -endef -export MSG_DEVICE .PHONY: check_platform check_platform: ifeq (,$(XPLATFORM)) @echo "$${MSG_PLATFORM}" && false endif -ifneq (,$(word 2,$(XPLATFORM))) - @echo "$${MSG_DEVICE}" && false -endif #Check ends # device2xsa - create a filesystem friendly name from device name # $(1) - full name of device -device2xsa = $(strip $(patsubst %.xpfm, % , $(shell basename $(DEVICE)))) +PLATFORM_NAME = $(strip $(patsubst %.xpfm, % , $(shell basename $(PLATFORM)))) + # Cleaning stuff RM = rm -f diff --git a/security/L1/benchmarks/rc4Encrypt/xrt.ini b/security/L1/benchmarks/rc4Encrypt/xrt.ini index a35d636bc7..1d3e0b09d9 100644 --- a/security/L1/benchmarks/rc4Encrypt/xrt.ini +++ b/security/L1/benchmarks/rc4Encrypt/xrt.ini @@ -1,8 +1,5 @@ [Debug] -opencl_summary=true -opencl_device_counter=true opencl_trace=true device_profile=true -data_transfer_trace=fine [Emulation] enable_shared_memory=false diff --git a/security/L1/include/xf_security/crc32c.hpp b/security/L1/include/xf_security/crc32c.hpp index 0aad05d9bd..8d560e1f01 100644 --- a/security/L1/include/xf_security/crc32c.hpp +++ b/security/L1/include/xf_security/crc32c.hpp @@ -1959,21 +1959,28 @@ void crc32c(hls::stream >& crcInitStrm, int offset = j % 4; crc ^= internal::table_crc32c[j][inTmp[W / 4 - 1 - index](31 - offset * 8, 24 - offset * 8)]; } - - // crc = internal::table_crc32c[15][inTmp[0](7, 0)] ^ internal::table_crc32c[14][inTmp[0](15, 8)] ^ - // internal::table_crc32c[13][inTmp[0](23, 16)] ^ internal::table_crc32c[12][inTmp[0](31, 24)] ^ - // internal::table_crc32c[11][inTmp[1](7, 0)] ^ internal::table_crc32c[10][inTmp[1](15, 8)] ^ - // internal::table_crc32c[9][inTmp[1](23, 16)] ^ internal::table_crc32c[8][inTmp[1](31, 24)] ^ - // internal::table_crc32c[7][inTmp[2](7, 0)] ^ internal::table_crc32c[6][inTmp[2](15, 8)] ^ - // internal::table_crc32c[5][inTmp[2](23, 16)] ^ internal::table_crc32c[4][inTmp[2](31, 24)] ^ - // internal::table_crc32c[3][inTmp[3](7, 0)] ^ internal::table_crc32c[2][inTmp[3](15, 8)] ^ - // internal::table_crc32c[1][inTmp[3](23, 16)] ^ internal::table_crc32c[0][inTmp[3](31, 24)]; } - for (uint64_t i = 0; i < len - (len / W) * W; i++) { -#pragma HLS PIPELINE II = 1 -#pragma HLS loop_tripcount max = W min = W - if (i == 0) in_data = inStrm.read(); - crc = (crc >> 8) ^ internal::table_crc32c[0][crc(7, 0) ^ in_data.range(7 + 8 * i, 8 * i)]; + + ap_uint<6> resdu_byte = len - (len / W) * W; + if (resdu_byte > 0) { + in_data = inStrm.read(); + in_data(31, 0) = in_data(31, 0) ^ crc; + + ap_uint<8 * W> tmp = in_data << (8 * (W - resdu_byte)); + if (resdu_byte == 1) + crc = crc(31, 8) ^ internal::table_crc32c[0][tmp(W * 8 - 1, W * 8 - 8)]; + else if (resdu_byte == 2) + crc = crc(31, 16) ^ internal::table_crc32c[0][tmp(W * 8 - 1, W * 8 - 8)]; + else if (resdu_byte == 3) + crc = crc(31, 24) ^ internal::table_crc32c[0][tmp(W * 8 - 1, W * 8 - 8)]; + else + crc = internal::table_crc32c[0][tmp(W * 8 - 1, W * 8 - 8)]; + for (int i = 1; i < W - 1; i++) { +#pragma HLS unroll + if (i < resdu_byte) { + crc ^= internal::table_crc32c[i][tmp(7 + 8 * (W - 1 - i), 8 * (W - 1 - i))]; + } + } } } outStrm.write(~crc); @@ -2051,7 +2058,8 @@ void crc32c(hls::stream >& crcInitStrm, } // crc = internal::table_crc32c[15][inTmp[0](7, 0)] ^ internal::table_crc32c[14][inTmp[0](15, 8)] ^ - // internal::table_crc32c[13][inTmp[0](23, 16)] ^ internal::table_crc32c[12][inTmp[0](31, 24)] ^ + // internal::table_crc32c[13][inTmp[0](23, 16)] ^ internal::table_crc32c[12][inTmp[0](31, 24)] + // ^ // internal::table_crc32c[11][inTmp[1](7, 0)] ^ internal::table_crc32c[10][inTmp[1](15, 8)] ^ // internal::table_crc32c[9][inTmp[1](23, 16)] ^ internal::table_crc32c[8][inTmp[1](31, 24)] ^ // internal::table_crc32c[7][inTmp[2](7, 0)] ^ internal::table_crc32c[6][inTmp[2](15, 8)] ^ diff --git a/security/L1/include/xf_security/des.hpp b/security/L1/include/xf_security/des.hpp index 440e483467..eafda8c7cf 100644 --- a/security/L1/include/xf_security/des.hpp +++ b/security/L1/include/xf_security/des.hpp @@ -83,11 +83,6 @@ const ap_uint<8> PermMap[64] = {58, 50, 42, 34, 26, 18, 10, 2, 60, 52, 44, 36, 14, 6, 64, 56, 48, 40, 32, 24, 16, 8, 57, 49, 41, 33, 25, 17, 9, 1, 59, 51, 43, 35, 27, 19, 11, 3, 61, 53, 45, 37, 29, 21, 13, 5, 63, 55, 47, 39, 31, 23, 15, 7}; -// Reverse of PermMap, not necessary -const ap_uint<8> IPermMap[64] = {40, 8, 48, 16, 56, 24, 64, 32, 39, 7, 47, 15, 55, 23, 63, 31, 38, 6, 46, 14, 54, 22, - 62, 30, 37, 5, 45, 13, 53, 21, 61, 29, 36, 4, 44, 12, 52, 20, 60, 28, 35, 3, 43, 11, - 51, 19, 59, 27, 34, 2, 42, 10, 50, 18, 58, 26, 33, 1, 41, 9, 49, 17, 57, 25}; - const ap_uint<8> ExtMap[48] = {32, 1, 2, 3, 4, 5, 4, 5, 6, 7, 8, 9, 8, 9, 10, 11, 12, 13, 12, 13, 14, 15, 16, 17, 16, 17, 18, 19, 20, 21, 20, 21, 22, 23, 24, 25, 24, 25, 26, 27, 28, 29, 28, 29, 30, 31, 32, 1}; @@ -162,28 +157,6 @@ const ap_uint<8> subkeyIndex[16][48] = { {17, 58, 41, 2, 56, 24, 40, 35, 9, 16, 26, 49, 10, 42, 33, 32, 51, 0, 1, 8, 43, 34, 25, 48, 29, 4, 46, 61, 44, 11, 54, 37, 12, 60, 30, 36, 5, 28, 45, 3, 22, 27, 52, 21, 20, 6, 62, 38}}; -template -static void convertEndian(ap_uint in, ap_uint& out) { - // speed up - // 8 * size and remaining - // actually W == 64 - int size = W / 8; - if (W % 8 != 0 /*(W >> 3) << 3 != W*/) { - size++; - } - - int start = 0; - for (int i = 0; i < size; ++i) { -#pragma HLS pipeline - int end = start + 8 > W ? W : start + 8; - for (int j = start, k = end - 1; j < end; ++j, --k) { - out[j] = in[k]; - } - - start += 8; - } -} - // Convert number according to endian static void convert(ap_uint<64> in, ap_uint<64>& out) { int start = 0; @@ -199,95 +172,6 @@ static void convert(ap_uint<64> in, ap_uint<64>& out) { } } -// Initialize subkeyC and subkeyD -static void initSubkeyCD(ap_uint<64> key, ap_uint<28>& subkeyC, ap_uint<28>& subkeyD) { - for (int i = 0; i < 28; ++i) { -#pragma HLS unroll - int id = PCMapC[i] - 1; - subkeyC[i] = key[id]; - int idx = PCMapD[i] - 1; - subkeyD[i] = key[idx]; - } -} - -// Helper function for subkey index -static void initSubkeyIndex(int cIndexArray[28], int dIndexArray[28]) { - for (int i = 0; i < 28; ++i) { -#pragma HLS unroll - int id = PCMapC[i] - 1; - cIndexArray[i] = id; - int idx = PCMapD[i] - 1; - dIndexArray[i] = idx; - } -} - -// Helper function for subkey index -template -static void leftRotateShiftArray(int in[W], int numShift) { - int tmp[W]; - for (int i = 0; i < W; ++i) { - int idx = (i + numShift) % W; - tmp[i] = in[idx]; - } - - for (int i = 0; i < W; ++i) { - in[i] = tmp[i]; - } -} - -static void getSubkeyIndex(int iter, int cIndexArray[28], int dIndexArray[28], int subkeyIndex[48]) { - int numShift = 2; - int round = iter + 1; - if (round == 1 || round == 2 || round == 9 || round == 16) { - numShift = 1; - } - - leftRotateShiftArray<28>(cIndexArray, numShift); - leftRotateShiftArray<28>(dIndexArray, numShift); - - int cd[56]; - for (int i = 0; i < 28; ++i) { - cd[i] = cIndexArray[i]; - cd[i + 28] = dIndexArray[i]; - } - - for (int i = 0; i < 48; ++i) { - subkeyIndex[i] = cd[PC2Map[i] - 1]; - } -} - -static void leftRotateShift(ap_uint<28>& in, int numShift) { - ap_uint<28> tmp; - for (int i = 0; i < 28; ++i) { -#pragma HLS unroll - int idx = (i + numShift) % 28; - tmp[i] = in[idx]; - } - - in = tmp; -} - -// Get subkey for iteration iter, subkeyC and subkeyD are updated -static void getSubkey(int iter, ap_uint<28>& subkeyC, ap_uint<28>& subkeyD, ap_uint<48>& subkey) { - int numShift = 2; - int round = iter + 1; - if (round == 1 || round == 2 || round == 9 || round == 16) { - numShift = 1; - } - - leftRotateShift(subkeyC, numShift); - leftRotateShift(subkeyD, numShift); - - ap_uint<56> cd; - cd(27, 0) = subkeyC; - cd(55, 28) = subkeyD; - - for (int i = 0; i < 48; ++i) { -#pragma HLS unroll - subkey[i] = cd[PC2Map[i] - 1]; - } -} - static void extend(ap_uint<32> in, ap_uint<48>& out) { for (int i = 0; i < 48; ++i) { #pragma HLS unroll @@ -371,54 +255,6 @@ static void finalPerm(ap_uint<64> in, ap_uint<64>& out) { } } -static void process(ap_uint<32>& l, ap_uint<32>& r, ap_uint<48> subkeys, bool enc) { - const int IterNum = 16; -Loop_Round: - for (int i = 0; i < IterNum; ++i) { -#pragma HLS pipeline - int keyId = enc ? i : 15 - i; - ap_uint<32> rr = l ^ f(r, subkeys[keyId]); - - // Update L and R, the order matters - l = r; - r = rr; - } -} - -static void keyIndexSchedule(ap_uint<64> key, int subkeyIndex[16][48]) { - int cIndexArray[28]; - int dIndexArray[28]; - - initSubkeyIndex(cIndexArray, dIndexArray); - - ap_uint<28> subkeyC, subkeyD; - for (int i = 0; i < 28; ++i) { - subkeyC[i] = key[cIndexArray[i]]; - subkeyD[i] = key[dIndexArray[i]]; - } - - for (int i = 0; i < 16; ++i) { - getSubkeyIndex(i, cIndexArray, dIndexArray, subkeyIndex[i]); - -#ifndef __SYNTHESIS__ - printArray(subkeyIndex[i], 48, 12); - if (i != 15) { - std::cout << ",\n"; - } -#endif - } -} - -static void keyScheduleOriginal(ap_uint<64> key, ap_uint<48> subkeys[16]) { - ap_uint<28> subkeyC, subkeyD; - initSubkeyCD(key, subkeyC, subkeyD); - - for (int i = 0; i < 16; ++i) { -#pragma HLS pipeline - getSubkey(i, subkeyC, subkeyD, subkeys[i]); - } -} - /** * @brief keySchedule is to schedule subkeys used in DES and 3DES * @@ -461,7 +297,6 @@ static void desEncrypt(ap_uint<64> in, ap_uint<64> key, ap_uint<64>& out) { keySchedule(cKey, subkeys); // ap_uint<28> subkeyC, subkeyD; - // initSubkeyCD(cKey, subkeyC, subkeyD); // Initital permutation ap_uint<64> data; @@ -477,7 +312,6 @@ static void desEncrypt(ap_uint<64> in, ap_uint<64> key, ap_uint<64>& out) { for (int i = 0; i < IterNum; ++i) { #pragma HLS pipeline // ap_uint<48> subkey; - // getSubkey(i, subkeyC, subkeyD, subkey); ap_uint<32> rr = l ^ f(r, subkeys[i]); // ap_uint<32> rr = l ^ f(r, subkey); @@ -521,7 +355,6 @@ static void desDecrypt(ap_uint<64> in, ap_uint<64> cipherKey, ap_uint<64>& out) ap_uint<48> subkeys[16]; // int subkeyIndex[16][48]; - // keyIndexSchedule(cKey, subkeyIndex); keySchedule(cKey, subkeys); // Initital permutation @@ -596,81 +429,6 @@ static void des3Decrypt(ap_uint<64> in, ap_uint<64> key1, ap_uint<64> key2, ap_u desDecrypt(dat2, key1, out); } -/* -static void desEncrypt2(ap_uint<64> in, ap_uint<64> key, ap_uint<64>& out, bool enc) { -#pragma HLS pipeline - ap_uint<48> subkeys[16]; - keySchedule(key, subkeys); - - // Initital permutation - ap_uint<64> data; - initPerm(in, data); - - // Stated in FIPS 46, the left most bit of a block is bit one - ap_uint<32> l = data(31, 0); - ap_uint<32> r = data(63, 32); - - // 16 rounds of processing - //process(l, r, subkeys, enc); - const int IterNum = 16; -Loop_Round: for (int i = 0; i < IterNum; ++i) { -#pragma HLS pipeline - int keyId = enc ? i : 15 - i; - ap_uint<32> rr = l ^ f(r, subkeys[keyId]); - - // Update L and R, the order matters - l = r; - r = rr; - } - - ap_uint<64> prePerm; - prePerm(31, 0) = r; - prePerm(63, 32) = l; - - // Final permutation - ap_uint<64> result; - finalPerm(prePerm, result); -} - -static void des3EncryptBk(ap_uint<64> in, ap_uint<64> key1, ap_uint<64> key2, ap_uint<64> key3, ap_uint<64>& out) { -#pragma HLS pipeline - ap_uint<64> block; - convert(in, block); - - ap_uint<64> cKey1, cKey2, cKey3; - convert(key1, cKey1); - convert(key2, cKey2); - convert(key3, cKey3); - - ap_uint<64> dat1, dat2, dat3; - - desEncrypt2(block, cKey1, dat1, true); - desEncrypt2(dat1, cKey2, dat2, false); - desEncrypt2(dat2, cKey3, dat3, true); - - convert(dat3, out); -} - -static void des3DecryptBk(ap_uint<64> in, ap_uint<64> key1, ap_uint<64> key2, ap_uint<64> key3, ap_uint<64>& out) { -#pragma HLS pipeline - ap_uint<64> block; - convert(in, block); - - ap_uint<64> cKey1, cKey2, cKey3; - convert(key1, cKey1); - convert(key2, cKey2); - convert(key3, cKey3); - - ap_uint<64> dat1, dat2, dat3; - - desEncrypt2(block, cKey3, dat1, false); - desEncrypt2(dat1, cKey2, dat2, true); - desEncrypt2(dat2, cKey1, dat3, false); - - convert(dat3, out); -} -*/ - } // namespace security } // namespace xf diff --git a/security/L1/include/xf_security/ecdsa_nistp256.hpp b/security/L1/include/xf_security/ecdsa_nistp256.hpp index 2c0205ed06..33798c7e72 100644 --- a/security/L1/include/xf_security/ecdsa_nistp256.hpp +++ b/security/L1/include/xf_security/ecdsa_nistp256.hpp @@ -171,60 +171,6 @@ const ap_uint<256> Gx = ap_uint<256>("0x6B17D1F2E12C4247F8BCE6E563A440F277037D81 const ap_uint<256> Gy = ap_uint<256>("0x4FE342E2FE1A7F9B8EE7EB4A7C0F9E162BCE33576B315ECECBB6406837BF51F5"); const ap_uint<256> n = ap_uint<256>("0xFFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC632551"); -ap_uint<256> productMod_p_karatsuba(ap_uint<256> opA, ap_uint<256> opB) { - ap_uint<224> negP = ap_uint<224>("0xFFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000001"); - ap_uint<256> P = ap_uint<256>("0xFFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF"); - - ap_uint<128> aH = opA.range(255, 128); - ap_uint<128> aL = opA.range(127, 0); - ap_uint<128> bH = opB.range(255, 128); - ap_uint<128> bL = opB.range(127, 0); - - ap_uint<256> aLbH = aL * bH; - ap_uint<256> aHbL = aH * bL; - ap_uint<256> aHbH = aH * bH; - ap_uint<257> aLbL = aL * bL; - ap_uint<257> mid = aLbH + aHbL; - - ap_uint<256> FL = 0; - FL.range(255, 128) = mid.range(127, 0); - aLbL += FL; - if (aLbL >= P) { - aLbL -= P; - } - aHbH += ap_uint<129>(mid.range(256, 128)); - if (aHbH >= P) { - aHbH -= P; - } - - ap_uint<257> res = 0; - for (int i = 223; i >= 0; i--) { - res <<= 1; - if (res >= P) { - res -= P; - } - if (negP[i] == 1) { - res += aHbH; - if (res >= P) { - res -= P; - } - } - } - res += aLbL; - if (res >= P) { - res -= P; - } - return res; -} - -ap_uint<256> productMod_p_scanning(ap_uint<256> opA, ap_uint<256> opB) { - return xf::security::internal::productMod<256>(opA, opB, p); -} - -ap_uint<256> productMod_p_direct(ap_uint<256> opA, ap_uint<256> opB) { - return opA * opB % p; -} - ap_uint<256> productMod_p_fastReduction(ap_uint<256> opA, ap_uint<256> opB) { ap_uint<128> aH = opA.range(255, 128); ap_uint<128> aL = opA.range(127, 0); @@ -355,12 +301,6 @@ void add(ap_uint<256> Px, ap_uint<256> Py, ap_uint<256> Qx, ap_uint<256> Qy, ap_ } } -void toJacobian(ap_uint<256> x, ap_uint<256> y, ap_uint<256>& X, ap_uint<256>& Y, ap_uint<256>& Z) { - X = x; - Y = y; - Z = 1; -} - void fromJacobian(ap_uint<256> X, ap_uint<256> Y, ap_uint<256> Z, ap_uint<256>& x, ap_uint<256>& y) { #pragma HLS inline if (Z == 0) { @@ -518,93 +458,6 @@ void addJacobianAffine(ap_uint<256> X1, } } -void dotProduct(ap_uint<256> Px, ap_uint<256> Py, ap_uint<256> k, ap_uint<256>& Rx, ap_uint<256>& Ry) { -#pragma HLS inline - ap_uint<256> resX = 0; - ap_uint<256> resY = 0; - -POINT_MULTIPLICATION: - for (int i = 0; i < 256; i++) { - if (k[i] == 1) { - add(Px, Py, resX, resY, resX, resY); - } - add(Px, Py, Px, Py, Px, Py); - } - - Rx = resX; - Ry = resY; -} - -void dotProductNAF(ap_uint<256> Px, ap_uint<256> Py, ap_uint<256> k, ap_uint<256>& Rx, ap_uint<256>& Ry) { - ap_uint<256> resX = 0; - ap_uint<256> resY = 0; - - ap_uint<256> kNafPos = 0; - ap_uint<256> kNafNeg = 0; - - getNAF(k, kNafPos, kNafNeg); - - for (int i = 0; i < 256; i++) { - if (kNafPos[i] == 1) { - add(Px, Py, resX, resY, resX, resY); - } - if (kNafNeg[i] == 1) { - ap_uint<256> tmp = Py; - if (tmp > p) { - tmp = tmp - p; - } - ap_uint<256> negPy = getNeg(tmp); - add(Px, negPy, resX, resY, resX, resY); - } - add(Px, Py, Px, Py, Px, Py); - } - - Rx = resX; - Ry = resY; -} - -void dotProductNAFPrecompute(ap_uint<256> Px, ap_uint<256> Py, ap_uint<256> k, ap_uint<256>& Rx, ap_uint<256>& Ry) { -#pragma HLS inline -#pragma HLS bind_storage variable = preComputeX type = ROM_1P impl = LUTRAM -#pragma HLS bind_storage variable = preComputeY type = ROM_1P impl = LUTRAM - ap_uint<256> kNafPos = 0; - ap_uint<256> kNafNeg = 0; - getNAF(k, kNafPos, kNafNeg); - ap_int<5> K[64]; -COMPUTE_K: - for (int i = 0; i < 64; i++) { - ap_uint<4> tmp1 = kNafPos.range(i * 4 + 3, i * 4); - ap_uint<4> tmp2 = kNafNeg.range(i * 4 + 3, i * 4); - K[i] = tmp1 - tmp2; - } - - ap_uint<256> resX = 0; - ap_uint<256> resY = 0; - ap_uint<256> tmpX = 0; - ap_uint<256> tmpY = 0; -POINT_MULTI_OUTER: - for (int j = 10; j > 0; j--) { - POINT_MULTI_INNER: - for (int i = 0; i < 64; i++) { - if (j == K[i]) { - add(preComputeX[i], preComputeY[i], tmpX, tmpY, tmpX, tmpY); - } - if (-j == K[i]) { - ap_uint<256> tmp = preComputeY[i]; - if (tmp > p) { - tmp = tmp - p; - } - ap_uint<256> negPy = getNeg(tmp); - add(preComputeX[i], negPy, tmpX, tmpY, tmpX, tmpY); - } - } - - add(tmpX, tmpY, resX, resY, resX, resY); - } - Rx = resX; - Ry = resY; -} - void dotProductNAFPrecomputeJacobian( ap_uint<256> Px, ap_uint<256> Py, ap_uint<256> k, ap_uint<256>& Rx, ap_uint<256>& Ry) { #pragma HLS inline @@ -652,27 +505,6 @@ void dotProductNAFPrecomputeJacobian( fromJacobian(resX, resY, resZ, Rx, Ry); } -void dotProductJacobian(ap_uint<256> Px, ap_uint<256> Py, ap_uint<256> k, ap_uint<256>& Rx, ap_uint<256>& Ry) { - ap_uint<256> X1, Y1, Z1, X2, Y2, Z2; - toJacobian(Px, Py, X1, Y1, Z1); - - ap_uint<256> RX = 1; - ap_uint<256> RY = 1; - ap_uint<256> RZ = 0; - - for (int i = 256 - 1; i >= 0; i--) { - doubleJacobian(RX, RY, RZ, RX, RY, RZ); - if (k[i] == 1) { - addJacobian(RX, RY, RZ, X1, Y1, Z1, RX, RY, RZ); - } - } - X2 = RX; - Y2 = RY; - Z2 = RZ; - - fromJacobian(X2, Y2, Z2, Rx, Ry); -} - void dotProductJacobianAffine(ap_uint<256> Px, ap_uint<256> Py, ap_uint<256> k, ap_uint<256>& Rx, ap_uint<256>& Ry) { #pragma HLS inline ap_uint<256> X2, Y2, Z2; @@ -695,66 +527,6 @@ void dotProductJacobianAffine(ap_uint<256> Px, ap_uint<256> Py, ap_uint<256> k, fromJacobian(X2, Y2, Z2, Rx, Ry); } -void preComputeW4(ap_uint<256> Px, ap_uint<256> Py, ap_uint<256> res_x[64], ap_uint<256> res_y[64]) { - ap_uint<256> tmp_x = Px; - ap_uint<256> tmp_y = Py; - res_x[0] = tmp_x; - res_y[0] = tmp_y; - for (int i = 1; i < 64; i++) { - for (int m = 0; m < 4; m++) { - add(tmp_x, tmp_y, tmp_x, tmp_y, tmp_x, tmp_y); - } - res_x[i] = tmp_x; - res_y[i] = tmp_y; - } -} - -/** - * @brief Generate Public Key point Q from private key - * - * @param privateKey Private Key. - * @param Qx X coordinate of point Q. - * @param Qy Y coordinate of point Q. - */ -void generatePubKey(ap_uint<256> privateKey, ap_uint<256>& Qx, ap_uint<256>& Qy) { - dotProductNAFPrecompute(Gx, Gy, privateKey, Qx, Qy); -} - -/** - * @brief Verifying Public Key. - * It will return true if verified, otherwise false. - * - * @param Px X coordinate of public key point P. - * @param Py Y coordinate of public key point P. - */ -bool verifyPubKey(ap_uint<256> Px, ap_uint<256> Py) { - if (Px == 0 && Py == 0) { - return false; // return false if public key is zero. - } else { - ap_uint<256> tx1 = productMod_p(Px, Px); - tx1 = productMod_p(tx1, Px); - - ap_uint<256> tx2 = productMod_p(Px, a); - tx2 = xf::security::internal::addMod<256>(tx2, b, p); - - ap_uint<256> tx3 = xf::security::internal::addMod<256>(tx2, tx1, p); - - ap_uint<256> ty = productMod_p(Py, Py); - - if (ty != tx3) { // return false if public key is not on the curve. - return false; - } else { - ap_uint<256> nPx, nPy; - dotProduct(Px, Py, n, nPx, nPy); - - if (nPx != 0 || nPy != 0) { // return false if public key * n is not zero. - return false; - } - } - } - return true; -} - template bool sign(ap_uint hash, ap_uint<256> k, ap_uint<256> privateKey, ap_uint<256>& r, ap_uint<256>& s) { #pragma HLS allocation function instances = productMod_p limit = 1 @@ -872,4 +644,4 @@ bool nistp256Verify(ap_uint<256> r, ap_uint<256> s, ap_uint<256> hash, ap_uint<2 } // namespace security } // namespace xf -#endif \ No newline at end of file +#endif diff --git a/security/L1/include/xf_security/ecdsa_secp256k1.hpp b/security/L1/include/xf_security/ecdsa_secp256k1.hpp index dfb80446dd..c171a92ef5 100644 --- a/security/L1/include/xf_security/ecdsa_secp256k1.hpp +++ b/security/L1/include/xf_security/ecdsa_secp256k1.hpp @@ -185,145 +185,6 @@ class ecdsaSecp256k1 { #pragma HLS inline } - ap_uint<256> productMod_p1(ap_uint<256> a, ap_uint<256> b) { - ap_uint<33> negP = ap_uint<33>("0x01000003D1"); - ap_uint<256> P = ap_uint<256>("0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F"); - - ap_uint<128> aH = a.range(255, 128); - ap_uint<128> aL = a.range(127, 0); - ap_uint<128> bH = b.range(255, 128); - ap_uint<128> bL = b.range(127, 0); - - ap_uint<256> aLbH = aL * bH; - ap_uint<256> aHbL = aH * bL; - ap_uint<256> aHbH = aH * bH; - ap_uint<257> aLbL = aL * bL; - ap_uint<257> mid = aLbH + aHbL; - - ap_uint<256> FL = 0; - FL.range(255, 128) = mid.range(127, 0); - aLbL += FL; - if (aLbL >= P) { - aLbL -= P; - } - aHbH += ap_uint<129>(mid.range(256, 128)); - if (aHbH >= P) { - aHbH -= P; - } - - ap_uint<257> res = 0; - for (int i = 32; i >= 0; i--) { - res <<= 1; - if (res >= P) { - res -= P; - } - if (negP[i] == 1) { - res += aHbH; - if (res >= P) { - res -= P; - } - } - } - res += aLbL; - if (res >= P) { - res -= P; - } - return res; - } - - ap_uint<256> productMod_p2(ap_uint<256> a, - ap_uint<256> b) { // a specialize product mode function made for a * b % p - ap_uint<33> negP = ap_uint<33>("0x01000003D1"); - ap_uint<256> P = ap_uint<256>("0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F"); - ap_uint<512> tmp = a * b; - ap_uint<256> H = tmp.range(511, 256); - ap_uint<256> L = tmp.range(255, 0); - if (L >= P) { - L -= P; - } - if (H >= P) { - H -= P; - } - - ap_uint<257> res = 0; - for (int i = 32; i >= 0; i--) { - res <<= 1; - if (res >= P) { - res -= P; - } - if (negP[i] == 1) { - res += H; - if (res >= P) { - res -= P; - } - } - } - res += L; - if (res >= P) { - res -= P; - } - return res; - } - - ap_uint<256> productMod_p3(ap_uint<256> a, ap_uint<256> b) { - ap_uint<33> negP = ap_uint<33>("0x01000003D1"); - ap_uint<256> P = ap_uint<256>("0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F"); - - ap_uint<128> aH = a.range(255, 128); - ap_uint<128> aL = a.range(127, 0); - ap_uint<128> bH = b.range(255, 128); - ap_uint<128> bL = b.range(127, 0); - - ap_uint<256> aLbH = aL * bH; - ap_uint<256> aHbL = aH * bL; - ap_uint<256> aHbH = aH * bH; - ap_uint<257> aLbL = aL * bL; - ap_uint<257> mid = aLbH + aHbL; - - ap_uint<256> FL = 0; - FL.range(255, 128) = mid.range(127, 0); - aLbL += FL; - ap_int<258> tmp_int = aLbL; - tmp_int -= P; - if (tmp_int[257] == 0) { - aLbL = tmp_int; - } - - aHbH += ap_uint<129>(mid.range(256, 128)); - tmp_int = aHbH; - tmp_int -= P; - if (tmp_int[257] == 0) { - aHbH = tmp_int; - } - - ap_uint<257> res = 0; - for (int i = 32; i >= 0; i--) { -#pragma HLS pipeline - res <<= 1; - tmp_int = res; - tmp_int -= P; - if (tmp_int[257] == 0) { - res = tmp_int; - } - - if (negP[i] == 1) { - res += aHbH; - tmp_int = res; - tmp_int -= P; - if (tmp_int[257] == 0) { - res = tmp_int; - } - } - } - res += aLbL; - tmp_int = res; - tmp_int -= P; - if (tmp_int[257] == 0) { - res = tmp_int; - } - return res; - } - ap_uint<256> productMod_p4(ap_uint<256> a, ap_uint<256> b) { ap_uint<128> aH = a.range(255, 128); ap_uint<128> aL = a.range(127, 0); diff --git a/security/L1/meta/api.json b/security/L1/meta/api.json new file mode 100644 index 0000000000..543008739b --- /dev/null +++ b/security/L1/meta/api.json @@ -0,0 +1,5765 @@ +{ + "schema": "vitis_libraries_api_list_schema-1.0", + "api_list": [ + { + "api_name": "xf::security::adler32", + "spec": { + "schema": "vitis_libraries_api_list_schema-1.0", + "api_name": "xf::security::adler32", + "display_name": "adler32", + "brief": "adler32 computes the Adler-32 checksum of an input data.", + "target_domain": "", + "header_file_name": [ + "adler32.hpp" + ], + "search_paths": [ + "L1/include/xf_security" + ], + "instance": "function", + "parameters": [ + { + "name": "W", + "type": "int", + "description": "byte number of input data, the value of W includes 1, 2, 4, 8, 16." + } + ], + "ports": [ + { + "name": "adlerStrm", + "direction": "", + "type": "hls::stream< ap_uint< 32 > > &" + }, + { + "name": "inStrm", + "direction": "", + "type": "hls::stream< ap_uint< W *8 > > &" + }, + { + "name": "inLenStrm", + "direction": "", + "type": "hls::stream< ap_uint< 32 > > &" + }, + { + "name": "endInLenStrm", + "direction": "", + "type": "hls::stream< bool > &" + }, + { + "name": "outStrm", + "direction": "", + "type": "hls::stream< ap_uint< 32 > > &" + }, + { + "name": "end", + "direction": "", + "type": "hls::stream< bool > &" + } + ] + } + }, + { + "api_name": "xf::security::blake2b", + "spec": { + "schema": "vitis_libraries_api_list_schema-1.0", + "api_name": "xf::security::blake2b", + "display_name": "blake2b", + "brief": "Top function of BLAKE2B.", + "target_domain": "", + "header_file_name": [ + "blake2b.hpp" + ], + "search_paths": [ + "L1/include/xf_security" + ], + "instance": "function", + "parameters": [], + "ports": [ + { + "name": "msg_strm", + "direction": "", + "type": "hls::stream< ap_uint< 64 > > &" + }, + { + "name": "msg_len_strm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "key_strm", + "direction": "", + "type": "hls::stream< ap_uint< 512 > > &" + }, + { + "name": "key_len_strm", + "direction": "", + "type": "hls::stream< ap_uint< 8 > > &" + }, + { + "name": "out_len_strm", + "direction": "", + "type": "hls::stream< ap_uint< 8 > > &" + }, + { + "name": "end_len_strm", + "direction": "", + "type": "hls::stream< bool > &" + }, + { + "name": "digest_strm", + "direction": "", + "type": "hls::stream< ap_uint< 8 *64 > > &" + }, + { + "name": "end_digest_strm", + "direction": "", + "type": "" + } + ] + } + }, + { + "api_name": "xf::security::desCbcEncrypt", + "spec": { + "schema": "vitis_libraries_api_list_schema-1.0", + "api_name": "xf::security::desCbcEncrypt", + "display_name": "desCbcEncrypt", + "brief": "desCbcEncrypt is CBC encryption mode with DES single block cipher.", + "target_domain": "", + "header_file_name": [ + "cbc.hpp" + ], + "search_paths": [ + "L1/include/xf_security" + ], + "instance": "function", + "parameters": [], + "ports": [ + { + "name": "plaintextStrm", + "direction": "", + "type": "hls::stream< ap_uint< 64 > > &" + }, + { + "name": "endPlaintextStrm", + "direction": "", + "type": "hls::stream< bool > &" + }, + { + "name": "cipherkeyStrm", + "direction": "", + "type": "hls::stream< ap_uint< 64 > > &" + }, + { + "name": "IVStrm", + "direction": "", + "type": "hls::stream< ap_uint< 64 > > &" + }, + { + "name": "ciphertextStrm", + "direction": "", + "type": "hls::stream< ap_uint< 64 > > &" + }, + { + "name": "endCiphertextStrm", + "direction": "", + "type": "hls::stream< bool > &" + } + ] + } + }, + { + "api_name": "xf::security::desCbcDecrypt", + "spec": { + "schema": "vitis_libraries_api_list_schema-1.0", + "api_name": "xf::security::desCbcDecrypt", + "display_name": "desCbcDecrypt", + "brief": "desCbcDecrypt is CBC decryption mode with DES single block cipher.", + "target_domain": "", + "header_file_name": [ + "cbc.hpp" + ], + "search_paths": [ + "L1/include/xf_security" + ], + "instance": "function", + "parameters": [], + "ports": [ + { + "name": "ciphertextStrm", + "direction": "", + "type": "hls::stream< ap_uint< 64 > > &" + }, + { + "name": "endCiphertextStrm", + "direction": "", + "type": "hls::stream< bool > &" + }, + { + "name": "cipherkeyStrm", + "direction": "", + "type": "hls::stream< ap_uint< 64 > > &" + }, + { + "name": "IVStrm", + "direction": "", + "type": "hls::stream< ap_uint< 64 > > &" + }, + { + "name": "plaintextStrm", + "direction": "", + "type": "hls::stream< ap_uint< 64 > > &" + }, + { + "name": "endPlaintextStrm", + "direction": "", + "type": "hls::stream< bool > &" + } + ] + } + }, + { + "api_name": "xf::security::aes128CbcEncrypt", + "spec": { + "schema": "vitis_libraries_api_list_schema-1.0", + "api_name": "xf::security::aes128CbcEncrypt", + "display_name": "aes128CbcEncrypt", + "brief": "aes128CbcEncrypt is CBC encryption mode with AES-128 single block cipher.", + "target_domain": "", + "header_file_name": [ + "cbc.hpp" + ], + "search_paths": [ + "L1/include/xf_security" + ], + "instance": "function", + "parameters": [], + "ports": [ + { + "name": "plaintextStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "endPlaintextStrm", + "direction": "", + "type": "hls::stream< bool > &" + }, + { + "name": "cipherkeyStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "IVStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "ciphertextStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "endCiphertextStrm", + "direction": "", + "type": "hls::stream< bool > &" + } + ] + } + }, + { + "api_name": "xf::security::aes128CbcDecrypt", + "spec": { + "schema": "vitis_libraries_api_list_schema-1.0", + "api_name": "xf::security::aes128CbcDecrypt", + "display_name": "aes128CbcDecrypt", + "brief": "aes128CbcDecrypt is CBC decryption mode with AES-128 single block cipher.", + "target_domain": "", + "header_file_name": [ + "cbc.hpp" + ], + "search_paths": [ + "L1/include/xf_security" + ], + "instance": "function", + "parameters": [], + "ports": [ + { + "name": "ciphertextStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "endCiphertextStrm", + "direction": "", + "type": "hls::stream< bool > &" + }, + { + "name": "cipherkeyStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "IVStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "plaintextStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "endPlaintextStrm", + "direction": "", + "type": "hls::stream< bool > &" + } + ] + } + }, + { + "api_name": "xf::security::aes192CbcEncrypt", + "spec": { + "schema": "vitis_libraries_api_list_schema-1.0", + "api_name": "xf::security::aes192CbcEncrypt", + "display_name": "aes192CbcEncrypt", + "brief": "aes192CbcEncrypt is CBC encryption mode with AES-192 single block cipher.", + "target_domain": "", + "header_file_name": [ + "cbc.hpp" + ], + "search_paths": [ + "L1/include/xf_security" + ], + "instance": "function", + "parameters": [], + "ports": [ + { + "name": "plaintextStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "endPlaintextStrm", + "direction": "", + "type": "hls::stream< bool > &" + }, + { + "name": "cipherkeyStrm", + "direction": "", + "type": "hls::stream< ap_uint< 192 > > &" + }, + { + "name": "IVStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "ciphertextStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "endCiphertextStrm", + "direction": "", + "type": "hls::stream< bool > &" + } + ] + } + }, + { + "api_name": "xf::security::aes192CbcDecrypt", + "spec": { + "schema": "vitis_libraries_api_list_schema-1.0", + "api_name": "xf::security::aes192CbcDecrypt", + "display_name": "aes192CbcDecrypt", + "brief": "aes192CbcDecrypt is CBC decryption mode with AES-192 single block cipher.", + "target_domain": "", + "header_file_name": [ + "cbc.hpp" + ], + "search_paths": [ + "L1/include/xf_security" + ], + "instance": "function", + "parameters": [], + "ports": [ + { + "name": "ciphertextStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "endCiphertextStrm", + "direction": "", + "type": "hls::stream< bool > &" + }, + { + "name": "cipherkeyStrm", + "direction": "", + "type": "hls::stream< ap_uint< 192 > > &" + }, + { + "name": "IVStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "plaintextStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "endPlaintextStrm", + "direction": "", + "type": "hls::stream< bool > &" + } + ] + } + }, + { + "api_name": "xf::security::aes256CbcEncrypt", + "spec": { + "schema": "vitis_libraries_api_list_schema-1.0", + "api_name": "xf::security::aes256CbcEncrypt", + "display_name": "aes256CbcEncrypt", + "brief": "aes256CbcEncrypt is CBC encryption mode with AES-256 single block cipher.", + "target_domain": "", + "header_file_name": [ + "cbc.hpp" + ], + "search_paths": [ + "L1/include/xf_security" + ], + "instance": "function", + "parameters": [], + "ports": [ + { + "name": "plaintextStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "endPlaintextStrm", + "direction": "", + "type": "hls::stream< bool > &" + }, + { + "name": "cipherkeyStrm", + "direction": "", + "type": "hls::stream< ap_uint< 256 > > &" + }, + { + "name": "IVStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "ciphertextStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "endCiphertextStrm", + "direction": "", + "type": "hls::stream< bool > &" + } + ] + } + }, + { + "api_name": "xf::security::aes256CbcDecrypt", + "spec": { + "schema": "vitis_libraries_api_list_schema-1.0", + "api_name": "xf::security::aes256CbcDecrypt", + "display_name": "aes256CbcDecrypt", + "brief": "aes256CbcDecrypt is CBC decryption mode with AES-256 single block cipher.", + "target_domain": "", + "header_file_name": [ + "cbc.hpp" + ], + "search_paths": [ + "L1/include/xf_security" + ], + "instance": "function", + "parameters": [], + "ports": [ + { + "name": "ciphertextStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "endCiphertextStrm", + "direction": "", + "type": "hls::stream< bool > &" + }, + { + "name": "cipherkeyStrm", + "direction": "", + "type": "hls::stream< ap_uint< 256 > > &" + }, + { + "name": "IVStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "plaintextStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "endPlaintextStrm", + "direction": "", + "type": "hls::stream< bool > &" + } + ] + } + }, + { + "api_name": "xf::security::aes128CcmEncrypt", + "spec": { + "schema": "vitis_libraries_api_list_schema-1.0", + "api_name": "xf::security::aes128CcmEncrypt", + "display_name": "aes128CcmEncrypt", + "brief": "aes128CcmEncrypt is CCM encryption mode with AES-128 single block cipher.", + "target_domain": "", + "header_file_name": [ + "ccm.hpp" + ], + "search_paths": [ + "L1/include/xf_security" + ], + "instance": "function", + "parameters": [ + { + "name": "_t", + "type": "unsigned int", + "description": "Length of the MAC in byte, t is an element of {4, 6, 8, 10, 12, 14, 16}." + }, + { + "name": "_q", + "type": "unsigned int", + "description": "Length in byte of the binary representation of the length of the payload in byte, q is an element of {2, 3, 4, 5, 6, 7, 8}." + } + ], + "ports": [ + { + "name": "payloadStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "cipherkeyStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "nonceStrm", + "direction": "", + "type": "hls::stream< ap_uint< 8 *(15-_q)> > &" + }, + { + "name": "ADStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "lenADStrm", + "direction": "", + "type": "hls::stream< ap_uint< 64 > > &lenPldStrm, hls::stream< bool > &endLenStrm, hls::stream< ap_uint< 128 > > &cipherStrm, hls::stream< ap_uint< 64 > > &lenCphStrm, hls::stream< ap_uint< 8 *_t > > &tagStrm, hls::stream< bool > &endTagStrm" + }, + { + "name": "lenPldStrm", + "direction": "", + "type": "hls::stream< ap_uint< 64 > > &" + }, + { + "name": "endLenStrm", + "direction": "", + "type": "hls::stream< bool > &" + }, + { + "name": "cipherStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "lenCphStrm", + "direction": "", + "type": "hls::stream< ap_uint< 64 > > &" + }, + { + "name": "tagStrm", + "direction": "", + "type": "hls::stream< ap_uint< 8 *_t > > &" + }, + { + "name": "endTagStrm", + "direction": "", + "type": "hls::stream< bool > &" + } + ] + } + }, + { + "api_name": "xf::security::aes128CcmDecrypt", + "spec": { + "schema": "vitis_libraries_api_list_schema-1.0", + "api_name": "xf::security::aes128CcmDecrypt", + "display_name": "aes128CcmDecrypt", + "brief": "aes128CcmDecrypt is CCM decryption mode with AES-128 single block cipher.", + "target_domain": "", + "header_file_name": [ + "ccm.hpp" + ], + "search_paths": [ + "L1/include/xf_security" + ], + "instance": "function", + "parameters": [ + { + "name": "_t", + "type": "unsigned int", + "description": "Length of the MAC in byte, t is an element of {4, 6, 8, 10, 12, 14, 16}." + }, + { + "name": "_q", + "type": "unsigned int", + "description": "Length in byte of the binary representation of the length of the payload in byte, q is an element of {2, 3, 4, 5, 6, 7, 8}." + } + ], + "ports": [ + { + "name": "payloadStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "cipherkeyStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "nonceStrm", + "direction": "", + "type": "hls::stream< ap_uint< 8 *(15-_q)> > &" + }, + { + "name": "ADStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "lenADStrm", + "direction": "", + "type": "hls::stream< ap_uint< 64 > > &lenPldStrm, hls::stream< bool > &endLenStrm, hls::stream< ap_uint< 128 > > &cipherStrm, hls::stream< ap_uint< 64 > > &lenCphStrm, hls::stream< ap_uint< 8 *_t > > &tagStrm, hls::stream< bool > &endTagStrm" + }, + { + "name": "lenPldStrm", + "direction": "", + "type": "hls::stream< ap_uint< 64 > > &" + }, + { + "name": "endLenStrm", + "direction": "", + "type": "hls::stream< bool > &" + }, + { + "name": "cipherStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "lenCphStrm", + "direction": "", + "type": "hls::stream< ap_uint< 64 > > &" + }, + { + "name": "tagStrm", + "direction": "", + "type": "hls::stream< ap_uint< 8 *_t > > &" + }, + { + "name": "endTagStrm", + "direction": "", + "type": "hls::stream< bool > &" + } + ] + } + }, + { + "api_name": "xf::security::aes192CcmEncrypt", + "spec": { + "schema": "vitis_libraries_api_list_schema-1.0", + "api_name": "xf::security::aes192CcmEncrypt", + "display_name": "aes192CcmEncrypt", + "brief": "aes192CcmEncrypt is CCM encryption mode with AES-192 single block cipher.", + "target_domain": "", + "header_file_name": [ + "ccm.hpp" + ], + "search_paths": [ + "L1/include/xf_security" + ], + "instance": "function", + "parameters": [ + { + "name": "_t", + "type": "unsigned int", + "description": "Length of the MAC in byte, t is an element of {4, 6, 8, 10, 12, 14, 16}." + }, + { + "name": "_q", + "type": "unsigned int", + "description": "Length in byte of the binary representation of the length of the payload in byte, q is an element of {2, 3, 4, 5, 6, 7, 8}." + } + ], + "ports": [ + { + "name": "payloadStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "cipherkeyStrm", + "direction": "", + "type": "hls::stream< ap_uint< 192 > > &" + }, + { + "name": "nonceStrm", + "direction": "", + "type": "hls::stream< ap_uint< 8 *(15-_q)> > &" + }, + { + "name": "ADStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "lenADStrm", + "direction": "", + "type": "hls::stream< ap_uint< 64 > > &lenPldStrm, hls::stream< bool > &endLenStrm, hls::stream< ap_uint< 128 > > &cipherStrm, hls::stream< ap_uint< 64 > > &lenCphStrm, hls::stream< ap_uint< 8 *_t > > &tagStrm, hls::stream< bool > &endTagStrm" + }, + { + "name": "lenPldStrm", + "direction": "", + "type": "hls::stream< ap_uint< 64 > > &" + }, + { + "name": "endLenStrm", + "direction": "", + "type": "hls::stream< bool > &" + }, + { + "name": "cipherStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "lenCphStrm", + "direction": "", + "type": "hls::stream< ap_uint< 64 > > &" + }, + { + "name": "tagStrm", + "direction": "", + "type": "hls::stream< ap_uint< 8 *_t > > &" + }, + { + "name": "endTagStrm", + "direction": "", + "type": "hls::stream< bool > &" + } + ] + } + }, + { + "api_name": "xf::security::aes192CcmDecrypt", + "spec": { + "schema": "vitis_libraries_api_list_schema-1.0", + "api_name": "xf::security::aes192CcmDecrypt", + "display_name": "aes192CcmDecrypt", + "brief": "aes192CcmDecrypt is CCM decryption mode with AES-192 single block cipher.", + "target_domain": "", + "header_file_name": [ + "ccm.hpp" + ], + "search_paths": [ + "L1/include/xf_security" + ], + "instance": "function", + "parameters": [ + { + "name": "_t", + "type": "unsigned int", + "description": "Length of the MAC in byte, t is an element of {4, 6, 8, 10, 12, 14, 16}." + }, + { + "name": "_q", + "type": "unsigned int", + "description": "Length in byte of the binary representation of the length of the payload in byte, q is an element of {2, 3, 4, 5, 6, 7, 8}." + } + ], + "ports": [ + { + "name": "payloadStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "cipherkeyStrm", + "direction": "", + "type": "hls::stream< ap_uint< 192 > > &" + }, + { + "name": "nonceStrm", + "direction": "", + "type": "hls::stream< ap_uint< 8 *(15-_q)> > &" + }, + { + "name": "ADStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "lenADStrm", + "direction": "", + "type": "hls::stream< ap_uint< 64 > > &lenPldStrm, hls::stream< bool > &endLenStrm, hls::stream< ap_uint< 128 > > &cipherStrm, hls::stream< ap_uint< 64 > > &lenCphStrm, hls::stream< ap_uint< 8 *_t > > &tagStrm, hls::stream< bool > &endTagStrm" + }, + { + "name": "lenPldStrm", + "direction": "", + "type": "hls::stream< ap_uint< 64 > > &" + }, + { + "name": "endLenStrm", + "direction": "", + "type": "hls::stream< bool > &" + }, + { + "name": "cipherStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "lenCphStrm", + "direction": "", + "type": "hls::stream< ap_uint< 64 > > &" + }, + { + "name": "tagStrm", + "direction": "", + "type": "hls::stream< ap_uint< 8 *_t > > &" + }, + { + "name": "endTagStrm", + "direction": "", + "type": "hls::stream< bool > &" + } + ] + } + }, + { + "api_name": "xf::security::aes256CcmEncrypt", + "spec": { + "schema": "vitis_libraries_api_list_schema-1.0", + "api_name": "xf::security::aes256CcmEncrypt", + "display_name": "aes256CcmEncrypt", + "brief": "aes256CcmEncrypt is CCM encryption mode with AES-256 single block cipher.", + "target_domain": "", + "header_file_name": [ + "ccm.hpp" + ], + "search_paths": [ + "L1/include/xf_security" + ], + "instance": "function", + "parameters": [ + { + "name": "_t", + "type": "unsigned int", + "description": "Length of the MAC in byte, t is an element of {4, 6, 8, 10, 12, 14, 16}." + }, + { + "name": "_q", + "type": "unsigned int", + "description": "Length in byte of the binary representation of the length of the payload in byte, q is an element of {2, 3, 4, 5, 6, 7, 8}." + } + ], + "ports": [ + { + "name": "payloadStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "cipherkeyStrm", + "direction": "", + "type": "hls::stream< ap_uint< 256 > > &" + }, + { + "name": "nonceStrm", + "direction": "", + "type": "hls::stream< ap_uint< 8 *(15-_q)> > &" + }, + { + "name": "ADStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "lenADStrm", + "direction": "", + "type": "hls::stream< ap_uint< 64 > > &lenPldStrm, hls::stream< bool > &endLenStrm, hls::stream< ap_uint< 128 > > &cipherStrm, hls::stream< ap_uint< 64 > > &lenCphStrm, hls::stream< ap_uint< 8 *_t > > &tagStrm, hls::stream< bool > &endTagStrm" + }, + { + "name": "lenPldStrm", + "direction": "", + "type": "hls::stream< ap_uint< 64 > > &" + }, + { + "name": "endLenStrm", + "direction": "", + "type": "hls::stream< bool > &" + }, + { + "name": "cipherStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "lenCphStrm", + "direction": "", + "type": "hls::stream< ap_uint< 64 > > &" + }, + { + "name": "tagStrm", + "direction": "", + "type": "hls::stream< ap_uint< 8 *_t > > &" + }, + { + "name": "endTagStrm", + "direction": "", + "type": "hls::stream< bool > &" + } + ] + } + }, + { + "api_name": "xf::security::aes256CcmDecrypt", + "spec": { + "schema": "vitis_libraries_api_list_schema-1.0", + "api_name": "xf::security::aes256CcmDecrypt", + "display_name": "aes256CcmDecrypt", + "brief": "aes256CcmDecrypt is CCM decryption mode with AES-256 single block cipher.", + "target_domain": "", + "header_file_name": [ + "ccm.hpp" + ], + "search_paths": [ + "L1/include/xf_security" + ], + "instance": "function", + "parameters": [ + { + "name": "_t", + "type": "unsigned int", + "description": "Length of the MAC in byte, t is an element of {4, 6, 8, 10, 12, 14, 16}." + }, + { + "name": "_q", + "type": "unsigned int", + "description": "Length in byte of the binary representation of the length of the payload in byte, q is an element of {2, 3, 4, 5, 6, 7, 8}." + } + ], + "ports": [ + { + "name": "payloadStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "cipherkeyStrm", + "direction": "", + "type": "hls::stream< ap_uint< 256 > > &" + }, + { + "name": "nonceStrm", + "direction": "", + "type": "hls::stream< ap_uint< 8 *(15-_q)> > &" + }, + { + "name": "ADStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "lenADStrm", + "direction": "", + "type": "hls::stream< ap_uint< 64 > > &lenPldStrm, hls::stream< bool > &endLenStrm, hls::stream< ap_uint< 128 > > &cipherStrm, hls::stream< ap_uint< 64 > > &lenCphStrm, hls::stream< ap_uint< 8 *_t > > &tagStrm, hls::stream< bool > &endTagStrm" + }, + { + "name": "lenPldStrm", + "direction": "", + "type": "hls::stream< ap_uint< 64 > > &" + }, + { + "name": "endLenStrm", + "direction": "", + "type": "hls::stream< bool > &" + }, + { + "name": "cipherStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "lenCphStrm", + "direction": "", + "type": "hls::stream< ap_uint< 64 > > &" + }, + { + "name": "tagStrm", + "direction": "", + "type": "hls::stream< ap_uint< 8 *_t > > &" + }, + { + "name": "endTagStrm", + "direction": "", + "type": "hls::stream< bool > &" + } + ] + } + }, + { + "api_name": "xf::security::desCfb1Encrypt", + "spec": { + "schema": "vitis_libraries_api_list_schema-1.0", + "api_name": "xf::security::desCfb1Encrypt", + "display_name": "desCfb1Encrypt", + "brief": "desCfb1Encrypt is CFB1 encryption mode with DES single block cipher.", + "target_domain": "", + "header_file_name": [ + "cfb.hpp" + ], + "search_paths": [ + "L1/include/xf_security" + ], + "instance": "function", + "parameters": [], + "ports": [ + { + "name": "plaintextStrm", + "direction": "", + "type": "hls::stream< ap_uint< 64 > > &" + }, + { + "name": "endPlaintextStrm", + "direction": "", + "type": "hls::stream< bool > &" + }, + { + "name": "cipherkeyStrm", + "direction": "", + "type": "hls::stream< ap_uint< 64 > > &" + }, + { + "name": "IVStrm", + "direction": "", + "type": "hls::stream< ap_uint< 64 > > &" + }, + { + "name": "ciphertextStrm", + "direction": "", + "type": "hls::stream< ap_uint< 64 > > &" + }, + { + "name": "endCiphertextStrm", + "direction": "", + "type": "hls::stream< bool > &" + } + ] + } + }, + { + "api_name": "xf::security::desCfb1Decrypt", + "spec": { + "schema": "vitis_libraries_api_list_schema-1.0", + "api_name": "xf::security::desCfb1Decrypt", + "display_name": "desCfb1Decrypt", + "brief": "desCfb1Decrypt is CFB1 decryption mode with DES single block cipher.", + "target_domain": "", + "header_file_name": [ + "cfb.hpp" + ], + "search_paths": [ + "L1/include/xf_security" + ], + "instance": "function", + "parameters": [], + "ports": [ + { + "name": "ciphertextStrm", + "direction": "", + "type": "hls::stream< ap_uint< 64 > > &" + }, + { + "name": "endCiphertextStrm", + "direction": "", + "type": "hls::stream< bool > &" + }, + { + "name": "cipherkeyStrm", + "direction": "", + "type": "hls::stream< ap_uint< 64 > > &" + }, + { + "name": "IVStrm", + "direction": "", + "type": "hls::stream< ap_uint< 64 > > &" + }, + { + "name": "plaintextStrm", + "direction": "", + "type": "hls::stream< ap_uint< 64 > > &" + }, + { + "name": "endPlaintextStrm", + "direction": "", + "type": "hls::stream< bool > &" + } + ] + } + }, + { + "api_name": "xf::security::aes128Cfb1Encrypt", + "spec": { + "schema": "vitis_libraries_api_list_schema-1.0", + "api_name": "xf::security::aes128Cfb1Encrypt", + "display_name": "aes128Cfb1Encrypt", + "brief": "aes128Cfb1Encrypt is CFB1 encryption mode with AES-128 single block cipher.", + "target_domain": "", + "header_file_name": [ + "cfb.hpp" + ], + "search_paths": [ + "L1/include/xf_security" + ], + "instance": "function", + "parameters": [], + "ports": [ + { + "name": "plaintextStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "endPlaintextStrm", + "direction": "", + "type": "hls::stream< bool > &" + }, + { + "name": "cipherkeyStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "IVStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "ciphertextStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "endCiphertextStrm", + "direction": "", + "type": "hls::stream< bool > &" + } + ] + } + }, + { + "api_name": "xf::security::aes128Cfb1Decrypt", + "spec": { + "schema": "vitis_libraries_api_list_schema-1.0", + "api_name": "xf::security::aes128Cfb1Decrypt", + "display_name": "aes128Cfb1Decrypt", + "brief": "aes128Cfb1Decrypt is CFB1 decryption mode with AES-128 single block cipher.", + "target_domain": "", + "header_file_name": [ + "cfb.hpp" + ], + "search_paths": [ + "L1/include/xf_security" + ], + "instance": "function", + "parameters": [], + "ports": [ + { + "name": "ciphertextStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "endCiphertextStrm", + "direction": "", + "type": "hls::stream< bool > &" + }, + { + "name": "cipherkeyStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "IVStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "plaintextStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "endPlaintextStrm", + "direction": "", + "type": "hls::stream< bool > &" + } + ] + } + }, + { + "api_name": "xf::security::aes192Cfb1Encrypt", + "spec": { + "schema": "vitis_libraries_api_list_schema-1.0", + "api_name": "xf::security::aes192Cfb1Encrypt", + "display_name": "aes192Cfb1Encrypt", + "brief": "aes192Cfb1Encrypt is CFB1 encryption mode with AES-192 single block cipher.", + "target_domain": "", + "header_file_name": [ + "cfb.hpp" + ], + "search_paths": [ + "L1/include/xf_security" + ], + "instance": "function", + "parameters": [], + "ports": [ + { + "name": "plaintextStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "endPlaintextStrm", + "direction": "", + "type": "hls::stream< bool > &" + }, + { + "name": "cipherkeyStrm", + "direction": "", + "type": "hls::stream< ap_uint< 192 > > &" + }, + { + "name": "IVStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "ciphertextStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "endCiphertextStrm", + "direction": "", + "type": "hls::stream< bool > &" + } + ] + } + }, + { + "api_name": "xf::security::aes192Cfb1Decrypt", + "spec": { + "schema": "vitis_libraries_api_list_schema-1.0", + "api_name": "xf::security::aes192Cfb1Decrypt", + "display_name": "aes192Cfb1Decrypt", + "brief": "aes192Cfb1Decrypt is CFB1 decryption mode with AES-192 single block cipher.", + "target_domain": "", + "header_file_name": [ + "cfb.hpp" + ], + "search_paths": [ + "L1/include/xf_security" + ], + "instance": "function", + "parameters": [], + "ports": [ + { + "name": "ciphertextStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "endCiphertextStrm", + "direction": "", + "type": "hls::stream< bool > &" + }, + { + "name": "cipherkeyStrm", + "direction": "", + "type": "hls::stream< ap_uint< 192 > > &" + }, + { + "name": "IVStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "plaintextStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "endPlaintextStrm", + "direction": "", + "type": "hls::stream< bool > &" + } + ] + } + }, + { + "api_name": "xf::security::aes256Cfb1Encrypt", + "spec": { + "schema": "vitis_libraries_api_list_schema-1.0", + "api_name": "xf::security::aes256Cfb1Encrypt", + "display_name": "aes256Cfb1Encrypt", + "brief": "aes256Cfb1Encrypt is CFB1 encryption mode with AES-256 single block cipher.", + "target_domain": "", + "header_file_name": [ + "cfb.hpp" + ], + "search_paths": [ + "L1/include/xf_security" + ], + "instance": "function", + "parameters": [], + "ports": [ + { + "name": "plaintextStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "endPlaintextStrm", + "direction": "", + "type": "hls::stream< bool > &" + }, + { + "name": "cipherkeyStrm", + "direction": "", + "type": "hls::stream< ap_uint< 256 > > &" + }, + { + "name": "IVStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "ciphertextStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "endCiphertextStrm", + "direction": "", + "type": "hls::stream< bool > &" + } + ] + } + }, + { + "api_name": "xf::security::aes256Cfb1Decrypt", + "spec": { + "schema": "vitis_libraries_api_list_schema-1.0", + "api_name": "xf::security::aes256Cfb1Decrypt", + "display_name": "aes256Cfb1Decrypt", + "brief": "aes256Cfb1Decrypt is CFB1 decryption mode with AES-256 single block cipher.", + "target_domain": "", + "header_file_name": [ + "cfb.hpp" + ], + "search_paths": [ + "L1/include/xf_security" + ], + "instance": "function", + "parameters": [], + "ports": [ + { + "name": "ciphertextStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "endCiphertextStrm", + "direction": "", + "type": "hls::stream< bool > &" + }, + { + "name": "cipherkeyStrm", + "direction": "", + "type": "hls::stream< ap_uint< 256 > > &" + }, + { + "name": "IVStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "plaintextStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "endPlaintextStrm", + "direction": "", + "type": "hls::stream< bool > &" + } + ] + } + }, + { + "api_name": "xf::security::desCfb8Encrypt", + "spec": { + "schema": "vitis_libraries_api_list_schema-1.0", + "api_name": "xf::security::desCfb8Encrypt", + "display_name": "desCfb8Encrypt", + "brief": "desCfb8Encrypt is CFB8 encryption mode with DES single block cipher.", + "target_domain": "", + "header_file_name": [ + "cfb.hpp" + ], + "search_paths": [ + "L1/include/xf_security" + ], + "instance": "function", + "parameters": [], + "ports": [ + { + "name": "plaintextStrm", + "direction": "", + "type": "hls::stream< ap_uint< 64 > > &" + }, + { + "name": "endPlaintextStrm", + "direction": "", + "type": "hls::stream< bool > &" + }, + { + "name": "cipherkeyStrm", + "direction": "", + "type": "hls::stream< ap_uint< 64 > > &" + }, + { + "name": "IVStrm", + "direction": "", + "type": "hls::stream< ap_uint< 64 > > &" + }, + { + "name": "ciphertextStrm", + "direction": "", + "type": "hls::stream< ap_uint< 64 > > &" + }, + { + "name": "endCiphertextStrm", + "direction": "", + "type": "hls::stream< bool > &" + } + ] + } + }, + { + "api_name": "xf::security::desCfb8Decrypt", + "spec": { + "schema": "vitis_libraries_api_list_schema-1.0", + "api_name": "xf::security::desCfb8Decrypt", + "display_name": "desCfb8Decrypt", + "brief": "desCfb8Decrypt is CFB8 decryption mode with DES single block cipher.", + "target_domain": "", + "header_file_name": [ + "cfb.hpp" + ], + "search_paths": [ + "L1/include/xf_security" + ], + "instance": "function", + "parameters": [], + "ports": [ + { + "name": "ciphertextStrm", + "direction": "", + "type": "hls::stream< ap_uint< 64 > > &" + }, + { + "name": "endCiphertextStrm", + "direction": "", + "type": "hls::stream< bool > &" + }, + { + "name": "cipherkeyStrm", + "direction": "", + "type": "hls::stream< ap_uint< 64 > > &" + }, + { + "name": "IVStrm", + "direction": "", + "type": "hls::stream< ap_uint< 64 > > &" + }, + { + "name": "plaintextStrm", + "direction": "", + "type": "hls::stream< ap_uint< 64 > > &" + }, + { + "name": "endPlaintextStrm", + "direction": "", + "type": "hls::stream< bool > &" + } + ] + } + }, + { + "api_name": "xf::security::aes128Cfb8Encrypt", + "spec": { + "schema": "vitis_libraries_api_list_schema-1.0", + "api_name": "xf::security::aes128Cfb8Encrypt", + "display_name": "aes128Cfb8Encrypt", + "brief": "aes128Cfb8Encrypt is CFB8 encryption mode with AES-128 single block cipher.", + "target_domain": "", + "header_file_name": [ + "cfb.hpp" + ], + "search_paths": [ + "L1/include/xf_security" + ], + "instance": "function", + "parameters": [], + "ports": [ + { + "name": "plaintextStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "endPlaintextStrm", + "direction": "", + "type": "hls::stream< bool > &" + }, + { + "name": "cipherkeyStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "IVStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "ciphertextStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "endCiphertextStrm", + "direction": "", + "type": "hls::stream< bool > &" + } + ] + } + }, + { + "api_name": "xf::security::aes128Cfb8Decrypt", + "spec": { + "schema": "vitis_libraries_api_list_schema-1.0", + "api_name": "xf::security::aes128Cfb8Decrypt", + "display_name": "aes128Cfb8Decrypt", + "brief": "aes128Cfb8Decrypt is CFB8 decryption mode with AES-128 single block cipher.", + "target_domain": "", + "header_file_name": [ + "cfb.hpp" + ], + "search_paths": [ + "L1/include/xf_security" + ], + "instance": "function", + "parameters": [], + "ports": [ + { + "name": "ciphertextStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "endCiphertextStrm", + "direction": "", + "type": "hls::stream< bool > &" + }, + { + "name": "cipherkeyStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "IVStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "plaintextStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "endPlaintextStrm", + "direction": "", + "type": "hls::stream< bool > &" + } + ] + } + }, + { + "api_name": "xf::security::aes192Cfb8Encrypt", + "spec": { + "schema": "vitis_libraries_api_list_schema-1.0", + "api_name": "xf::security::aes192Cfb8Encrypt", + "display_name": "aes192Cfb8Encrypt", + "brief": "aes192Cfb8Encrypt is CFB8 encryption mode with AES-192 single block cipher.", + "target_domain": "", + "header_file_name": [ + "cfb.hpp" + ], + "search_paths": [ + "L1/include/xf_security" + ], + "instance": "function", + "parameters": [], + "ports": [ + { + "name": "plaintextStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "endPlaintextStrm", + "direction": "", + "type": "hls::stream< bool > &" + }, + { + "name": "cipherkeyStrm", + "direction": "", + "type": "hls::stream< ap_uint< 192 > > &" + }, + { + "name": "IVStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "ciphertextStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "endCiphertextStrm", + "direction": "", + "type": "hls::stream< bool > &" + } + ] + } + }, + { + "api_name": "xf::security::aes192Cfb8Decrypt", + "spec": { + "schema": "vitis_libraries_api_list_schema-1.0", + "api_name": "xf::security::aes192Cfb8Decrypt", + "display_name": "aes192Cfb8Decrypt", + "brief": "aes192Cfb8Decrypt is CFB8 decryption mode with AES-192 single block cipher.", + "target_domain": "", + "header_file_name": [ + "cfb.hpp" + ], + "search_paths": [ + "L1/include/xf_security" + ], + "instance": "function", + "parameters": [], + "ports": [ + { + "name": "ciphertextStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "endCiphertextStrm", + "direction": "", + "type": "hls::stream< bool > &" + }, + { + "name": "cipherkeyStrm", + "direction": "", + "type": "hls::stream< ap_uint< 192 > > &" + }, + { + "name": "IVStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "plaintextStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "endPlaintextStrm", + "direction": "", + "type": "hls::stream< bool > &" + } + ] + } + }, + { + "api_name": "xf::security::aes256Cfb8Encrypt", + "spec": { + "schema": "vitis_libraries_api_list_schema-1.0", + "api_name": "xf::security::aes256Cfb8Encrypt", + "display_name": "aes256Cfb8Encrypt", + "brief": "aes256Cfb8Encrypt is CFB8 encryption mode with AES-256 single block cipher.", + "target_domain": "", + "header_file_name": [ + "cfb.hpp" + ], + "search_paths": [ + "L1/include/xf_security" + ], + "instance": "function", + "parameters": [], + "ports": [ + { + "name": "plaintextStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "endPlaintextStrm", + "direction": "", + "type": "hls::stream< bool > &" + }, + { + "name": "cipherkeyStrm", + "direction": "", + "type": "hls::stream< ap_uint< 256 > > &" + }, + { + "name": "IVStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "ciphertextStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "endCiphertextStrm", + "direction": "", + "type": "hls::stream< bool > &" + } + ] + } + }, + { + "api_name": "xf::security::aes256Cfb8Decrypt", + "spec": { + "schema": "vitis_libraries_api_list_schema-1.0", + "api_name": "xf::security::aes256Cfb8Decrypt", + "display_name": "aes256Cfb8Decrypt", + "brief": "aes256Cfb8Decrypt is CFB8 decryption mode with AES-256 single block cipher.", + "target_domain": "", + "header_file_name": [ + "cfb.hpp" + ], + "search_paths": [ + "L1/include/xf_security" + ], + "instance": "function", + "parameters": [], + "ports": [ + { + "name": "ciphertextStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "endCiphertextStrm", + "direction": "", + "type": "hls::stream< bool > &" + }, + { + "name": "cipherkeyStrm", + "direction": "", + "type": "hls::stream< ap_uint< 256 > > &" + }, + { + "name": "IVStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "plaintextStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "endPlaintextStrm", + "direction": "", + "type": "hls::stream< bool > &" + } + ] + } + }, + { + "api_name": "xf::security::desCfb128Encrypt", + "spec": { + "schema": "vitis_libraries_api_list_schema-1.0", + "api_name": "xf::security::desCfb128Encrypt", + "display_name": "desCfb128Encrypt", + "brief": "desCfb128Encrypt is CFB128 encryption mode with DES single block cipher.", + "target_domain": "", + "header_file_name": [ + "cfb.hpp" + ], + "search_paths": [ + "L1/include/xf_security" + ], + "instance": "function", + "parameters": [], + "ports": [ + { + "name": "plaintextStrm", + "direction": "", + "type": "hls::stream< ap_uint< 64 > > &" + }, + { + "name": "endPlaintextStrm", + "direction": "", + "type": "hls::stream< bool > &" + }, + { + "name": "cipherkeyStrm", + "direction": "", + "type": "hls::stream< ap_uint< 64 > > &" + }, + { + "name": "IVStrm", + "direction": "", + "type": "hls::stream< ap_uint< 64 > > &" + }, + { + "name": "ciphertextStrm", + "direction": "", + "type": "hls::stream< ap_uint< 64 > > &" + }, + { + "name": "endCiphertextStrm", + "direction": "", + "type": "hls::stream< bool > &" + } + ] + } + }, + { + "api_name": "xf::security::desCfb128Decrypt", + "spec": { + "schema": "vitis_libraries_api_list_schema-1.0", + "api_name": "xf::security::desCfb128Decrypt", + "display_name": "desCfb128Decrypt", + "brief": "desCfb128Decrypt is CFB128 decryption mode with DES single block cipher.", + "target_domain": "", + "header_file_name": [ + "cfb.hpp" + ], + "search_paths": [ + "L1/include/xf_security" + ], + "instance": "function", + "parameters": [], + "ports": [ + { + "name": "ciphertextStrm", + "direction": "", + "type": "hls::stream< ap_uint< 64 > > &" + }, + { + "name": "endCiphertextStrm", + "direction": "", + "type": "hls::stream< bool > &" + }, + { + "name": "cipherkeyStrm", + "direction": "", + "type": "hls::stream< ap_uint< 64 > > &" + }, + { + "name": "IVStrm", + "direction": "", + "type": "hls::stream< ap_uint< 64 > > &" + }, + { + "name": "plaintextStrm", + "direction": "", + "type": "hls::stream< ap_uint< 64 > > &" + }, + { + "name": "endPlaintextStrm", + "direction": "", + "type": "hls::stream< bool > &" + } + ] + } + }, + { + "api_name": "xf::security::aes128Cfb128Encrypt", + "spec": { + "schema": "vitis_libraries_api_list_schema-1.0", + "api_name": "xf::security::aes128Cfb128Encrypt", + "display_name": "aes128Cfb128Encrypt", + "brief": "aes128Cfb128Encrypt is CFB128 encryption mode with AES-128 single block cipher.", + "target_domain": "", + "header_file_name": [ + "cfb.hpp" + ], + "search_paths": [ + "L1/include/xf_security" + ], + "instance": "function", + "parameters": [], + "ports": [ + { + "name": "plaintextStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "endPlaintextStrm", + "direction": "", + "type": "hls::stream< bool > &" + }, + { + "name": "cipherkeyStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "IVStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "ciphertextStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "endCiphertextStrm", + "direction": "", + "type": "hls::stream< bool > &" + } + ] + } + }, + { + "api_name": "xf::security::aes128Cfb128Decrypt", + "spec": { + "schema": "vitis_libraries_api_list_schema-1.0", + "api_name": "xf::security::aes128Cfb128Decrypt", + "display_name": "aes128Cfb128Decrypt", + "brief": "aes128Cfb128Decrypt is CFB128 decryption mode with AES-128 single block cipher.", + "target_domain": "", + "header_file_name": [ + "cfb.hpp" + ], + "search_paths": [ + "L1/include/xf_security" + ], + "instance": "function", + "parameters": [], + "ports": [ + { + "name": "ciphertextStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "endCiphertextStrm", + "direction": "", + "type": "hls::stream< bool > &" + }, + { + "name": "cipherkeyStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "IVStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "plaintextStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "endPlaintextStrm", + "direction": "", + "type": "hls::stream< bool > &" + } + ] + } + }, + { + "api_name": "xf::security::aes192Cfb128Encrypt", + "spec": { + "schema": "vitis_libraries_api_list_schema-1.0", + "api_name": "xf::security::aes192Cfb128Encrypt", + "display_name": "aes192Cfb128Encrypt", + "brief": "aes192Cfb128Encrypt is CFB128 encryption mode with AES-192 single block cipher.", + "target_domain": "", + "header_file_name": [ + "cfb.hpp" + ], + "search_paths": [ + "L1/include/xf_security" + ], + "instance": "function", + "parameters": [], + "ports": [ + { + "name": "plaintextStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "endPlaintextStrm", + "direction": "", + "type": "hls::stream< bool > &" + }, + { + "name": "cipherkeyStrm", + "direction": "", + "type": "hls::stream< ap_uint< 192 > > &" + }, + { + "name": "IVStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "ciphertextStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "endCiphertextStrm", + "direction": "", + "type": "hls::stream< bool > &" + } + ] + } + }, + { + "api_name": "xf::security::aes192Cfb128Decrypt", + "spec": { + "schema": "vitis_libraries_api_list_schema-1.0", + "api_name": "xf::security::aes192Cfb128Decrypt", + "display_name": "aes192Cfb128Decrypt", + "brief": "aes192Cfb128Decrypt is CFB128 decryption mode with AES-192 single block cipher.", + "target_domain": "", + "header_file_name": [ + "cfb.hpp" + ], + "search_paths": [ + "L1/include/xf_security" + ], + "instance": "function", + "parameters": [], + "ports": [ + { + "name": "ciphertextStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "endCiphertextStrm", + "direction": "", + "type": "hls::stream< bool > &" + }, + { + "name": "cipherkeyStrm", + "direction": "", + "type": "hls::stream< ap_uint< 192 > > &" + }, + { + "name": "IVStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "plaintextStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "endPlaintextStrm", + "direction": "", + "type": "hls::stream< bool > &" + } + ] + } + }, + { + "api_name": "xf::security::aes256Cfb128Encrypt", + "spec": { + "schema": "vitis_libraries_api_list_schema-1.0", + "api_name": "xf::security::aes256Cfb128Encrypt", + "display_name": "aes256Cfb128Encrypt", + "brief": "aes256Cfb128Encrypt is CFB128 encryption mode with AES-256 single block cipher.", + "target_domain": "", + "header_file_name": [ + "cfb.hpp" + ], + "search_paths": [ + "L1/include/xf_security" + ], + "instance": "function", + "parameters": [], + "ports": [ + { + "name": "plaintextStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "endPlaintextStrm", + "direction": "", + "type": "hls::stream< bool > &" + }, + { + "name": "cipherkeyStrm", + "direction": "", + "type": "hls::stream< ap_uint< 256 > > &" + }, + { + "name": "IVStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "ciphertextStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "endCiphertextStrm", + "direction": "", + "type": "hls::stream< bool > &" + } + ] + } + }, + { + "api_name": "xf::security::aes256Cfb128Decrypt", + "spec": { + "schema": "vitis_libraries_api_list_schema-1.0", + "api_name": "xf::security::aes256Cfb128Decrypt", + "display_name": "aes256Cfb128Decrypt", + "brief": "aes256Cfb128Decrypt is CFB128 decryption mode with AES-256 single block cipher.", + "target_domain": "", + "header_file_name": [ + "cfb.hpp" + ], + "search_paths": [ + "L1/include/xf_security" + ], + "instance": "function", + "parameters": [], + "ports": [ + { + "name": "ciphertextStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "endCiphertextStrm", + "direction": "", + "type": "hls::stream< bool > &" + }, + { + "name": "cipherkeyStrm", + "direction": "", + "type": "hls::stream< ap_uint< 256 > > &" + }, + { + "name": "IVStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "plaintextStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "endPlaintextStrm", + "direction": "", + "type": "hls::stream< bool > &" + } + ] + } + }, + { + "api_name": "xf::security::chacha20", + "spec": { + "schema": "vitis_libraries_api_list_schema-1.0", + "api_name": "xf::security::chacha20", + "display_name": "chacha20", + "brief": "chahcha20 is a basic function for stream ciphering when key is \"keylayout-chacha\", its layout in a 256-bit ap_uint<> likes this,", + "target_domain": "", + "header_file_name": [ + "chacha20.hpp" + ], + "search_paths": [ + "L1/include/xf_security" + ], + "instance": "function", + "parameters": [], + "ports": [ + { + "name": "keyStrm", + "direction": "", + "type": "hls::stream< ap_uint< 256 > > &" + }, + { + "name": "counterNonceStm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &counterNonceStrm, hls::stream< ap_uint< 512 > > &plainStrm, hls::stream< bool > &ePlainStrm, hls::stream< ap_uint< 512 > > &cipherStrm, hls::stream< bool > &eCipherStrm" + }, + { + "name": "plainStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &counterNonceStrm, hls::stream< ap_uint< 512 > > &" + }, + { + "name": "ePlainStrm", + "direction": "", + "type": "hls::stream< bool > &" + }, + { + "name": "cipherStrm", + "direction": "", + "type": "hls::stream< ap_uint< 512 > > &" + }, + { + "name": "eCipherStrm", + "direction": "", + "type": "hls::stream< bool > &" + } + ] + } + }, + { + "api_name": "xf::security::xchacha20", + "spec": { + "schema": "vitis_libraries_api_list_schema-1.0", + "api_name": "xf::security::xchacha20", + "display_name": "xchacha20", + "brief": "xchahcha20 is variant of original chacha20 to support longer nonce of 192bits.", + "target_domain": "", + "header_file_name": [ + "chacha20.hpp" + ], + "search_paths": [ + "L1/include/xf_security" + ], + "instance": "function", + "parameters": [], + "ports": [ + { + "name": "keyStrm", + "direction": "", + "type": "hls::stream< ap_uint< 256 > > &" + }, + { + "name": "nonceStm", + "direction": "", + "type": "hls::stream< ap_uint< 192 > > &nonceStrm, hls::stream< ap_uint< 512 > > &plainStrm, hls::stream< bool > &ePlainStrm, hls::stream< ap_uint< 512 > > &cipherStrm, hls::stream< bool > &eCipherStrm" + }, + { + "name": "plainStrm", + "direction": "", + "type": "hls::stream< ap_uint< 192 > > &nonceStrm, hls::stream< ap_uint< 512 > > &" + }, + { + "name": "ePlainStrm", + "direction": "", + "type": "hls::stream< bool > &" + }, + { + "name": "cipherStrm", + "direction": "", + "type": "hls::stream< ap_uint< 512 > > &" + }, + { + "name": "eCipherStrm", + "direction": "", + "type": "hls::stream< bool > &" + } + ] + } + }, + { + "api_name": "xf::security::crc32", + "spec": { + "schema": "vitis_libraries_api_list_schema-1.0", + "api_name": "xf::security::crc32", + "display_name": "crc32", + "brief": "crc32 computes the CRC32 check value of an input data.", + "target_domain": "", + "header_file_name": [ + "crc32.hpp" + ], + "search_paths": [ + "L1/include/xf_security" + ], + "instance": "function", + "parameters": [ + { + "name": "W", + "type": "int", + "description": "byte number of input data, the value of W includes 1, 2, 4, 8, 16." + } + ], + "ports": [ + { + "name": "crcInitStrm", + "direction": "", + "type": "hls::stream< ap_uint< 32 > > &" + }, + { + "name": "inStrm", + "direction": "", + "type": "hls::stream< ap_uint< 8 *W > > &" + }, + { + "name": "inPackLenStrm", + "direction": "", + "type": "hls::stream< ap_uint< 5 > > &" + }, + { + "name": "endInPackLenStrm", + "direction": "", + "type": "hls::stream< bool > &" + }, + { + "name": "outStrm", + "direction": "", + "type": "hls::stream< ap_uint< 32 > > &" + }, + { + "name": "endOutStrm", + "direction": "", + "type": "hls::stream< bool > &" + } + ] + } + }, + { + "api_name": "xf::security::crc32c", + "spec": { + "schema": "vitis_libraries_api_list_schema-1.0", + "api_name": "xf::security::crc32c", + "display_name": "crc32c", + "brief": "crc32c computes the CRC32 (Castagnoli) check value of an input data.", + "target_domain": "", + "header_file_name": [ + "crc32c.hpp" + ], + "search_paths": [ + "L1/include/xf_security" + ], + "instance": "function", + "parameters": [ + { + "name": "W", + "type": "int", + "description": "byte number of input data, the value of W includes 1, 2, 4, 8, 16, 32, 64." + } + ], + "ports": [ + { + "name": "crcInitStrm", + "direction": "", + "type": "hls::stream< ap_uint< 32 > > &" + }, + { + "name": "inStrm", + "direction": "", + "type": "hls::stream< ap_uint< 8 *W > > &" + }, + { + "name": "inLenStrm", + "direction": "", + "type": "hls::stream< ap_uint< 32 > > &" + }, + { + "name": "endInStrm", + "direction": "", + "type": "hls::stream< bool > &" + }, + { + "name": "outStrm", + "direction": "", + "type": "hls::stream< ap_uint< 32 > > &" + }, + { + "name": "endOutStrm", + "direction": "", + "type": "hls::stream< bool > &" + } + ] + } + }, + { + "api_name": "xf::security::aes128CtrEncrypt", + "spec": { + "schema": "vitis_libraries_api_list_schema-1.0", + "api_name": "xf::security::aes128CtrEncrypt", + "display_name": "aes128CtrEncrypt", + "brief": "aes128CtrEncrypt is CTR encryption mode with AES-128 single block cipher.", + "target_domain": "", + "header_file_name": [ + "ctr.hpp" + ], + "search_paths": [ + "L1/include/xf_security" + ], + "instance": "function", + "parameters": [], + "ports": [ + { + "name": "plaintextStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "endPlaintextStrm", + "direction": "", + "type": "hls::stream< bool > &" + }, + { + "name": "cipherkeyStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "IVStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "ciphertextStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "endCiphertextStrm", + "direction": "", + "type": "hls::stream< bool > &" + } + ] + } + }, + { + "api_name": "xf::security::aes128CtrDecrypt", + "spec": { + "schema": "vitis_libraries_api_list_schema-1.0", + "api_name": "xf::security::aes128CtrDecrypt", + "display_name": "aes128CtrDecrypt", + "brief": "aes128CtrDecrypt is CTR decryption mode with AES-128 single block cipher.", + "target_domain": "", + "header_file_name": [ + "ctr.hpp" + ], + "search_paths": [ + "L1/include/xf_security" + ], + "instance": "function", + "parameters": [], + "ports": [ + { + "name": "ciphertextStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "endCiphertextStrm", + "direction": "", + "type": "hls::stream< bool > &" + }, + { + "name": "cipherkeyStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "IVStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "plaintextStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "endPlaintextStrm", + "direction": "", + "type": "hls::stream< bool > &" + } + ] + } + }, + { + "api_name": "xf::security::aes192CtrEncrypt", + "spec": { + "schema": "vitis_libraries_api_list_schema-1.0", + "api_name": "xf::security::aes192CtrEncrypt", + "display_name": "aes192CtrEncrypt", + "brief": "aes192CtrEncrypt is CTR encryption mode with AES-192 single block cipher.", + "target_domain": "", + "header_file_name": [ + "ctr.hpp" + ], + "search_paths": [ + "L1/include/xf_security" + ], + "instance": "function", + "parameters": [], + "ports": [ + { + "name": "plaintextStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "endPlaintextStrm", + "direction": "", + "type": "hls::stream< bool > &" + }, + { + "name": "cipherkeyStrm", + "direction": "", + "type": "hls::stream< ap_uint< 192 > > &" + }, + { + "name": "IVStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "ciphertextStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "endCiphertextStrm", + "direction": "", + "type": "hls::stream< bool > &" + } + ] + } + }, + { + "api_name": "xf::security::aes192CtrDecrypt", + "spec": { + "schema": "vitis_libraries_api_list_schema-1.0", + "api_name": "xf::security::aes192CtrDecrypt", + "display_name": "aes192CtrDecrypt", + "brief": "aes192CtrDecrypt is CTR decryption mode with AES-192 single block cipher.", + "target_domain": "", + "header_file_name": [ + "ctr.hpp" + ], + "search_paths": [ + "L1/include/xf_security" + ], + "instance": "function", + "parameters": [], + "ports": [ + { + "name": "ciphertextStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "endCiphertextStrm", + "direction": "", + "type": "hls::stream< bool > &" + }, + { + "name": "cipherkeyStrm", + "direction": "", + "type": "hls::stream< ap_uint< 192 > > &" + }, + { + "name": "IVStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "plaintextStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "endPlaintextStrm", + "direction": "", + "type": "hls::stream< bool > &" + } + ] + } + }, + { + "api_name": "xf::security::aes256CtrEncrypt", + "spec": { + "schema": "vitis_libraries_api_list_schema-1.0", + "api_name": "xf::security::aes256CtrEncrypt", + "display_name": "aes256CtrEncrypt", + "brief": "aes256CtrEncrypt is CTR encryption mode with AES-256 single block cipher.", + "target_domain": "", + "header_file_name": [ + "ctr.hpp" + ], + "search_paths": [ + "L1/include/xf_security" + ], + "instance": "function", + "parameters": [], + "ports": [ + { + "name": "plaintextStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "endPlaintextStrm", + "direction": "", + "type": "hls::stream< bool > &" + }, + { + "name": "cipherkeyStrm", + "direction": "", + "type": "hls::stream< ap_uint< 256 > > &" + }, + { + "name": "IVStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "ciphertextStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "endCiphertextStrm", + "direction": "", + "type": "hls::stream< bool > &" + } + ] + } + }, + { + "api_name": "xf::security::aes256CtrDecrypt", + "spec": { + "schema": "vitis_libraries_api_list_schema-1.0", + "api_name": "xf::security::aes256CtrDecrypt", + "display_name": "aes256CtrDecrypt", + "brief": "aes256CtrDecrypt is CTR decryption mode with AES-256 single block cipher.", + "target_domain": "", + "header_file_name": [ + "ctr.hpp" + ], + "search_paths": [ + "L1/include/xf_security" + ], + "instance": "function", + "parameters": [], + "ports": [ + { + "name": "ciphertextStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "endCiphertextStrm", + "direction": "", + "type": "hls::stream< bool > &" + }, + { + "name": "cipherkeyStrm", + "direction": "", + "type": "hls::stream< ap_uint< 256 > > &" + }, + { + "name": "IVStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "plaintextStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "endPlaintextStrm", + "direction": "", + "type": "hls::stream< bool > &" + } + ] + } + }, + { + "api_name": "xf::security::desEncrypt", + "spec": { + "schema": "vitis_libraries_api_list_schema-1.0", + "api_name": "xf::security::desEncrypt", + "display_name": "desEncrypt", + "brief": "desEncrypt is the basic function for ciphering one block with one cipher key using DES", + "target_domain": "", + "header_file_name": [ + "des.hpp" + ], + "search_paths": [ + "L1/include/xf_security" + ], + "instance": "function", + "parameters": [], + "ports": [ + { + "name": "in", + "direction": "", + "type": "ap_u" + }, + { + "name": "key", + "direction": "", + "type": "t< 64 > &out" + }, + { + "name": "out", + "direction": "", + "type": "t< 64 > &" + } + ] + } + }, + { + "api_name": "xf::security::desDecrypt", + "spec": { + "schema": "vitis_libraries_api_list_schema-1.0", + "api_name": "xf::security::desDecrypt", + "display_name": "desDecrypt", + "brief": "desDecrypt is the basic function for decrypt one block with one cipher key using DES", + "target_domain": "", + "header_file_name": [ + "des.hpp" + ], + "search_paths": [ + "L1/include/xf_security" + ], + "instance": "function", + "parameters": [], + "ports": [ + { + "name": "in", + "direction": "", + "type": "ap_u" + }, + { + "name": "cipherKey", + "direction": "", + "type": "t< 64 > &out" + }, + { + "name": "out", + "direction": "", + "type": "t< 64 > &" + } + ] + } + }, + { + "api_name": "xf::security::des3Encrypt", + "spec": { + "schema": "vitis_libraries_api_list_schema-1.0", + "api_name": "xf::security::des3Encrypt", + "display_name": "des3Encrypt", + "brief": "des3Encrypt is the basic function for ciphering one block with three cipher keys using 3DES", + "target_domain": "", + "header_file_name": [ + "des.hpp" + ], + "search_paths": [ + "L1/include/xf_security" + ], + "instance": "function", + "parameters": [], + "ports": [ + { + "name": "in", + "direction": "", + "type": "ap_u" + }, + { + "name": "key1", + "direction": "", + "type": "t< 64 > &out" + }, + { + "name": "key2", + "direction": "", + "type": "t< 64 > &out" + }, + { + "name": "key3", + "direction": "", + "type": "t< 64 > &out" + }, + { + "name": "out", + "direction": "", + "type": "t< 64 > &" + } + ] + } + }, + { + "api_name": "xf::security::des3Decrypt", + "spec": { + "schema": "vitis_libraries_api_list_schema-1.0", + "api_name": "xf::security::des3Decrypt", + "display_name": "des3Decrypt", + "brief": "des3Decrypt is the basic function for decrypt one block with three cipher keys using 3DES", + "target_domain": "", + "header_file_name": [ + "des.hpp" + ], + "search_paths": [ + "L1/include/xf_security" + ], + "instance": "function", + "parameters": [], + "ports": [ + { + "name": "in", + "direction": "", + "type": "ap_u" + }, + { + "name": "key1", + "direction": "", + "type": "t< 64 > &out" + }, + { + "name": "key2", + "direction": "", + "type": "t< 64 > &out" + }, + { + "name": "key3", + "direction": "", + "type": "t< 64 > &out" + }, + { + "name": "out", + "direction": "", + "type": "t< 64 > &" + } + ] + } + }, + { + "api_name": "xf::security::desEcbEncrypt", + "spec": { + "schema": "vitis_libraries_api_list_schema-1.0", + "api_name": "xf::security::desEcbEncrypt", + "display_name": "desEcbEncrypt", + "brief": "desEcbEncrypt is ECB encryption mode with DES single block cipher.", + "target_domain": "", + "header_file_name": [ + "ecb.hpp" + ], + "search_paths": [ + "L1/include/xf_security" + ], + "instance": "function", + "parameters": [], + "ports": [ + { + "name": "plaintextStrm", + "direction": "", + "type": "hls::stream< ap_uint< 64 > > &" + }, + { + "name": "endPlaintextStrm", + "direction": "", + "type": "hls::stream< bool > &" + }, + { + "name": "cipherkeyStrm", + "direction": "", + "type": "hls::stream< ap_uint< 64 > > &" + }, + { + "name": "ciphertextStrm", + "direction": "", + "type": "hls::stream< ap_uint< 64 > > &" + }, + { + "name": "endCiphertextStrm", + "direction": "", + "type": "hls::stream< bool > &" + } + ] + } + }, + { + "api_name": "xf::security::desEcbDecrypt", + "spec": { + "schema": "vitis_libraries_api_list_schema-1.0", + "api_name": "xf::security::desEcbDecrypt", + "display_name": "desEcbDecrypt", + "brief": "desEcbDecrypt is ECB decryption mode with DES single block cipher.", + "target_domain": "", + "header_file_name": [ + "ecb.hpp" + ], + "search_paths": [ + "L1/include/xf_security" + ], + "instance": "function", + "parameters": [], + "ports": [ + { + "name": "ciphertextStrm", + "direction": "", + "type": "hls::stream< ap_uint< 64 > > &" + }, + { + "name": "endCiphertextStrm", + "direction": "", + "type": "hls::stream< bool > &" + }, + { + "name": "cipherkeyStrm", + "direction": "", + "type": "hls::stream< ap_uint< 64 > > &" + }, + { + "name": "plaintextStrm", + "direction": "", + "type": "hls::stream< ap_uint< 64 > > &" + }, + { + "name": "endPlaintextStrm", + "direction": "", + "type": "hls::stream< bool > &" + } + ] + } + }, + { + "api_name": "xf::security::aes128EcbEncrypt", + "spec": { + "schema": "vitis_libraries_api_list_schema-1.0", + "api_name": "xf::security::aes128EcbEncrypt", + "display_name": "aes128EcbEncrypt", + "brief": "aes128EcbEncrypt is ECB encryption mode with AES-128 single block cipher.", + "target_domain": "", + "header_file_name": [ + "ecb.hpp" + ], + "search_paths": [ + "L1/include/xf_security" + ], + "instance": "function", + "parameters": [], + "ports": [ + { + "name": "plaintextStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "endPlaintextStrm", + "direction": "", + "type": "hls::stream< bool > &" + }, + { + "name": "cipherkeyStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "ciphertextStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "endCiphertextStrm", + "direction": "", + "type": "hls::stream< bool > &" + } + ] + } + }, + { + "api_name": "xf::security::aes128EcbDecrypt", + "spec": { + "schema": "vitis_libraries_api_list_schema-1.0", + "api_name": "xf::security::aes128EcbDecrypt", + "display_name": "aes128EcbDecrypt", + "brief": "aes128EcbDecrypt is ECB decryption mode with AES-128 single block cipher.", + "target_domain": "", + "header_file_name": [ + "ecb.hpp" + ], + "search_paths": [ + "L1/include/xf_security" + ], + "instance": "function", + "parameters": [], + "ports": [ + { + "name": "ciphertextStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "endCiphertextStrm", + "direction": "", + "type": "hls::stream< bool > &" + }, + { + "name": "cipherkeyStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "plaintextStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "endPlaintextStrm", + "direction": "", + "type": "hls::stream< bool > &" + } + ] + } + }, + { + "api_name": "xf::security::aes192EcbEncrypt", + "spec": { + "schema": "vitis_libraries_api_list_schema-1.0", + "api_name": "xf::security::aes192EcbEncrypt", + "display_name": "aes192EcbEncrypt", + "brief": "aes192EcbEncrypt is ECB encryption mode with AES-192 single block cipher.", + "target_domain": "", + "header_file_name": [ + "ecb.hpp" + ], + "search_paths": [ + "L1/include/xf_security" + ], + "instance": "function", + "parameters": [], + "ports": [ + { + "name": "plaintextStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "endPlaintextStrm", + "direction": "", + "type": "hls::stream< bool > &" + }, + { + "name": "cipherkeyStrm", + "direction": "", + "type": "hls::stream< ap_uint< 192 > > &" + }, + { + "name": "ciphertextStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "endCiphertextStrm", + "direction": "", + "type": "hls::stream< bool > &" + } + ] + } + }, + { + "api_name": "xf::security::aes192EcbDecrypt", + "spec": { + "schema": "vitis_libraries_api_list_schema-1.0", + "api_name": "xf::security::aes192EcbDecrypt", + "display_name": "aes192EcbDecrypt", + "brief": "aes192EcbDecrypt is ECB decryption mode with AES-192 single block cipher.", + "target_domain": "", + "header_file_name": [ + "ecb.hpp" + ], + "search_paths": [ + "L1/include/xf_security" + ], + "instance": "function", + "parameters": [], + "ports": [ + { + "name": "ciphertextStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "endCiphertextStrm", + "direction": "", + "type": "hls::stream< bool > &" + }, + { + "name": "cipherkeyStrm", + "direction": "", + "type": "hls::stream< ap_uint< 192 > > &" + }, + { + "name": "plaintextStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "endPlaintextStrm", + "direction": "", + "type": "hls::stream< bool > &" + } + ] + } + }, + { + "api_name": "xf::security::aes256EcbEncrypt", + "spec": { + "schema": "vitis_libraries_api_list_schema-1.0", + "api_name": "xf::security::aes256EcbEncrypt", + "display_name": "aes256EcbEncrypt", + "brief": "aes256EcbEncrypt is ECB encryption mode with AES-256 single block cipher.", + "target_domain": "", + "header_file_name": [ + "ecb.hpp" + ], + "search_paths": [ + "L1/include/xf_security" + ], + "instance": "function", + "parameters": [], + "ports": [ + { + "name": "plaintextStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "endPlaintextStrm", + "direction": "", + "type": "hls::stream< bool > &" + }, + { + "name": "cipherkeyStrm", + "direction": "", + "type": "hls::stream< ap_uint< 256 > > &" + }, + { + "name": "ciphertextStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "endCiphertextStrm", + "direction": "", + "type": "hls::stream< bool > &" + } + ] + } + }, + { + "api_name": "xf::security::aes256EcbDecrypt", + "spec": { + "schema": "vitis_libraries_api_list_schema-1.0", + "api_name": "xf::security::aes256EcbDecrypt", + "display_name": "aes256EcbDecrypt", + "brief": "aes256EcbDecrypt is ECB decryption mode with AES-256 single block cipher.", + "target_domain": "", + "header_file_name": [ + "ecb.hpp" + ], + "search_paths": [ + "L1/include/xf_security" + ], + "instance": "function", + "parameters": [], + "ports": [ + { + "name": "ciphertextStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "endCiphertextStrm", + "direction": "", + "type": "hls::stream< bool > &" + }, + { + "name": "cipherkeyStrm", + "direction": "", + "type": "hls::stream< ap_uint< 256 > > &" + }, + { + "name": "plaintextStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "endPlaintextStrm", + "direction": "", + "type": "hls::stream< bool > &" + } + ] + } + }, + { + "api_name": "xf::security::nistp256Sign", + "spec": { + "schema": "vitis_libraries_api_list_schema-1.0", + "api_name": "xf::security::nistp256Sign", + "display_name": "nistp256Sign", + "brief": "signing function. It will return true if input parameters are legal, otherwise return false.", + "target_domain": "", + "header_file_name": [ + "ecdsa_nistp256.hpp" + ], + "search_paths": [ + "L1/include/xf_security" + ], + "instance": "function", + "parameters": [], + "ports": [ + { + "name": "hash", + "direction": "", + "type": "ap_uint< 256 >" + }, + { + "name": "k", + "direction": "", + "type": "ap_uint< 256 >" + }, + { + "name": "privateKey", + "direction": "", + "type": "ap_uint< 256 >" + }, + { + "name": "r", + "direction": "", + "type": "ap_uint< 256 > &" + }, + { + "name": "s", + "direction": "", + "type": "ap_uint< 256 > &" + } + ] + } + }, + { + "api_name": "xf::security::nistp256Verify", + "spec": { + "schema": "vitis_libraries_api_list_schema-1.0", + "api_name": "xf::security::nistp256Verify", + "display_name": "nistp256Verify", + "brief": "verifying function. It will return true if verified, otherwise false.", + "target_domain": "", + "header_file_name": [ + "ecdsa_nistp256.hpp" + ], + "search_paths": [ + "L1/include/xf_security" + ], + "instance": "function", + "parameters": [], + "ports": [ + { + "name": "r", + "direction": "", + "type": "ap_uint< 256 >" + }, + { + "name": "s", + "direction": "", + "type": "ap_uint< 256 >h," + }, + { + "name": "hash", + "direction": "", + "type": "ap_uint< 256 > Px, ap_uint< 256 > P" + }, + { + "name": "Px", + "direction": "", + "type": "ap_uint< 256 >" + }, + { + "name": "Py", + "direction": "", + "type": "ap_uint< 256 > P" + } + ] + } + }, + { + "api_name": "xf::security::aes128GcmEncrypt", + "spec": { + "schema": "vitis_libraries_api_list_schema-1.0", + "api_name": "xf::security::aes128GcmEncrypt", + "display_name": "aes128GcmEncrypt", + "brief": "aes128GcmEncrypt is GCM encryption mode with AES-128 single block cipher.", + "target_domain": "", + "header_file_name": [ + "gcm.hpp" + ], + "search_paths": [ + "L1/include/xf_security" + ], + "instance": "function", + "parameters": [], + "ports": [ + { + "name": "payloadStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "cipherkeyStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "IVStrm", + "direction": "", + "type": "hls::stream< ap_uint< 96 > > &" + }, + { + "name": "AADStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "lenAADStrm", + "direction": "", + "type": "hls::stream< ap_uint< 64 > > &lenPldStrm, hls::stream< bool > &endLenStrm, hls::stream< ap_uint< 128 > > &cipherStrm, hls::stream< ap_uint< 64 > > &lenCphStrm, hls::stream< ap_uint< 128 > > &tagStrm, hls::stream< bool > &endTagStrm" + }, + { + "name": "lenPldStrm", + "direction": "", + "type": "hls::stream< ap_uint< 64 > > &" + }, + { + "name": "endLenStrm", + "direction": "", + "type": "hls::stream< bool > &" + }, + { + "name": "cipherStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "lenCphStrm", + "direction": "", + "type": "hls::stream< ap_uint< 64 > > &" + }, + { + "name": "tagStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "endTagStrm", + "direction": "", + "type": "hls::stream< bool > &" + } + ] + } + }, + { + "api_name": "xf::security::aes128GcmDecrypt", + "spec": { + "schema": "vitis_libraries_api_list_schema-1.0", + "api_name": "xf::security::aes128GcmDecrypt", + "display_name": "aes128GcmDecrypt", + "brief": "aes128GcmDecrypt is GCM decryption mode with AES-128 single block cipher.", + "target_domain": "", + "header_file_name": [ + "gcm.hpp" + ], + "search_paths": [ + "L1/include/xf_security" + ], + "instance": "function", + "parameters": [], + "ports": [ + { + "name": "payloadStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "cipherkeyStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "IVStrm", + "direction": "", + "type": "hls::stream< ap_uint< 96 > > &" + }, + { + "name": "AADStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "lenAADStrm", + "direction": "", + "type": "hls::stream< ap_uint< 64 > > &lenPldStrm, hls::stream< bool > &endLenStrm, hls::stream< ap_uint< 128 > > &cipherStrm, hls::stream< ap_uint< 64 > > &lenCphStrm, hls::stream< ap_uint< 128 > > &tagStrm, hls::stream< bool > &endTagStrm" + }, + { + "name": "lenPldStrm", + "direction": "", + "type": "hls::stream< ap_uint< 64 > > &" + }, + { + "name": "endLenStrm", + "direction": "", + "type": "hls::stream< bool > &" + }, + { + "name": "cipherStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "lenCphStrm", + "direction": "", + "type": "hls::stream< ap_uint< 64 > > &" + }, + { + "name": "tagStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "endTagStrm", + "direction": "", + "type": "hls::stream< bool > &" + } + ] + } + }, + { + "api_name": "xf::security::aes192GcmEncrypt", + "spec": { + "schema": "vitis_libraries_api_list_schema-1.0", + "api_name": "xf::security::aes192GcmEncrypt", + "display_name": "aes192GcmEncrypt", + "brief": "aes192GcmEncrypt is GCM encryption mode with AES-192 single block cipher.", + "target_domain": "", + "header_file_name": [ + "gcm.hpp" + ], + "search_paths": [ + "L1/include/xf_security" + ], + "instance": "function", + "parameters": [], + "ports": [ + { + "name": "payloadStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "cipherkeyStrm", + "direction": "", + "type": "hls::stream< ap_uint< 192 > > &" + }, + { + "name": "IVStrm", + "direction": "", + "type": "hls::stream< ap_uint< 96 > > &" + }, + { + "name": "AADStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "lenAADStrm", + "direction": "", + "type": "hls::stream< ap_uint< 64 > > &lenPldStrm, hls::stream< bool > &endLenStrm, hls::stream< ap_uint< 128 > > &cipherStrm, hls::stream< ap_uint< 64 > > &lenCphStrm, hls::stream< ap_uint< 128 > > &tagStrm, hls::stream< bool > &endTagStrm" + }, + { + "name": "lenPldStrm", + "direction": "", + "type": "hls::stream< ap_uint< 64 > > &" + }, + { + "name": "endLenStrm", + "direction": "", + "type": "hls::stream< bool > &" + }, + { + "name": "cipherStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "lenCphStrm", + "direction": "", + "type": "hls::stream< ap_uint< 64 > > &" + }, + { + "name": "tagStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "endTagStrm", + "direction": "", + "type": "hls::stream< bool > &" + } + ] + } + }, + { + "api_name": "xf::security::aes192GcmDecrypt", + "spec": { + "schema": "vitis_libraries_api_list_schema-1.0", + "api_name": "xf::security::aes192GcmDecrypt", + "display_name": "aes192GcmDecrypt", + "brief": "aes192GcmDecrypt is GCM decryption mode with AES-192 single block cipher.", + "target_domain": "", + "header_file_name": [ + "gcm.hpp" + ], + "search_paths": [ + "L1/include/xf_security" + ], + "instance": "function", + "parameters": [], + "ports": [ + { + "name": "payloadStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "cipherkeyStrm", + "direction": "", + "type": "hls::stream< ap_uint< 192 > > &" + }, + { + "name": "IVStrm", + "direction": "", + "type": "hls::stream< ap_uint< 96 > > &" + }, + { + "name": "AADStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "lenAADStrm", + "direction": "", + "type": "hls::stream< ap_uint< 64 > > &lenPldStrm, hls::stream< bool > &endLenStrm, hls::stream< ap_uint< 128 > > &cipherStrm, hls::stream< ap_uint< 64 > > &lenCphStrm, hls::stream< ap_uint< 128 > > &tagStrm, hls::stream< bool > &endTagStrm" + }, + { + "name": "lenPldStrm", + "direction": "", + "type": "hls::stream< ap_uint< 64 > > &" + }, + { + "name": "endLenStrm", + "direction": "", + "type": "hls::stream< bool > &" + }, + { + "name": "cipherStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "lenCphStrm", + "direction": "", + "type": "hls::stream< ap_uint< 64 > > &" + }, + { + "name": "tagStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "endTagStrm", + "direction": "", + "type": "hls::stream< bool > &" + } + ] + } + }, + { + "api_name": "xf::security::aes256GcmEncrypt", + "spec": { + "schema": "vitis_libraries_api_list_schema-1.0", + "api_name": "xf::security::aes256GcmEncrypt", + "display_name": "aes256GcmEncrypt", + "brief": "aes256GcmEncrypt is GCM encryption mode with AES-256 single block cipher.", + "target_domain": "", + "header_file_name": [ + "gcm.hpp" + ], + "search_paths": [ + "L1/include/xf_security" + ], + "instance": "function", + "parameters": [], + "ports": [ + { + "name": "payloadStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "cipherkeyStrm", + "direction": "", + "type": "hls::stream< ap_uint< 256 > > &" + }, + { + "name": "IVStrm", + "direction": "", + "type": "hls::stream< ap_uint< 96 > > &" + }, + { + "name": "AADStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "lenAADStrm", + "direction": "", + "type": "hls::stream< ap_uint< 64 > > &lenPldStrm, hls::stream< bool > &endLenStrm, hls::stream< ap_uint< 128 > > &cipherStrm, hls::stream< ap_uint< 64 > > &lenCphStrm, hls::stream< ap_uint< 128 > > &tagStrm, hls::stream< bool > &endTagStrm" + }, + { + "name": "lenPldStrm", + "direction": "", + "type": "hls::stream< ap_uint< 64 > > &" + }, + { + "name": "endLenStrm", + "direction": "", + "type": "hls::stream< bool > &" + }, + { + "name": "cipherStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "lenCphStrm", + "direction": "", + "type": "hls::stream< ap_uint< 64 > > &" + }, + { + "name": "tagStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "endTagStrm", + "direction": "", + "type": "hls::stream< bool > &" + } + ] + } + }, + { + "api_name": "xf::security::aes256GcmDecrypt", + "spec": { + "schema": "vitis_libraries_api_list_schema-1.0", + "api_name": "xf::security::aes256GcmDecrypt", + "display_name": "aes256GcmDecrypt", + "brief": "aes256GcmDecrypt is GCM decryption mode with AES-2562 single block cipher.", + "target_domain": "", + "header_file_name": [ + "gcm.hpp" + ], + "search_paths": [ + "L1/include/xf_security" + ], + "instance": "function", + "parameters": [], + "ports": [ + { + "name": "payloadStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "cipherkeyStrm", + "direction": "", + "type": "hls::stream< ap_uint< 256 > > &" + }, + { + "name": "IVStrm", + "direction": "", + "type": "hls::stream< ap_uint< 96 > > &" + }, + { + "name": "AADStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "lenAADStrm", + "direction": "", + "type": "hls::stream< ap_uint< 64 > > &lenPldStrm, hls::stream< bool > &endLenStrm, hls::stream< ap_uint< 128 > > &cipherStrm, hls::stream< ap_uint< 64 > > &lenCphStrm, hls::stream< ap_uint< 128 > > &tagStrm, hls::stream< bool > &endTagStrm" + }, + { + "name": "lenPldStrm", + "direction": "", + "type": "hls::stream< ap_uint< 64 > > &" + }, + { + "name": "endLenStrm", + "direction": "", + "type": "hls::stream< bool > &" + }, + { + "name": "cipherStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "lenCphStrm", + "direction": "", + "type": "hls::stream< ap_uint< 64 > > &" + }, + { + "name": "tagStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "endTagStrm", + "direction": "", + "type": "hls::stream< bool > &" + } + ] + } + }, + { + "api_name": "xf::security::aes128Gmac", + "spec": { + "schema": "vitis_libraries_api_list_schema-1.0", + "api_name": "xf::security::aes128Gmac", + "display_name": "aes128Gmac", + "brief": "GMAC using AES-128 block cipher.", + "target_domain": "", + "header_file_name": [ + "gmac.hpp" + ], + "search_paths": [ + "L1/include/xf_security" + ], + "instance": "function", + "parameters": [], + "ports": [ + { + "name": "dataStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "lenDataStrm", + "direction": "", + "type": "hls::stream< ap_uint< 64 > > &" + }, + { + "name": "cipherkeyStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "IVStrm", + "direction": "", + "type": "hls::stream< ap_uint< 96 > > &" + }, + { + "name": "tagStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + } + ] + } + }, + { + "api_name": "xf::security::aes192Gmac", + "spec": { + "schema": "vitis_libraries_api_list_schema-1.0", + "api_name": "xf::security::aes192Gmac", + "display_name": "aes192Gmac", + "brief": "GMAC using AES-192 block cipher.", + "target_domain": "", + "header_file_name": [ + "gmac.hpp" + ], + "search_paths": [ + "L1/include/xf_security" + ], + "instance": "function", + "parameters": [], + "ports": [ + { + "name": "dataStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "lenDataStrm", + "direction": "", + "type": "hls::stream< ap_uint< 64 > > &" + }, + { + "name": "cipherkeyStrm", + "direction": "", + "type": "hls::stream< ap_uint< 192 > > &" + }, + { + "name": "IVStrm", + "direction": "", + "type": "hls::stream< ap_uint< 96 > > &" + }, + { + "name": "tagStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + } + ] + } + }, + { + "api_name": "xf::security::aes256Gmac", + "spec": { + "schema": "vitis_libraries_api_list_schema-1.0", + "api_name": "xf::security::aes256Gmac", + "display_name": "aes256Gmac", + "brief": "GMAC using AES-256 block cipher.", + "target_domain": "", + "header_file_name": [ + "gmac.hpp" + ], + "search_paths": [ + "L1/include/xf_security" + ], + "instance": "function", + "parameters": [], + "ports": [ + { + "name": "dataStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "lenDataStrm", + "direction": "", + "type": "hls::stream< ap_uint< 64 > > &" + }, + { + "name": "cipherkeyStrm", + "direction": "", + "type": "hls::stream< ap_uint< 256 > > &" + }, + { + "name": "IVStrm", + "direction": "", + "type": "hls::stream< ap_uint< 96 > > &" + }, + { + "name": "tagStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + } + ] + } + }, + { + "api_name": "xf::security::hmac", + "spec": { + "schema": "vitis_libraries_api_list_schema-1.0", + "api_name": "xf::security::hmac", + "display_name": "hmac", + "brief": "Compute HMAC value according to specified hash function and input data.", + "target_domain": "", + "header_file_name": [ + "hmac.hpp" + ], + "search_paths": [ + "L1/include/xf_security" + ], + "instance": "function", + "parameters": [ + { + "name": "dataW", + "type": "int", + "description": "the width of input stream keyStrm and msgStrm." + }, + { + "name": "lW", + "type": "int", + "description": "the with of input msgLenstrm." + }, + { + "name": "hshW", + "type": "int", + "description": "the width of output stream hshStrm." + }, + { + "name": "keyLen", + "type": "int", + "description": "lenght of key (in bytes)" + }, + { + "name": "blockSize", + "type": "int", + "description": "the block size (in bytes) of the underlying hash function (e.g. 64 bytes for md5 and SHA-1)." + }, + { + "name": "F", + "type": "template< int iW, int ilW, int oW > class", + "description": "a wrapper of hash function which must have a static fucntion named" + } + ], + "ports": [ + { + "name": "keyStrm", + "direction": "", + "type": "hls::stream< ap_uint< dataW > > &" + }, + { + "name": "msgStrm", + "direction": "", + "type": "hls::stream< ap_uint< dataW > > &" + }, + { + "name": "msgLenStrm", + "direction": "", + "type": "hls::stream< ap_uint< lW > > &" + }, + { + "name": "eLenStrm", + "direction": "", + "type": "hls::stream< bool > &" + }, + { + "name": "hshStrm", + "direction": "", + "type": "hls::stream< ap_uint< hshW > > &" + }, + { + "name": "eHshStrm", + "direction": "", + "type": "hls::stream< bool > &" + } + ] + } + }, + { + "api_name": "xf::security::keccak_256", + "spec": { + "schema": "vitis_libraries_api_list_schema-1.0", + "api_name": "xf::security::keccak_256", + "display_name": "keccak_256", + "brief": "Top function of KECCAK-256.", + "target_domain": "", + "header_file_name": [ + "keccak256.hpp" + ], + "search_paths": [ + "L1/include/xf_security" + ], + "instance": "function", + "parameters": [], + "ports": [ + { + "name": "msgStrm", + "direction": "", + "type": "hls::stream< ap_uint< 64 > > &" + }, + { + "name": "msgLenStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "endMsgLenStrm", + "direction": "", + "type": "hls::stream< bool > &" + }, + { + "name": "digestStrm", + "direction": "", + "type": "hls::stream< ap_uint< 256 > > &" + }, + { + "name": "endDigestStrm", + "direction": "", + "type": "hls::stream< bool > &" + } + ] + } + }, + { + "api_name": "xf::security::md4", + "spec": { + "schema": "vitis_libraries_api_list_schema-1.0", + "api_name": "xf::security::md4", + "display_name": "md4", + "brief": "Top function of MD4.", + "target_domain": "", + "header_file_name": [ + "md4.hpp" + ], + "search_paths": [ + "L1/include/xf_security" + ], + "instance": "function", + "parameters": [], + "ports": [ + { + "name": "msg_strm", + "direction": "", + "type": "hls::stream< ap_uint< 32 > > &" + }, + { + "name": "len_strm", + "direction": "", + "type": "hls::stream< ap_uint< 64 > > &" + }, + { + "name": "end_len_strm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &digest_strm, hls::stream< bool > &end_digest_strm" + }, + { + "name": "digest_strm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "end_digest_strm", + "direction": "", + "type": "" + } + ] + } + }, + { + "api_name": "xf::security::md5", + "spec": { + "schema": "vitis_libraries_api_list_schema-1.0", + "api_name": "xf::security::md5", + "display_name": "md5", + "brief": "Top function of MD5.", + "target_domain": "", + "header_file_name": [ + "md5.hpp" + ], + "search_paths": [ + "L1/include/xf_security" + ], + "instance": "function", + "parameters": [], + "ports": [ + { + "name": "msg_strm", + "direction": "", + "type": "hls::stream< ap_uint< 32 > > &" + }, + { + "name": "len_strm", + "direction": "", + "type": "hls::stream< ap_uint< 64 > > &" + }, + { + "name": "end_len_strm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &digest_strm, hls::stream< bool > &end_digest_strm" + }, + { + "name": "digest_strm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "end_digest_strm", + "direction": "", + "type": "" + } + ] + } + }, + { + "api_name": "xf::security::desOfbEncrypt", + "spec": { + "schema": "vitis_libraries_api_list_schema-1.0", + "api_name": "xf::security::desOfbEncrypt", + "display_name": "desOfbEncrypt", + "brief": "desOfbEncrypt is OFB encryption mode with DES single block cipher.", + "target_domain": "", + "header_file_name": [ + "ofb.hpp" + ], + "search_paths": [ + "L1/include/xf_security" + ], + "instance": "function", + "parameters": [], + "ports": [ + { + "name": "plaintextStrm", + "direction": "", + "type": "hls::stream< ap_uint< 64 > > &" + }, + { + "name": "endPlaintextStrm", + "direction": "", + "type": "hls::stream< bool > &" + }, + { + "name": "cipherkeyStrm", + "direction": "", + "type": "hls::stream< ap_uint< 64 > > &" + }, + { + "name": "IVStrm", + "direction": "", + "type": "hls::stream< ap_uint< 64 > > &" + }, + { + "name": "ciphertextStrm", + "direction": "", + "type": "hls::stream< ap_uint< 64 > > &" + }, + { + "name": "endCiphertextStrm", + "direction": "", + "type": "hls::stream< bool > &" + } + ] + } + }, + { + "api_name": "xf::security::desOfbDecrypt", + "spec": { + "schema": "vitis_libraries_api_list_schema-1.0", + "api_name": "xf::security::desOfbDecrypt", + "display_name": "desOfbDecrypt", + "brief": "desOfbDecrypt is OFB decryption mode with DES single block cipher.", + "target_domain": "", + "header_file_name": [ + "ofb.hpp" + ], + "search_paths": [ + "L1/include/xf_security" + ], + "instance": "function", + "parameters": [], + "ports": [ + { + "name": "ciphertextStrm", + "direction": "", + "type": "hls::stream< ap_uint< 64 > > &" + }, + { + "name": "endCiphertextStrm", + "direction": "", + "type": "hls::stream< bool > &" + }, + { + "name": "cipherkeyStrm", + "direction": "", + "type": "hls::stream< ap_uint< 64 > > &" + }, + { + "name": "IVStrm", + "direction": "", + "type": "hls::stream< ap_uint< 64 > > &" + }, + { + "name": "plaintextStrm", + "direction": "", + "type": "hls::stream< ap_uint< 64 > > &" + }, + { + "name": "endPlaintextStrm", + "direction": "", + "type": "hls::stream< bool > &" + } + ] + } + }, + { + "api_name": "xf::security::aes128OfbEncrypt", + "spec": { + "schema": "vitis_libraries_api_list_schema-1.0", + "api_name": "xf::security::aes128OfbEncrypt", + "display_name": "aes128OfbEncrypt", + "brief": "aes128OfbEncrypt is OFB encryption mode with AES-128 single block cipher.", + "target_domain": "", + "header_file_name": [ + "ofb.hpp" + ], + "search_paths": [ + "L1/include/xf_security" + ], + "instance": "function", + "parameters": [], + "ports": [ + { + "name": "plaintextStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "endPlaintextStrm", + "direction": "", + "type": "hls::stream< bool > &" + }, + { + "name": "cipherkeyStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "IVStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "ciphertextStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "endCiphertextStrm", + "direction": "", + "type": "hls::stream< bool > &" + } + ] + } + }, + { + "api_name": "xf::security::aes128OfbDecrypt", + "spec": { + "schema": "vitis_libraries_api_list_schema-1.0", + "api_name": "xf::security::aes128OfbDecrypt", + "display_name": "aes128OfbDecrypt", + "brief": "aes128OfbDecrypt is OFB decryption mode with AES-128 single block cipher.", + "target_domain": "", + "header_file_name": [ + "ofb.hpp" + ], + "search_paths": [ + "L1/include/xf_security" + ], + "instance": "function", + "parameters": [], + "ports": [ + { + "name": "ciphertextStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "endCiphertextStrm", + "direction": "", + "type": "hls::stream< bool > &" + }, + { + "name": "cipherkeyStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "IVStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "plaintextStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "endPlaintextStrm", + "direction": "", + "type": "hls::stream< bool > &" + } + ] + } + }, + { + "api_name": "xf::security::aes192OfbEncrypt", + "spec": { + "schema": "vitis_libraries_api_list_schema-1.0", + "api_name": "xf::security::aes192OfbEncrypt", + "display_name": "aes192OfbEncrypt", + "brief": "aes192OfbEncrypt is OFB encryption mode with AES-192 single block cipher.", + "target_domain": "", + "header_file_name": [ + "ofb.hpp" + ], + "search_paths": [ + "L1/include/xf_security" + ], + "instance": "function", + "parameters": [], + "ports": [ + { + "name": "plaintextStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "endPlaintextStrm", + "direction": "", + "type": "hls::stream< bool > &" + }, + { + "name": "cipherkeyStrm", + "direction": "", + "type": "hls::stream< ap_uint< 192 > > &" + }, + { + "name": "IVStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "ciphertextStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "endCiphertextStrm", + "direction": "", + "type": "hls::stream< bool > &" + } + ] + } + }, + { + "api_name": "xf::security::aes192OfbDecrypt", + "spec": { + "schema": "vitis_libraries_api_list_schema-1.0", + "api_name": "xf::security::aes192OfbDecrypt", + "display_name": "aes192OfbDecrypt", + "brief": "aes192OfbDecrypt is OFB decryption mode with AES-192 single block cipher.", + "target_domain": "", + "header_file_name": [ + "ofb.hpp" + ], + "search_paths": [ + "L1/include/xf_security" + ], + "instance": "function", + "parameters": [], + "ports": [ + { + "name": "ciphertextStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "endCiphertextStrm", + "direction": "", + "type": "hls::stream< bool > &" + }, + { + "name": "cipherkeyStrm", + "direction": "", + "type": "hls::stream< ap_uint< 192 > > &" + }, + { + "name": "IVStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "plaintextStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "endPlaintextStrm", + "direction": "", + "type": "hls::stream< bool > &" + } + ] + } + }, + { + "api_name": "xf::security::aes256OfbEncrypt", + "spec": { + "schema": "vitis_libraries_api_list_schema-1.0", + "api_name": "xf::security::aes256OfbEncrypt", + "display_name": "aes256OfbEncrypt", + "brief": "aes256OfbEncrypt is OFB encryption mode with AES-256 single block cipher.", + "target_domain": "", + "header_file_name": [ + "ofb.hpp" + ], + "search_paths": [ + "L1/include/xf_security" + ], + "instance": "function", + "parameters": [], + "ports": [ + { + "name": "plaintextStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "endPlaintextStrm", + "direction": "", + "type": "hls::stream< bool > &" + }, + { + "name": "cipherkeyStrm", + "direction": "", + "type": "hls::stream< ap_uint< 256 > > &" + }, + { + "name": "IVStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "ciphertextStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "endCiphertextStrm", + "direction": "", + "type": "hls::stream< bool > &" + } + ] + } + }, + { + "api_name": "xf::security::aes256OfbDecrypt", + "spec": { + "schema": "vitis_libraries_api_list_schema-1.0", + "api_name": "xf::security::aes256OfbDecrypt", + "display_name": "aes256OfbDecrypt", + "brief": "aes256OfbDecrypt is OFB decryption mode with AES-256 single block cipher.", + "target_domain": "", + "header_file_name": [ + "ofb.hpp" + ], + "search_paths": [ + "L1/include/xf_security" + ], + "instance": "function", + "parameters": [], + "ports": [ + { + "name": "ciphertextStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "endCiphertextStrm", + "direction": "", + "type": "hls::stream< bool > &" + }, + { + "name": "cipherkeyStrm", + "direction": "", + "type": "hls::stream< ap_uint< 256 > > &" + }, + { + "name": "IVStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "plaintextStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "endPlaintextStrm", + "direction": "", + "type": "hls::stream< bool > &" + } + ] + } + }, + { + "api_name": "xf::security::poly1305", + "spec": { + "schema": "vitis_libraries_api_list_schema-1.0", + "api_name": "xf::security::poly1305", + "display_name": "poly1305", + "brief": "The poly1305 takes a 32-byte one-time key and a message and produces a 16-byte tag. This tag is used to authenticate the message.", + "target_domain": "", + "header_file_name": [ + "poly1305.hpp" + ], + "search_paths": [ + "L1/include/xf_security" + ], + "instance": "function", + "parameters": [], + "ports": [ + { + "name": "keyStrm", + "direction": "", + "type": "hls::stream< ap_uint< 256 > > &" + }, + { + "name": "payloadStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "lenPldStrm", + "direction": "", + "type": "hls::stream< ap_uint< 64 > > &" + }, + { + "name": "endLenStrm", + "direction": "", + "type": "hls::stream< bool > &" + }, + { + "name": "tagStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + } + ] + } + }, + { + "api_name": "xf::security::poly1305MultiChan", + "spec": { + "schema": "vitis_libraries_api_list_schema-1.0", + "api_name": "xf::security::poly1305MultiChan", + "display_name": "poly1305MultiChan", + "brief": "The poly1305MultiChan takes N 32-byte one-time keys and N messages and produces N 16-byte tags. These tags are used to authenticate the corresponding messages.", + "target_domain": "", + "header_file_name": [ + "poly1305.hpp" + ], + "search_paths": [ + "L1/include/xf_security" + ], + "instance": "function", + "parameters": [ + { + "name": "N", + "type": "int", + "description": "Channel number" + } + ], + "ports": [ + { + "name": "keyStrm", + "direction": "", + "type": "hls::stream< ap_uint< 256 > > &" + }, + { + "name": "payloadStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "lenPldStrm", + "direction": "", + "type": "hls::stream< ap_uint< 64 > > &" + }, + { + "name": "endLenStrm", + "direction": "", + "type": "hls::stream< bool > &" + }, + { + "name": "tagStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + } + ] + } + }, + { + "api_name": "xf::security::rc4", + "spec": { + "schema": "vitis_libraries_api_list_schema-1.0", + "api_name": "xf::security::rc4", + "display_name": "rc4", + "brief": "Rc_4 is the basic function for stream ciphering keyLength defined as the number of bytes in the key and can be in the range 1<= keylength <=256, typically between 5 and 16, corresponding to a key length of 40-128 bits.", + "target_domain": "", + "header_file_name": [ + "rc4.hpp" + ], + "search_paths": [ + "L1/include/xf_security" + ], + "instance": "function", + "parameters": [], + "ports": [ + { + "name": "keyStrm", + "direction": "", + "type": "hls::stream< ap_uint< 8 > > &" + }, + { + "name": "eKeyStrm", + "direction": "", + "type": "hls::stream< bool > &" + }, + { + "name": "plaintStrm", + "direction": "", + "type": "hls::stream< ap_uint< 8 > > &plainStream, hls::stream< bool > &ePlainStream, hls::stream< ap_uint< 8 > > &cipherStream, hls::stream< bool > &eCipherStream" + }, + { + "name": "ePlaintStrm", + "direction": "", + "type": "hls::stream< ap_uint< 8 > > &plainStream, hls::stream< bool > &ePlainStream, hls::stream< ap_uint< 8 > > &cipherStream, hls::stream< bool > &eCipherStream" + }, + { + "name": "cipherStrm", + "direction": "", + "type": "hls::stream< ap_uint< 8 > > &plainStream, hls::stream< bool > &ePlainStream, hls::stream< ap_uint< 8 > > &cipherStream, hls::stream< bool > &eCipherStream" + }, + { + "name": "eCipherStrm", + "direction": "", + "type": "hls::stream< ap_uint< 8 > > &plainStream, hls::stream< bool > &ePlainStream, hls::stream< ap_uint< 8 > > &cipherStream, hls::stream< bool > &eCipherStream" + } + ] + } + }, + { + "api_name": "xf::security::ripemd160", + "spec": { + "schema": "vitis_libraries_api_list_schema-1.0", + "api_name": "xf::security::ripemd160", + "display_name": "ripemd160", + "brief": "", + "target_domain": "", + "header_file_name": [ + "ripemd.hpp" + ], + "search_paths": [ + "L1/include/xf_security" + ], + "instance": "function", + "parameters": [], + "ports": [] + } + }, + { + "api_name": "xf::security::sha1", + "spec": { + "schema": "vitis_libraries_api_list_schema-1.0", + "api_name": "xf::security::sha1", + "display_name": "sha1", + "brief": "Top function of SHA-1.", + "target_domain": "", + "header_file_name": [ + "sha1.hpp" + ], + "search_paths": [ + "L1/include/xf_security" + ], + "instance": "function", + "parameters": [ + { + "name": "w", + "type": "unsigned int", + "description": "The bit width of each input message word, default value is 32." + } + ], + "ports": [ + { + "name": "msg_strm", + "direction": "", + "type": "hls::stream< ap_uint< w > > &" + }, + { + "name": "len_strm", + "direction": "", + "type": "hls::stream< ap_uint< 64 > > &" + }, + { + "name": "end_len_strm", + "direction": "", + "type": "hls::stream< ap_uint< 5 *w > > &digest_strm, hls::stream< bool > &end_digest_strm" + }, + { + "name": "digest_strm", + "direction": "", + "type": "hls::stream< ap_uint< 5 *w > > &" + }, + { + "name": "end_digest_strm", + "direction": "", + "type": "" + } + ] + } + }, + { + "api_name": "xf::security::sha224", + "spec": { + "schema": "vitis_libraries_api_list_schema-1.0", + "api_name": "xf::security::sha224", + "display_name": "sha224", + "brief": "SHA-224 algorithm with ap_uint stream input and output.", + "target_domain": "", + "header_file_name": [ + "sha224_256.hpp" + ], + "search_paths": [ + "L1/include/xf_security" + ], + "instance": "function", + "parameters": [ + { + "name": "m_width", + "type": "int", + "description": "the input message stream width, currently only 32 allowed." + } + ], + "ports": [ + { + "name": "msg_strm", + "direction": "", + "type": "hls::stream< ap_uint< m_width > > &" + }, + { + "name": "len_strm", + "direction": "", + "type": "hls::stream< ap_uint< 64 > > &" + }, + { + "name": "end_len_strm", + "direction": "", + "type": "hls::stream< ap_uint< 224 > > &hash_strm, hls::stream< bool > &end_hash_strm" + }, + { + "name": "hash_strm", + "direction": "", + "type": "hls::stream< ap_uint< 224 > > &" + }, + { + "name": "end_hash_strm", + "direction": "", + "type": "" + } + ] + } + }, + { + "api_name": "xf::security::sha256", + "spec": { + "schema": "vitis_libraries_api_list_schema-1.0", + "api_name": "xf::security::sha256", + "display_name": "sha256", + "brief": "SHA-256 algorithm with ap_uint stream input and output.", + "target_domain": "", + "header_file_name": [ + "sha224_256.hpp" + ], + "search_paths": [ + "L1/include/xf_security" + ], + "instance": "function", + "parameters": [ + { + "name": "m_width", + "type": "int", + "description": "the input message stream width, currently only 32 allowed." + } + ], + "ports": [ + { + "name": "msg_strm", + "direction": "", + "type": "hls::stream< ap_uint< m_width > > &" + }, + { + "name": "len_strm", + "direction": "", + "type": "hls::stream< ap_uint< 64 > > &" + }, + { + "name": "end_len_strm", + "direction": "", + "type": "hls::stream< ap_uint< 256 > > &hash_strm, hls::stream< bool > &end_hash_strm" + }, + { + "name": "hash_strm", + "direction": "", + "type": "hls::stream< ap_uint< 256 > > &" + }, + { + "name": "end_hash_strm", + "direction": "", + "type": "" + } + ] + } + }, + { + "api_name": "xf::security::sha3_224", + "spec": { + "schema": "vitis_libraries_api_list_schema-1.0", + "api_name": "xf::security::sha3_224", + "display_name": "sha3_224", + "brief": "Top function of SHA3-224.", + "target_domain": "", + "header_file_name": [ + "sha3.hpp" + ], + "search_paths": [ + "L1/include/xf_security" + ], + "instance": "function", + "parameters": [], + "ports": [ + { + "name": "msgStrm", + "direction": "", + "type": "hls::stream< ap_uint< 64 > > &" + }, + { + "name": "msgLenStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "endMsgLenStrm", + "direction": "", + "type": "hls::stream< bool > &" + }, + { + "name": "digestStrm", + "direction": "", + "type": "hls::stream< ap_uint< 224 > > &" + }, + { + "name": "endDigestStrm", + "direction": "", + "type": "hls::stream< bool > &" + } + ] + } + }, + { + "api_name": "xf::security::sha3_256", + "spec": { + "schema": "vitis_libraries_api_list_schema-1.0", + "api_name": "xf::security::sha3_256", + "display_name": "sha3_256", + "brief": "Top function of SHA3-256.", + "target_domain": "", + "header_file_name": [ + "sha3.hpp" + ], + "search_paths": [ + "L1/include/xf_security" + ], + "instance": "function", + "parameters": [], + "ports": [ + { + "name": "msgStrm", + "direction": "", + "type": "hls::stream< ap_uint< 64 > > &" + }, + { + "name": "msgLenStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "endMsgLenStrm", + "direction": "", + "type": "hls::stream< bool > &" + }, + { + "name": "digestStrm", + "direction": "", + "type": "hls::stream< ap_uint< 256 > > &" + }, + { + "name": "endDigestStrm", + "direction": "", + "type": "hls::stream< bool > &" + } + ] + } + }, + { + "api_name": "xf::security::sha3_384", + "spec": { + "schema": "vitis_libraries_api_list_schema-1.0", + "api_name": "xf::security::sha3_384", + "display_name": "sha3_384", + "brief": "Top function of SHA3-384.", + "target_domain": "", + "header_file_name": [ + "sha3.hpp" + ], + "search_paths": [ + "L1/include/xf_security" + ], + "instance": "function", + "parameters": [], + "ports": [ + { + "name": "msgStrm", + "direction": "", + "type": "hls::stream< ap_uint< 64 > > &" + }, + { + "name": "msgLenStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "endMsgLenStrm", + "direction": "", + "type": "hls::stream< bool > &" + }, + { + "name": "digestStrm", + "direction": "", + "type": "hls::stream< ap_uint< 384 > > &" + }, + { + "name": "endDigestStrm", + "direction": "", + "type": "hls::stream< bool > &" + } + ] + } + }, + { + "api_name": "xf::security::sha3_512", + "spec": { + "schema": "vitis_libraries_api_list_schema-1.0", + "api_name": "xf::security::sha3_512", + "display_name": "sha3_512", + "brief": "Top function of SHA3-512.", + "target_domain": "", + "header_file_name": [ + "sha3.hpp" + ], + "search_paths": [ + "L1/include/xf_security" + ], + "instance": "function", + "parameters": [], + "ports": [ + { + "name": "msgStrm", + "direction": "", + "type": "hls::stream< ap_uint< 64 > > &" + }, + { + "name": "msgLenStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "endMsgLenStrm", + "direction": "", + "type": "hls::stream< bool > &" + }, + { + "name": "digestStrm", + "direction": "", + "type": "hls::stream< ap_uint< 512 > > &" + }, + { + "name": "endDigestStrm", + "direction": "", + "type": "hls::stream< bool > &" + } + ] + } + }, + { + "api_name": "xf::security::shake128", + "spec": { + "schema": "vitis_libraries_api_list_schema-1.0", + "api_name": "xf::security::shake128", + "display_name": "shake128", + "brief": "Top function of SHAKE-128.", + "target_domain": "", + "header_file_name": [ + "sha3.hpp" + ], + "search_paths": [ + "L1/include/xf_security" + ], + "instance": "function", + "parameters": [], + "ports": [ + { + "name": "msgStrm", + "direction": "", + "type": "hls::stream< ap_uint< 64 > > &" + }, + { + "name": "msgLenStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "endMsgLenStrm", + "direction": "", + "type": "hls::stream< bool > &" + }, + { + "name": "digestStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "endDigestStrm", + "direction": "", + "type": "hls::stream< bool > &" + } + ] + } + }, + { + "api_name": "xf::security::shake256", + "spec": { + "schema": "vitis_libraries_api_list_schema-1.0", + "api_name": "xf::security::shake256", + "display_name": "shake256", + "brief": "Top function of SHAKE-256.", + "target_domain": "", + "header_file_name": [ + "sha3.hpp" + ], + "search_paths": [ + "L1/include/xf_security" + ], + "instance": "function", + "parameters": [], + "ports": [ + { + "name": "msgStrm", + "direction": "", + "type": "hls::stream< ap_uint< 64 > > &" + }, + { + "name": "msgLenStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "endMsgLenStrm", + "direction": "", + "type": "hls::stream< bool > &" + }, + { + "name": "digestStrm", + "direction": "", + "type": "hls::stream< ap_uint< 256 > > &" + }, + { + "name": "endDigestStrm", + "direction": "", + "type": "hls::stream< bool > &" + } + ] + } + }, + { + "api_name": "xf::security::sha384", + "spec": { + "schema": "vitis_libraries_api_list_schema-1.0", + "api_name": "xf::security::sha384", + "display_name": "sha384", + "brief": "SHA-384 algorithm with stream input and output.", + "target_domain": "", + "header_file_name": [ + "sha512_t.hpp" + ], + "search_paths": [ + "L1/include/xf_security" + ], + "instance": "function", + "parameters": [ + { + "name": "w", + "type": "unsigned int", + "description": "The bit width of each input message word, default value is 64." + } + ], + "ports": [ + { + "name": "msg_strm", + "direction": "", + "type": "hls::stream< ap_uint< w > > &" + }, + { + "name": "len_strm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "end_len_strm", + "direction": "", + "type": "hls::stream< ap_uint< 384 > > &digest_strm, hls::stream< bool > &end_digest_strm" + }, + { + "name": "digest_strm", + "direction": "", + "type": "hls::stream< ap_uint< 384 > > &" + }, + { + "name": "end_digest_strm", + "direction": "", + "type": "" + } + ] + } + }, + { + "api_name": "xf::security::sha512", + "spec": { + "schema": "vitis_libraries_api_list_schema-1.0", + "api_name": "xf::security::sha512", + "display_name": "sha512", + "brief": "SHA-512 algorithm with stream input and output.", + "target_domain": "", + "header_file_name": [ + "sha512_t.hpp" + ], + "search_paths": [ + "L1/include/xf_security" + ], + "instance": "function", + "parameters": [ + { + "name": "w", + "type": "unsigned int", + "description": "The bit width of each input message word, default value is 64." + } + ], + "ports": [ + { + "name": "msg_strm", + "direction": "", + "type": "hls::stream< ap_uint< w > > &" + }, + { + "name": "len_strm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "end_len_strm", + "direction": "", + "type": "hls::stream< ap_uint< 512 > > &digest_strm, hls::stream< bool > &end_digest_strm" + }, + { + "name": "digest_strm", + "direction": "", + "type": "hls::stream< ap_uint< 512 > > &" + }, + { + "name": "end_digest_strm", + "direction": "", + "type": "" + } + ] + } + }, + { + "api_name": "xf::security::sha512_t", + "spec": { + "schema": "vitis_libraries_api_list_schema-1.0", + "api_name": "xf::security::sha512_t", + "display_name": "sha512_t", + "brief": "SHA-512/t algorithm with stream input and output.", + "target_domain": "", + "header_file_name": [ + "sha512_t.hpp" + ], + "search_paths": [ + "L1/include/xf_security" + ], + "instance": "function", + "parameters": [ + { + "name": "w", + "type": "unsigned int", + "description": "The bit width of each input message word, default value is 64." + }, + { + "name": "t", + "type": "unsigned in", + "description": "The bit width of the digest which depends on specific algorithm, typically is 224 or 256." + } + ], + "ports": [ + { + "name": "msg_strm", + "direction": "", + "type": "hls::stream< ap_uint< w > > &" + }, + { + "name": "len_strm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "end_len_strm", + "direction": "", + "type": "hls::stream< ap_uint< t > > &digest_strm, hls::stream< bool > &end_digest_strm" + }, + { + "name": "digest_strm", + "direction": "", + "type": "hls::stream< ap_uint< t > > &" + }, + { + "name": "end_digest_strm", + "direction": "", + "type": "" + } + ] + } + }, + { + "api_name": "xf::security::sm3", + "spec": { + "schema": "vitis_libraries_api_list_schema-1.0", + "api_name": "xf::security::sm3", + "display_name": "sm3", + "brief": "SM3 function to genrate digest value for input messages.", + "target_domain": "", + "header_file_name": [ + "sm234.hpp" + ], + "search_paths": [ + "L1/include/xf_security" + ], + "instance": "function", + "parameters": [], + "ports": [ + { + "name": "msgStrm", + "direction": "", + "type": "hls::stream< ap_uint< 64 > > &" + }, + { + "name": "lenStrm", + "direction": "", + "type": "hls::stream< ap_uint< 64 > > &" + }, + { + "name": "endLenStrm", + "direction": "", + "type": "hls::stream< bool > &" + }, + { + "name": "hashStrm", + "direction": "", + "type": "hls::stream< ap_uint< 256 > > &" + }, + { + "name": "endHashStrm", + "direction": "", + "type": "hls::stream< bool > &" + } + ] + } + }, + { + "api_name": "xf::security::evaluate", + "spec": { + "schema": "vitis_libraries_api_list_schema-1.0", + "api_name": "xf::security::evaluate", + "display_name": "evaluate", + "brief": "", + "target_domain": "", + "header_file_name": [ + "vdf.hpp" + ], + "search_paths": [ + "L1/include/xf_security" + ], + "instance": "function", + "parameters": [ + { + "name": "L", + "type": "int", + "description": "bit width" + }, + { + "name": "N", + "type": "int", + "description": "bit width" + } + ], + "ports": [ + { + "name": "g", + "direction": "", + "type": "ap_uint< L >" + }, + { + "name": "l", + "direction": "", + "type": "ap_uint< L >us," + }, + { + "name": "modulus", + "direction": "", + "type": "ap_uint< L > r2Mod, ap_uint< N > t, ap_uint< L > &y, ap_uint< L > &p" + }, + { + "name": "r2Mod", + "direction": "", + "type": "ap_uint< L >" + }, + { + "name": "t", + "direction": "", + "type": "ap_uin" + }, + { + "name": "y", + "direction": "", + "type": "< L > &p" + }, + { + "name": "pi", + "direction": "", + "type": "< L > &p" + } + ] + } + }, + { + "api_name": "xf::security::verifyWesolowski", + "spec": { + "schema": "vitis_libraries_api_list_schema-1.0", + "api_name": "xf::security::verifyWesolowski", + "display_name": "verifyWesolowski", + "brief": "", + "target_domain": "", + "header_file_name": [ + "vdf.hpp" + ], + "search_paths": [ + "L1/include/xf_security" + ], + "instance": "function", + "parameters": [ + { + "name": "L", + "type": "int", + "description": "bit width" + }, + { + "name": "N", + "type": "int", + "description": "bit width" + } + ], + "ports": [ + { + "name": "g", + "direction": "", + "type": "ap_uint< L >" + }, + { + "name": "l", + "direction": "", + "type": "ap_uint< L >us," + }, + { + "name": "modulus", + "direction": "", + "type": "ap_uint< L > r2Mod, ap_uint< L > tMod, ap_uint< N > t, ap_uint< L > y, ap_uint< L > &p" + }, + { + "name": "r2Mod", + "direction": "", + "type": "ap_uint< L >" + }, + { + "name": "tMod", + "direction": "", + "type": "ap_uint< L >" + }, + { + "name": "t", + "direction": "", + "type": "ap_uin" + }, + { + "name": "y", + "direction": "", + "type": "< L > &p" + }, + { + "name": "pi", + "direction": "", + "type": "< L > &p" + } + ] + } + }, + { + "api_name": "xf::security::verifyPietrzak", + "spec": { + "schema": "vitis_libraries_api_list_schema-1.0", + "api_name": "xf::security::verifyPietrzak", + "display_name": "verifyPietrzak", + "brief": "verifyPietrzak verify function of verifiable delay function, its algorithm: if T is even, return (N, x, T/2, y) = (N, x^(r+2^(T/2)), T/2, x^(r*2^(T/2)+2^T)), if T is odd, return (N, x, (T+1)/2, y) = (N, x^(r+2^((T-1)/2)), T/2, x^(r*2^((T+1)/2)+2^T))", + "target_domain": "", + "header_file_name": [ + "vdf.hpp" + ], + "search_paths": [ + "L1/include/xf_security" + ], + "instance": "function", + "parameters": [ + { + "name": "L", + "type": "int", + "description": "bit width" + }, + { + "name": "N", + "type": "int", + "description": "bit width" + } + ], + "ports": [ + { + "name": "g", + "direction": "", + "type": "ap_uint< L >" + }, + { + "name": "modulus", + "direction": "", + "type": "ap_uint< L >" + }, + { + "name": "r2Mod", + "direction": "", + "type": "ap_uint< L >" + }, + { + "name": "T", + "direction": "", + "type": "ap_uint< N >" + }, + { + "name": "y", + "direction": "", + "type": "ap_uint< L >" + } + ] + } + }, + { + "api_name": "xf::security::aes128XtsEncrypt", + "spec": { + "schema": "vitis_libraries_api_list_schema-1.0", + "api_name": "xf::security::aes128XtsEncrypt", + "display_name": "aes128XtsEncrypt", + "brief": "aes128XtsEncrypt is XTS encryption mode with AES-128 single block cipher.", + "target_domain": "", + "header_file_name": [ + "xts.hpp" + ], + "search_paths": [ + "L1/include/xf_security" + ], + "instance": "function", + "parameters": [], + "ports": [ + { + "name": "plaintextStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "endPlaintextStrm", + "direction": "", + "type": "hls::stream< bool > &" + }, + { + "name": "lenStrm", + "direction": "", + "type": "hls::stream< ap_uint< 64 > > &" + }, + { + "name": "cipherkeyStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "IVStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "ciphertextStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "endCiphertextStrm", + "direction": "", + "type": "hls::stream< bool > &" + } + ] + } + }, + { + "api_name": "xf::security::aes128XtsDecrypt", + "spec": { + "schema": "vitis_libraries_api_list_schema-1.0", + "api_name": "xf::security::aes128XtsDecrypt", + "display_name": "aes128XtsDecrypt", + "brief": "aes128XtsDecrypt is XTS decryption mode with AES-128 single block cipher.", + "target_domain": "", + "header_file_name": [ + "xts.hpp" + ], + "search_paths": [ + "L1/include/xf_security" + ], + "instance": "function", + "parameters": [], + "ports": [ + { + "name": "ciphertextStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "endCiphertextStrm", + "direction": "", + "type": "hls::stream< bool > &" + }, + { + "name": "lenStrm", + "direction": "", + "type": "hls::stream< ap_uint< 64 > > &" + }, + { + "name": "cipherkeyStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "IVStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "plaintextStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "endPlaintextStrm", + "direction": "", + "type": "hls::stream< bool > &" + } + ] + } + }, + { + "api_name": "xf::security::aes256XtsEncrypt", + "spec": { + "schema": "vitis_libraries_api_list_schema-1.0", + "api_name": "xf::security::aes256XtsEncrypt", + "display_name": "aes256XtsEncrypt", + "brief": "aes256XtsEncrypt is XTS encryption mode with AES-256 single block cipher.", + "target_domain": "", + "header_file_name": [ + "xts.hpp" + ], + "search_paths": [ + "L1/include/xf_security" + ], + "instance": "function", + "parameters": [], + "ports": [ + { + "name": "plaintextStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "endPlaintextStrm", + "direction": "", + "type": "hls::stream< bool > &" + }, + { + "name": "lenStrm", + "direction": "", + "type": "hls::stream< ap_uint< 64 > > &" + }, + { + "name": "cipherkeyStrm", + "direction": "", + "type": "hls::stream< ap_uint< 256 > > &" + }, + { + "name": "IVStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "ciphertextStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "endCiphertextStrm", + "direction": "", + "type": "hls::stream< bool > &" + } + ] + } + }, + { + "api_name": "xf::security::aes256XtsDecrypt", + "spec": { + "schema": "vitis_libraries_api_list_schema-1.0", + "api_name": "xf::security::aes256XtsDecrypt", + "display_name": "aes256XtsDecrypt", + "brief": "aes256XtsDecrypt is XTS decryption mode with AES-256 single block cipher.", + "target_domain": "", + "header_file_name": [ + "xts.hpp" + ], + "search_paths": [ + "L1/include/xf_security" + ], + "instance": "function", + "parameters": [], + "ports": [ + { + "name": "ciphertextStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "endCiphertextStrm", + "direction": "", + "type": "hls::stream< bool > &" + }, + { + "name": "lenStrm", + "direction": "", + "type": "hls::stream< ap_uint< 64 > > &" + }, + { + "name": "cipherkeyStrm", + "direction": "", + "type": "hls::stream< ap_uint< 256 > > &" + }, + { + "name": "IVStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "plaintextStrm", + "direction": "", + "type": "hls::stream< ap_uint< 128 > > &" + }, + { + "name": "endPlaintextStrm", + "direction": "", + "type": "hls::stream< bool > &" + } + ] + } + } + ], + "target_domain": "" +} \ No newline at end of file diff --git a/security/L1/tests/adler32/Makefile b/security/L1/tests/adler32/Makefile index 650e876b73..2d64289db9 100644 --- a/security/L1/tests/adler32/Makefile +++ b/security/L1/tests/adler32/Makefile @@ -1,5 +1,5 @@ # -# Copyright 2019 Xilinx, Inc. +# Copyright 2019-2020 Xilinx, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -16,7 +16,7 @@ MK_PATH := $(abspath $(lastword $(MAKEFILE_LIST))) CUR_DIR := $(patsubst %/,%,$(dir $(MK_PATH))) -XF_PROJ_ROOT ?= $(shell bash -c 'export MK_PATH=$(MK_PATH); echo $${MK_PATH%L1/tests/*}') +XF_PROJ_ROOT ?= $(shell bash -c 'export MK_PATH=$(MK_PATH); echo $${MK_PATH%/L1/*}') # MK_INC_BEGIN hls_common.mk @@ -51,13 +51,6 @@ help:: # MK_INC_BEGIN vivado.mk -TOOL_VERSION ?= 2019.2 - -ifeq (,$(XILINX_VIVADO)) -XILINX_VIVADO = /opt/xilinx/Vivado/$(TOOL_VERSION) -endif -export XILINX_VIVADO - .PHONY: check_vivado check_vivado: ifeq (,$(wildcard $(XILINX_VIVADO)/bin/vivado)) @@ -72,27 +65,14 @@ DEVICE ?= u200 # MK_INC_BEGIN vitis_set_part.mk -.PHONY: check_part - -ifeq (,$(XPART)) # MK_INC_BEGIN vitis.mk -TOOL_VERSION ?= 2019.2 - -ifeq (,$(XILINX_VITIS)) -XILINX_VITIS = /opt/xilinx/Vitis/$(TOOL_VERSION) -endif -export XILINX_VITIS .PHONY: check_vpp check_vpp: ifeq (,$(wildcard $(XILINX_VITIS)/bin/v++)) @echo "Cannot locate Vitis installation. Please set XILINX_VITIS variable." && false endif -ifeq (,$(XILINX_XRT)) -XILINX_XRT = /opt/xilinx/xrt -endif -export XILINX_XRT .PHONY: check_xrt check_xrt: ifeq (,$(wildcard $(XILINX_XRT)/lib/libxilinxopencl.so)) @@ -111,6 +91,10 @@ export LD_LIBRARY_PATH := $(shell $(XILINX_VITIS)/bin/ldlibpath.sh $(XILINX_VITI endif # MK_INC_END vitis.mk + +.PHONY: check_part + +ifeq (,$(XPART)) # MK_INC_BEGIN vitis_set_platform.mk ifneq (,$(wildcard $(DEVICE))) @@ -119,31 +103,48 @@ XPLATFORM := $(DEVICE) else # Use DEVICE as a file name pattern DEVICE_L := $(shell echo $(DEVICE) | tr A-Z a-z) -# Match the name +# 1. search paths specified by variable ifneq (,$(PLATFORM_REPO_PATHS)) +# 1.1 as exact name +XPLATFORM := $(strip $(foreach p, $(subst :, ,$(PLATFORM_REPO_PATHS)), $(wildcard $(p)/$(DEVICE_L)/$(DEVICE_L).xpfm))) +# 1.2 as a pattern +ifeq (,$(XPLATFORM)) XPLATFORMS := $(foreach p, $(subst :, ,$(PLATFORM_REPO_PATHS)), $(wildcard $(p)/*/*.xpfm)) XPLATFORM := $(strip $(foreach p, $(XPLATFORMS), $(shell echo $(p) | awk '$$1 ~ /$(DEVICE_L)/'))) -endif +endif # 1.2 +endif # 1 +# 2. search Vitis installation +ifeq (,$(XPLATFORM)) +# 2.1 as exact name +XPLATFORM := $(strip $(wildcard $(XILINX_VITIS)/platforms/$(DEVICE_L)/$(DEVICE_L).xpfm)) +# 2.2 as a pattern ifeq (,$(XPLATFORM)) XPLATFORMS := $(wildcard $(XILINX_VITIS)/platforms/*/*.xpfm) XPLATFORM := $(strip $(foreach p, $(XPLATFORMS), $(shell echo $(p) | awk '$$1 ~ /$(DEVICE_L)/'))) -endif +endif # 2.2 +endif # 2 +# 3. search default locations +ifeq (,$(XPLATFORM)) +# 3.1 as exact name +XPLATFORM := $(strip $(wildcard /opt/xilinx/platforms/$(DEVICE_L)/$(DEVICE_L).xpfm)) +# 3.2 as a pattern ifeq (,$(XPLATFORM)) XPLATFORMS := $(wildcard /opt/xilinx/platforms/*/*.xpfm) XPLATFORM := $(strip $(foreach p, $(XPLATFORMS), $(shell echo $(p) | awk '$$1 ~ /$(DEVICE_L)/'))) -endif +endif # 3.2 +endif # 3 endif define MSG_PLATFORM No platform matched pattern '$(DEVICE)'. Available platforms are: $(XPLATFORMS) -To add more platform directories, set the PLATFORM_REPO_PATHS variable. +To add more platform directories, set the PLATFORM_REPO_PATHS variable or point DEVICE variable to the full path of platform .xpfm file. endef export MSG_PLATFORM define MSG_DEVICE More than one platform matched: $(XPLATFORM) -Please set DEVICE variable more accurately to select only one platform file. For example: DEVICE='u200.*xdma' +Please set DEVICE variable more accurately to select only one platform file, or set DEVICE variable to the full path of the platform .xpfm file. endef export MSG_DEVICE @@ -211,7 +212,11 @@ ifeq (1,$(COSIM)) override CSYNTH := 1 endif -run: setup runhls +# From testbench.data_recipe of description.json +data: + @true + +run: data setup runhls setup: | check_part @rm -f ./settings.tcl @@ -222,15 +227,15 @@ setup: | check_part @echo 'set COSIM $(COSIM)' >> ./settings.tcl @echo 'set VIVADO_SYN $(VIVADO_SYN)' >> ./settings.tcl @echo 'set VIVADO_IMPL $(VIVADO_IMPL)' >> ./settings.tcl - @echo 'set QOR_CHECK $(QOR_CHECK)' >> ./settings.tcl @echo 'set XF_PROJ_ROOT "$(XF_PROJ_ROOT)"' >> ./settings.tcl + @echo 'set CUR_DIR "$(CUR_DIR)"' >> ./settings.tcl @echo "Configured: settings.tcl" @echo "----" @cat ./settings.tcl @echo "----" HLS ?= vitis_hls -runhls: setup | check_vivado +runhls: data setup | check_vivado check_vpp $(HLS) -f run_hls.tcl; clean: @@ -239,4 +244,4 @@ clean: # Used by Jenkins test cleanall: clean -# MK_INC_END hls_test_rules.mk +# MK_INC_END hls_test_rules.mk \ No newline at end of file diff --git a/security/L1/tests/adler32/description.json b/security/L1/tests/adler32/description.json index 92000b00ab..d0f481f654 100644 --- a/security/L1/tests/adler32/description.json +++ b/security/L1/tests/adler32/description.json @@ -2,27 +2,28 @@ "name": "Xilinx Adler32", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "adler32", "solution": "sol", "clock": "3.33", "topfunction": "dut", "top": { "source": [ - "tb.cpp" + "dut.cpp" ], "cflags": "-I${XF_PROJ_ROOT}/L1/include" }, "testbench": { "source": [ - "tb.cpp" + "tb.cpp", + "test.dat" ], "cflags": "-I${XF_PROJ_ROOT}/L1/include", "argv": {}, @@ -37,17 +38,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -56,10 +57,10 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, "clock_uncertainty": 1.05 -} \ No newline at end of file +} diff --git a/security/L1/tests/adler32/run_hls.tcl b/security/L1/tests/adler32/run_hls.tcl index f57b937e86..ca1169ec78 100644 --- a/security/L1/tests/adler32/run_hls.tcl +++ b/security/L1/tests/adler32/run_hls.tcl @@ -1,5 +1,5 @@ # -# Copyright 2019 Xilinx, Inc. +# Copyright 2019-2021 Xilinx, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -25,14 +25,15 @@ if {![info exists CLKP]} { open_project -reset $PROJ -set cflags "-std=c++14" -add_files "dut.cpp" -cflags "-I${XF_PROJ_ROOT}/L1/include" -add_files -tb "tb.cpp" -cflags "-I${XF_PROJ_ROOT}/L1/include" -add_files -tb test.dat +add_files "dut.cpp" -cflags "-I${XF_PROJ_ROOT}/L1/include -std=c++14" +add_files -tb "tb.cpp test.dat" -cflags "-I${XF_PROJ_ROOT}/L1/include" set_top dut open_solution -reset $SOLN + + + set_part $XPART create_clock -period $CLKP set_clock_uncertainty 1.05 @@ -57,8 +58,4 @@ if {$VIVADO_IMPL == 1} { export_design -flow impl -rtl verilog } -if {$QOR_CHECK == 1} { - puts "QoR check not implemented yet" -} - -exit +exit \ No newline at end of file diff --git a/security/L1/tests/adler32_sizeLess/Makefile b/security/L1/tests/adler32_sizeLess/Makefile index 650e876b73..2d64289db9 100644 --- a/security/L1/tests/adler32_sizeLess/Makefile +++ b/security/L1/tests/adler32_sizeLess/Makefile @@ -1,5 +1,5 @@ # -# Copyright 2019 Xilinx, Inc. +# Copyright 2019-2020 Xilinx, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -16,7 +16,7 @@ MK_PATH := $(abspath $(lastword $(MAKEFILE_LIST))) CUR_DIR := $(patsubst %/,%,$(dir $(MK_PATH))) -XF_PROJ_ROOT ?= $(shell bash -c 'export MK_PATH=$(MK_PATH); echo $${MK_PATH%L1/tests/*}') +XF_PROJ_ROOT ?= $(shell bash -c 'export MK_PATH=$(MK_PATH); echo $${MK_PATH%/L1/*}') # MK_INC_BEGIN hls_common.mk @@ -51,13 +51,6 @@ help:: # MK_INC_BEGIN vivado.mk -TOOL_VERSION ?= 2019.2 - -ifeq (,$(XILINX_VIVADO)) -XILINX_VIVADO = /opt/xilinx/Vivado/$(TOOL_VERSION) -endif -export XILINX_VIVADO - .PHONY: check_vivado check_vivado: ifeq (,$(wildcard $(XILINX_VIVADO)/bin/vivado)) @@ -72,27 +65,14 @@ DEVICE ?= u200 # MK_INC_BEGIN vitis_set_part.mk -.PHONY: check_part - -ifeq (,$(XPART)) # MK_INC_BEGIN vitis.mk -TOOL_VERSION ?= 2019.2 - -ifeq (,$(XILINX_VITIS)) -XILINX_VITIS = /opt/xilinx/Vitis/$(TOOL_VERSION) -endif -export XILINX_VITIS .PHONY: check_vpp check_vpp: ifeq (,$(wildcard $(XILINX_VITIS)/bin/v++)) @echo "Cannot locate Vitis installation. Please set XILINX_VITIS variable." && false endif -ifeq (,$(XILINX_XRT)) -XILINX_XRT = /opt/xilinx/xrt -endif -export XILINX_XRT .PHONY: check_xrt check_xrt: ifeq (,$(wildcard $(XILINX_XRT)/lib/libxilinxopencl.so)) @@ -111,6 +91,10 @@ export LD_LIBRARY_PATH := $(shell $(XILINX_VITIS)/bin/ldlibpath.sh $(XILINX_VITI endif # MK_INC_END vitis.mk + +.PHONY: check_part + +ifeq (,$(XPART)) # MK_INC_BEGIN vitis_set_platform.mk ifneq (,$(wildcard $(DEVICE))) @@ -119,31 +103,48 @@ XPLATFORM := $(DEVICE) else # Use DEVICE as a file name pattern DEVICE_L := $(shell echo $(DEVICE) | tr A-Z a-z) -# Match the name +# 1. search paths specified by variable ifneq (,$(PLATFORM_REPO_PATHS)) +# 1.1 as exact name +XPLATFORM := $(strip $(foreach p, $(subst :, ,$(PLATFORM_REPO_PATHS)), $(wildcard $(p)/$(DEVICE_L)/$(DEVICE_L).xpfm))) +# 1.2 as a pattern +ifeq (,$(XPLATFORM)) XPLATFORMS := $(foreach p, $(subst :, ,$(PLATFORM_REPO_PATHS)), $(wildcard $(p)/*/*.xpfm)) XPLATFORM := $(strip $(foreach p, $(XPLATFORMS), $(shell echo $(p) | awk '$$1 ~ /$(DEVICE_L)/'))) -endif +endif # 1.2 +endif # 1 +# 2. search Vitis installation +ifeq (,$(XPLATFORM)) +# 2.1 as exact name +XPLATFORM := $(strip $(wildcard $(XILINX_VITIS)/platforms/$(DEVICE_L)/$(DEVICE_L).xpfm)) +# 2.2 as a pattern ifeq (,$(XPLATFORM)) XPLATFORMS := $(wildcard $(XILINX_VITIS)/platforms/*/*.xpfm) XPLATFORM := $(strip $(foreach p, $(XPLATFORMS), $(shell echo $(p) | awk '$$1 ~ /$(DEVICE_L)/'))) -endif +endif # 2.2 +endif # 2 +# 3. search default locations +ifeq (,$(XPLATFORM)) +# 3.1 as exact name +XPLATFORM := $(strip $(wildcard /opt/xilinx/platforms/$(DEVICE_L)/$(DEVICE_L).xpfm)) +# 3.2 as a pattern ifeq (,$(XPLATFORM)) XPLATFORMS := $(wildcard /opt/xilinx/platforms/*/*.xpfm) XPLATFORM := $(strip $(foreach p, $(XPLATFORMS), $(shell echo $(p) | awk '$$1 ~ /$(DEVICE_L)/'))) -endif +endif # 3.2 +endif # 3 endif define MSG_PLATFORM No platform matched pattern '$(DEVICE)'. Available platforms are: $(XPLATFORMS) -To add more platform directories, set the PLATFORM_REPO_PATHS variable. +To add more platform directories, set the PLATFORM_REPO_PATHS variable or point DEVICE variable to the full path of platform .xpfm file. endef export MSG_PLATFORM define MSG_DEVICE More than one platform matched: $(XPLATFORM) -Please set DEVICE variable more accurately to select only one platform file. For example: DEVICE='u200.*xdma' +Please set DEVICE variable more accurately to select only one platform file, or set DEVICE variable to the full path of the platform .xpfm file. endef export MSG_DEVICE @@ -211,7 +212,11 @@ ifeq (1,$(COSIM)) override CSYNTH := 1 endif -run: setup runhls +# From testbench.data_recipe of description.json +data: + @true + +run: data setup runhls setup: | check_part @rm -f ./settings.tcl @@ -222,15 +227,15 @@ setup: | check_part @echo 'set COSIM $(COSIM)' >> ./settings.tcl @echo 'set VIVADO_SYN $(VIVADO_SYN)' >> ./settings.tcl @echo 'set VIVADO_IMPL $(VIVADO_IMPL)' >> ./settings.tcl - @echo 'set QOR_CHECK $(QOR_CHECK)' >> ./settings.tcl @echo 'set XF_PROJ_ROOT "$(XF_PROJ_ROOT)"' >> ./settings.tcl + @echo 'set CUR_DIR "$(CUR_DIR)"' >> ./settings.tcl @echo "Configured: settings.tcl" @echo "----" @cat ./settings.tcl @echo "----" HLS ?= vitis_hls -runhls: setup | check_vivado +runhls: data setup | check_vivado check_vpp $(HLS) -f run_hls.tcl; clean: @@ -239,4 +244,4 @@ clean: # Used by Jenkins test cleanall: clean -# MK_INC_END hls_test_rules.mk +# MK_INC_END hls_test_rules.mk \ No newline at end of file diff --git a/security/L1/tests/adler32_sizeLess/description.json b/security/L1/tests/adler32_sizeLess/description.json index da6ba8934c..c096c96bed 100644 --- a/security/L1/tests/adler32_sizeLess/description.json +++ b/security/L1/tests/adler32_sizeLess/description.json @@ -2,27 +2,28 @@ "name": "Xilinx Adler32 size-less version", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "adler32", "solution": "sol", "clock": "3.33", "topfunction": "dut", "top": { "source": [ - "tb.cpp" + "dut.cpp" ], "cflags": "-I${XF_PROJ_ROOT}/L1/include" }, "testbench": { "source": [ - "tb.cpp" + "tb.cpp", + "test.dat" ], "cflags": "-I${XF_PROJ_ROOT}/L1/include", "argv": {}, @@ -37,17 +38,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -56,10 +57,10 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, "clock_uncertainty": 1.05 -} \ No newline at end of file +} diff --git a/security/L1/tests/adler32_sizeLess/run_hls.tcl b/security/L1/tests/adler32_sizeLess/run_hls.tcl index f57b937e86..5cc329d12b 100644 --- a/security/L1/tests/adler32_sizeLess/run_hls.tcl +++ b/security/L1/tests/adler32_sizeLess/run_hls.tcl @@ -1,5 +1,5 @@ # -# Copyright 2019 Xilinx, Inc. +# Copyright 2019-2021 Xilinx, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -25,14 +25,15 @@ if {![info exists CLKP]} { open_project -reset $PROJ -set cflags "-std=c++14" add_files "dut.cpp" -cflags "-I${XF_PROJ_ROOT}/L1/include" -add_files -tb "tb.cpp" -cflags "-I${XF_PROJ_ROOT}/L1/include" -add_files -tb test.dat +add_files -tb "tb.cpp test.dat" -cflags "-I${XF_PROJ_ROOT}/L1/include" set_top dut open_solution -reset $SOLN + + + set_part $XPART create_clock -period $CLKP set_clock_uncertainty 1.05 @@ -57,8 +58,4 @@ if {$VIVADO_IMPL == 1} { export_design -flow impl -rtl verilog } -if {$QOR_CHECK == 1} { - puts "QoR check not implemented yet" -} - -exit +exit \ No newline at end of file diff --git a/security/L1/tests/adler32_sizeLess2/Makefile b/security/L1/tests/adler32_sizeLess2/Makefile index 650e876b73..2d64289db9 100644 --- a/security/L1/tests/adler32_sizeLess2/Makefile +++ b/security/L1/tests/adler32_sizeLess2/Makefile @@ -1,5 +1,5 @@ # -# Copyright 2019 Xilinx, Inc. +# Copyright 2019-2020 Xilinx, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -16,7 +16,7 @@ MK_PATH := $(abspath $(lastword $(MAKEFILE_LIST))) CUR_DIR := $(patsubst %/,%,$(dir $(MK_PATH))) -XF_PROJ_ROOT ?= $(shell bash -c 'export MK_PATH=$(MK_PATH); echo $${MK_PATH%L1/tests/*}') +XF_PROJ_ROOT ?= $(shell bash -c 'export MK_PATH=$(MK_PATH); echo $${MK_PATH%/L1/*}') # MK_INC_BEGIN hls_common.mk @@ -51,13 +51,6 @@ help:: # MK_INC_BEGIN vivado.mk -TOOL_VERSION ?= 2019.2 - -ifeq (,$(XILINX_VIVADO)) -XILINX_VIVADO = /opt/xilinx/Vivado/$(TOOL_VERSION) -endif -export XILINX_VIVADO - .PHONY: check_vivado check_vivado: ifeq (,$(wildcard $(XILINX_VIVADO)/bin/vivado)) @@ -72,27 +65,14 @@ DEVICE ?= u200 # MK_INC_BEGIN vitis_set_part.mk -.PHONY: check_part - -ifeq (,$(XPART)) # MK_INC_BEGIN vitis.mk -TOOL_VERSION ?= 2019.2 - -ifeq (,$(XILINX_VITIS)) -XILINX_VITIS = /opt/xilinx/Vitis/$(TOOL_VERSION) -endif -export XILINX_VITIS .PHONY: check_vpp check_vpp: ifeq (,$(wildcard $(XILINX_VITIS)/bin/v++)) @echo "Cannot locate Vitis installation. Please set XILINX_VITIS variable." && false endif -ifeq (,$(XILINX_XRT)) -XILINX_XRT = /opt/xilinx/xrt -endif -export XILINX_XRT .PHONY: check_xrt check_xrt: ifeq (,$(wildcard $(XILINX_XRT)/lib/libxilinxopencl.so)) @@ -111,6 +91,10 @@ export LD_LIBRARY_PATH := $(shell $(XILINX_VITIS)/bin/ldlibpath.sh $(XILINX_VITI endif # MK_INC_END vitis.mk + +.PHONY: check_part + +ifeq (,$(XPART)) # MK_INC_BEGIN vitis_set_platform.mk ifneq (,$(wildcard $(DEVICE))) @@ -119,31 +103,48 @@ XPLATFORM := $(DEVICE) else # Use DEVICE as a file name pattern DEVICE_L := $(shell echo $(DEVICE) | tr A-Z a-z) -# Match the name +# 1. search paths specified by variable ifneq (,$(PLATFORM_REPO_PATHS)) +# 1.1 as exact name +XPLATFORM := $(strip $(foreach p, $(subst :, ,$(PLATFORM_REPO_PATHS)), $(wildcard $(p)/$(DEVICE_L)/$(DEVICE_L).xpfm))) +# 1.2 as a pattern +ifeq (,$(XPLATFORM)) XPLATFORMS := $(foreach p, $(subst :, ,$(PLATFORM_REPO_PATHS)), $(wildcard $(p)/*/*.xpfm)) XPLATFORM := $(strip $(foreach p, $(XPLATFORMS), $(shell echo $(p) | awk '$$1 ~ /$(DEVICE_L)/'))) -endif +endif # 1.2 +endif # 1 +# 2. search Vitis installation +ifeq (,$(XPLATFORM)) +# 2.1 as exact name +XPLATFORM := $(strip $(wildcard $(XILINX_VITIS)/platforms/$(DEVICE_L)/$(DEVICE_L).xpfm)) +# 2.2 as a pattern ifeq (,$(XPLATFORM)) XPLATFORMS := $(wildcard $(XILINX_VITIS)/platforms/*/*.xpfm) XPLATFORM := $(strip $(foreach p, $(XPLATFORMS), $(shell echo $(p) | awk '$$1 ~ /$(DEVICE_L)/'))) -endif +endif # 2.2 +endif # 2 +# 3. search default locations +ifeq (,$(XPLATFORM)) +# 3.1 as exact name +XPLATFORM := $(strip $(wildcard /opt/xilinx/platforms/$(DEVICE_L)/$(DEVICE_L).xpfm)) +# 3.2 as a pattern ifeq (,$(XPLATFORM)) XPLATFORMS := $(wildcard /opt/xilinx/platforms/*/*.xpfm) XPLATFORM := $(strip $(foreach p, $(XPLATFORMS), $(shell echo $(p) | awk '$$1 ~ /$(DEVICE_L)/'))) -endif +endif # 3.2 +endif # 3 endif define MSG_PLATFORM No platform matched pattern '$(DEVICE)'. Available platforms are: $(XPLATFORMS) -To add more platform directories, set the PLATFORM_REPO_PATHS variable. +To add more platform directories, set the PLATFORM_REPO_PATHS variable or point DEVICE variable to the full path of platform .xpfm file. endef export MSG_PLATFORM define MSG_DEVICE More than one platform matched: $(XPLATFORM) -Please set DEVICE variable more accurately to select only one platform file. For example: DEVICE='u200.*xdma' +Please set DEVICE variable more accurately to select only one platform file, or set DEVICE variable to the full path of the platform .xpfm file. endef export MSG_DEVICE @@ -211,7 +212,11 @@ ifeq (1,$(COSIM)) override CSYNTH := 1 endif -run: setup runhls +# From testbench.data_recipe of description.json +data: + @true + +run: data setup runhls setup: | check_part @rm -f ./settings.tcl @@ -222,15 +227,15 @@ setup: | check_part @echo 'set COSIM $(COSIM)' >> ./settings.tcl @echo 'set VIVADO_SYN $(VIVADO_SYN)' >> ./settings.tcl @echo 'set VIVADO_IMPL $(VIVADO_IMPL)' >> ./settings.tcl - @echo 'set QOR_CHECK $(QOR_CHECK)' >> ./settings.tcl @echo 'set XF_PROJ_ROOT "$(XF_PROJ_ROOT)"' >> ./settings.tcl + @echo 'set CUR_DIR "$(CUR_DIR)"' >> ./settings.tcl @echo "Configured: settings.tcl" @echo "----" @cat ./settings.tcl @echo "----" HLS ?= vitis_hls -runhls: setup | check_vivado +runhls: data setup | check_vivado check_vpp $(HLS) -f run_hls.tcl; clean: @@ -239,4 +244,4 @@ clean: # Used by Jenkins test cleanall: clean -# MK_INC_END hls_test_rules.mk +# MK_INC_END hls_test_rules.mk \ No newline at end of file diff --git a/security/L1/tests/adler32_sizeLess2/description.json b/security/L1/tests/adler32_sizeLess2/description.json index 4cfbaa80d7..54f450b758 100644 --- a/security/L1/tests/adler32_sizeLess2/description.json +++ b/security/L1/tests/adler32_sizeLess2/description.json @@ -2,27 +2,28 @@ "name": "Xilinx Adler32 size-less version", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "adler32", "solution": "sol", "clock": "3.33", "topfunction": "dut", "top": { "source": [ - "tb.cpp" + "dut.cpp" ], "cflags": "-I${XF_PROJ_ROOT}/L1/include" }, "testbench": { "source": [ - "tb.cpp" + "tb.cpp", + "test.dat" ], "cflags": "-I${XF_PROJ_ROOT}/L1/include", "argv": {}, @@ -37,17 +38,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -56,8 +57,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/adler32_sizeLess2/run_hls.tcl b/security/L1/tests/adler32_sizeLess2/run_hls.tcl index f57b937e86..5cc329d12b 100644 --- a/security/L1/tests/adler32_sizeLess2/run_hls.tcl +++ b/security/L1/tests/adler32_sizeLess2/run_hls.tcl @@ -1,5 +1,5 @@ # -# Copyright 2019 Xilinx, Inc. +# Copyright 2019-2021 Xilinx, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -25,14 +25,15 @@ if {![info exists CLKP]} { open_project -reset $PROJ -set cflags "-std=c++14" add_files "dut.cpp" -cflags "-I${XF_PROJ_ROOT}/L1/include" -add_files -tb "tb.cpp" -cflags "-I${XF_PROJ_ROOT}/L1/include" -add_files -tb test.dat +add_files -tb "tb.cpp test.dat" -cflags "-I${XF_PROJ_ROOT}/L1/include" set_top dut open_solution -reset $SOLN + + + set_part $XPART create_clock -period $CLKP set_clock_uncertainty 1.05 @@ -57,8 +58,4 @@ if {$VIVADO_IMPL == 1} { export_design -flow impl -rtl verilog } -if {$QOR_CHECK == 1} { - puts "QoR check not implemented yet" -} - -exit +exit \ No newline at end of file diff --git a/security/L1/tests/aes/aes128dec/description.json b/security/L1/tests/aes/aes128dec/description.json index cc0717173a..7eed072c78 100644 --- a/security/L1/tests/aes/aes128dec/description.json +++ b/security/L1/tests/aes/aes128dec/description.json @@ -2,14 +2,14 @@ "name": "Xilinx AES128 Decryption", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "aesTest", "solution": "solution1", "clock": "3.33", @@ -38,17 +38,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -57,8 +57,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/aes/aes128enc/description.json b/security/L1/tests/aes/aes128enc/description.json index c29e0ba655..85eecbdf9d 100644 --- a/security/L1/tests/aes/aes128enc/description.json +++ b/security/L1/tests/aes/aes128enc/description.json @@ -2,14 +2,14 @@ "name": "Xilinx AES128 Encryption", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "aesTest", "solution": "solution1", "clock": "3.33", @@ -38,17 +38,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -57,8 +57,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/aes/aes192dec/description.json b/security/L1/tests/aes/aes192dec/description.json index 348d1f4d54..182e653750 100644 --- a/security/L1/tests/aes/aes192dec/description.json +++ b/security/L1/tests/aes/aes192dec/description.json @@ -2,14 +2,14 @@ "name": "Xilinx AES192 Decryption", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "aes_test", "solution": "solution1", "clock": "3.33", @@ -38,17 +38,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -57,8 +57,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/aes/aes192enc/description.json b/security/L1/tests/aes/aes192enc/description.json index 6e7cbc2d27..91ea58af39 100644 --- a/security/L1/tests/aes/aes192enc/description.json +++ b/security/L1/tests/aes/aes192enc/description.json @@ -2,14 +2,14 @@ "name": "Xilinx AES192 Encryption", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "aes_test", "solution": "solution1", "clock": "3.33", @@ -38,17 +38,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -57,8 +57,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/aes/aes256dec/description.json b/security/L1/tests/aes/aes256dec/description.json index 596111784e..f18092f2f1 100644 --- a/security/L1/tests/aes/aes256dec/description.json +++ b/security/L1/tests/aes/aes256dec/description.json @@ -2,14 +2,14 @@ "name": "Xilinx AES256 Decryption", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "iaes_test", "solution": "solution1", "clock": "3.33", @@ -38,17 +38,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -57,8 +57,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/aes/aes256enc/description.json b/security/L1/tests/aes/aes256enc/description.json index 7426ab2732..77883172a9 100644 --- a/security/L1/tests/aes/aes256enc/description.json +++ b/security/L1/tests/aes/aes256enc/description.json @@ -2,14 +2,14 @@ "name": "Xilinx AES256 Encryption", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "aesTest", "solution": "solution1", "clock": "3.33", @@ -38,17 +38,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -57,8 +57,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/blake2b/description.json b/security/L1/tests/blake2b/description.json index 532b168ecb..1244c9f2ba 100644 --- a/security/L1/tests/blake2b/description.json +++ b/security/L1/tests/blake2b/description.json @@ -2,14 +2,14 @@ "name": "Xilinx Blake2B", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "blake2b_test", "solution": "solution1", "clock": "3.33", @@ -39,17 +39,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -58,8 +58,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/blake2b_sizeLess/description.json b/security/L1/tests/blake2b_sizeLess/description.json index 532b168ecb..1244c9f2ba 100644 --- a/security/L1/tests/blake2b_sizeLess/description.json +++ b/security/L1/tests/blake2b_sizeLess/description.json @@ -2,14 +2,14 @@ "name": "Xilinx Blake2B", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "blake2b_test", "solution": "solution1", "clock": "3.33", @@ -39,17 +39,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -58,8 +58,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/bls_genkey/description.json b/security/L1/tests/bls_genkey/description.json index 559fd279e2..9a6de25b87 100644 --- a/security/L1/tests/bls_genkey/description.json +++ b/security/L1/tests/bls_genkey/description.json @@ -2,14 +2,14 @@ "name": "Xilinx BLS Gen Key", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "bls_test", "solution": "solution1", "clock": "3.33", @@ -37,17 +37,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -56,8 +56,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/cbc/aes128dec/description.json b/security/L1/tests/cbc/aes128dec/description.json index 4212b9a7c9..238bec7e9e 100644 --- a/security/L1/tests/cbc/aes128dec/description.json +++ b/security/L1/tests/cbc/aes128dec/description.json @@ -2,14 +2,14 @@ "name": "Xilinx AES128CBC Decryption", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "icbc_aes128_test", "solution": "solution1", "clock": "3.33", @@ -38,17 +38,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -57,8 +57,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/cbc/aes128enc/description.json b/security/L1/tests/cbc/aes128enc/description.json index a957d5453c..545b661eec 100644 --- a/security/L1/tests/cbc/aes128enc/description.json +++ b/security/L1/tests/cbc/aes128enc/description.json @@ -2,14 +2,14 @@ "name": "Xilinx AES128CBC Encryption", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "cbc_aes128_test", "solution": "solution1", "clock": "3.33", @@ -38,17 +38,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -57,8 +57,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/cbc/aes192dec/description.json b/security/L1/tests/cbc/aes192dec/description.json index 5dd9aab930..599879dd07 100644 --- a/security/L1/tests/cbc/aes192dec/description.json +++ b/security/L1/tests/cbc/aes192dec/description.json @@ -2,14 +2,14 @@ "name": "Xilinx AES192CBC Decryption", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "icbc_aes192_test", "solution": "solution1", "clock": "3.33", @@ -38,17 +38,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -57,8 +57,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/cbc/aes192enc/description.json b/security/L1/tests/cbc/aes192enc/description.json index 39a57973df..305c9578f5 100644 --- a/security/L1/tests/cbc/aes192enc/description.json +++ b/security/L1/tests/cbc/aes192enc/description.json @@ -2,14 +2,14 @@ "name": "Xilinx AES192CBC Encryption", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "cbc_aes192_test", "solution": "solution1", "clock": "3.33", @@ -38,17 +38,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -57,8 +57,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/cbc/aes256dec/description.json b/security/L1/tests/cbc/aes256dec/description.json index d2b253838a..1f51f594bf 100644 --- a/security/L1/tests/cbc/aes256dec/description.json +++ b/security/L1/tests/cbc/aes256dec/description.json @@ -2,14 +2,14 @@ "name": "Xilinx AES256CBC Decryption", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "icbc_aes256_test", "solution": "solution1", "clock": "3.33", @@ -38,17 +38,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -57,8 +57,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/cbc/aes256enc/description.json b/security/L1/tests/cbc/aes256enc/description.json index d80b0d0579..58ebbfb538 100644 --- a/security/L1/tests/cbc/aes256enc/description.json +++ b/security/L1/tests/cbc/aes256enc/description.json @@ -2,14 +2,14 @@ "name": "Xilinx AES256CBC Encryption", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "cbc_aes256_test", "solution": "solution1", "clock": "3.33", @@ -38,17 +38,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -57,8 +57,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/cbc/des64dec/description.json b/security/L1/tests/cbc/des64dec/description.json index 41ae4f1329..da7b288414 100644 --- a/security/L1/tests/cbc/des64dec/description.json +++ b/security/L1/tests/cbc/des64dec/description.json @@ -2,14 +2,14 @@ "name": "Xilinx DES64CBC Decryption", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "icbc_des64_test", "solution": "solution1", "clock": "3.33", @@ -38,17 +38,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -57,8 +57,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/cbc/des64enc/description.json b/security/L1/tests/cbc/des64enc/description.json index 02b4a2d2c2..cad08d2aa9 100644 --- a/security/L1/tests/cbc/des64enc/description.json +++ b/security/L1/tests/cbc/des64enc/description.json @@ -2,14 +2,14 @@ "name": "Xilinx DES64CBC Encryption", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "cbc_des64_test", "solution": "solution1", "clock": "3.33", @@ -38,17 +38,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -57,8 +57,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/ccm/aes128dec/description.json b/security/L1/tests/ccm/aes128dec/description.json index edf1794d1d..35dadb07d3 100644 --- a/security/L1/tests/ccm/aes128dec/description.json +++ b/security/L1/tests/ccm/aes128dec/description.json @@ -2,14 +2,14 @@ "name": "Xilinx AES128CCM Decryption", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "iccm_aes128_test", "solution": "solution1", "clock": "3.33", @@ -38,17 +38,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -57,8 +57,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/ccm/aes128enc/description.json b/security/L1/tests/ccm/aes128enc/description.json index 6444915b7d..60da319312 100644 --- a/security/L1/tests/ccm/aes128enc/description.json +++ b/security/L1/tests/ccm/aes128enc/description.json @@ -2,14 +2,14 @@ "name": "Xilinx AES128CCM Encryption", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "ccm_aes128_test", "solution": "solution1", "clock": "3.33", @@ -38,17 +38,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -57,8 +57,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/ccm/aes192dec/description.json b/security/L1/tests/ccm/aes192dec/description.json index 53cbb14564..30c1fda370 100644 --- a/security/L1/tests/ccm/aes192dec/description.json +++ b/security/L1/tests/ccm/aes192dec/description.json @@ -2,14 +2,14 @@ "name": "Xilinx AES192CCM Decryption", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "iccm_aes192_test", "solution": "solution1", "clock": "3.33", @@ -38,17 +38,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -57,8 +57,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/ccm/aes192enc/description.json b/security/L1/tests/ccm/aes192enc/description.json index 41d1c46f29..2d7b96090c 100644 --- a/security/L1/tests/ccm/aes192enc/description.json +++ b/security/L1/tests/ccm/aes192enc/description.json @@ -2,14 +2,14 @@ "name": "Xilinx AES192CCM Encryption", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "ccm_aes192_test", "solution": "solution1", "clock": "3.33", @@ -38,17 +38,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -57,8 +57,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/ccm/aes256dec/description.json b/security/L1/tests/ccm/aes256dec/description.json index f2b8d1dd9f..4ee40a595c 100644 --- a/security/L1/tests/ccm/aes256dec/description.json +++ b/security/L1/tests/ccm/aes256dec/description.json @@ -2,14 +2,14 @@ "name": "Xilinx AES256CCM Decryption", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "iccm_aes256_test", "solution": "solution1", "clock": "3.33", @@ -38,17 +38,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -57,8 +57,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/ccm/aes256enc/description.json b/security/L1/tests/ccm/aes256enc/description.json index d131761f2f..22d0c9d233 100644 --- a/security/L1/tests/ccm/aes256enc/description.json +++ b/security/L1/tests/ccm/aes256enc/description.json @@ -2,14 +2,14 @@ "name": "Xilinx AES256CCM Encryption", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "ccm_aes256_test", "solution": "solution1", "clock": "3.33", @@ -38,17 +38,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -57,8 +57,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/cfb/cfb1/aes128dec/description.json b/security/L1/tests/cfb/cfb1/aes128dec/description.json index cc0318679a..c0524ffce6 100644 --- a/security/L1/tests/cfb/cfb1/aes128dec/description.json +++ b/security/L1/tests/cfb/cfb1/aes128dec/description.json @@ -2,14 +2,14 @@ "name": "Xilinx AES128CBF1 Decryption", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "icfb1_aes128_test", "solution": "solution1", "clock": "3.33", @@ -38,17 +38,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -57,8 +57,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/cfb/cfb1/aes128enc/description.json b/security/L1/tests/cfb/cfb1/aes128enc/description.json index 574d03c1c4..ab3fb1c276 100644 --- a/security/L1/tests/cfb/cfb1/aes128enc/description.json +++ b/security/L1/tests/cfb/cfb1/aes128enc/description.json @@ -2,14 +2,14 @@ "name": "Xilinx AES128CBF1 Encryption", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "cfb1_aes128_test", "solution": "solution1", "clock": "3.33", @@ -38,17 +38,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -57,8 +57,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/cfb/cfb1/aes192dec/description.json b/security/L1/tests/cfb/cfb1/aes192dec/description.json index 770591f980..8aa9207c73 100644 --- a/security/L1/tests/cfb/cfb1/aes192dec/description.json +++ b/security/L1/tests/cfb/cfb1/aes192dec/description.json @@ -2,14 +2,14 @@ "name": "Xilinx AES192CBF1 Decryption", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "icfb1_aes192_test", "solution": "solution1", "clock": "3.33", @@ -38,17 +38,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -57,8 +57,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/cfb/cfb1/aes192enc/description.json b/security/L1/tests/cfb/cfb1/aes192enc/description.json index c7e1b6eb2b..a42721c383 100644 --- a/security/L1/tests/cfb/cfb1/aes192enc/description.json +++ b/security/L1/tests/cfb/cfb1/aes192enc/description.json @@ -2,14 +2,14 @@ "name": "Xilinx AES192CBF1 Encryption", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "cfb1_aes192_test", "solution": "solution1", "clock": "3.33", @@ -38,17 +38,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -57,8 +57,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/cfb/cfb1/aes256dec/description.json b/security/L1/tests/cfb/cfb1/aes256dec/description.json index e231d9d05b..566fef36e0 100644 --- a/security/L1/tests/cfb/cfb1/aes256dec/description.json +++ b/security/L1/tests/cfb/cfb1/aes256dec/description.json @@ -2,14 +2,14 @@ "name": "Xilinx AES256CBF1 Decryption", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "icfb1_aes256_test", "solution": "solution1", "clock": "3.33", @@ -38,17 +38,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -57,8 +57,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/cfb/cfb1/aes256enc/description.json b/security/L1/tests/cfb/cfb1/aes256enc/description.json index 23c454b006..c82ccc4268 100644 --- a/security/L1/tests/cfb/cfb1/aes256enc/description.json +++ b/security/L1/tests/cfb/cfb1/aes256enc/description.json @@ -2,14 +2,14 @@ "name": "Xilinx AES256CBF1 Encryption", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "cfb1_aes256_test", "solution": "solution1", "clock": "3.33", @@ -38,17 +38,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -57,8 +57,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/cfb/cfb1/des64dec/description.json b/security/L1/tests/cfb/cfb1/des64dec/description.json index b9e52e1b57..8b622e242f 100644 --- a/security/L1/tests/cfb/cfb1/des64dec/description.json +++ b/security/L1/tests/cfb/cfb1/des64dec/description.json @@ -2,14 +2,14 @@ "name": "Xilinx DES64CBF1 Decryption", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "icfb1_des64_test", "solution": "solution1", "clock": "3.33", @@ -38,17 +38,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -57,8 +57,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/cfb/cfb1/des64enc/description.json b/security/L1/tests/cfb/cfb1/des64enc/description.json index 803d78f9c8..00bc46a18a 100644 --- a/security/L1/tests/cfb/cfb1/des64enc/description.json +++ b/security/L1/tests/cfb/cfb1/des64enc/description.json @@ -2,14 +2,14 @@ "name": "Xilinx DES64CBF1 Encryption", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "cfb1_des64_test", "solution": "solution1", "clock": "3.33", @@ -38,17 +38,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -57,8 +57,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/cfb/cfb128/aes128dec/description.json b/security/L1/tests/cfb/cfb128/aes128dec/description.json index a58bed017f..cdefdded6c 100644 --- a/security/L1/tests/cfb/cfb128/aes128dec/description.json +++ b/security/L1/tests/cfb/cfb128/aes128dec/description.json @@ -2,14 +2,14 @@ "name": "Xilinx AES128CFB128 Decryption", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "icfb128_aes128_test", "solution": "solution1", "clock": "3.33", @@ -38,17 +38,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -57,8 +57,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/cfb/cfb128/aes128enc/description.json b/security/L1/tests/cfb/cfb128/aes128enc/description.json index 6ee323e394..1372b03210 100644 --- a/security/L1/tests/cfb/cfb128/aes128enc/description.json +++ b/security/L1/tests/cfb/cfb128/aes128enc/description.json @@ -2,14 +2,14 @@ "name": "Xilinx AES128CFB128 Encryption", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "cfb128_aes128_test", "solution": "solution1", "clock": "3.33", @@ -38,17 +38,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -57,8 +57,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/cfb/cfb128/aes192dec/description.json b/security/L1/tests/cfb/cfb128/aes192dec/description.json index 11c7115b7c..74979ca0bd 100644 --- a/security/L1/tests/cfb/cfb128/aes192dec/description.json +++ b/security/L1/tests/cfb/cfb128/aes192dec/description.json @@ -2,14 +2,14 @@ "name": "Xilinx AES192CFB128 Decryption", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "icfb128_aes192_test", "solution": "solution1", "clock": "3.33", @@ -38,17 +38,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -57,8 +57,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/cfb/cfb128/aes192enc/description.json b/security/L1/tests/cfb/cfb128/aes192enc/description.json index e66300e199..ca35c86447 100644 --- a/security/L1/tests/cfb/cfb128/aes192enc/description.json +++ b/security/L1/tests/cfb/cfb128/aes192enc/description.json @@ -2,14 +2,14 @@ "name": "Xilinx AES192CFB128 Encryption", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "cfb128_aes192_test", "solution": "solution1", "clock": "3.33", @@ -38,17 +38,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -57,8 +57,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/cfb/cfb128/aes256dec/description.json b/security/L1/tests/cfb/cfb128/aes256dec/description.json index f3597beaf1..a44d66acc3 100644 --- a/security/L1/tests/cfb/cfb128/aes256dec/description.json +++ b/security/L1/tests/cfb/cfb128/aes256dec/description.json @@ -2,14 +2,14 @@ "name": "Xilinx AES256CFB128 Decryption", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "icfb128_aes256_test", "solution": "solution1", "clock": "3.33", @@ -38,17 +38,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -57,8 +57,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/cfb/cfb128/aes256enc/description.json b/security/L1/tests/cfb/cfb128/aes256enc/description.json index f938016e82..5d86633951 100644 --- a/security/L1/tests/cfb/cfb128/aes256enc/description.json +++ b/security/L1/tests/cfb/cfb128/aes256enc/description.json @@ -2,14 +2,14 @@ "name": "Xilinx AES256CFB128 Encryption", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "cfb128_aes256_test", "solution": "solution1", "clock": "3.33", @@ -38,17 +38,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -57,8 +57,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/cfb/cfb128/des64dec/description.json b/security/L1/tests/cfb/cfb128/des64dec/description.json index c86cb35d7a..b3eeeff364 100644 --- a/security/L1/tests/cfb/cfb128/des64dec/description.json +++ b/security/L1/tests/cfb/cfb128/des64dec/description.json @@ -2,14 +2,14 @@ "name": "Xilinx DES64CFB128 Decryption", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "icfb128_des64_test", "solution": "solution1", "clock": "3.33", @@ -38,17 +38,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -57,8 +57,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/cfb/cfb128/des64enc/description.json b/security/L1/tests/cfb/cfb128/des64enc/description.json index cd5f5131cd..5b800f1259 100644 --- a/security/L1/tests/cfb/cfb128/des64enc/description.json +++ b/security/L1/tests/cfb/cfb128/des64enc/description.json @@ -2,14 +2,14 @@ "name": "Xilinx DES64CFB128 Encryption", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "cfb128_des64_test", "solution": "solution1", "clock": "3.33", @@ -38,17 +38,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -57,8 +57,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/cfb/cfb8/aes128dec/description.json b/security/L1/tests/cfb/cfb8/aes128dec/description.json index a20a5e4b6e..dab59a5751 100644 --- a/security/L1/tests/cfb/cfb8/aes128dec/description.json +++ b/security/L1/tests/cfb/cfb8/aes128dec/description.json @@ -2,14 +2,14 @@ "name": "Xilinx AES128CFB8 Decryption", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "icfb8_aes128_test", "solution": "solution1", "clock": "3.33", @@ -38,17 +38,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -57,8 +57,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/cfb/cfb8/aes128enc/description.json b/security/L1/tests/cfb/cfb8/aes128enc/description.json index 7efde6830c..8204bcf1ad 100644 --- a/security/L1/tests/cfb/cfb8/aes128enc/description.json +++ b/security/L1/tests/cfb/cfb8/aes128enc/description.json @@ -2,14 +2,14 @@ "name": "Xilinx AES128CFB8 Encryption", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "cfb8_aes128_test", "solution": "solution1", "clock": "3.33", @@ -38,17 +38,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -57,8 +57,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/cfb/cfb8/aes192dec/description.json b/security/L1/tests/cfb/cfb8/aes192dec/description.json index f1e383ac0f..00b6a1ceca 100644 --- a/security/L1/tests/cfb/cfb8/aes192dec/description.json +++ b/security/L1/tests/cfb/cfb8/aes192dec/description.json @@ -2,14 +2,14 @@ "name": "Xilinx AES192CFB8 Decryption", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "icfb8_aes192_test", "solution": "solution1", "clock": "3.33", @@ -38,17 +38,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -57,8 +57,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/cfb/cfb8/aes192enc/description.json b/security/L1/tests/cfb/cfb8/aes192enc/description.json index 01b8bd1ee3..12a2616431 100644 --- a/security/L1/tests/cfb/cfb8/aes192enc/description.json +++ b/security/L1/tests/cfb/cfb8/aes192enc/description.json @@ -2,14 +2,14 @@ "name": "Xilinx AES192CFB8 Encryption", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "cfb8_aes192_test", "solution": "solution1", "clock": "3.33", @@ -38,17 +38,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -57,8 +57,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/cfb/cfb8/aes256dec/description.json b/security/L1/tests/cfb/cfb8/aes256dec/description.json index 0983030a17..a188747457 100644 --- a/security/L1/tests/cfb/cfb8/aes256dec/description.json +++ b/security/L1/tests/cfb/cfb8/aes256dec/description.json @@ -2,14 +2,14 @@ "name": "Xilinx AES256CFB8 Decryption", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "icfb8_aes256_test", "solution": "solution1", "clock": "3.33", @@ -38,17 +38,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -57,8 +57,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/cfb/cfb8/aes256enc/description.json b/security/L1/tests/cfb/cfb8/aes256enc/description.json index cbc04e2ac2..9813d0332d 100644 --- a/security/L1/tests/cfb/cfb8/aes256enc/description.json +++ b/security/L1/tests/cfb/cfb8/aes256enc/description.json @@ -2,14 +2,14 @@ "name": "Xilinx AES256CFB8 Encryption", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "cfb8_aes256_test", "solution": "solution1", "clock": "3.33", @@ -38,17 +38,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -57,8 +57,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/cfb/cfb8/des64dec/description.json b/security/L1/tests/cfb/cfb8/des64dec/description.json index 816d62abd4..3608a83199 100644 --- a/security/L1/tests/cfb/cfb8/des64dec/description.json +++ b/security/L1/tests/cfb/cfb8/des64dec/description.json @@ -2,14 +2,14 @@ "name": "Xilinx DES64CFB8 Decryption", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "icfb8_des64_test", "solution": "solution1", "clock": "3.33", @@ -38,17 +38,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -57,8 +57,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/cfb/cfb8/des64enc/description.json b/security/L1/tests/cfb/cfb8/des64enc/description.json index 913e6f4c8a..d8623f9bc9 100644 --- a/security/L1/tests/cfb/cfb8/des64enc/description.json +++ b/security/L1/tests/cfb/cfb8/des64enc/description.json @@ -2,14 +2,14 @@ "name": "Xilinx DES64CFB8 Encryption", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "cfb8_des64_test", "solution": "solution1", "clock": "3.33", @@ -38,17 +38,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -57,8 +57,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/chacha20/description.json b/security/L1/tests/chacha20/description.json index 932fa94000..cc97dda5b1 100644 --- a/security/L1/tests/chacha20/description.json +++ b/security/L1/tests/chacha20/description.json @@ -2,14 +2,14 @@ "name": "Xilinx Chacha20", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "chacha20_test", "solution": "solution1", "clock": "3.33", @@ -37,17 +37,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -56,8 +56,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/crc32/Makefile b/security/L1/tests/crc32/Makefile index 6c0ecc8706..d08654dcab 100644 --- a/security/L1/tests/crc32/Makefile +++ b/security/L1/tests/crc32/Makefile @@ -1,5 +1,5 @@ # -# Copyright 2019 Xilinx, Inc. +# Copyright 2019-2020 Xilinx, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -16,7 +16,7 @@ MK_PATH := $(abspath $(lastword $(MAKEFILE_LIST))) CUR_DIR := $(patsubst %/,%,$(dir $(MK_PATH))) -XF_PROJ_ROOT ?= $(shell bash -c 'export MK_PATH=$(MK_PATH); echo $${MK_PATH%L1/tests/*}') +XF_PROJ_ROOT ?= $(shell bash -c 'export MK_PATH=$(MK_PATH); echo $${MK_PATH%/L1/*}') # MK_INC_BEGIN hls_common.mk @@ -51,13 +51,6 @@ help:: # MK_INC_BEGIN vivado.mk -TOOL_VERSION ?= 2019.2 - -ifeq (,$(XILINX_VIVADO)) -XILINX_VIVADO = /opt/xilinx/Vivado/$(TOOL_VERSION) -endif -export XILINX_VIVADO - .PHONY: check_vivado check_vivado: ifeq (,$(wildcard $(XILINX_VIVADO)/bin/vivado)) @@ -72,27 +65,14 @@ DEVICE ?= u200 # MK_INC_BEGIN vitis_set_part.mk -.PHONY: check_part - -ifeq (,$(XPART)) # MK_INC_BEGIN vitis.mk -TOOL_VERSION ?= 2019.2 - -ifeq (,$(XILINX_VITIS)) -XILINX_VITIS = /opt/xilinx/Vitis/$(TOOL_VERSION) -endif -export XILINX_VITIS .PHONY: check_vpp check_vpp: ifeq (,$(wildcard $(XILINX_VITIS)/bin/v++)) @echo "Cannot locate Vitis installation. Please set XILINX_VITIS variable." && false endif -ifeq (,$(XILINX_XRT)) -XILINX_XRT = /opt/xilinx/xrt -endif -export XILINX_XRT .PHONY: check_xrt check_xrt: ifeq (,$(wildcard $(XILINX_XRT)/lib/libxilinxopencl.so)) @@ -111,6 +91,10 @@ export LD_LIBRARY_PATH := $(shell $(XILINX_VITIS)/bin/ldlibpath.sh $(XILINX_VITI endif # MK_INC_END vitis.mk + +.PHONY: check_part + +ifeq (,$(XPART)) # MK_INC_BEGIN vitis_set_platform.mk ifneq (,$(wildcard $(DEVICE))) @@ -119,31 +103,48 @@ XPLATFORM := $(DEVICE) else # Use DEVICE as a file name pattern DEVICE_L := $(shell echo $(DEVICE) | tr A-Z a-z) -# Match the name +# 1. search paths specified by variable ifneq (,$(PLATFORM_REPO_PATHS)) +# 1.1 as exact name +XPLATFORM := $(strip $(foreach p, $(subst :, ,$(PLATFORM_REPO_PATHS)), $(wildcard $(p)/$(DEVICE_L)/$(DEVICE_L).xpfm))) +# 1.2 as a pattern +ifeq (,$(XPLATFORM)) XPLATFORMS := $(foreach p, $(subst :, ,$(PLATFORM_REPO_PATHS)), $(wildcard $(p)/*/*.xpfm)) XPLATFORM := $(strip $(foreach p, $(XPLATFORMS), $(shell echo $(p) | awk '$$1 ~ /$(DEVICE_L)/'))) -endif +endif # 1.2 +endif # 1 +# 2. search Vitis installation +ifeq (,$(XPLATFORM)) +# 2.1 as exact name +XPLATFORM := $(strip $(wildcard $(XILINX_VITIS)/platforms/$(DEVICE_L)/$(DEVICE_L).xpfm)) +# 2.2 as a pattern ifeq (,$(XPLATFORM)) XPLATFORMS := $(wildcard $(XILINX_VITIS)/platforms/*/*.xpfm) XPLATFORM := $(strip $(foreach p, $(XPLATFORMS), $(shell echo $(p) | awk '$$1 ~ /$(DEVICE_L)/'))) -endif +endif # 2.2 +endif # 2 +# 3. search default locations +ifeq (,$(XPLATFORM)) +# 3.1 as exact name +XPLATFORM := $(strip $(wildcard /opt/xilinx/platforms/$(DEVICE_L)/$(DEVICE_L).xpfm)) +# 3.2 as a pattern ifeq (,$(XPLATFORM)) XPLATFORMS := $(wildcard /opt/xilinx/platforms/*/*.xpfm) XPLATFORM := $(strip $(foreach p, $(XPLATFORMS), $(shell echo $(p) | awk '$$1 ~ /$(DEVICE_L)/'))) -endif +endif # 3.2 +endif # 3 endif define MSG_PLATFORM No platform matched pattern '$(DEVICE)'. Available platforms are: $(XPLATFORMS) -To add more platform directories, set the PLATFORM_REPO_PATHS variable. +To add more platform directories, set the PLATFORM_REPO_PATHS variable or point DEVICE variable to the full path of platform .xpfm file. endef export MSG_PLATFORM define MSG_DEVICE More than one platform matched: $(XPLATFORM) -Please set DEVICE variable more accurately to select only one platform file. For example: DEVICE='u200.*xdma' +Please set DEVICE variable more accurately to select only one platform file, or set DEVICE variable to the full path of the platform .xpfm file. endef export MSG_DEVICE @@ -211,7 +212,11 @@ ifeq (1,$(COSIM)) override CSYNTH := 1 endif -run: setup runhls +# From testbench.data_recipe of description.json +data: + @true + +run: data setup runhls setup: | check_part @rm -f ./settings.tcl @@ -222,15 +227,15 @@ setup: | check_part @echo 'set COSIM $(COSIM)' >> ./settings.tcl @echo 'set VIVADO_SYN $(VIVADO_SYN)' >> ./settings.tcl @echo 'set VIVADO_IMPL $(VIVADO_IMPL)' >> ./settings.tcl - @echo 'set QOR_CHECK $(QOR_CHECK)' >> ./settings.tcl @echo 'set XF_PROJ_ROOT "$(XF_PROJ_ROOT)"' >> ./settings.tcl + @echo 'set CUR_DIR "$(CUR_DIR)"' >> ./settings.tcl @echo "Configured: settings.tcl" @echo "----" @cat ./settings.tcl @echo "----" HLS ?= vitis_hls -runhls: setup | check_vivado +runhls: data setup | check_vivado check_vpp $(HLS) -f run_hls.tcl; clean: @@ -239,4 +244,4 @@ clean: # Used by Jenkins test cleanall: clean -# MK_INC_END hls_test_rules.mk +# MK_INC_END hls_test_rules.mk \ No newline at end of file diff --git a/security/L1/tests/crc32/description.json b/security/L1/tests/crc32/description.json index d4d434ecba..f207fb8d24 100644 --- a/security/L1/tests/crc32/description.json +++ b/security/L1/tests/crc32/description.json @@ -2,27 +2,28 @@ "name": "Xilinx CRC32", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "crc32", "solution": "sol", "clock": "3.33", "topfunction": "dut", "top": { "source": [ - "tb.cpp" + "dut.cpp" ], "cflags": "-I${XF_PROJ_ROOT}/L1/include" }, "testbench": { "source": [ - "tb.cpp" + "tb.cpp", + "test.dat" ], "cflags": "-I${XF_PROJ_ROOT}/L1/include", "argv": {}, @@ -37,17 +38,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -56,10 +57,10 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, "clock_uncertainty": 1.05 -} \ No newline at end of file +} diff --git a/security/L1/tests/crc32/run_hls.tcl b/security/L1/tests/crc32/run_hls.tcl index b7fe32b6a2..394f482cf9 100644 --- a/security/L1/tests/crc32/run_hls.tcl +++ b/security/L1/tests/crc32/run_hls.tcl @@ -1,5 +1,5 @@ # -# Copyright 2019 Xilinx, Inc. +# Copyright 2019-2021 Xilinx, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -25,14 +25,15 @@ if {![info exists CLKP]} { open_project -reset $PROJ -set cflags "-std=c++14" add_files "dut.cpp" -cflags "-I${XF_PROJ_ROOT}/L1/include" -add_files -tb "tb.cpp" -cflags "-I${XF_PROJ_ROOT}/L1/include" -add_files -tb test.dat +add_files -tb "tb.cpp test.dat" -cflags "-I${XF_PROJ_ROOT}/L1/include" set_top dut open_solution -reset $SOLN + + + set_part $XPART create_clock -period $CLKP set_clock_uncertainty 1.05 @@ -57,8 +58,4 @@ if {$VIVADO_IMPL == 1} { export_design -flow impl -rtl verilog } -if {$QOR_CHECK == 1} { - puts "QoR check not implemented yet" -} - -exit +exit \ No newline at end of file diff --git a/security/L1/tests/crc32_2/Makefile b/security/L1/tests/crc32_2/Makefile index 6c0ecc8706..d08654dcab 100644 --- a/security/L1/tests/crc32_2/Makefile +++ b/security/L1/tests/crc32_2/Makefile @@ -1,5 +1,5 @@ # -# Copyright 2019 Xilinx, Inc. +# Copyright 2019-2020 Xilinx, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -16,7 +16,7 @@ MK_PATH := $(abspath $(lastword $(MAKEFILE_LIST))) CUR_DIR := $(patsubst %/,%,$(dir $(MK_PATH))) -XF_PROJ_ROOT ?= $(shell bash -c 'export MK_PATH=$(MK_PATH); echo $${MK_PATH%L1/tests/*}') +XF_PROJ_ROOT ?= $(shell bash -c 'export MK_PATH=$(MK_PATH); echo $${MK_PATH%/L1/*}') # MK_INC_BEGIN hls_common.mk @@ -51,13 +51,6 @@ help:: # MK_INC_BEGIN vivado.mk -TOOL_VERSION ?= 2019.2 - -ifeq (,$(XILINX_VIVADO)) -XILINX_VIVADO = /opt/xilinx/Vivado/$(TOOL_VERSION) -endif -export XILINX_VIVADO - .PHONY: check_vivado check_vivado: ifeq (,$(wildcard $(XILINX_VIVADO)/bin/vivado)) @@ -72,27 +65,14 @@ DEVICE ?= u200 # MK_INC_BEGIN vitis_set_part.mk -.PHONY: check_part - -ifeq (,$(XPART)) # MK_INC_BEGIN vitis.mk -TOOL_VERSION ?= 2019.2 - -ifeq (,$(XILINX_VITIS)) -XILINX_VITIS = /opt/xilinx/Vitis/$(TOOL_VERSION) -endif -export XILINX_VITIS .PHONY: check_vpp check_vpp: ifeq (,$(wildcard $(XILINX_VITIS)/bin/v++)) @echo "Cannot locate Vitis installation. Please set XILINX_VITIS variable." && false endif -ifeq (,$(XILINX_XRT)) -XILINX_XRT = /opt/xilinx/xrt -endif -export XILINX_XRT .PHONY: check_xrt check_xrt: ifeq (,$(wildcard $(XILINX_XRT)/lib/libxilinxopencl.so)) @@ -111,6 +91,10 @@ export LD_LIBRARY_PATH := $(shell $(XILINX_VITIS)/bin/ldlibpath.sh $(XILINX_VITI endif # MK_INC_END vitis.mk + +.PHONY: check_part + +ifeq (,$(XPART)) # MK_INC_BEGIN vitis_set_platform.mk ifneq (,$(wildcard $(DEVICE))) @@ -119,31 +103,48 @@ XPLATFORM := $(DEVICE) else # Use DEVICE as a file name pattern DEVICE_L := $(shell echo $(DEVICE) | tr A-Z a-z) -# Match the name +# 1. search paths specified by variable ifneq (,$(PLATFORM_REPO_PATHS)) +# 1.1 as exact name +XPLATFORM := $(strip $(foreach p, $(subst :, ,$(PLATFORM_REPO_PATHS)), $(wildcard $(p)/$(DEVICE_L)/$(DEVICE_L).xpfm))) +# 1.2 as a pattern +ifeq (,$(XPLATFORM)) XPLATFORMS := $(foreach p, $(subst :, ,$(PLATFORM_REPO_PATHS)), $(wildcard $(p)/*/*.xpfm)) XPLATFORM := $(strip $(foreach p, $(XPLATFORMS), $(shell echo $(p) | awk '$$1 ~ /$(DEVICE_L)/'))) -endif +endif # 1.2 +endif # 1 +# 2. search Vitis installation +ifeq (,$(XPLATFORM)) +# 2.1 as exact name +XPLATFORM := $(strip $(wildcard $(XILINX_VITIS)/platforms/$(DEVICE_L)/$(DEVICE_L).xpfm)) +# 2.2 as a pattern ifeq (,$(XPLATFORM)) XPLATFORMS := $(wildcard $(XILINX_VITIS)/platforms/*/*.xpfm) XPLATFORM := $(strip $(foreach p, $(XPLATFORMS), $(shell echo $(p) | awk '$$1 ~ /$(DEVICE_L)/'))) -endif +endif # 2.2 +endif # 2 +# 3. search default locations +ifeq (,$(XPLATFORM)) +# 3.1 as exact name +XPLATFORM := $(strip $(wildcard /opt/xilinx/platforms/$(DEVICE_L)/$(DEVICE_L).xpfm)) +# 3.2 as a pattern ifeq (,$(XPLATFORM)) XPLATFORMS := $(wildcard /opt/xilinx/platforms/*/*.xpfm) XPLATFORM := $(strip $(foreach p, $(XPLATFORMS), $(shell echo $(p) | awk '$$1 ~ /$(DEVICE_L)/'))) -endif +endif # 3.2 +endif # 3 endif define MSG_PLATFORM No platform matched pattern '$(DEVICE)'. Available platforms are: $(XPLATFORMS) -To add more platform directories, set the PLATFORM_REPO_PATHS variable. +To add more platform directories, set the PLATFORM_REPO_PATHS variable or point DEVICE variable to the full path of platform .xpfm file. endef export MSG_PLATFORM define MSG_DEVICE More than one platform matched: $(XPLATFORM) -Please set DEVICE variable more accurately to select only one platform file. For example: DEVICE='u200.*xdma' +Please set DEVICE variable more accurately to select only one platform file, or set DEVICE variable to the full path of the platform .xpfm file. endef export MSG_DEVICE @@ -211,7 +212,11 @@ ifeq (1,$(COSIM)) override CSYNTH := 1 endif -run: setup runhls +# From testbench.data_recipe of description.json +data: + @true + +run: data setup runhls setup: | check_part @rm -f ./settings.tcl @@ -222,15 +227,15 @@ setup: | check_part @echo 'set COSIM $(COSIM)' >> ./settings.tcl @echo 'set VIVADO_SYN $(VIVADO_SYN)' >> ./settings.tcl @echo 'set VIVADO_IMPL $(VIVADO_IMPL)' >> ./settings.tcl - @echo 'set QOR_CHECK $(QOR_CHECK)' >> ./settings.tcl @echo 'set XF_PROJ_ROOT "$(XF_PROJ_ROOT)"' >> ./settings.tcl + @echo 'set CUR_DIR "$(CUR_DIR)"' >> ./settings.tcl @echo "Configured: settings.tcl" @echo "----" @cat ./settings.tcl @echo "----" HLS ?= vitis_hls -runhls: setup | check_vivado +runhls: data setup | check_vivado check_vpp $(HLS) -f run_hls.tcl; clean: @@ -239,4 +244,4 @@ clean: # Used by Jenkins test cleanall: clean -# MK_INC_END hls_test_rules.mk +# MK_INC_END hls_test_rules.mk \ No newline at end of file diff --git a/security/L1/tests/crc32_2/description.json b/security/L1/tests/crc32_2/description.json index d4d434ecba..f207fb8d24 100644 --- a/security/L1/tests/crc32_2/description.json +++ b/security/L1/tests/crc32_2/description.json @@ -2,27 +2,28 @@ "name": "Xilinx CRC32", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "crc32", "solution": "sol", "clock": "3.33", "topfunction": "dut", "top": { "source": [ - "tb.cpp" + "dut.cpp" ], "cflags": "-I${XF_PROJ_ROOT}/L1/include" }, "testbench": { "source": [ - "tb.cpp" + "tb.cpp", + "test.dat" ], "cflags": "-I${XF_PROJ_ROOT}/L1/include", "argv": {}, @@ -37,17 +38,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -56,10 +57,10 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, "clock_uncertainty": 1.05 -} \ No newline at end of file +} diff --git a/security/L1/tests/crc32_2/run_hls.tcl b/security/L1/tests/crc32_2/run_hls.tcl index b7fe32b6a2..394f482cf9 100644 --- a/security/L1/tests/crc32_2/run_hls.tcl +++ b/security/L1/tests/crc32_2/run_hls.tcl @@ -1,5 +1,5 @@ # -# Copyright 2019 Xilinx, Inc. +# Copyright 2019-2021 Xilinx, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -25,14 +25,15 @@ if {![info exists CLKP]} { open_project -reset $PROJ -set cflags "-std=c++14" add_files "dut.cpp" -cflags "-I${XF_PROJ_ROOT}/L1/include" -add_files -tb "tb.cpp" -cflags "-I${XF_PROJ_ROOT}/L1/include" -add_files -tb test.dat +add_files -tb "tb.cpp test.dat" -cflags "-I${XF_PROJ_ROOT}/L1/include" set_top dut open_solution -reset $SOLN + + + set_part $XPART create_clock -period $CLKP set_clock_uncertainty 1.05 @@ -57,8 +58,4 @@ if {$VIVADO_IMPL == 1} { export_design -flow impl -rtl verilog } -if {$QOR_CHECK == 1} { - puts "QoR check not implemented yet" -} - -exit +exit \ No newline at end of file diff --git a/security/L1/tests/crc32_sizeLess/Makefile b/security/L1/tests/crc32_sizeLess/Makefile index 6c0ecc8706..d08654dcab 100644 --- a/security/L1/tests/crc32_sizeLess/Makefile +++ b/security/L1/tests/crc32_sizeLess/Makefile @@ -1,5 +1,5 @@ # -# Copyright 2019 Xilinx, Inc. +# Copyright 2019-2020 Xilinx, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -16,7 +16,7 @@ MK_PATH := $(abspath $(lastword $(MAKEFILE_LIST))) CUR_DIR := $(patsubst %/,%,$(dir $(MK_PATH))) -XF_PROJ_ROOT ?= $(shell bash -c 'export MK_PATH=$(MK_PATH); echo $${MK_PATH%L1/tests/*}') +XF_PROJ_ROOT ?= $(shell bash -c 'export MK_PATH=$(MK_PATH); echo $${MK_PATH%/L1/*}') # MK_INC_BEGIN hls_common.mk @@ -51,13 +51,6 @@ help:: # MK_INC_BEGIN vivado.mk -TOOL_VERSION ?= 2019.2 - -ifeq (,$(XILINX_VIVADO)) -XILINX_VIVADO = /opt/xilinx/Vivado/$(TOOL_VERSION) -endif -export XILINX_VIVADO - .PHONY: check_vivado check_vivado: ifeq (,$(wildcard $(XILINX_VIVADO)/bin/vivado)) @@ -72,27 +65,14 @@ DEVICE ?= u200 # MK_INC_BEGIN vitis_set_part.mk -.PHONY: check_part - -ifeq (,$(XPART)) # MK_INC_BEGIN vitis.mk -TOOL_VERSION ?= 2019.2 - -ifeq (,$(XILINX_VITIS)) -XILINX_VITIS = /opt/xilinx/Vitis/$(TOOL_VERSION) -endif -export XILINX_VITIS .PHONY: check_vpp check_vpp: ifeq (,$(wildcard $(XILINX_VITIS)/bin/v++)) @echo "Cannot locate Vitis installation. Please set XILINX_VITIS variable." && false endif -ifeq (,$(XILINX_XRT)) -XILINX_XRT = /opt/xilinx/xrt -endif -export XILINX_XRT .PHONY: check_xrt check_xrt: ifeq (,$(wildcard $(XILINX_XRT)/lib/libxilinxopencl.so)) @@ -111,6 +91,10 @@ export LD_LIBRARY_PATH := $(shell $(XILINX_VITIS)/bin/ldlibpath.sh $(XILINX_VITI endif # MK_INC_END vitis.mk + +.PHONY: check_part + +ifeq (,$(XPART)) # MK_INC_BEGIN vitis_set_platform.mk ifneq (,$(wildcard $(DEVICE))) @@ -119,31 +103,48 @@ XPLATFORM := $(DEVICE) else # Use DEVICE as a file name pattern DEVICE_L := $(shell echo $(DEVICE) | tr A-Z a-z) -# Match the name +# 1. search paths specified by variable ifneq (,$(PLATFORM_REPO_PATHS)) +# 1.1 as exact name +XPLATFORM := $(strip $(foreach p, $(subst :, ,$(PLATFORM_REPO_PATHS)), $(wildcard $(p)/$(DEVICE_L)/$(DEVICE_L).xpfm))) +# 1.2 as a pattern +ifeq (,$(XPLATFORM)) XPLATFORMS := $(foreach p, $(subst :, ,$(PLATFORM_REPO_PATHS)), $(wildcard $(p)/*/*.xpfm)) XPLATFORM := $(strip $(foreach p, $(XPLATFORMS), $(shell echo $(p) | awk '$$1 ~ /$(DEVICE_L)/'))) -endif +endif # 1.2 +endif # 1 +# 2. search Vitis installation +ifeq (,$(XPLATFORM)) +# 2.1 as exact name +XPLATFORM := $(strip $(wildcard $(XILINX_VITIS)/platforms/$(DEVICE_L)/$(DEVICE_L).xpfm)) +# 2.2 as a pattern ifeq (,$(XPLATFORM)) XPLATFORMS := $(wildcard $(XILINX_VITIS)/platforms/*/*.xpfm) XPLATFORM := $(strip $(foreach p, $(XPLATFORMS), $(shell echo $(p) | awk '$$1 ~ /$(DEVICE_L)/'))) -endif +endif # 2.2 +endif # 2 +# 3. search default locations +ifeq (,$(XPLATFORM)) +# 3.1 as exact name +XPLATFORM := $(strip $(wildcard /opt/xilinx/platforms/$(DEVICE_L)/$(DEVICE_L).xpfm)) +# 3.2 as a pattern ifeq (,$(XPLATFORM)) XPLATFORMS := $(wildcard /opt/xilinx/platforms/*/*.xpfm) XPLATFORM := $(strip $(foreach p, $(XPLATFORMS), $(shell echo $(p) | awk '$$1 ~ /$(DEVICE_L)/'))) -endif +endif # 3.2 +endif # 3 endif define MSG_PLATFORM No platform matched pattern '$(DEVICE)'. Available platforms are: $(XPLATFORMS) -To add more platform directories, set the PLATFORM_REPO_PATHS variable. +To add more platform directories, set the PLATFORM_REPO_PATHS variable or point DEVICE variable to the full path of platform .xpfm file. endef export MSG_PLATFORM define MSG_DEVICE More than one platform matched: $(XPLATFORM) -Please set DEVICE variable more accurately to select only one platform file. For example: DEVICE='u200.*xdma' +Please set DEVICE variable more accurately to select only one platform file, or set DEVICE variable to the full path of the platform .xpfm file. endef export MSG_DEVICE @@ -211,7 +212,11 @@ ifeq (1,$(COSIM)) override CSYNTH := 1 endif -run: setup runhls +# From testbench.data_recipe of description.json +data: + @true + +run: data setup runhls setup: | check_part @rm -f ./settings.tcl @@ -222,15 +227,15 @@ setup: | check_part @echo 'set COSIM $(COSIM)' >> ./settings.tcl @echo 'set VIVADO_SYN $(VIVADO_SYN)' >> ./settings.tcl @echo 'set VIVADO_IMPL $(VIVADO_IMPL)' >> ./settings.tcl - @echo 'set QOR_CHECK $(QOR_CHECK)' >> ./settings.tcl @echo 'set XF_PROJ_ROOT "$(XF_PROJ_ROOT)"' >> ./settings.tcl + @echo 'set CUR_DIR "$(CUR_DIR)"' >> ./settings.tcl @echo "Configured: settings.tcl" @echo "----" @cat ./settings.tcl @echo "----" HLS ?= vitis_hls -runhls: setup | check_vivado +runhls: data setup | check_vivado check_vpp $(HLS) -f run_hls.tcl; clean: @@ -239,4 +244,4 @@ clean: # Used by Jenkins test cleanall: clean -# MK_INC_END hls_test_rules.mk +# MK_INC_END hls_test_rules.mk \ No newline at end of file diff --git a/security/L1/tests/crc32_sizeLess/description.json b/security/L1/tests/crc32_sizeLess/description.json index a8c1ba87ba..5cd2f7622f 100644 --- a/security/L1/tests/crc32_sizeLess/description.json +++ b/security/L1/tests/crc32_sizeLess/description.json @@ -2,27 +2,28 @@ "name": "Xilinx CRC32 Size Less", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "crc32", "solution": "sol", "clock": "3.33", "topfunction": "dut", "top": { "source": [ - "tb.cpp" + "dut.cpp" ], "cflags": "-I${XF_PROJ_ROOT}/L1/include" }, "testbench": { "source": [ - "tb.cpp" + "tb.cpp", + "test.dat" ], "cflags": "-I${XF_PROJ_ROOT}/L1/include", "argv": {}, @@ -37,17 +38,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -56,10 +57,10 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, "clock_uncertainty": 1.05 -} \ No newline at end of file +} diff --git a/security/L1/tests/crc32_sizeLess/run_hls.tcl b/security/L1/tests/crc32_sizeLess/run_hls.tcl index b7fe32b6a2..394f482cf9 100644 --- a/security/L1/tests/crc32_sizeLess/run_hls.tcl +++ b/security/L1/tests/crc32_sizeLess/run_hls.tcl @@ -1,5 +1,5 @@ # -# Copyright 2019 Xilinx, Inc. +# Copyright 2019-2021 Xilinx, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -25,14 +25,15 @@ if {![info exists CLKP]} { open_project -reset $PROJ -set cflags "-std=c++14" add_files "dut.cpp" -cflags "-I${XF_PROJ_ROOT}/L1/include" -add_files -tb "tb.cpp" -cflags "-I${XF_PROJ_ROOT}/L1/include" -add_files -tb test.dat +add_files -tb "tb.cpp test.dat" -cflags "-I${XF_PROJ_ROOT}/L1/include" set_top dut open_solution -reset $SOLN + + + set_part $XPART create_clock -period $CLKP set_clock_uncertainty 1.05 @@ -57,8 +58,4 @@ if {$VIVADO_IMPL == 1} { export_design -flow impl -rtl verilog } -if {$QOR_CHECK == 1} { - puts "QoR check not implemented yet" -} - -exit +exit \ No newline at end of file diff --git a/security/L1/tests/crc32_sizeLess2/Makefile b/security/L1/tests/crc32_sizeLess2/Makefile index 6c0ecc8706..d08654dcab 100644 --- a/security/L1/tests/crc32_sizeLess2/Makefile +++ b/security/L1/tests/crc32_sizeLess2/Makefile @@ -1,5 +1,5 @@ # -# Copyright 2019 Xilinx, Inc. +# Copyright 2019-2020 Xilinx, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -16,7 +16,7 @@ MK_PATH := $(abspath $(lastword $(MAKEFILE_LIST))) CUR_DIR := $(patsubst %/,%,$(dir $(MK_PATH))) -XF_PROJ_ROOT ?= $(shell bash -c 'export MK_PATH=$(MK_PATH); echo $${MK_PATH%L1/tests/*}') +XF_PROJ_ROOT ?= $(shell bash -c 'export MK_PATH=$(MK_PATH); echo $${MK_PATH%/L1/*}') # MK_INC_BEGIN hls_common.mk @@ -51,13 +51,6 @@ help:: # MK_INC_BEGIN vivado.mk -TOOL_VERSION ?= 2019.2 - -ifeq (,$(XILINX_VIVADO)) -XILINX_VIVADO = /opt/xilinx/Vivado/$(TOOL_VERSION) -endif -export XILINX_VIVADO - .PHONY: check_vivado check_vivado: ifeq (,$(wildcard $(XILINX_VIVADO)/bin/vivado)) @@ -72,27 +65,14 @@ DEVICE ?= u200 # MK_INC_BEGIN vitis_set_part.mk -.PHONY: check_part - -ifeq (,$(XPART)) # MK_INC_BEGIN vitis.mk -TOOL_VERSION ?= 2019.2 - -ifeq (,$(XILINX_VITIS)) -XILINX_VITIS = /opt/xilinx/Vitis/$(TOOL_VERSION) -endif -export XILINX_VITIS .PHONY: check_vpp check_vpp: ifeq (,$(wildcard $(XILINX_VITIS)/bin/v++)) @echo "Cannot locate Vitis installation. Please set XILINX_VITIS variable." && false endif -ifeq (,$(XILINX_XRT)) -XILINX_XRT = /opt/xilinx/xrt -endif -export XILINX_XRT .PHONY: check_xrt check_xrt: ifeq (,$(wildcard $(XILINX_XRT)/lib/libxilinxopencl.so)) @@ -111,6 +91,10 @@ export LD_LIBRARY_PATH := $(shell $(XILINX_VITIS)/bin/ldlibpath.sh $(XILINX_VITI endif # MK_INC_END vitis.mk + +.PHONY: check_part + +ifeq (,$(XPART)) # MK_INC_BEGIN vitis_set_platform.mk ifneq (,$(wildcard $(DEVICE))) @@ -119,31 +103,48 @@ XPLATFORM := $(DEVICE) else # Use DEVICE as a file name pattern DEVICE_L := $(shell echo $(DEVICE) | tr A-Z a-z) -# Match the name +# 1. search paths specified by variable ifneq (,$(PLATFORM_REPO_PATHS)) +# 1.1 as exact name +XPLATFORM := $(strip $(foreach p, $(subst :, ,$(PLATFORM_REPO_PATHS)), $(wildcard $(p)/$(DEVICE_L)/$(DEVICE_L).xpfm))) +# 1.2 as a pattern +ifeq (,$(XPLATFORM)) XPLATFORMS := $(foreach p, $(subst :, ,$(PLATFORM_REPO_PATHS)), $(wildcard $(p)/*/*.xpfm)) XPLATFORM := $(strip $(foreach p, $(XPLATFORMS), $(shell echo $(p) | awk '$$1 ~ /$(DEVICE_L)/'))) -endif +endif # 1.2 +endif # 1 +# 2. search Vitis installation +ifeq (,$(XPLATFORM)) +# 2.1 as exact name +XPLATFORM := $(strip $(wildcard $(XILINX_VITIS)/platforms/$(DEVICE_L)/$(DEVICE_L).xpfm)) +# 2.2 as a pattern ifeq (,$(XPLATFORM)) XPLATFORMS := $(wildcard $(XILINX_VITIS)/platforms/*/*.xpfm) XPLATFORM := $(strip $(foreach p, $(XPLATFORMS), $(shell echo $(p) | awk '$$1 ~ /$(DEVICE_L)/'))) -endif +endif # 2.2 +endif # 2 +# 3. search default locations +ifeq (,$(XPLATFORM)) +# 3.1 as exact name +XPLATFORM := $(strip $(wildcard /opt/xilinx/platforms/$(DEVICE_L)/$(DEVICE_L).xpfm)) +# 3.2 as a pattern ifeq (,$(XPLATFORM)) XPLATFORMS := $(wildcard /opt/xilinx/platforms/*/*.xpfm) XPLATFORM := $(strip $(foreach p, $(XPLATFORMS), $(shell echo $(p) | awk '$$1 ~ /$(DEVICE_L)/'))) -endif +endif # 3.2 +endif # 3 endif define MSG_PLATFORM No platform matched pattern '$(DEVICE)'. Available platforms are: $(XPLATFORMS) -To add more platform directories, set the PLATFORM_REPO_PATHS variable. +To add more platform directories, set the PLATFORM_REPO_PATHS variable or point DEVICE variable to the full path of platform .xpfm file. endef export MSG_PLATFORM define MSG_DEVICE More than one platform matched: $(XPLATFORM) -Please set DEVICE variable more accurately to select only one platform file. For example: DEVICE='u200.*xdma' +Please set DEVICE variable more accurately to select only one platform file, or set DEVICE variable to the full path of the platform .xpfm file. endef export MSG_DEVICE @@ -211,7 +212,11 @@ ifeq (1,$(COSIM)) override CSYNTH := 1 endif -run: setup runhls +# From testbench.data_recipe of description.json +data: + @true + +run: data setup runhls setup: | check_part @rm -f ./settings.tcl @@ -222,15 +227,15 @@ setup: | check_part @echo 'set COSIM $(COSIM)' >> ./settings.tcl @echo 'set VIVADO_SYN $(VIVADO_SYN)' >> ./settings.tcl @echo 'set VIVADO_IMPL $(VIVADO_IMPL)' >> ./settings.tcl - @echo 'set QOR_CHECK $(QOR_CHECK)' >> ./settings.tcl @echo 'set XF_PROJ_ROOT "$(XF_PROJ_ROOT)"' >> ./settings.tcl + @echo 'set CUR_DIR "$(CUR_DIR)"' >> ./settings.tcl @echo "Configured: settings.tcl" @echo "----" @cat ./settings.tcl @echo "----" HLS ?= vitis_hls -runhls: setup | check_vivado +runhls: data setup | check_vivado check_vpp $(HLS) -f run_hls.tcl; clean: @@ -239,4 +244,4 @@ clean: # Used by Jenkins test cleanall: clean -# MK_INC_END hls_test_rules.mk +# MK_INC_END hls_test_rules.mk \ No newline at end of file diff --git a/security/L1/tests/crc32_sizeLess2/description.json b/security/L1/tests/crc32_sizeLess2/description.json index a8c1ba87ba..5cd2f7622f 100644 --- a/security/L1/tests/crc32_sizeLess2/description.json +++ b/security/L1/tests/crc32_sizeLess2/description.json @@ -2,27 +2,28 @@ "name": "Xilinx CRC32 Size Less", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "crc32", "solution": "sol", "clock": "3.33", "topfunction": "dut", "top": { "source": [ - "tb.cpp" + "dut.cpp" ], "cflags": "-I${XF_PROJ_ROOT}/L1/include" }, "testbench": { "source": [ - "tb.cpp" + "tb.cpp", + "test.dat" ], "cflags": "-I${XF_PROJ_ROOT}/L1/include", "argv": {}, @@ -37,17 +38,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -56,10 +57,10 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, "clock_uncertainty": 1.05 -} \ No newline at end of file +} diff --git a/security/L1/tests/crc32_sizeLess2/run_hls.tcl b/security/L1/tests/crc32_sizeLess2/run_hls.tcl index b7fe32b6a2..394f482cf9 100644 --- a/security/L1/tests/crc32_sizeLess2/run_hls.tcl +++ b/security/L1/tests/crc32_sizeLess2/run_hls.tcl @@ -1,5 +1,5 @@ # -# Copyright 2019 Xilinx, Inc. +# Copyright 2019-2021 Xilinx, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -25,14 +25,15 @@ if {![info exists CLKP]} { open_project -reset $PROJ -set cflags "-std=c++14" add_files "dut.cpp" -cflags "-I${XF_PROJ_ROOT}/L1/include" -add_files -tb "tb.cpp" -cflags "-I${XF_PROJ_ROOT}/L1/include" -add_files -tb test.dat +add_files -tb "tb.cpp test.dat" -cflags "-I${XF_PROJ_ROOT}/L1/include" set_top dut open_solution -reset $SOLN + + + set_part $XPART create_clock -period $CLKP set_clock_uncertainty 1.05 @@ -57,8 +58,4 @@ if {$VIVADO_IMPL == 1} { export_design -flow impl -rtl verilog } -if {$QOR_CHECK == 1} { - puts "QoR check not implemented yet" -} - -exit +exit \ No newline at end of file diff --git a/security/L1/tests/crc32c/Makefile b/security/L1/tests/crc32c/Makefile index 6c0ecc8706..d08654dcab 100644 --- a/security/L1/tests/crc32c/Makefile +++ b/security/L1/tests/crc32c/Makefile @@ -1,5 +1,5 @@ # -# Copyright 2019 Xilinx, Inc. +# Copyright 2019-2020 Xilinx, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -16,7 +16,7 @@ MK_PATH := $(abspath $(lastword $(MAKEFILE_LIST))) CUR_DIR := $(patsubst %/,%,$(dir $(MK_PATH))) -XF_PROJ_ROOT ?= $(shell bash -c 'export MK_PATH=$(MK_PATH); echo $${MK_PATH%L1/tests/*}') +XF_PROJ_ROOT ?= $(shell bash -c 'export MK_PATH=$(MK_PATH); echo $${MK_PATH%/L1/*}') # MK_INC_BEGIN hls_common.mk @@ -51,13 +51,6 @@ help:: # MK_INC_BEGIN vivado.mk -TOOL_VERSION ?= 2019.2 - -ifeq (,$(XILINX_VIVADO)) -XILINX_VIVADO = /opt/xilinx/Vivado/$(TOOL_VERSION) -endif -export XILINX_VIVADO - .PHONY: check_vivado check_vivado: ifeq (,$(wildcard $(XILINX_VIVADO)/bin/vivado)) @@ -72,27 +65,14 @@ DEVICE ?= u200 # MK_INC_BEGIN vitis_set_part.mk -.PHONY: check_part - -ifeq (,$(XPART)) # MK_INC_BEGIN vitis.mk -TOOL_VERSION ?= 2019.2 - -ifeq (,$(XILINX_VITIS)) -XILINX_VITIS = /opt/xilinx/Vitis/$(TOOL_VERSION) -endif -export XILINX_VITIS .PHONY: check_vpp check_vpp: ifeq (,$(wildcard $(XILINX_VITIS)/bin/v++)) @echo "Cannot locate Vitis installation. Please set XILINX_VITIS variable." && false endif -ifeq (,$(XILINX_XRT)) -XILINX_XRT = /opt/xilinx/xrt -endif -export XILINX_XRT .PHONY: check_xrt check_xrt: ifeq (,$(wildcard $(XILINX_XRT)/lib/libxilinxopencl.so)) @@ -111,6 +91,10 @@ export LD_LIBRARY_PATH := $(shell $(XILINX_VITIS)/bin/ldlibpath.sh $(XILINX_VITI endif # MK_INC_END vitis.mk + +.PHONY: check_part + +ifeq (,$(XPART)) # MK_INC_BEGIN vitis_set_platform.mk ifneq (,$(wildcard $(DEVICE))) @@ -119,31 +103,48 @@ XPLATFORM := $(DEVICE) else # Use DEVICE as a file name pattern DEVICE_L := $(shell echo $(DEVICE) | tr A-Z a-z) -# Match the name +# 1. search paths specified by variable ifneq (,$(PLATFORM_REPO_PATHS)) +# 1.1 as exact name +XPLATFORM := $(strip $(foreach p, $(subst :, ,$(PLATFORM_REPO_PATHS)), $(wildcard $(p)/$(DEVICE_L)/$(DEVICE_L).xpfm))) +# 1.2 as a pattern +ifeq (,$(XPLATFORM)) XPLATFORMS := $(foreach p, $(subst :, ,$(PLATFORM_REPO_PATHS)), $(wildcard $(p)/*/*.xpfm)) XPLATFORM := $(strip $(foreach p, $(XPLATFORMS), $(shell echo $(p) | awk '$$1 ~ /$(DEVICE_L)/'))) -endif +endif # 1.2 +endif # 1 +# 2. search Vitis installation +ifeq (,$(XPLATFORM)) +# 2.1 as exact name +XPLATFORM := $(strip $(wildcard $(XILINX_VITIS)/platforms/$(DEVICE_L)/$(DEVICE_L).xpfm)) +# 2.2 as a pattern ifeq (,$(XPLATFORM)) XPLATFORMS := $(wildcard $(XILINX_VITIS)/platforms/*/*.xpfm) XPLATFORM := $(strip $(foreach p, $(XPLATFORMS), $(shell echo $(p) | awk '$$1 ~ /$(DEVICE_L)/'))) -endif +endif # 2.2 +endif # 2 +# 3. search default locations +ifeq (,$(XPLATFORM)) +# 3.1 as exact name +XPLATFORM := $(strip $(wildcard /opt/xilinx/platforms/$(DEVICE_L)/$(DEVICE_L).xpfm)) +# 3.2 as a pattern ifeq (,$(XPLATFORM)) XPLATFORMS := $(wildcard /opt/xilinx/platforms/*/*.xpfm) XPLATFORM := $(strip $(foreach p, $(XPLATFORMS), $(shell echo $(p) | awk '$$1 ~ /$(DEVICE_L)/'))) -endif +endif # 3.2 +endif # 3 endif define MSG_PLATFORM No platform matched pattern '$(DEVICE)'. Available platforms are: $(XPLATFORMS) -To add more platform directories, set the PLATFORM_REPO_PATHS variable. +To add more platform directories, set the PLATFORM_REPO_PATHS variable or point DEVICE variable to the full path of platform .xpfm file. endef export MSG_PLATFORM define MSG_DEVICE More than one platform matched: $(XPLATFORM) -Please set DEVICE variable more accurately to select only one platform file. For example: DEVICE='u200.*xdma' +Please set DEVICE variable more accurately to select only one platform file, or set DEVICE variable to the full path of the platform .xpfm file. endef export MSG_DEVICE @@ -211,7 +212,11 @@ ifeq (1,$(COSIM)) override CSYNTH := 1 endif -run: setup runhls +# From testbench.data_recipe of description.json +data: + @true + +run: data setup runhls setup: | check_part @rm -f ./settings.tcl @@ -222,15 +227,15 @@ setup: | check_part @echo 'set COSIM $(COSIM)' >> ./settings.tcl @echo 'set VIVADO_SYN $(VIVADO_SYN)' >> ./settings.tcl @echo 'set VIVADO_IMPL $(VIVADO_IMPL)' >> ./settings.tcl - @echo 'set QOR_CHECK $(QOR_CHECK)' >> ./settings.tcl @echo 'set XF_PROJ_ROOT "$(XF_PROJ_ROOT)"' >> ./settings.tcl + @echo 'set CUR_DIR "$(CUR_DIR)"' >> ./settings.tcl @echo "Configured: settings.tcl" @echo "----" @cat ./settings.tcl @echo "----" HLS ?= vitis_hls -runhls: setup | check_vivado +runhls: data setup | check_vivado check_vpp $(HLS) -f run_hls.tcl; clean: @@ -239,4 +244,4 @@ clean: # Used by Jenkins test cleanall: clean -# MK_INC_END hls_test_rules.mk +# MK_INC_END hls_test_rules.mk \ No newline at end of file diff --git a/security/L1/tests/crc32c/description.json b/security/L1/tests/crc32c/description.json index e34f6a4a42..0dd1929d97 100644 --- a/security/L1/tests/crc32c/description.json +++ b/security/L1/tests/crc32c/description.json @@ -2,27 +2,28 @@ "name": "Xilinx CRC32C", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "crc32", "solution": "sol", "clock": "3.33", "topfunction": "dut", "top": { "source": [ - "tb.cpp" + "dut.cpp" ], "cflags": "-I${XF_PROJ_ROOT}/L1/include" }, "testbench": { "source": [ - "tb.cpp" + "tb.cpp", + "test.dat" ], "cflags": "-I${XF_PROJ_ROOT}/L1/include", "argv": {}, @@ -37,17 +38,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -56,8 +57,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/crc32c/run_hls.tcl b/security/L1/tests/crc32c/run_hls.tcl index 066067f50c..394f482cf9 100644 --- a/security/L1/tests/crc32c/run_hls.tcl +++ b/security/L1/tests/crc32c/run_hls.tcl @@ -1,5 +1,5 @@ # -# Copyright 2019 Xilinx, Inc. +# Copyright 2019-2021 Xilinx, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -16,7 +16,7 @@ source settings.tcl -set PROJ "crc32c.prj" +set PROJ "crc32.prj" set SOLN "sol" if {![info exists CLKP]} { @@ -25,14 +25,15 @@ if {![info exists CLKP]} { open_project -reset $PROJ -set cflags "-std=c++14" add_files "dut.cpp" -cflags "-I${XF_PROJ_ROOT}/L1/include" -add_files -tb "tb.cpp" -cflags "-I${XF_PROJ_ROOT}/L1/include" -add_files -tb test.dat +add_files -tb "tb.cpp test.dat" -cflags "-I${XF_PROJ_ROOT}/L1/include" set_top dut open_solution -reset $SOLN + + + set_part $XPART create_clock -period $CLKP set_clock_uncertainty 1.05 @@ -57,8 +58,4 @@ if {$VIVADO_IMPL == 1} { export_design -flow impl -rtl verilog } -if {$QOR_CHECK == 1} { - puts "QoR check not implemented yet" -} - -exit +exit \ No newline at end of file diff --git a/security/L1/tests/crc32c_sizeLess/Makefile b/security/L1/tests/crc32c_sizeLess/Makefile index 6c0ecc8706..d08654dcab 100644 --- a/security/L1/tests/crc32c_sizeLess/Makefile +++ b/security/L1/tests/crc32c_sizeLess/Makefile @@ -1,5 +1,5 @@ # -# Copyright 2019 Xilinx, Inc. +# Copyright 2019-2020 Xilinx, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -16,7 +16,7 @@ MK_PATH := $(abspath $(lastword $(MAKEFILE_LIST))) CUR_DIR := $(patsubst %/,%,$(dir $(MK_PATH))) -XF_PROJ_ROOT ?= $(shell bash -c 'export MK_PATH=$(MK_PATH); echo $${MK_PATH%L1/tests/*}') +XF_PROJ_ROOT ?= $(shell bash -c 'export MK_PATH=$(MK_PATH); echo $${MK_PATH%/L1/*}') # MK_INC_BEGIN hls_common.mk @@ -51,13 +51,6 @@ help:: # MK_INC_BEGIN vivado.mk -TOOL_VERSION ?= 2019.2 - -ifeq (,$(XILINX_VIVADO)) -XILINX_VIVADO = /opt/xilinx/Vivado/$(TOOL_VERSION) -endif -export XILINX_VIVADO - .PHONY: check_vivado check_vivado: ifeq (,$(wildcard $(XILINX_VIVADO)/bin/vivado)) @@ -72,27 +65,14 @@ DEVICE ?= u200 # MK_INC_BEGIN vitis_set_part.mk -.PHONY: check_part - -ifeq (,$(XPART)) # MK_INC_BEGIN vitis.mk -TOOL_VERSION ?= 2019.2 - -ifeq (,$(XILINX_VITIS)) -XILINX_VITIS = /opt/xilinx/Vitis/$(TOOL_VERSION) -endif -export XILINX_VITIS .PHONY: check_vpp check_vpp: ifeq (,$(wildcard $(XILINX_VITIS)/bin/v++)) @echo "Cannot locate Vitis installation. Please set XILINX_VITIS variable." && false endif -ifeq (,$(XILINX_XRT)) -XILINX_XRT = /opt/xilinx/xrt -endif -export XILINX_XRT .PHONY: check_xrt check_xrt: ifeq (,$(wildcard $(XILINX_XRT)/lib/libxilinxopencl.so)) @@ -111,6 +91,10 @@ export LD_LIBRARY_PATH := $(shell $(XILINX_VITIS)/bin/ldlibpath.sh $(XILINX_VITI endif # MK_INC_END vitis.mk + +.PHONY: check_part + +ifeq (,$(XPART)) # MK_INC_BEGIN vitis_set_platform.mk ifneq (,$(wildcard $(DEVICE))) @@ -119,31 +103,48 @@ XPLATFORM := $(DEVICE) else # Use DEVICE as a file name pattern DEVICE_L := $(shell echo $(DEVICE) | tr A-Z a-z) -# Match the name +# 1. search paths specified by variable ifneq (,$(PLATFORM_REPO_PATHS)) +# 1.1 as exact name +XPLATFORM := $(strip $(foreach p, $(subst :, ,$(PLATFORM_REPO_PATHS)), $(wildcard $(p)/$(DEVICE_L)/$(DEVICE_L).xpfm))) +# 1.2 as a pattern +ifeq (,$(XPLATFORM)) XPLATFORMS := $(foreach p, $(subst :, ,$(PLATFORM_REPO_PATHS)), $(wildcard $(p)/*/*.xpfm)) XPLATFORM := $(strip $(foreach p, $(XPLATFORMS), $(shell echo $(p) | awk '$$1 ~ /$(DEVICE_L)/'))) -endif +endif # 1.2 +endif # 1 +# 2. search Vitis installation +ifeq (,$(XPLATFORM)) +# 2.1 as exact name +XPLATFORM := $(strip $(wildcard $(XILINX_VITIS)/platforms/$(DEVICE_L)/$(DEVICE_L).xpfm)) +# 2.2 as a pattern ifeq (,$(XPLATFORM)) XPLATFORMS := $(wildcard $(XILINX_VITIS)/platforms/*/*.xpfm) XPLATFORM := $(strip $(foreach p, $(XPLATFORMS), $(shell echo $(p) | awk '$$1 ~ /$(DEVICE_L)/'))) -endif +endif # 2.2 +endif # 2 +# 3. search default locations +ifeq (,$(XPLATFORM)) +# 3.1 as exact name +XPLATFORM := $(strip $(wildcard /opt/xilinx/platforms/$(DEVICE_L)/$(DEVICE_L).xpfm)) +# 3.2 as a pattern ifeq (,$(XPLATFORM)) XPLATFORMS := $(wildcard /opt/xilinx/platforms/*/*.xpfm) XPLATFORM := $(strip $(foreach p, $(XPLATFORMS), $(shell echo $(p) | awk '$$1 ~ /$(DEVICE_L)/'))) -endif +endif # 3.2 +endif # 3 endif define MSG_PLATFORM No platform matched pattern '$(DEVICE)'. Available platforms are: $(XPLATFORMS) -To add more platform directories, set the PLATFORM_REPO_PATHS variable. +To add more platform directories, set the PLATFORM_REPO_PATHS variable or point DEVICE variable to the full path of platform .xpfm file. endef export MSG_PLATFORM define MSG_DEVICE More than one platform matched: $(XPLATFORM) -Please set DEVICE variable more accurately to select only one platform file. For example: DEVICE='u200.*xdma' +Please set DEVICE variable more accurately to select only one platform file, or set DEVICE variable to the full path of the platform .xpfm file. endef export MSG_DEVICE @@ -211,7 +212,11 @@ ifeq (1,$(COSIM)) override CSYNTH := 1 endif -run: setup runhls +# From testbench.data_recipe of description.json +data: + @true + +run: data setup runhls setup: | check_part @rm -f ./settings.tcl @@ -222,15 +227,15 @@ setup: | check_part @echo 'set COSIM $(COSIM)' >> ./settings.tcl @echo 'set VIVADO_SYN $(VIVADO_SYN)' >> ./settings.tcl @echo 'set VIVADO_IMPL $(VIVADO_IMPL)' >> ./settings.tcl - @echo 'set QOR_CHECK $(QOR_CHECK)' >> ./settings.tcl @echo 'set XF_PROJ_ROOT "$(XF_PROJ_ROOT)"' >> ./settings.tcl + @echo 'set CUR_DIR "$(CUR_DIR)"' >> ./settings.tcl @echo "Configured: settings.tcl" @echo "----" @cat ./settings.tcl @echo "----" HLS ?= vitis_hls -runhls: setup | check_vivado +runhls: data setup | check_vivado check_vpp $(HLS) -f run_hls.tcl; clean: @@ -239,4 +244,4 @@ clean: # Used by Jenkins test cleanall: clean -# MK_INC_END hls_test_rules.mk +# MK_INC_END hls_test_rules.mk \ No newline at end of file diff --git a/security/L1/tests/crc32c_sizeLess/description.json b/security/L1/tests/crc32c_sizeLess/description.json index 75403b249e..2799e5ab7d 100644 --- a/security/L1/tests/crc32c_sizeLess/description.json +++ b/security/L1/tests/crc32c_sizeLess/description.json @@ -2,27 +2,28 @@ "name": "Xilinx CRC32C Size Less", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "crc32", "solution": "sol", "clock": "3.33", "topfunction": "dut", "top": { "source": [ - "tb.cpp" + "dut.cpp" ], "cflags": "-I${XF_PROJ_ROOT}/L1/include" }, "testbench": { "source": [ - "tb.cpp" + "tb.cpp", + "test.dat" ], "cflags": "-I${XF_PROJ_ROOT}/L1/include", "argv": {}, @@ -37,17 +38,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -56,8 +57,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/crc32c_sizeLess/run_hls.tcl b/security/L1/tests/crc32c_sizeLess/run_hls.tcl index 066067f50c..394f482cf9 100644 --- a/security/L1/tests/crc32c_sizeLess/run_hls.tcl +++ b/security/L1/tests/crc32c_sizeLess/run_hls.tcl @@ -1,5 +1,5 @@ # -# Copyright 2019 Xilinx, Inc. +# Copyright 2019-2021 Xilinx, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -16,7 +16,7 @@ source settings.tcl -set PROJ "crc32c.prj" +set PROJ "crc32.prj" set SOLN "sol" if {![info exists CLKP]} { @@ -25,14 +25,15 @@ if {![info exists CLKP]} { open_project -reset $PROJ -set cflags "-std=c++14" add_files "dut.cpp" -cflags "-I${XF_PROJ_ROOT}/L1/include" -add_files -tb "tb.cpp" -cflags "-I${XF_PROJ_ROOT}/L1/include" -add_files -tb test.dat +add_files -tb "tb.cpp test.dat" -cflags "-I${XF_PROJ_ROOT}/L1/include" set_top dut open_solution -reset $SOLN + + + set_part $XPART create_clock -period $CLKP set_clock_uncertainty 1.05 @@ -57,8 +58,4 @@ if {$VIVADO_IMPL == 1} { export_design -flow impl -rtl verilog } -if {$QOR_CHECK == 1} { - puts "QoR check not implemented yet" -} - -exit +exit \ No newline at end of file diff --git a/security/L1/tests/ctr/aes128dec/description.json b/security/L1/tests/ctr/aes128dec/description.json index 9366730ca9..5d177ff61c 100644 --- a/security/L1/tests/ctr/aes128dec/description.json +++ b/security/L1/tests/ctr/aes128dec/description.json @@ -2,14 +2,14 @@ "name": "Xilinx AES128CTR Decryption", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "ictr_aes128_test", "solution": "solution1", "clock": "3.33", @@ -38,17 +38,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -57,8 +57,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/ctr/aes128enc/description.json b/security/L1/tests/ctr/aes128enc/description.json index 014c2edbad..a48f16085e 100644 --- a/security/L1/tests/ctr/aes128enc/description.json +++ b/security/L1/tests/ctr/aes128enc/description.json @@ -2,14 +2,14 @@ "name": "Xilinx AES128CTR Encryption", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "ctr_aes128_test", "solution": "solution1", "clock": "3.33", @@ -38,17 +38,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -57,8 +57,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/ctr/aes192dec/description.json b/security/L1/tests/ctr/aes192dec/description.json index 19420af6f3..6cc1260ce9 100644 --- a/security/L1/tests/ctr/aes192dec/description.json +++ b/security/L1/tests/ctr/aes192dec/description.json @@ -2,14 +2,14 @@ "name": "Xilinx AES192CTR Decryption", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "ictr_aes192_test", "solution": "solution1", "clock": "3.33", @@ -38,17 +38,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -57,8 +57,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/ctr/aes192enc/description.json b/security/L1/tests/ctr/aes192enc/description.json index ada117c4ea..54d75c239c 100644 --- a/security/L1/tests/ctr/aes192enc/description.json +++ b/security/L1/tests/ctr/aes192enc/description.json @@ -2,14 +2,14 @@ "name": "Xilinx AES192CTR Encryption", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "ctr_aes192_test", "solution": "solution1", "clock": "3.33", @@ -38,17 +38,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -57,8 +57,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/ctr/aes256dec/description.json b/security/L1/tests/ctr/aes256dec/description.json index 7b5d07ee3c..42959d8053 100644 --- a/security/L1/tests/ctr/aes256dec/description.json +++ b/security/L1/tests/ctr/aes256dec/description.json @@ -2,14 +2,14 @@ "name": "Xilinx AES256CTR Decryption", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "ictr_aes256_test", "solution": "solution1", "clock": "3.33", @@ -38,17 +38,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -57,8 +57,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/ctr/aes256enc/description.json b/security/L1/tests/ctr/aes256enc/description.json index beeda7c21a..70b7372ea1 100644 --- a/security/L1/tests/ctr/aes256enc/description.json +++ b/security/L1/tests/ctr/aes256enc/description.json @@ -2,14 +2,14 @@ "name": "Xilinx AES256CTR Encryption", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "ctr_aes256_test", "solution": "solution1", "clock": "3.33", @@ -38,17 +38,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -57,8 +57,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/des/3desDec/description.json b/security/L1/tests/des/3desDec/description.json index 506fb66777..2f15bba751 100644 --- a/security/L1/tests/des/3desDec/description.json +++ b/security/L1/tests/des/3desDec/description.json @@ -2,14 +2,14 @@ "name": "Xilinx 3DES Decryption", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "tdes_test", "solution": "solution1", "clock": "3.33", @@ -37,17 +37,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -56,8 +56,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/des/3desEnc/description.json b/security/L1/tests/des/3desEnc/description.json index e0d881c0ce..1eb47f908a 100644 --- a/security/L1/tests/des/3desEnc/description.json +++ b/security/L1/tests/des/3desEnc/description.json @@ -2,14 +2,14 @@ "name": "Xilinx 3DES Encryption", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "tdes_test", "solution": "solution1", "clock": "3.33", @@ -37,17 +37,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -56,8 +56,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/des/desDec/description.json b/security/L1/tests/des/desDec/description.json index a101bbd9fd..ffc345e903 100644 --- a/security/L1/tests/des/desDec/description.json +++ b/security/L1/tests/des/desDec/description.json @@ -2,14 +2,14 @@ "name": "Xilinx DES Decryption", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "des_test", "solution": "solution1", "clock": "3.33", @@ -38,17 +38,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -57,8 +57,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/des/desEnc/description.json b/security/L1/tests/des/desEnc/description.json index c8ccabf9fc..0b64036f5e 100644 --- a/security/L1/tests/des/desEnc/description.json +++ b/security/L1/tests/des/desEnc/description.json @@ -2,14 +2,14 @@ "name": "Xilinx DES Encryption", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "des_test", "solution": "solution1", "clock": "3.33", @@ -38,17 +38,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -57,8 +57,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/dsa/description.json b/security/L1/tests/dsa/description.json index 4003d2e144..beeba4b87b 100644 --- a/security/L1/tests/dsa/description.json +++ b/security/L1/tests/dsa/description.json @@ -2,14 +2,14 @@ "name": "Xilinx DSA", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "prj", "solution": "solution1", "clock": "4", @@ -38,17 +38,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 360, + "vivado_syn": 360, "hls_csim": 60, "hls_cosim": 360, - "hls_vivado_impl": 360, + "vivado_impl": 360, "hls_csynth": 60 } } diff --git a/security/L1/tests/ecb/aes128dec/description.json b/security/L1/tests/ecb/aes128dec/description.json index 0b45b9c59f..27447c2e92 100644 --- a/security/L1/tests/ecb/aes128dec/description.json +++ b/security/L1/tests/ecb/aes128dec/description.json @@ -2,14 +2,14 @@ "name": "Xilinx AES128ECB Decryption", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "iecb_aes128_test", "solution": "solution1", "clock": "3.33", @@ -38,17 +38,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -57,8 +57,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/ecb/aes128enc/description.json b/security/L1/tests/ecb/aes128enc/description.json index 4524f0e692..20238e8fcf 100644 --- a/security/L1/tests/ecb/aes128enc/description.json +++ b/security/L1/tests/ecb/aes128enc/description.json @@ -2,14 +2,14 @@ "name": "Xilinx AES128ECB Encryption", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "ecb_aes128_test", "solution": "solution1", "clock": "3.33", @@ -38,17 +38,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -57,8 +57,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/ecb/aes192dec/description.json b/security/L1/tests/ecb/aes192dec/description.json index b03adb6653..d090b71cc3 100644 --- a/security/L1/tests/ecb/aes192dec/description.json +++ b/security/L1/tests/ecb/aes192dec/description.json @@ -2,14 +2,14 @@ "name": "Xilinx AES192ECB Decryption", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "iecb_aes192_test", "solution": "solution1", "clock": "3.33", @@ -38,17 +38,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -57,8 +57,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/ecb/aes192enc/description.json b/security/L1/tests/ecb/aes192enc/description.json index 4b2cc920f1..f05ec28a94 100644 --- a/security/L1/tests/ecb/aes192enc/description.json +++ b/security/L1/tests/ecb/aes192enc/description.json @@ -2,14 +2,14 @@ "name": "Xilinx AES192ECB Encryption", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "ecb_aes192_test", "solution": "solution1", "clock": "3.33", @@ -38,17 +38,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -57,8 +57,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/ecb/aes256dec/description.json b/security/L1/tests/ecb/aes256dec/description.json index aeeeb979d6..665db805e0 100644 --- a/security/L1/tests/ecb/aes256dec/description.json +++ b/security/L1/tests/ecb/aes256dec/description.json @@ -2,14 +2,14 @@ "name": "Xilinx AES256ECB Decryption", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "iecb_aes256_test", "solution": "solution1", "clock": "3.33", @@ -38,17 +38,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -57,8 +57,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/ecb/aes256enc/description.json b/security/L1/tests/ecb/aes256enc/description.json index ff9c0c6333..929e14f8ae 100644 --- a/security/L1/tests/ecb/aes256enc/description.json +++ b/security/L1/tests/ecb/aes256enc/description.json @@ -2,14 +2,14 @@ "name": "Xilinx AES256ECB Encryption", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "ecb_aes256_test", "solution": "solution1", "clock": "3.33", @@ -38,17 +38,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -57,8 +57,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/ecb/des64dec/description.json b/security/L1/tests/ecb/des64dec/description.json index 829b6e8449..89a25f1c7d 100644 --- a/security/L1/tests/ecb/des64dec/description.json +++ b/security/L1/tests/ecb/des64dec/description.json @@ -2,14 +2,14 @@ "name": "Xilinx DES64ECB Decryption", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "iecb_des64_test", "solution": "solution1", "clock": "3.33", @@ -38,17 +38,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -57,8 +57,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/ecb/des64enc/description.json b/security/L1/tests/ecb/des64enc/description.json index ed1ea70164..a2214a9b28 100644 --- a/security/L1/tests/ecb/des64enc/description.json +++ b/security/L1/tests/ecb/des64enc/description.json @@ -2,14 +2,14 @@ "name": "Xilinx DES64ECB Encryption", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "ecb_des64_test", "solution": "solution1", "clock": "3.33", @@ -38,17 +38,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -57,8 +57,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/ecc_dec/description.json b/security/L1/tests/ecc_dec/description.json index bbe87ff678..ab69ea6837 100644 --- a/security/L1/tests/ecc_dec/description.json +++ b/security/L1/tests/ecc_dec/description.json @@ -2,14 +2,14 @@ "name": "Xilinx ECC Decryption", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "ecc_test", "solution": "solution1", "clock": "3.33", @@ -37,17 +37,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -56,8 +56,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/ecc_enc/description.json b/security/L1/tests/ecc_enc/description.json index 42ec2e14b9..7d999c83be 100644 --- a/security/L1/tests/ecc_enc/description.json +++ b/security/L1/tests/ecc_enc/description.json @@ -2,14 +2,14 @@ "name": "Xilinx ECC Encryption", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "ecc_test", "solution": "solution1", "clock": "3.33", @@ -37,17 +37,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -56,8 +56,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/ecdsa_nistp256_sign/description.json b/security/L1/tests/ecdsa_nistp256_sign/description.json index 843a87f7ae..9d7e0d349b 100644 --- a/security/L1/tests/ecdsa_nistp256_sign/description.json +++ b/security/L1/tests/ecdsa_nistp256_sign/description.json @@ -2,14 +2,14 @@ "name": "Xilinx ECDSA NISTP256 Sign", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "ecdsa_nistp256_sign_test", "solution": "solution1", "clock": "3.33", @@ -37,17 +37,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -56,8 +56,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/ecdsa_nistp256_verify/description.json b/security/L1/tests/ecdsa_nistp256_verify/description.json index 06e59b0446..0c50904154 100644 --- a/security/L1/tests/ecdsa_nistp256_verify/description.json +++ b/security/L1/tests/ecdsa_nistp256_verify/description.json @@ -2,14 +2,14 @@ "name": "Xilinx ECDSA NISTP256 Verify", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "ecdsa_nistp256_verify_test", "solution": "solution1", "clock": "3.33", @@ -37,17 +37,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -56,8 +56,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/ecdsa_secp256k1_sign/description.json b/security/L1/tests/ecdsa_secp256k1_sign/description.json index b658659c90..99cb90f91e 100644 --- a/security/L1/tests/ecdsa_secp256k1_sign/description.json +++ b/security/L1/tests/ecdsa_secp256k1_sign/description.json @@ -2,14 +2,14 @@ "name": "Xilinx ECDSA Sign", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "ecdsa_secp256k1_sign_test", "solution": "solution1", "clock": "3.33", @@ -37,17 +37,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -56,8 +56,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/ecdsa_secp256k1_verify/description.json b/security/L1/tests/ecdsa_secp256k1_verify/description.json index 59f56bead9..aeb228b2c2 100644 --- a/security/L1/tests/ecdsa_secp256k1_verify/description.json +++ b/security/L1/tests/ecdsa_secp256k1_verify/description.json @@ -2,14 +2,14 @@ "name": "Xilinx ECDSA Verify", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "ecdsa_secp256k1_verify_test", "solution": "solution1", "clock": "3.33", @@ -37,17 +37,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -56,8 +56,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/ed25519_sign/description.json b/security/L1/tests/ed25519_sign/description.json index 09b31c7a0b..b0e13d800c 100644 --- a/security/L1/tests/ed25519_sign/description.json +++ b/security/L1/tests/ed25519_sign/description.json @@ -2,14 +2,14 @@ "name": "Xilinx Ed25519 Sign", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "ecc_test", "solution": "solution1", "clock": "3.33", @@ -37,17 +37,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -56,8 +56,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/ed25519_verify/description.json b/security/L1/tests/ed25519_verify/description.json index 3e6bf8226e..adae50878c 100644 --- a/security/L1/tests/ed25519_verify/description.json +++ b/security/L1/tests/ed25519_verify/description.json @@ -2,14 +2,14 @@ "name": "Xilinx Ed25519 Verify", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "ecc_test", "solution": "solution1", "clock": "3.33", @@ -37,17 +37,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -56,8 +56,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/gcm/aes128dec/description.json b/security/L1/tests/gcm/aes128dec/description.json index b201859ea8..a00159b8e6 100644 --- a/security/L1/tests/gcm/aes128dec/description.json +++ b/security/L1/tests/gcm/aes128dec/description.json @@ -2,14 +2,14 @@ "name": "Xilinx AES128GCM Decryption", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "igcm_aes128_test", "solution": "solution1", "clock": "3.33", @@ -38,17 +38,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -57,8 +57,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/gcm/aes128enc/description.json b/security/L1/tests/gcm/aes128enc/description.json index 8bbc18ea8b..606503097d 100644 --- a/security/L1/tests/gcm/aes128enc/description.json +++ b/security/L1/tests/gcm/aes128enc/description.json @@ -2,14 +2,14 @@ "name": "Xilinx AES128GCM Encryption", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "gcm_aes128_test", "solution": "solution1", "clock": "3.33", @@ -38,17 +38,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -57,8 +57,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/gcm/aes192dec/description.json b/security/L1/tests/gcm/aes192dec/description.json index a3c3802878..11ae7ccb66 100644 --- a/security/L1/tests/gcm/aes192dec/description.json +++ b/security/L1/tests/gcm/aes192dec/description.json @@ -2,14 +2,14 @@ "name": "Xilinx AES192GCM Decryption", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "igcm_aes192_test", "solution": "solution1", "clock": "3.33", @@ -38,17 +38,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -57,8 +57,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/gcm/aes192enc/description.json b/security/L1/tests/gcm/aes192enc/description.json index 33d5cf8a09..1f7fd0552c 100644 --- a/security/L1/tests/gcm/aes192enc/description.json +++ b/security/L1/tests/gcm/aes192enc/description.json @@ -2,14 +2,14 @@ "name": "Xilinx AES192GCM Encryption", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "gcm_aes192_test", "solution": "solution1", "clock": "3.33", @@ -38,17 +38,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -57,8 +57,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/gcm/aes256dec/description.json b/security/L1/tests/gcm/aes256dec/description.json index 3d41fb1d8f..f5f2b2acef 100644 --- a/security/L1/tests/gcm/aes256dec/description.json +++ b/security/L1/tests/gcm/aes256dec/description.json @@ -2,14 +2,14 @@ "name": "Xilinx AES256GCM Decryption", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "igcm_aes256_test", "solution": "solution1", "clock": "3.33", @@ -38,17 +38,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -57,8 +57,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/gcm/aes256enc/description.json b/security/L1/tests/gcm/aes256enc/description.json index cddac62210..b3ea042c19 100644 --- a/security/L1/tests/gcm/aes256enc/description.json +++ b/security/L1/tests/gcm/aes256enc/description.json @@ -2,14 +2,14 @@ "name": "Xilinx AES256GCM Encryption", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "gcm_aes256_test", "solution": "solution1", "clock": "3.33", @@ -38,17 +38,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -57,8 +57,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/gmac/aes128/description.json b/security/L1/tests/gmac/aes128/description.json index 9be7aedbd8..bee4e765ba 100644 --- a/security/L1/tests/gmac/aes128/description.json +++ b/security/L1/tests/gmac/aes128/description.json @@ -2,14 +2,14 @@ "name": "Xilinx GMAC AES128", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "gmac_aes128_test", "solution": "solution1", "clock": "3.33", @@ -38,17 +38,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -57,8 +57,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/gmac/aes192/description.json b/security/L1/tests/gmac/aes192/description.json index df5db1f0ef..f8892a629d 100644 --- a/security/L1/tests/gmac/aes192/description.json +++ b/security/L1/tests/gmac/aes192/description.json @@ -2,14 +2,14 @@ "name": "Xilinx GMAC AES192", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "gmac_aes192_test", "solution": "solution1", "clock": "3.33", @@ -38,17 +38,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -57,8 +57,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/gmac/aes256/description.json b/security/L1/tests/gmac/aes256/description.json index b6d7067d78..000110907e 100644 --- a/security/L1/tests/gmac/aes256/description.json +++ b/security/L1/tests/gmac/aes256/description.json @@ -2,14 +2,14 @@ "name": "Xilinx GMAC AES256", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "gmac_aes256_test", "solution": "solution1", "clock": "3.33", @@ -38,17 +38,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -57,8 +57,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/hmac/md4/description.json b/security/L1/tests/hmac/md4/description.json index 4568195e2e..b62ad496eb 100644 --- a/security/L1/tests/hmac/md4/description.json +++ b/security/L1/tests/hmac/md4/description.json @@ -2,14 +2,14 @@ "name": "Xilinx HMAC MD4", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "hmac_md4_test", "solution": "solution1", "clock": "3.33", @@ -38,17 +38,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -57,8 +57,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/hmac/md5/description.json b/security/L1/tests/hmac/md5/description.json index e26f62bb30..7ba234169f 100644 --- a/security/L1/tests/hmac/md5/description.json +++ b/security/L1/tests/hmac/md5/description.json @@ -2,14 +2,14 @@ "name": "Xilinx HMAC MD5", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "hmac_test", "solution": "solution1", "clock": "3.33", @@ -38,17 +38,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -57,8 +57,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/hmac/sha1/description.json b/security/L1/tests/hmac/sha1/description.json index 41a1a5b84d..f1077d5800 100644 --- a/security/L1/tests/hmac/sha1/description.json +++ b/security/L1/tests/hmac/sha1/description.json @@ -2,14 +2,14 @@ "name": "Xilinx HMAC SHA1", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "hmac_sha1_test", "solution": "solution1", "clock": "3.33", @@ -38,17 +38,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -57,8 +57,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/hmac/sha224/description.json b/security/L1/tests/hmac/sha224/description.json index d3536e2266..35ff86d633 100644 --- a/security/L1/tests/hmac/sha224/description.json +++ b/security/L1/tests/hmac/sha224/description.json @@ -2,14 +2,14 @@ "name": "Xilinx HMAC SHA224", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "hmac_sha224_test", "solution": "solution1", "clock": "3.33", @@ -38,17 +38,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -57,8 +57,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/hmac/sha256/description.json b/security/L1/tests/hmac/sha256/description.json index cfc854ea3a..1ce0101257 100644 --- a/security/L1/tests/hmac/sha256/description.json +++ b/security/L1/tests/hmac/sha256/description.json @@ -2,14 +2,14 @@ "name": "Xilinx HMAC SHA256", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "hmac_sha256_test", "solution": "solution1", "clock": "3.33", @@ -38,17 +38,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -57,8 +57,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/hmac/sha384/description.json b/security/L1/tests/hmac/sha384/description.json index f70efc644d..c67982e64c 100644 --- a/security/L1/tests/hmac/sha384/description.json +++ b/security/L1/tests/hmac/sha384/description.json @@ -2,14 +2,14 @@ "name": "Xilinx HMAC SHA284", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "hmac_sha384_test", "solution": "solution1", "clock": "3.33", @@ -38,17 +38,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -57,8 +57,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/hmac/sha512/description.json b/security/L1/tests/hmac/sha512/description.json index f9af82c9d8..37d5de40ce 100644 --- a/security/L1/tests/hmac/sha512/description.json +++ b/security/L1/tests/hmac/sha512/description.json @@ -2,14 +2,14 @@ "name": "Xilinx HMAC SHA512", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "hmac_sha512_test", "solution": "solution1", "clock": "3.33", @@ -38,17 +38,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -57,8 +57,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/keccak256/description.json b/security/L1/tests/keccak256/description.json index 5651e8b272..ca5baec0b4 100644 --- a/security/L1/tests/keccak256/description.json +++ b/security/L1/tests/keccak256/description.json @@ -2,14 +2,14 @@ "name": "Xilinx KECCAK_256", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "keccak_256_test", "solution": "solution1", "clock": "3.33", @@ -39,17 +39,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -58,8 +58,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/md4/description.json b/security/L1/tests/md4/description.json index a6e8fdad36..43fd7a4b98 100644 --- a/security/L1/tests/md4/description.json +++ b/security/L1/tests/md4/description.json @@ -2,14 +2,14 @@ "name": "Xilinx MD4", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "md4_test", "solution": "solution1", "clock": "3.33", @@ -38,17 +38,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -57,8 +57,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/md5/description.json b/security/L1/tests/md5/description.json index 6d3c9b752c..dbd7ad8933 100644 --- a/security/L1/tests/md5/description.json +++ b/security/L1/tests/md5/description.json @@ -2,14 +2,14 @@ "name": "Xilinx MD5", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "md5_test", "solution": "solution1", "clock": "3.33", @@ -38,17 +38,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -57,8 +57,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/ofb/aes128dec/description.json b/security/L1/tests/ofb/aes128dec/description.json index 4239aa7948..773c4a107f 100644 --- a/security/L1/tests/ofb/aes128dec/description.json +++ b/security/L1/tests/ofb/aes128dec/description.json @@ -2,14 +2,14 @@ "name": "Xilinx AES128OFB Decryption", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "iofb_aes128_test", "solution": "solution1", "clock": "3.33", @@ -38,17 +38,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -57,8 +57,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/ofb/aes128enc/description.json b/security/L1/tests/ofb/aes128enc/description.json index baae8bd286..4fb9bd8e95 100644 --- a/security/L1/tests/ofb/aes128enc/description.json +++ b/security/L1/tests/ofb/aes128enc/description.json @@ -2,14 +2,14 @@ "name": "Xilinx AES128OFB Encryption", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "ofb_aes128_test", "solution": "solution1", "clock": "3.33", @@ -38,17 +38,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -57,8 +57,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/ofb/aes192dec/description.json b/security/L1/tests/ofb/aes192dec/description.json index 77033821c7..1f91891298 100644 --- a/security/L1/tests/ofb/aes192dec/description.json +++ b/security/L1/tests/ofb/aes192dec/description.json @@ -2,14 +2,14 @@ "name": "Xilinx AES192OFB Decryption", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "iofb_aes192_test", "solution": "solution1", "clock": "3.33", @@ -38,17 +38,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -57,8 +57,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/ofb/aes192enc/description.json b/security/L1/tests/ofb/aes192enc/description.json index bcbdbba166..ed8c1177fa 100644 --- a/security/L1/tests/ofb/aes192enc/description.json +++ b/security/L1/tests/ofb/aes192enc/description.json @@ -2,14 +2,14 @@ "name": "Xilinx AES192OFB Encryption", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "ofb_aes192_test", "solution": "solution1", "clock": "3.33", @@ -38,17 +38,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -57,8 +57,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/ofb/aes256dec/description.json b/security/L1/tests/ofb/aes256dec/description.json index e197a4b615..52c9e2187c 100644 --- a/security/L1/tests/ofb/aes256dec/description.json +++ b/security/L1/tests/ofb/aes256dec/description.json @@ -2,14 +2,14 @@ "name": "Xilinx AES256OFB Decryption", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "iofb_aes256_test", "solution": "solution1", "clock": "3.33", @@ -38,17 +38,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -57,8 +57,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/ofb/aes256enc/description.json b/security/L1/tests/ofb/aes256enc/description.json index 22c868f548..66bc044ec7 100644 --- a/security/L1/tests/ofb/aes256enc/description.json +++ b/security/L1/tests/ofb/aes256enc/description.json @@ -2,14 +2,14 @@ "name": "Xilinx AES256OFB Encryption", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "ofb_aes256_test", "solution": "solution1", "clock": "3.33", @@ -38,17 +38,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -57,8 +57,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/ofb/des64dec/description.json b/security/L1/tests/ofb/des64dec/description.json index 7c1e743c48..8f281b3757 100644 --- a/security/L1/tests/ofb/des64dec/description.json +++ b/security/L1/tests/ofb/des64dec/description.json @@ -2,14 +2,14 @@ "name": "Xilinx DES64OFB Decryption", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "iofb_des64_test", "solution": "solution1", "clock": "3.33", @@ -38,17 +38,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -57,8 +57,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/ofb/des64enc/description.json b/security/L1/tests/ofb/des64enc/description.json index e05be65d8b..8f7aacb270 100644 --- a/security/L1/tests/ofb/des64enc/description.json +++ b/security/L1/tests/ofb/des64enc/description.json @@ -2,14 +2,14 @@ "name": "Xilinx DES64OFB Encryption", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "ofb_des64_test", "solution": "solution1", "clock": "3.33", @@ -38,17 +38,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -57,8 +57,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/poly1305/description.json b/security/L1/tests/poly1305/description.json index ba90af32ab..c6d4c167a7 100644 --- a/security/L1/tests/poly1305/description.json +++ b/security/L1/tests/poly1305/description.json @@ -2,14 +2,14 @@ "name": "Xilinx Poly1305", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "poly1305", "solution": "sol", "clock": "3.33", @@ -37,17 +37,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -56,8 +56,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/poly1305_multichan/description.json b/security/L1/tests/poly1305_multichan/description.json index bdafe0fc48..b76e1f0457 100644 --- a/security/L1/tests/poly1305_multichan/description.json +++ b/security/L1/tests/poly1305_multichan/description.json @@ -2,14 +2,14 @@ "name": "Xilinx Multi Channel Poly1305", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "poly1305_multichan", "solution": "sol", "clock": "3.33", @@ -37,17 +37,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -56,8 +56,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/rc4/description.json b/security/L1/tests/rc4/description.json index 793a0f0eaa..50b008a612 100644 --- a/security/L1/tests/rc4/description.json +++ b/security/L1/tests/rc4/description.json @@ -2,14 +2,14 @@ "name": "Xilinx RC4", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "rc4_test", "solution": "solution1", "clock": "3.33", @@ -38,17 +38,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -57,8 +57,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/ripemd160/description.json b/security/L1/tests/ripemd160/description.json index 76e69c8a79..380003f9f5 100644 --- a/security/L1/tests/ripemd160/description.json +++ b/security/L1/tests/ripemd160/description.json @@ -2,14 +2,14 @@ "name": "Xilinx RIPEMD160", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "ripemd160", "solution": "sol", "clock": "3.33", @@ -37,17 +37,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -56,8 +56,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/rsa/description.json b/security/L1/tests/rsa/description.json index 2e1ae0bb11..9d7b1f6b82 100644 --- a/security/L1/tests/rsa/description.json +++ b/security/L1/tests/rsa/description.json @@ -2,14 +2,14 @@ "name": "Xilinx RSA", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "prj", "solution": "solution1", "clock": "4", @@ -38,17 +38,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 360, + "vivado_syn": 360, "hls_csim": 60, "hls_cosim": 360, - "hls_vivado_impl": 360, + "vivado_impl": 360, "hls_csynth": 60 } } diff --git a/security/L1/tests/sha1/description.json b/security/L1/tests/sha1/description.json index 9874dbe61b..cf87ce502c 100644 --- a/security/L1/tests/sha1/description.json +++ b/security/L1/tests/sha1/description.json @@ -2,14 +2,14 @@ "name": "Xilinx SHA1", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "sha1_test", "solution": "solution1", "clock": "3.33", @@ -38,17 +38,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -57,8 +57,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/sha224_256/sha224/description.json b/security/L1/tests/sha224_256/sha224/description.json index a7bf64b8e2..a7b977b140 100644 --- a/security/L1/tests/sha224_256/sha224/description.json +++ b/security/L1/tests/sha224_256/sha224/description.json @@ -2,14 +2,14 @@ "name": "Xilinx SHA224", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "sha224_test", "solution": "solution1", "clock": "3.33", @@ -38,17 +38,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -57,8 +57,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/sha224_256/sha256/description.json b/security/L1/tests/sha224_256/sha256/description.json index 02f5460022..9509e5bc36 100644 --- a/security/L1/tests/sha224_256/sha256/description.json +++ b/security/L1/tests/sha224_256/sha256/description.json @@ -2,14 +2,14 @@ "name": "Xilinx SHA256", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "sha256_test", "solution": "solution1", "clock": "3.33", @@ -38,17 +38,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -57,8 +57,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/sha3/sha3_224/description.json b/security/L1/tests/sha3/sha3_224/description.json index 791a407cbb..b0b8f911e6 100644 --- a/security/L1/tests/sha3/sha3_224/description.json +++ b/security/L1/tests/sha3/sha3_224/description.json @@ -2,14 +2,14 @@ "name": "Xilinx SHA3_224", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "sha3_224_test", "solution": "solution1", "clock": "3.33", @@ -39,17 +39,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -58,8 +58,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/sha3/sha3_256/description.json b/security/L1/tests/sha3/sha3_256/description.json index 609c3789f2..78787896a0 100644 --- a/security/L1/tests/sha3/sha3_256/description.json +++ b/security/L1/tests/sha3/sha3_256/description.json @@ -2,14 +2,14 @@ "name": "Xilinx SHA3_256", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "sha3_256_test", "solution": "solution1", "clock": "3.33", @@ -39,17 +39,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -58,8 +58,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/sha3/sha3_384/description.json b/security/L1/tests/sha3/sha3_384/description.json index 8cc99ee874..cf5eb3df99 100644 --- a/security/L1/tests/sha3/sha3_384/description.json +++ b/security/L1/tests/sha3/sha3_384/description.json @@ -2,14 +2,14 @@ "name": "Xilinx SHA3_384", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "sha3_384_test", "solution": "solution1", "clock": "3.33", @@ -39,17 +39,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -58,8 +58,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/sha3/sha3_512/description.json b/security/L1/tests/sha3/sha3_512/description.json index 633b44f9d2..30450fa828 100644 --- a/security/L1/tests/sha3/sha3_512/description.json +++ b/security/L1/tests/sha3/sha3_512/description.json @@ -2,14 +2,14 @@ "name": "Xilinx SHA3_512", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "sha3_512_test", "solution": "solution1", "clock": "3.33", @@ -39,17 +39,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -58,8 +58,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/sha3/shake128/description.json b/security/L1/tests/sha3/shake128/description.json index 0d6ee52499..cf26ad67ac 100644 --- a/security/L1/tests/sha3/shake128/description.json +++ b/security/L1/tests/sha3/shake128/description.json @@ -2,14 +2,14 @@ "name": "Xilinx Shake128", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "shake128_test", "solution": "solution1", "clock": "3.00", @@ -39,17 +39,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -58,8 +58,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/sha3/shake256/description.json b/security/L1/tests/sha3/shake256/description.json index 0319201220..827bfe0ec5 100644 --- a/security/L1/tests/sha3/shake256/description.json +++ b/security/L1/tests/sha3/shake256/description.json @@ -2,14 +2,14 @@ "name": "Xilinx Shake256", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "shake256_test", "solution": "solution1", "clock": "3.33", @@ -39,17 +39,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -58,8 +58,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/sha512_t/sha384/description.json b/security/L1/tests/sha512_t/sha384/description.json index 3b29a342a5..5cfae4d6ea 100644 --- a/security/L1/tests/sha512_t/sha384/description.json +++ b/security/L1/tests/sha512_t/sha384/description.json @@ -2,14 +2,14 @@ "name": "Xilinx SHA512_T_384", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "sha384_test", "solution": "solution1", "clock": "3.33", @@ -38,17 +38,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -57,8 +57,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/sha512_t/sha512/description.json b/security/L1/tests/sha512_t/sha512/description.json index 35e07065d3..b0bbe4cca4 100644 --- a/security/L1/tests/sha512_t/sha512/description.json +++ b/security/L1/tests/sha512_t/sha512/description.json @@ -2,14 +2,14 @@ "name": "Xilinx SHA512_T_512", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "sha512_test", "solution": "solution1", "clock": "3.33", @@ -38,17 +38,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -57,8 +57,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/sha512_t/sha512_224/description.json b/security/L1/tests/sha512_t/sha512_224/description.json index 4d36331100..d79552db7b 100644 --- a/security/L1/tests/sha512_t/sha512_224/description.json +++ b/security/L1/tests/sha512_t/sha512_224/description.json @@ -2,14 +2,14 @@ "name": "Xilinx SHA512_224", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "sha512_224_test", "solution": "solution1", "clock": "3.33", @@ -39,17 +39,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -58,8 +58,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/sha512_t/sha512_256/description.json b/security/L1/tests/sha512_t/sha512_256/description.json index 1cae4e649c..6a10a65838 100644 --- a/security/L1/tests/sha512_t/sha512_256/description.json +++ b/security/L1/tests/sha512_t/sha512_256/description.json @@ -2,14 +2,14 @@ "name": "Xilinx SHA512_256", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "sha512_256_test", "solution": "solution1", "clock": "3.33", @@ -39,17 +39,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -58,8 +58,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/sm2_sign/description.json b/security/L1/tests/sm2_sign/description.json index 06bb393a51..3908e16d6c 100644 --- a/security/L1/tests/sm2_sign/description.json +++ b/security/L1/tests/sm2_sign/description.json @@ -2,14 +2,14 @@ "name": "Xilinx SM2 Sign", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "ecc_test", "solution": "solution1", "clock": "3.33", @@ -37,17 +37,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -56,8 +56,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/sm2_verify/description.json b/security/L1/tests/sm2_verify/description.json index a3d6899b5d..4a2807cc0e 100644 --- a/security/L1/tests/sm2_verify/description.json +++ b/security/L1/tests/sm2_verify/description.json @@ -2,14 +2,14 @@ "name": "Xilinx SM2 Verify", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "ecc_test", "solution": "solution1", "clock": "3.33", @@ -37,17 +37,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -56,8 +56,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/sm3/description.json b/security/L1/tests/sm3/description.json index 5f44200929..d336c747a8 100644 --- a/security/L1/tests/sm3/description.json +++ b/security/L1/tests/sm3/description.json @@ -2,14 +2,14 @@ "name": "Xilinx SM3", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "ecc_test", "solution": "solution1", "clock": "3.33", @@ -37,17 +37,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -56,8 +56,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/sm4_dec/description.json b/security/L1/tests/sm4_dec/description.json index 7b62351740..f827062df5 100644 --- a/security/L1/tests/sm4_dec/description.json +++ b/security/L1/tests/sm4_dec/description.json @@ -2,14 +2,14 @@ "name": "Xilinx SM4 Decryption", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "ecc_test", "solution": "solution1", "clock": "3.33", @@ -37,17 +37,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -56,8 +56,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/sm4_enc/description.json b/security/L1/tests/sm4_enc/description.json index eb1987850e..8e6fe72347 100644 --- a/security/L1/tests/sm4_enc/description.json +++ b/security/L1/tests/sm4_enc/description.json @@ -2,14 +2,14 @@ "name": "Xilinx SM4 Encryption", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "ecc_test", "solution": "solution1", "clock": "3.33", @@ -37,17 +37,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -56,8 +56,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/vdf/evaluate/description.json b/security/L1/tests/vdf/evaluate/description.json index 283b4a774c..39bbc52ec3 100644 --- a/security/L1/tests/vdf/evaluate/description.json +++ b/security/L1/tests/vdf/evaluate/description.json @@ -2,14 +2,14 @@ "name": "Xilinx VDF Evaluation", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "VDF_Evaluation", "solution": "sol", "clock": "3.33", @@ -37,17 +37,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -56,8 +56,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/vdf/pietrzak_verify/description.json b/security/L1/tests/vdf/pietrzak_verify/description.json index ecba05091b..28edd38cc6 100644 --- a/security/L1/tests/vdf/pietrzak_verify/description.json +++ b/security/L1/tests/vdf/pietrzak_verify/description.json @@ -2,14 +2,14 @@ "name": "Xilinx VDF Pietrzak Verify", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "VDF_Verify", "solution": "sol", "clock": "3.33", @@ -37,17 +37,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 24576, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 24576, + "vivado_impl": 24576, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -56,8 +56,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/vdf/wesolowski_verify/description.json b/security/L1/tests/vdf/wesolowski_verify/description.json index db1c0b1268..babb360b88 100644 --- a/security/L1/tests/vdf/wesolowski_verify/description.json +++ b/security/L1/tests/vdf/wesolowski_verify/description.json @@ -2,14 +2,14 @@ "name": "Xilinx Wesolowski Verify", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "VDF_Verify", "solution": "sol", "clock": "3.33", @@ -37,17 +37,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 20480, + "vivado_impl": 20480, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -56,8 +56,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/xchacha20/description.json b/security/L1/tests/xchacha20/description.json index 063b17e282..54112ab019 100644 --- a/security/L1/tests/xchacha20/description.json +++ b/security/L1/tests/xchacha20/description.json @@ -2,14 +2,14 @@ "name": "Xilinx Xchacha20", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "chacha20_test", "solution": "solution1", "clock": "3.33", @@ -37,17 +37,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -56,8 +56,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/xts/aes128dec/description.json b/security/L1/tests/xts/aes128dec/description.json index 78d4024aa4..bf861e682e 100644 --- a/security/L1/tests/xts/aes128dec/description.json +++ b/security/L1/tests/xts/aes128dec/description.json @@ -2,14 +2,14 @@ "name": "Xilinx AES128XTS Decryption", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "ixts_aes128_test", "solution": "solution1", "clock": "3.33", @@ -38,17 +38,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -57,8 +57,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/xts/aes128enc/description.json b/security/L1/tests/xts/aes128enc/description.json index edd85fada4..e0b349a8f5 100644 --- a/security/L1/tests/xts/aes128enc/description.json +++ b/security/L1/tests/xts/aes128enc/description.json @@ -2,14 +2,14 @@ "name": "Xilinx AES128XTS Encryption", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "xts_aes128_test", "solution": "solution1", "clock": "3.33", @@ -38,17 +38,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -57,8 +57,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/xts/aes256dec/description.json b/security/L1/tests/xts/aes256dec/description.json index d85ca2d452..ac02a0447f 100644 --- a/security/L1/tests/xts/aes256dec/description.json +++ b/security/L1/tests/xts/aes256dec/description.json @@ -2,14 +2,14 @@ "name": "Xilinx AES256XTS Decryption", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "ixts_aes256_test", "solution": "solution1", "clock": "3.33", @@ -38,17 +38,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -57,8 +57,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L1/tests/xts/aes256enc/description.json b/security/L1/tests/xts/aes256enc/description.json index 582a8722c9..3ba20e269b 100644 --- a/security/L1/tests/xts/aes256enc/description.json +++ b/security/L1/tests/xts/aes256enc/description.json @@ -2,14 +2,14 @@ "name": "Xilinx AES256XTS Encryption", "description": "", "flow": "hls", - "platform_whitelist": [ + "platform_allowlist": [ "u200", "aws-vu9p-f1", "vck190" ], - "platform_blacklist": [], - "part_whitelist": [], - "part_blacklist": [], + "platform_blocklist": [], + "part_allowlist": [], + "part_blocklist": [], "project": "xts_aes256_test", "solution": "solution1", "clock": "3.33", @@ -38,17 +38,17 @@ "env": "", "cmd": "", "max_memory_MB": { - "hls_vivado_syn": 16384, + "vivado_syn": 16384, "hls_csim": 10240, "hls_cosim": 16384, - "hls_vivado_impl": 16384, + "vivado_impl": 16384, "hls_csynth": 10240 }, "max_time_min": { - "hls_vivado_syn": 420, + "vivado_syn": 420, "hls_csim": 60, "hls_cosim": 420, - "hls_vivado_impl": 420, + "vivado_impl": 420, "hls_csynth": 60 } } @@ -57,8 +57,8 @@ "hls_csim", "hls_csynth", "hls_cosim", - "hls_vivado_syn", - "hls_vivado_impl" + "vivado_syn", + "vivado_impl" ], "category": "canary" }, diff --git a/security/L2/README.md b/security/L2/README.md new file mode 100644 index 0000000000..347ee629a8 --- /dev/null +++ b/security/L2/README.md @@ -0,0 +1,4 @@ +## Level 2: Predefined Kernels + +The Level 2 of Vitis Security Library is presented as SystemCompilier kernels. + diff --git a/security/L2/demos/ethash_sc/Makefile b/security/L2/demos/ethash_sc/Makefile new file mode 100644 index 0000000000..2be649ec6a --- /dev/null +++ b/security/L2/demos/ethash_sc/Makefile @@ -0,0 +1,269 @@ +# Copyright 2019-2021 Xilinx, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# sc makefile-generator v1.0.0 + +############################## Help Section ############################## +.PHONY: help + +help:: + $(ECHO) "Makefile Usage:" + $(ECHO) " make all TARGET= PLATFORM= HOST_ARCH=<>" + $(ECHO) " Command to generate the design for specified Target and Shell." + $(ECHO) " By default, HOST_ARCH=. HOST_ARCH is required for SoC shells" + $(ECHO) "" + $(ECHO) " make run TARGET= PLATFORM= HOST_ARCH=<>" + $(ECHO) " Command to run application in emulation." + $(ECHO) " By default, HOST_ARCH=. HOST_ARCH required for SoC shells" + $(ECHO) "" + $(ECHO) " make host HOST_ARCH=" + $(ECHO) " Command to build host application." + $(ECHO) " By default, HOST_ARCH=. HOST_ARCH is required for SoC shells" + $(ECHO) "" + $(ECHO) " make clean " + $(ECHO) " Command to remove the generated non-hardware files." + $(ECHO) "" + $(ECHO) " make cleanall" + $(ECHO) " Command to remove all the generated files." + $(ECHO) "" + +############################## Setting up Project Variables ############################## + +MK_PATH := $(abspath $(lastword $(MAKEFILE_LIST))) +XF_PROJ_ROOT ?= $(shell bash -c 'export MK_PATH=$(MK_PATH); echo $${MK_PATH%/L2/*}') +CUR_DIR := $(patsubst %/,%,$(dir $(MK_PATH))) +XFLIB_DIR = $(XF_PROJ_ROOT) + +# setting devault value +TARGET ?= sw_emu +HOST_ARCH ?= + +#setting PLATFORM +ifeq ($(PLATFORM),) +PLATFORM := $(DEVICE) +endif +ifeq ($(PLATFORM),) +PLATFORM := xilinx_u55n_gen3x4_xdma_2_202110_1 +endif + +# #################### Checking if PLATFORM in whitelist ############################ +PLATFORM_ALLOWLIST += xilinx_u55n_gen3x4_xdma_2_202110_1 +PLATFORM_BLOCKLIST += other + +GCC_INTOOL := 8.3.0 +BINUTILS_INTOOL := 2.37 +include ./utils.mk +TEMP_DIR := _x_temp.$(TARGET).$(PLATFORM_NAME) +TEMP_REPORT_DIR := $(CUR_DIR)/reports/_x.$(TARGET).$(PLATFORM_NAME) +BUILD_DIR := build_dir.$(TARGET).$(PLATFORM_NAME) +BUILD_REPORT_DIR := $(CUR_DIR)/reports/_build.$(TARGET).$(PLATFORM_NAME) +EMCONFIG := $(BUILD_DIR)/emconfig.json +XCLBIN_DIR := $(CUR_DIR)/$(BUILD_DIR) +export XCL_BINDIR = $(XCLBIN_DIR) + +EXE_FILE_DEPS := +BINARY_CONTAINERS_DEPS := +RUN_DEPS := + +# set debug switch +ifneq ($(debug),yes) +CXXFLAGS += -O3 +endif + +# get global setting +ifdef XILINX_SC_PFM_CONFIG +CXXFLAGS += -DXILINX_SC_PFM_CONFIG=$(XILINX_SC_PFM_CONFIG) +endif +ifdef XILINX_SC_PFM_EXT +CXXFLAGS += -DXILINX_SC_PFM_EXT=$(XILINX_SC_PFM_EXT) +endif +ifeq ($(HOST_ARCH), x86) +CXXFLAGS += -I $(XILINX_VITIS)/system_compiler/include -I $(XILINX_HLS)/include +LDFLAGS += -L$(XILINX_XRT)/lib -L$(XILINX_VITIS)/system_compiler/lib/x86 -lvpp_acc -l$(LIB_XRT) -lxrt_coreutil -Wl,-rpath=$(XILINX_VITIS)/system_compiler/lib/x86:$(XILINX_XRT)/lib:$(GCC_HOME)/lib64 -Wl,--enable-new-dtags -lpthread +VPP_FLAGS += -t $(TARGET) --platform $(XPLATFORM) --temp_dir $(TEMP_DIR) --save-temps -g -I $(XILINX_VITIS)/system_compiler/include +VPP_LDFLAGS += +else ifeq ($(HOST_ARCH), aarch64) +CXXFLAGS += +LDFLAGS += +VPP_FLAGS += +VPP_LDFLAGS += +endif +CXXFLAGS += $(EXTRA_CXXFLAGS) +VPP_FLAGS += $(EXTRA_VPP_FLAGS) + +ifeq ($(TARGET),sw) + $(error Error: The sw target is not supported anymore. Please use sw_emu instead) +else ifeq ($(TARGET),sw_emu) + LIB_XRT := xrt_swemu + HOST_PREAMBLE := XCL_EMULATION_MODE=sw_emu +else ifeq ($(TARGET),hw_emu) + LIB_XRT := xrt_hwemu + HOST_PREAMBLE := XCL_EMULATION_MODE=hw_emu + HOST_PREAMBLE += VPP_SC_NPI=1 + ifneq (,$(findstring -g,$(EXTRA_VPPFLAGS) $(CXXFLAGS))) + # for sourcing pre/post xsim scripts + ifneq ($(XILINX_SC_HW_EMU),0) + HOST_PREAMBLE += XILINX_SC_HW_EMU=1 XILINX_SC_BUILD_DIR=$(PWD)/$(BUILD_DIR) + endif + endif +else ifeq ($(TARGET),hw) + LIB_XRT := xrt_core +endif + +########################## Setting up Host Variables ########################## + +#Inclue Required Host Source Files +HOST_SRCS += $(CUR_DIR)/host/main.cpp +CXXFLAGS += -I $(CUR_DIR)/host -I $(XFLIB_DIR)/L2/include -I $(XFLIB_DIR)/ext/xcl2 +CXXFLAGS += -O3 + +EXE_NAME := host.exe +EXE_OBJS := $(addprefix $(TEMP_DIR)/, $(addsuffix .o,$(basename $(HOST_SRCS)))) +EXE_FILE := $(BUILD_DIR)/$(EXE_NAME) +EXE_FILE_DEPS := $(EXE_OBJS) +MAKEDEPEND = $(CXX) $< -MM -MP -MF $(basename $@).d -MT $@ $(CXXFLAGS) + +HOST_ARGS := -n 1 +ifneq ($(HOST_ARCH), x86) +PKG_HOST_ARGS = $(foreach args,$(HOST_ARGS),$(subst $(dir $(patsubst %/,%,$(args))),,$(args))) +endif + +########################## Kernel compiler global settings ########################## +VPP_FLAGS += -I $(CUR_DIR)/host -I $(XFLIB_DIR)/L2/include -I $(XFLIB_DIR)/L1/include + +######################### binary container global settings ########################## +VPP_FLAGS_kernel_ethash += --hls.clock 300000000:kernel_ethash +ifneq ($(HOST_ARCH), x86) +VPP_LDFLAGS_kernel_ethash += --clock.defaultFreqHz 300000000 +else +VPP_LDFLAGS_kernel_ethash += --kernel_frequency 300 +endif + +ifeq ($(HOST_ARCH), x86) +BINARY_CONTAINERS_TMP := $(BUILD_DIR)/$(TARGET).o +BINARY_CONTAINERS := $(BUILD_DIR)/$(TARGET).xclbin +ifeq ($(TARGET),sw_emu) + BINARY_CONTAINERS_TMP := +endif +else +# placeholder for non_x86 +endif + +.SECONDEXPANSION: +# ################ Setting Rules for Binary Containers (Building Kernels) ################ +ACC_SRCS_kernel_ethash += $(CUR_DIR)/kernel/ethash_krl.cpp +ACC_OBJS_kernel_ethash := $(addprefix $(TEMP_DIR)/, $(addsuffix .o,$(basename $(ACC_SRCS_kernel_ethash)))) +$(ACC_OBJS_kernel_ethash): $(TEMP_DIR)/%.o : %.cpp $$(@D)/.f + @echo "--> Making $@ from: $?" + $(MAKEDEPEND) + $(VPP) $(VPP_FLAGS) $(VPP_FLAGS_kernel_ethash) -o $@ -c $< +BINARY_CONTAINERS_DEPS += $(ACC_OBJS_kernel_ethash) +$(BINARY_CONTAINERS_TMP) : $(BINARY_CONTAINERS_DEPS) + @echo "--> Making $@ from: $?" + $(VPP) $(VPP_FLAGS) $(VPP_LDFLAGS) $(VPP_LDFLAGS_kernel_ethash) -o $(BINARY_CONTAINERS) -l $^ +EXE_FILE_DEPS += $(BINARY_CONTAINERS_TMP) +EXE_FILE_DEPS += $(BINARY_CONTAINERS_DEPS) + +############################## Setting Rules for Host (Building Host Executable) ############################## +ifeq ($(HOST_ARCH), x86) +$(TEMP_DIR)/%.o : %.cpp $$(@D)/.f + @echo "--> Making $@ from: $?" + mkdir -p $(BUILD_DIR) + $(MAKEDEPEND) + $(CXX) -o $@ $(CXXFLAGS) -I . -c $< +$(EXE_FILE): $(EXE_FILE_DEPS) + mkdir -p $(BUILD_DIR) + $(CXX) -o $@ $^ $(CXXFLAGS) $(LDFLAGS) +else +# place holder for arch64 +endif + +$(EMCONFIG): + emconfigutil --platform $(XPLATFORM) --od $(BUILD_DIR) + +%/.f: + mkdir -p $(dir $@) + touch $@ + +.PRECIOUS: %/.f + +RUN_DEPS += $(EXE_FILE) $(EMCONFIG) + +run: check_device $(RUN_DEPS) +#sw_emu +ifneq (,$(filter sw_emu, $(TARGET))) +ifeq ($(HOST_ARCH), x86) + LD_LIBRARY_PATH=$(LIBRARY_PATH):$$LD_LIBRARY_PATH \ + $(HOST_PREAMBLE) $(EXE_FILE) $(HOST_ARGS) + +else +# place holder for arch64 +endif +endif + +#hw_emu +ifneq (,$(filter hw_emu, $(TARGET))) +ifeq ($(HOST_ARCH), x86) + LD_LIBRARY_PATH=$(LIBRARY_PATH):$$LD_LIBRARY_PATH \ + $(HOST_PREAMBLE) $(EXE_FILE) $(HOST_ARGS) + +else +# place holder for arch64 +endif +endif + +#hw +ifeq ($(TARGET), hw) +ifeq ($(HOST_ARCH), x86) + LD_LIBRARY_PATH=$(LIBRARY_PATH):$$LD_LIBRARY_PATH \ + $(HOST_PREAMBLE) $(EXE_FILE) $(HOST_ARGS) + +else +# place holder for arch64 +endif +endif + +############################## Setting Targets ############################## + +.PHONY: all clean cleanall emconfig +emconfig: $(EMCONFIG) +ifeq ($(HOST_ARCH), x86) +all: check_vpp check_platform check_xrt $(EXE_FILE) $(BINARY_CONTAINERS) emconfig +else +all: check_vpp check_platform check_sysroot $(EXE_FILE) $(BINARY_CONTAINERS) emconfig sd_card +endif + +.PHONY: host xclbin +ifeq ($(HOST_ARCH), x86) +host: check_xrt $(EXE_FILE) +else +host: check_sysroot $(EXE_FILE) +endif +xclbin: $(BINARY_CONTAINERS_TMP) + +############################## Cleaning Rules ############################## +cleanh: + -$(RMDIR) $(EXE_FILE) vitis_* TempConfig system_estimate.xtxt *.rpt .run/ + -$(RMDIR) src/*.ll _xocc_* .Xil dltmp* xmltmp* *.log *.jou *.wcfg *.wdb sample_link.ini sample_compile.ini obj* bin* *.csv *.jpg *.jpeg *.png + +cleank: + -$(RMDIR) $(BUILD_DIR)/*.xclbin _vimage *xclbin.run_summary qemu-memory-_* emulation/ _vimage/ pl*start_simulation. sh *.xclbin + -$(RMDIR) _x_temp.*/_x.* _x_temp.*/.Xil _x_temp.*/profile_summary.* xo_* _x* + -$(RMDIR) _x_temp.*/dltmp* _x_temp.*/kernel_info.dat _x_temp.*/*.log + -$(RMDIR) _x_temp.* + +cleanall: cleanh cleank + -$(RMDIR) $(BUILD_DIR) build_dir.* emconfig.json *.html $(TEMP_DIR) $(CUR_DIR)/reports *.csv *.run_summary $(CUR_DIR)/*.raw package_* $(BUILD_DIR)/run_script.sh .ipcache *.str + -$(RMDIR) $(XFLIB_DIR)/common/data/*.xe2xd* $(XFLIB_DIR)/common/data/*.orig* + +clean: cleanh diff --git a/security/L2/demos/ethash_sc/README.md b/security/L2/demos/ethash_sc/README.md new file mode 100644 index 0000000000..69347b9350 --- /dev/null +++ b/security/L2/demos/ethash_sc/README.md @@ -0,0 +1,34 @@ +## Demo for Ethash with SystemCompiler + +### Introduction +This demo is trying to give a show case for how to implement the Ethash algorithm with SystemCompiler. However, it is important to be noticed that this demo is not the final status of the Ethash design, it aims to display a feasible way for implementing a dataflow loop with the new feature called free running kernel in SystemCompiler. Some other latest added supports from SystemCompiler is also needed, like: + + 1. Configurable stream depth in vpp::stream. + 2. Binding for different platform with SYS_PORT_PFM. + 3. SLR assignments with ASSIGN_SLR. + 4. Loop back dataflow with FREE_RUNNING. + +### input file +A dag-file is provided at this folder for initializing the nodes allocated in the HBMs. + +### How to run +Firstly, source the env.sh to set Vitis and XRT environment. +1. re-build the xclbin and host binary + +```console +# build and run one of the following using U55N platform +# * software emulation +# * hardware emulation +# * actual deployment on physical platform + +$ make run TARGET=sw_emu DEVICE=xilinx_u55n_gen3x4_xdma_2_202110_1 +$ make run TARGET=hw_emu DEVICE=xilinx_u55n_gen3x4_xdma_2_202110_1 +$ make run TARGET=hw DEVICE=xilinx_u55n_gen3x4_xdma_2_202110_1 +``` +2. use the existing xclbin and binary for board verification + +```console +# run binary on the server with U55N cards. +$ export VPP_SC_NPI=1 +$ ./host.exe -dagfile ./dagfile1G.dat -n 1 +``` diff --git a/security/L2/demos/ethash_sc/description.json b/security/L2/demos/ethash_sc/description.json new file mode 100644 index 0000000000..17f8fa7626 --- /dev/null +++ b/security/L2/demos/ethash_sc/description.json @@ -0,0 +1,79 @@ +{ + "gui": false, + "name": "Xilinx L2 ETHASH (SC) Test", + "description": "A SystemCompiler example for ETHASH acceleration.", + "flow": "vitis", + "platform_allowlist": [ + "xilinx_u55n_gen3x4_xdma_2_202110_1" + ], + "platform_blocklist": [ + "other" + ], + "platform_properties": { + }, + "launch": [ + { + "cmd_args": "-n 1", + "name": "generic launch for all flows" + } + ], + "host": { + "host_exe": "host.exe", + "compiler": { + "sources": [ + "host/main.cpp" + ], + "includepaths": [ + "host", + "LIB_DIR/L2/include" + ], + "options": "-O3" + } + }, + "v++": { + "compiler": { + "includepaths": [ + "host", + "LIB_DIR/L2/include" + ] + } + }, + "containers": [ + { + "accelerators": [ + { + "location": "kernel/ethash_krl.cpp", + "frequency": 300.0, + "name": "kernel_ethash" + } + ], + "frequency": 300.0, + "name": "kernel_ethash" + } + ], + "testinfo": { + "disable": false, + "jobs": [ + { + "index": 0, + "dependency": [], + "env": "", + "cmd": "", + "max_memory_MB": 32768, + "max_time_min": { + "vitis_hw_build": 470, + "vitis_hw_emu": 300, + "vitis_sw_emu": 60, + "vitis_hw_run": 10 + } + } + ], + "targets": [ + "vitis_sw_emu", + "vitis_hw_emu", + "vitis_hw_build", + "vitis_hw_run" + ], + "category": "canary" + } +} diff --git a/security/L2/demos/ethash_sc/host/main.cpp b/security/L2/demos/ethash_sc/host/main.cpp new file mode 100644 index 0000000000..58e09112b7 --- /dev/null +++ b/security/L2/demos/ethash_sc/host/main.cpp @@ -0,0 +1,268 @@ +/* + * Copyright 2022 Xilinx, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "xf_security/ethash_krl.hpp" + +#include "sha3_ethash.hpp" + +#include +#include + +#include +#include +#include +#include +#include + +#include +#include +#include + +static ap_uint<32> fnv_hash_host(ap_uint<32> x, ap_uint<32> y) { + // result = (x * FNV_PRIME) ^ y; + // the second operator is XOR, not POWR... + const ap_uint<25> FNV_PRIME = 0x01000193; + ap_uint<32> tmp = x * FNV_PRIME; + return tmp ^ y; +} + +inline void ethash_naive(ap_uint<64> cnt, + ap_uint<256>& result, + ap_uint<256>& mix_hash, + ap_uint<512>* full_node, + ap_uint<64> full_size, + ap_uint<256> header_hash, + ap_uint<64> nonce) { + // 1. pack hash and nonce together into first 40 bytes of s_mix + ap_uint<512> s_mix[3]; + //#pragma HLS array_partition variable = s_mix dim = 1 + for (int i = 0; i < 3; i++) { +#pragma HLS unroll + s_mix[3] = 0; + } + s_mix[0].range(255, 0) = header_hash; + s_mix[0].range(319, 256) = nonce; + + // 2. compute sha3-512 hash and replicate across mix + s_mix[0] = sha3_512_40(s_mix[0]); + s_mix[1] = s_mix[0]; + s_mix[2] = s_mix[0]; + + const unsigned int page_size = 128; + const unsigned int num_full_pages = full_size / page_size; + + for (ap_uint<32> i = 0; i < 64; i++) { +#pragma HLS pipeline + const ap_uint<32> fnv_x = s_mix[0].range(31, 0) ^ i; + const ap_uint<32> fnv_t1 = (i % 32) / 16; + const ap_uint<32> fnv_t2 = (i % 32) % 16; + const ap_uint<32> fnv_y = + fnv_t1 == 0 ? s_mix[1].range(fnv_t2 * 32 + 31, fnv_t2 * 32) : s_mix[2].range(fnv_t2 * 32 + 31, fnv_t2 * 32); + const ap_uint<32> index = fnv_hash_host(fnv_x, fnv_y) % num_full_pages; + + for (int j = 0; j < 2; j++) { +#pragma HLS unroll + ap_uint<512> dag_node = full_node[index * 2 + j]; + + for (int k = 0; k < 16; k++) { +#pragma HLS unroll + s_mix[j + 1].range(k * 32 + 31, k * 32) = + fnv_hash_host(s_mix[j + 1].range(k * 32 + 31, k * 32), dag_node.range(k * 32 + 31, k * 32)); + } + } + } + + // 3. compress mix + ap_uint<256> res_hash; + for (int w = 0; w < 32; w += 4) { +#pragma HLS unroll + const ap_uint<32> t1 = w / 16; + const ap_uint<32> t2 = w % 16; + const ap_uint<512> local_mix = t1 == 0 ? s_mix[1] : s_mix[2]; + + ap_uint<32> reduction = local_mix.range(t2 * 32 + 31, t2 * 32); + reduction = fnv_hash_host(reduction, local_mix.range((t2 + 1) * 32 + 31, (t2 + 1) * 32)); + reduction = fnv_hash_host(reduction, local_mix.range((t2 + 2) * 32 + 31, (t2 + 2) * 32)); + reduction = fnv_hash_host(reduction, local_mix.range((t2 + 3) * 32 + 31, (t2 + 3) * 32)); + res_hash.range((w / 4) * 32 + 31, (w / 4) * 32) = reduction; + } + if (cnt == 0) { + // std::cout << "compress: " << res_hash; + } + + s_mix[1].range(255, 0) = res_hash; + mix_hash = res_hash; + + // 4. final Keccak hash + result = sha3_256_96(s_mix[0], s_mix[1]); + if (cnt == 0) { + // std::cout << "sha256: " << result; + } +} + +inline int tvdiff(struct timeval* tv0, struct timeval* tv1) { + return (tv1->tv_sec - tv0->tv_sec) * 1000000 + (tv1->tv_usec - tv0->tv_usec); +} + +class ArgParser { + public: + ArgParser(int& argc, const char** argv) { + for (int i = 1; i < argc; ++i) mTokens.push_back(std::string(argv[i])); + } + bool getCmdOption(const std::string option, std::string& value) const { + std::vector::const_iterator itr; + itr = std::find(this->mTokens.begin(), this->mTokens.end(), option); + if (itr != this->mTokens.end() && ++itr != this->mTokens.end()) { + value = *itr; + return true; + } + return false; + } + + private: + std::vector mTokens; +}; + +template +T* aligned_alloc(std::size_t num) { + void* ptr = nullptr; + if (posix_memalign(&ptr, 4096, num * sizeof(T))) throw std::bad_alloc(); + return reinterpret_cast(ptr); +} + +int main(int argc, char* argv[]) { + ArgParser parser(argc, (const char**)argv); + + std::string cnt_str; + if (!parser.getCmdOption("-n", cnt_str)) { + std::cout << "ERROR:batch number is not set!\n"; + return 1; + } + unsigned int num = std::stoi(cnt_str); + + // prepare host buffer + // dag size, header hash, nonce_start, nonce_count + // long full_size = 8UL * 1024UL * 1024UL * 1024UL - 4096UL - 4096UL; + long full_size = 1UL * 1024UL * 1024UL * 1024UL; + char header_hash_string[] = "~~~X~~~~~~~~~~~~~~~~~~~~~~~~~~~~"; + ap_uint<256> header_hash = 0; + for (int i = 0; i < 32; i++) { + header_hash.range(i * 8 + 7, i * 8) = header_hash_string[i]; + } + ap_uint<64> nonce_start = 0x7c7c597c; + ap_uint<64> dag_magic_number = 0xfee1deadbaddcafe; + std::cout << "dag magic number:" << std::hex << dag_magic_number << std::dec << std::endl; + + ap_uint<512>* full_node = aligned_alloc >((full_size + 63) / 64); + char* full_node_char = reinterpret_cast(full_node); + srand(5); + for (int i = 0; i < ((full_size + 63) / 64); i++) { + full_node_char[i] = rand() % 256; + } + std::cout << "Finish feeding all nodes.\n"; + + std::vector dram(4); + for (unsigned long int i = 0; i < 3; i++) { + dram[i] = aligned_alloc(256UL * 1024UL * 1024UL); + } + dram[3] = aligned_alloc(256UL * 1024UL * 1024UL - 4096UL - 4096UL); + for (int i = 0; i < 8192; i++) { + dram[3][256UL * 1024UL * 1024UL - 8192UL] = 0; + } + + ap_uint<1024>* fullnode_1K = reinterpret_cast*>(full_node); + std::vector*> dram1K(4); + for (int i = 0; i < 4; i++) { + dram1K[i] = reinterpret_cast*>(dram[i]); + } + + for (ap_uint<26> i = 0; i < (full_size + 127) / 128; i++) { + ap_uint<12> index_remapL = i.range(11, 0); + ap_uint<2> index_remapM = i.range(13, 12); + ap_uint<12> index_remapH = i.range(25, 14); + ap_uint<12> index_remapHR = index_remapH.reverse(); + + ap_uint<2> addrH = index_remapM; + ap_uint<24> addrL = index_remapHR.concat(index_remapL); + addrL.range(23, 21) = 0; + + dram1K[addrH][addrL] = fullnode_1K[i]; + } + std::cout << "DRAM updated.\n"; + + auto dram_buf0 = ethash_acc::create_bufpool(vpp::input); + auto dram_buf1 = ethash_acc::create_bufpool(vpp::input); + auto dram_buf2 = ethash_acc::create_bufpool(vpp::input); + auto dram_buf3 = ethash_acc::create_bufpool(vpp::bidirectional); + + unsigned int index = 0; + ethash_acc::send_while([&]() -> bool { + std::cout << "send_while index=" << index << "\n"; + ap_uint<512>* acc_dram0 = (ap_uint<512>*)ethash_acc::alloc_buf(dram_buf0, 256UL * 1024UL * 1024UL); + ap_uint<512>* acc_dram1 = (ap_uint<512>*)ethash_acc::alloc_buf(dram_buf1, 256UL * 1024UL * 1024UL); + ap_uint<512>* acc_dram2 = (ap_uint<512>*)ethash_acc::alloc_buf(dram_buf2, 256UL * 1024UL * 1024UL); + ap_uint<512>* acc_dram3 = (ap_uint<512>*)ethash_acc::alloc_buf(dram_buf3, 256UL * 1024UL * 1024UL); + memcpy(acc_dram0, dram[0], 256UL * 1024UL * 1024UL); + memcpy(acc_dram1, dram[1], 256UL * 1024UL * 1024UL); + memcpy(acc_dram2, dram[2], 256UL * 1024UL * 1024UL); + memcpy(acc_dram3, dram[3], 256UL * 1024UL * 1024UL); + + ethash_acc::compute(index, (full_size / 128), header_hash, nonce_start, num, acc_dram0, acc_dram1, acc_dram2, + acc_dram3); + + index++; + nonce_start = nonce_start + 4096 * num * index; + + return (index < 8); + }); + std::cout << "All task requests sent.\n"; + + char* ret = aligned_alloc(4096UL); + for (int i = 0; i < 4096; i++) { + ret[i] = 0; + } + ap_uint<32>* ret32 = reinterpret_cast*>(ret); + unsigned int order = 0; + ethash_acc::receive_all_in_order([&]() { + char* ret_acc = (char*)ethash_acc::get_buf(dram_buf3); + ap_uint<32>* ret32_acc = reinterpret_cast*>(&ret_acc[256UL * 1024UL * 1024UL - 4096UL]); + std::cout << "Round " << order << std::endl; + for (int i = 0; i < 8; i++) { + std::cout << "ret32[" << i << "] = " << std::hex << ret32_acc[i] << std::dec << std::endl; + } + memcpy(&ret[order * 4], &ret_acc[256UL * 1024UL * 1024UL - 4096UL + order * 4], 4); + order++; + }); + std::cout << "All result receiving requests sent.\n"; + + std::cout << "Starting ethash_acc::join()\n"; + struct timeval start_time, end_time; + gettimeofday(&start_time, 0); + ethash_acc::join(); + gettimeofday(&end_time, 0); + std::cout << "Finishing ethash_acc::join()\n"; + std::cout << "Total execution time " << tvdiff(&start_time, &end_time) / 1000 << "ms" << std::endl; + + std::cout << "============================================================" << std::endl; + ap_uint<32> sum = 0; + for (int i = 0; i < 8; i++) { + std::cout << "ret32[" << i << "] = " << std::hex << ret32[i] << std::dec << std::endl; + sum += ret32[i]; + } + std::cout << "Checksum = " << std::hex << sum << std::dec << std::endl; + + return 0; +} diff --git a/security/L2/demos/ethash_sc/host/sha3_ethash.hpp b/security/L2/demos/ethash_sc/host/sha3_ethash.hpp new file mode 100644 index 0000000000..b1dcf39c17 --- /dev/null +++ b/security/L2/demos/ethash_sc/host/sha3_ethash.hpp @@ -0,0 +1,292 @@ +/* + * Copyright 2022 Xilinx, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef __XILINX_ETHASH_SHA3__ +#define __XILINX_ETHASH_SHA3__ + +#include +#include + +struct blockType { + ap_uint<64> M[25]; + blockType() { +#pragma HLS array_partition variable = M dim = 1 + } +}; + +template +ap_uint ROTL( + // inputs + ap_uint x, + unsigned int n) { +#pragma HLS inline + + return ((x << n) | (x >> (w - n))); + +} // end ROTL + +static void KECCAK_f( + // in-out + ap_uint<64> stateArray[25]) { + // round index for iota + const ap_uint<64> roundIndex[24] = {0x0000000000000001, 0x0000000000008082, 0x800000000000808a, 0x8000000080008000, + 0x000000000000808b, 0x0000000080000001, 0x8000000080008081, 0x8000000000008009, + 0x000000000000008a, 0x0000000000000088, 0x0000000080008009, 0x000000008000000a, + 0x000000008000808b, 0x800000000000008b, 0x8000000000008089, 0x8000000000008003, + 0x8000000000008002, 0x8000000000000080, 0x000000000000800a, 0x800000008000000a, + 0x8000000080008081, 0x8000000000008080, 0x0000000080000001, 0x8000000080008008}; +#pragma HLS resource variable = roundIndex core = ROM_2P_LUTRAM + +LOOP_5_STEP_MAPPING: + for (ap_uint<5> rnd = 0; rnd < 24; rnd++) { +#pragma HLS pipeline II = 1 + // 1st step theta + ap_uint<64> rowReg[5]; +#pragma HLS array_partition variable = rowReg complete + LOOP_THETA_1: + for (ap_uint<3> i = 0; i < 5; i++) { +#pragma HLS unroll + rowReg[i] = + stateArray[i] ^ stateArray[i + 5] ^ stateArray[i + 10] ^ stateArray[i + 15] ^ stateArray[i + 20]; + } + + LOOP_THETA_2: + for (ap_uint<3> i = 0; i < 5; i++) { +#pragma HLS unroll + ap_uint<64> tmp = rowReg[(i + 4) % 5] ^ ROTL<64>(rowReg[(i + 1) % 5], 1); + LOOP_CALCULATE_THETA: + for (ap_uint<5> j = 0; j < 25; j += 5) { +#pragma HLS unroll + stateArray[i + j] ^= tmp; + } + } + + // 2nd step rho, and 3rd step pi + ap_uint<64> tmpStateArray[24]; +#pragma HLS array_partition variable = tmpStateArray dim = 1 + { + tmpStateArray[0] = ROTL<64>(stateArray[1], 1); + tmpStateArray[1] = ROTL<64>(stateArray[10], 3); + tmpStateArray[2] = ROTL<64>(stateArray[7], 6); + tmpStateArray[3] = ROTL<64>(stateArray[11], 10); + tmpStateArray[4] = ROTL<64>(stateArray[17], 15); + tmpStateArray[5] = ROTL<64>(stateArray[18], 21); + tmpStateArray[6] = ROTL<64>(stateArray[3], 28); + tmpStateArray[7] = ROTL<64>(stateArray[5], 36); + tmpStateArray[8] = ROTL<64>(stateArray[16], 45); + tmpStateArray[9] = ROTL<64>(stateArray[8], 55); + tmpStateArray[10] = ROTL<64>(stateArray[21], 2); + tmpStateArray[11] = ROTL<64>(stateArray[24], 14); + tmpStateArray[12] = ROTL<64>(stateArray[4], 27); + tmpStateArray[13] = ROTL<64>(stateArray[15], 41); + tmpStateArray[14] = ROTL<64>(stateArray[23], 56); + tmpStateArray[15] = ROTL<64>(stateArray[19], 8); + tmpStateArray[16] = ROTL<64>(stateArray[13], 25); + tmpStateArray[17] = ROTL<64>(stateArray[12], 43); + tmpStateArray[18] = ROTL<64>(stateArray[2], 62); + tmpStateArray[19] = ROTL<64>(stateArray[20], 18); + tmpStateArray[20] = ROTL<64>(stateArray[14], 39); + tmpStateArray[21] = ROTL<64>(stateArray[22], 61); + tmpStateArray[22] = ROTL<64>(stateArray[9], 20); + tmpStateArray[23] = ROTL<64>(stateArray[6], 44); + } + + { + stateArray[10] = tmpStateArray[0]; + stateArray[7] = tmpStateArray[1]; + stateArray[11] = tmpStateArray[2]; + stateArray[17] = tmpStateArray[3]; + stateArray[18] = tmpStateArray[4]; + stateArray[3] = tmpStateArray[5]; + stateArray[5] = tmpStateArray[6]; + stateArray[16] = tmpStateArray[7]; + stateArray[8] = tmpStateArray[8]; + stateArray[21] = tmpStateArray[9]; + stateArray[24] = tmpStateArray[10]; + stateArray[4] = tmpStateArray[11]; + stateArray[15] = tmpStateArray[12]; + stateArray[23] = tmpStateArray[13]; + stateArray[19] = tmpStateArray[14]; + stateArray[13] = tmpStateArray[15]; + stateArray[12] = tmpStateArray[16]; + stateArray[2] = tmpStateArray[17]; + stateArray[20] = tmpStateArray[18]; + stateArray[14] = tmpStateArray[19]; + stateArray[22] = tmpStateArray[20]; + stateArray[9] = tmpStateArray[21]; + stateArray[6] = tmpStateArray[22]; + stateArray[1] = tmpStateArray[23]; + } + + // 4th step chi + LOOP_CHI: + for (ap_uint<5> j = 0; j < 25; j += 5) { +#pragma HLS unroll + ap_uint<64> stateReg[5]; +#pragma HLS array_partition variable = stateReg complete + LOOP_INIT_STATEREG: + for (ap_uint<3> i = 0; i < 5; i++) { +#pragma HLS unroll + stateReg[i] = stateArray[j + i]; + } + LOOP_CALCULATE_CHI: + for (ap_uint<3> i = 0; i < 5; i++) { +#pragma HLS unroll + stateArray[j + i] ^= (~stateReg[(i + 1) % 5]) & stateReg[(i + 2) % 5]; + } + } + + // 5th step iota + stateArray[0] ^= roundIndex[rnd]; + } + +} // end KECCAK_f + +inline ap_uint<512> sha3_512_40(ap_uint<512> input) { + // This is a special version of sha3_512 for ethash, limited on input message size and padding method + ap_uint<64> state[25]; +#pragma HLS array_partition variable = state dim = 1 + for (int i = 0; i < 25; i++) { +#pragma HLS unroll + state[i] = 0; + } + + for (int i = 0; i < 5; i++) { +#pragma HLS unroll + state[i] ^= input.range(i * 64 + 63, i * 64); + } + state[5] ^= 0x0000000000000001UL; // delim is 01 for sha3 in ethereum, and 06 for sha3 in NIST + state[8] ^= 0x8000000000000000UL; + + KECCAK_f(state); + + ap_uint<512> digest = 0; + for (int i = 0; i < 8; i++) { +#pragma HLS unroll + digest.range(64 * i + 63, 64 * i) = state[i]; + } + return digest; +} + +inline ap_uint<512> sha3_512_64(ap_uint<512> input) { + // This is a special version of sha3_512 for ethash, limited on input message size and padding method + ap_uint<64> state[25]; +#pragma HLS array_partition variable = state dim = 1 + for (int i = 0; i < 25; i++) { +#pragma HLS unroll + state[i] = 0; + } + + for (int i = 0; i < 8; i++) { +#pragma HLS unroll + state[i] ^= input.range(i * 64 + 63, i * 64); + } + state[8] ^= 0x0000000000000001UL; // delim is 01 for sha3 in ethereum, and 06 for sha3 in NIST + state[8] ^= 0x8000000000000000UL; + + KECCAK_f(state); + + ap_uint<512> digest = 0; + for (int i = 0; i < 8; i++) { +#pragma HLS unroll + digest.range(64 * i + 63, 64 * i) = state[i]; + } + return digest; +} + +inline ap_uint<512> sha3_512_32(ap_uint<512> input) { + // This is a special version of sha3_512 for ethash, limited on input message size and padding method + ap_uint<64> state[25]; +#pragma HLS array_partition variable = state dim = 1 + for (int i = 0; i < 25; i++) { +#pragma HLS unroll + state[i] = 0; + } + + for (int i = 0; i < 4; i++) { +#pragma HLS unroll + state[i] ^= input.range(i * 64 + 63, i * 64); + } + state[4] ^= 0x0000000000000001UL; // delim is 01 for sha3 in ethereum, and 06 for sha3 in NIST + state[8] ^= 0x8000000000000000UL; + + KECCAK_f(state); + + ap_uint<512> digest = 0; + for (int i = 0; i < 8; i++) { +#pragma HLS unroll + digest.range(64 * i + 63, 64 * i) = state[i]; + } + return digest; +} + +inline ap_uint<256> sha3_256_96(ap_uint<512> input0, ap_uint<512> input1) { + // This is a special version of sha3_512 for ethash, limited on input message size and padding method + ap_uint<64> state[25]; +#pragma HLS array_partition variable = state dim = 1 + for (int i = 0; i < 25; i++) { +#pragma HLS unroll + state[i] = 0; + } + + for (int i = 0; i < 8; i++) { +#pragma HLS unroll + state[i] ^= input0.range(i * 64 + 63, i * 64); + } + for (int i = 0; i < 4; i++) { +#pragma HLS unroll + state[i + 8] ^= input1.range(i * 64 + 63, i * 64); + } + state[12] ^= 0x0000000000000001UL; // delim is 01 for sha3 in ethereum, and 06 for sha3 in NIST + state[16] ^= 0x8000000000000000UL; + + KECCAK_f(state); + + ap_uint<256> digest = 0; + for (int i = 0; i < 4; i++) { +#pragma HLS unroll + digest.range(64 * i + 63, 64 * i) = state[i]; + } + return digest; +} + +inline ap_uint<256> sha3_256_32(ap_uint<512> input0, ap_uint<512> input1) { + // This is a special version of sha3_512 for ethash, limited on input message size and padding method + ap_uint<64> state[25]; +#pragma HLS array_partition variable = state dim = 1 + for (int i = 0; i < 25; i++) { +#pragma HLS unroll + state[i] = 0; + } + + for (int i = 0; i < 4; i++) { +#pragma HLS unroll + state[i] ^= input0.range(i * 64 + 63, i * 64); + } + + state[4] ^= 0x0000000000000001UL; // delim is 01 for sha3 in ethereum, and 06 for sha3 in NIST + state[16] ^= 0x8000000000000000UL; + + KECCAK_f(state); + + ap_uint<256> digest = 0; + for (int i = 0; i < 4; i++) { +#pragma HLS unroll + digest.range(64 * i + 63, 64 * i) = state[i]; + } + return digest; +} +#endif // __XILINX_ETHASH_SHA3__ diff --git a/security/L2/demos/ethash_sc/kernel/ethash_krl.cpp b/security/L2/demos/ethash_sc/kernel/ethash_krl.cpp new file mode 100644 index 0000000000..bda8c6bbc1 --- /dev/null +++ b/security/L2/demos/ethash_sc/kernel/ethash_krl.cpp @@ -0,0 +1,660 @@ +/* + * Copyright 2022 Xilinx, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef __XILINX_ETHASH_HPP__ +#define __XILINX_ETHASH_HPP__ + +#ifndef __SYNTHESIS__ +#include +#endif +#include +#include +#include "sha3_ethash.hpp" +#include "xf_security/ethash_krl.hpp" + +#define BATCH_SIZE 32 + +void ethash_acc::prefnv(ap_uint<32> full_size, + ap_uint<32> batch_cnt_ap, + + vpp_stream_256_4096& sha3_512_Strm0, + vpp_stream_256_4096& sha3_512_Strm1, + + vpp_stream_32_4096& s0pingStrm, + vpp_stream_512_4096& smix0pingStrm, + vpp_stream_512_4096& smix1pingStrm, + + vpp_stream_2_1024& orderpreStrm, + vpp_stream_25_1024& indexpreStrm0, + vpp_stream_25_1024& indexpreStrm1, + vpp_stream_25_1024& indexpreStrm2, + vpp_stream_25_1024& indexpreStrm3, + + vpp_stream_32_1024& s0preStrm, + vpp_stream_256_1024& smix0preStrm0, + vpp_stream_256_1024& smix0preStrm1, + vpp_stream_256_1024& smix1preStrm0, + vpp_stream_256_1024& smix1preStrm1) { +#ifndef __SYNTHESIS__ + std::cout << "prefnv start.\n"; +#endif + const unsigned int num_full_pages = full_size; // / page_size; + + ap_uint<32> index; + ap_uint<32> s0; + ap_uint<512> smix0; + ap_uint<512> smix1; + ap_uint<2> addrH; + ap_uint<25> addrL; + + for (int k = 0; k < batch_cnt_ap; k++) { + for (ap_uint<8> iter = 0; iter < 64; iter++) { + for (ap_uint<32> i = 0; i < BATCH_SIZE; i++) { +#pragma HLS PIPELINE enable_flush II = 1 + if (iter == 0) { + ap_uint<256> reg0 = sha3_512_Strm0.read(); + ap_uint<256> reg1 = sha3_512_Strm1.read(); + s0 = reg0.range(31, 0); + smix0.range(255, 0) = reg0; + smix0.range(511, 256) = reg1; + smix1.range(255, 0) = reg0; + smix1.range(511, 256) = reg1; + } else { + s0 = s0pingStrm.read(); + smix0 = smix0pingStrm.read(); + smix1 = smix1pingStrm.read(); + } + + ap_uint<32> fnv_x = s0.range(31, 0) ^ iter; + ap_uint<32> fnv_t1 = iter[4]; + ap_uint<32> fnv_t2 = iter.range(3, 0); + + ap_uint<512> pre_fnv_y = fnv_t1 == 0 ? smix0 : smix1; + + ap_uint<32> pre_fnv_y_array[16]; +#pragma HLS array_partition variable = pre_fnv_y_array dim = 1 complete + for (int j = 0; j < 16; j++) { +#pragma HLS unroll + pre_fnv_y_array[j] = pre_fnv_y.range(j * 32 + 31, j * 32); + } + + ap_uint<32> fnv_y = pre_fnv_y_array[fnv_t2]; + ap_uint<32> index = special_mod<26>(fnv_hash(fnv_x, fnv_y), num_full_pages); + + ap_uint<12> index_remapL = index.range(11, 0); + ap_uint<2> index_remapM = index.range(13, 12); + ap_uint<12> index_remapH = index.range(25, 14); + ap_uint<12> index_remapHR = index_remapH.reverse(); + + addrH = index_remapM; + addrL.range(23, 0) = index_remapHR.concat(index_remapL); + addrL[24] = 0; + + if (addrH == 0) { + indexpreStrm0.write(addrL); + } else if (addrH == 1) { + indexpreStrm1.write(addrL); + } else if (addrH == 2) { + indexpreStrm2.write(addrL); + } else if (addrH == 3) { + indexpreStrm3.write(addrL); + } + orderpreStrm.write(addrH); + + s0preStrm.write(s0); + smix0preStrm0.write(smix0.range(255, 0)); + smix0preStrm1.write(smix0.range(511, 256)); + smix1preStrm0.write(smix1.range(255, 0)); + smix1preStrm1.write(smix1.range(511, 256)); + } + } + } + + addrL[24] = 1; + indexpreStrm0.write(addrL); + indexpreStrm1.write(addrL); + indexpreStrm2.write(addrL); + indexpreStrm3.write(addrL); +#ifndef __SYNTHESIS__ + std::cout << "prefnv end.\n"; +#endif +} + +void ethash_acc::nodeLookup0(ap_uint<512>* dram0, + vpp_stream_25_1024& indexpreStrm0, + vpp_stream_256_32& dagStrm00, + vpp_stream_256_32& dagStrm01, + vpp_stream_256_32& dagStrm02, + vpp_stream_256_32& dagStrm03) { +#ifndef __SYNTHESIS__ + std::cout << "nodeLookup0 start.\n"; +#endif + ap_uint<25> index = 0; + + while (index[24] != 1) { +#pragma HLS PIPELINE enable_flush II = 2 + index = indexpreStrm0.read(); + ap_uint<25> index_for_512 = index << 1; + ap_uint<512> dag_item[2]; + // limited address space to single HBM bank size (256MB) + ap_uint<22> limit_addr = index.range(21, 0); + limit_addr[0] = 0; + for (int i = 0; i < 2; i++) { + // dag_item[i] = full_node[index_for_512 + i]; + dag_item[i] = dram0[limit_addr + i]; + } + ap_uint<1024> combined_dag_item; + combined_dag_item.range(511, 0) = dag_item[0]; + combined_dag_item.range(1023, 512) = dag_item[1]; + dagStrm00.write(combined_dag_item.range(255, 0)); + dagStrm01.write(combined_dag_item.range(511, 256)); + dagStrm02.write(combined_dag_item.range(767, 512)); + dagStrm03.write(combined_dag_item.range(1023, 768)); + } +#ifndef __SYNTHESIS__ + std::cout << "nodeLookup0 end.\n"; +#endif +} + +void ethash_acc::nodeLookup1(ap_uint<512>* dram1, + vpp_stream_25_1024& indexpreStrm1, + vpp_stream_256_32& dagStrm10, + vpp_stream_256_32& dagStrm11, + vpp_stream_256_32& dagStrm12, + vpp_stream_256_32& dagStrm13) { +#ifndef __SYNTHESIS__ + std::cout << "nodeLookup1 start.\n"; +#endif + ap_uint<25> index = 0; + + while (index[24] != 1) { +#pragma HLS PIPELINE enable_flush II = 2 + index = indexpreStrm1.read(); + ap_uint<25> index_for_512 = index << 1; + ap_uint<512> dag_item[2]; + // limited address space to single HBM bank size (256MB) + ap_uint<22> limit_addr = index.range(21, 0); + limit_addr[0] = 0; + for (int i = 0; i < 2; i++) { + // dag_item[i] = full_node[index_for_512 + i]; + dag_item[i] = dram1[limit_addr + i]; + } + ap_uint<1024> combined_dag_item; + combined_dag_item.range(511, 0) = dag_item[0]; + combined_dag_item.range(1023, 512) = dag_item[1]; + dagStrm10.write(combined_dag_item.range(255, 0)); + dagStrm11.write(combined_dag_item.range(511, 256)); + dagStrm12.write(combined_dag_item.range(767, 512)); + dagStrm13.write(combined_dag_item.range(1023, 768)); + } +#ifndef __SYNTHESIS__ + std::cout << "nodeLookup1 end.\n"; +#endif +} + +void ethash_acc::nodeLookup2(ap_uint<512>* dram2, + vpp_stream_25_1024& indexpreStrm2, + vpp_stream_256_32& dagStrm20, + vpp_stream_256_32& dagStrm21, + vpp_stream_256_32& dagStrm22, + vpp_stream_256_32& dagStrm23) { +#ifndef __SYNTHESIS__ + std::cout << "nodeLookup2 start.\n"; +#endif + ap_uint<25> index = 0; + + while (index[24] != 1) { +#pragma HLS PIPELINE enable_flush II = 2 + index = indexpreStrm2.read(); + ap_uint<25> index_for_512 = index << 1; + ap_uint<512> dag_item[2]; + // limited address space to single HBM bank size (256MB) + ap_uint<22> limit_addr = index.range(21, 0); + limit_addr[0] = 0; + for (int i = 0; i < 2; i++) { + // dag_item[i] = full_node[index_for_512 + i]; + dag_item[i] = dram2[limit_addr + i]; + } + ap_uint<1024> combined_dag_item; + combined_dag_item.range(511, 0) = dag_item[0]; + combined_dag_item.range(1023, 512) = dag_item[1]; + dagStrm20.write(combined_dag_item.range(255, 0)); + dagStrm21.write(combined_dag_item.range(511, 256)); + dagStrm22.write(combined_dag_item.range(767, 512)); + dagStrm23.write(combined_dag_item.range(1023, 768)); + } +#ifndef __SYNTHESIS__ + std::cout << "nodeLookup2 end.\n"; +#endif +} + +void ethash_acc::nodeLookup3(ap_uint<512>* dram3_ret, + vpp_stream_25_1024& indexpreStrm3, + vpp_stream_256_32& dagStrm30, + vpp_stream_256_32& dagStrm31, + vpp_stream_256_32& dagStrm32, + vpp_stream_256_32& dagStrm33) { +#ifndef __SYNTHESIS__ + std::cout << "nodeLookup3 start.\n"; +#endif + ap_uint<25> index = 0; + + while (index[24] != 1) { +#pragma HLS PIPELINE enable_flush II = 2 + index = indexpreStrm3.read(); + ap_uint<25> index_for_512 = index << 1; + ap_uint<512> dag_item[2]; + // limited address space to single HBM bank size (256MB) + ap_uint<22> limit_addr = index.range(21, 0); + limit_addr[0] = 0; + for (int i = 0; i < 2; i++) { + // dag_item[i] = full_node[index_for_512 + i]; + dag_item[i] = dram3_ret[limit_addr + i]; + } + ap_uint<1024> combined_dag_item; + combined_dag_item.range(511, 0) = dag_item[0]; + combined_dag_item.range(1023, 512) = dag_item[1]; + dagStrm30.write(combined_dag_item.range(255, 0)); + dagStrm31.write(combined_dag_item.range(511, 256)); + dagStrm32.write(combined_dag_item.range(767, 512)); + dagStrm33.write(combined_dag_item.range(1023, 768)); + } +#ifndef __SYNTHESIS__ + std::cout << "nodeLookup3 end.\n"; +#endif +} + +void ethash_acc::postfnv(ap_uint<32> batch_cnt_ap, + + vpp_stream_32_1024& s0preStream0, + vpp_stream_256_1024& smix0preStrm0, + vpp_stream_256_1024& smix0preStrm1, + vpp_stream_256_1024& smix1preStrm0, + vpp_stream_256_1024& smix1preStrm1, + + vpp_stream_2_1024& orderStrm, + vpp_stream_256_32& dagStrm00, + vpp_stream_256_32& dagStrm01, + vpp_stream_256_32& dagStrm02, + vpp_stream_256_32& dagStrm03, + + vpp_stream_256_32& dagStrm10, + vpp_stream_256_32& dagStrm11, + vpp_stream_256_32& dagStrm12, + vpp_stream_256_32& dagStrm13, + + vpp_stream_256_32& dagStrm20, + vpp_stream_256_32& dagStrm21, + vpp_stream_256_32& dagStrm22, + vpp_stream_256_32& dagStrm23, + + vpp_stream_256_32& dagStrm30, + vpp_stream_256_32& dagStrm31, + vpp_stream_256_32& dagStrm32, + vpp_stream_256_32& dagStrm33, + + vpp_stream_32_4096& s0pongStrm, + vpp_stream_512_4096& smix0pongStrm, + vpp_stream_512_4096& smix1pongStrm, + + vpp_stream_256_32& mixStrm00, + vpp_stream_256_32& mixStrm01, + vpp_stream_256_32& mixStrm10, + vpp_stream_256_32& mixStrm11) { +#ifndef __SYNTHESIS__ + std::cout << "postfnv start.\n"; +#endif + for (int k = 0; k < batch_cnt_ap; k++) { + for (ap_uint<8> iter = 0; iter < 64; iter++) { + for (ap_uint<32> i = 0; i < BATCH_SIZE; i++) { +#pragma HLS PIPELINE enable_flush II = 1 + ap_uint<2> order = orderStrm.read(); + ap_uint<1024> dag_r; + if (order == 0) { + dag_r.range(255, 0) = dagStrm00.read(); + dag_r.range(511, 256) = dagStrm01.read(); + dag_r.range(767, 512) = dagStrm02.read(); + dag_r.range(1023, 768) = dagStrm03.read(); + } else if (order == 1) { + dag_r.range(255, 0) = dagStrm10.read(); + dag_r.range(511, 256) = dagStrm11.read(); + dag_r.range(767, 512) = dagStrm12.read(); + dag_r.range(1023, 768) = dagStrm13.read(); + } else if (order == 2) { + dag_r.range(255, 0) = dagStrm20.read(); + dag_r.range(511, 256) = dagStrm21.read(); + dag_r.range(767, 512) = dagStrm22.read(); + dag_r.range(1023, 768) = dagStrm23.read(); + } else if (order == 3) { + dag_r.range(255, 0) = dagStrm30.read(); + dag_r.range(511, 256) = dagStrm31.read(); + dag_r.range(767, 512) = dagStrm32.read(); + dag_r.range(1023, 768) = dagStrm33.read(); + } + + ap_uint<512> smix0; + smix0.range(255, 0) = smix0preStrm0.read(); + smix0.range(511, 256) = smix0preStrm1.read(); + ap_uint<512> smix1; + smix1.range(255, 0) = smix1preStrm0.read(); + smix1.range(511, 256) = smix1preStrm1.read(); + + ap_uint<512> dag0 = dag_r.range(511, 0); + ap_uint<512> dag1 = dag_r.range(1023, 512); + + ap_uint<512> smix0nxt; + ap_uint<512> smix1nxt; + + for (int k = 0; k < NODE_WORDS; k++) { +#pragma HLS unroll + smix0nxt.range(k * 32 + 31, k * 32) = + fnv_hash(smix0.range(k * 32 + 31, k * 32), dag0.range(k * 32 + 31, k * 32)); + } + + for (int k = 0; k < NODE_WORDS; k++) { +#pragma HLS unroll + smix1nxt.range(k * 32 + 31, k * 32) = + fnv_hash(smix1.range(k * 32 + 31, k * 32), dag1.range(k * 32 + 31, k * 32)); + } + + if (iter == 63) { + s0preStream0.read(); + mixStrm00.write(smix0nxt.range(255, 0)); + mixStrm01.write(smix0nxt.range(511, 256)); + mixStrm10.write(smix1nxt.range(255, 0)); + mixStrm11.write(smix1nxt.range(511, 256)); + } else { + ap_uint<32> s0 = s0preStream0.read(); + s0pongStrm.write(s0); + smix0pongStrm.write(smix0nxt); + smix1pongStrm.write(smix1nxt); + } + } + } + } + + dagStrm00.read(); + dagStrm01.read(); + dagStrm02.read(); + dagStrm03.read(); + dagStrm10.read(); + dagStrm11.read(); + dagStrm12.read(); + dagStrm13.read(); + dagStrm20.read(); + dagStrm21.read(); + dagStrm22.read(); + dagStrm23.read(); + dagStrm30.read(); + dagStrm31.read(); + dagStrm32.read(); + dagStrm33.read(); +#ifndef __SYNTHESIS__ + std::cout << "postfnv end.\n"; +#endif +} + +void ethash_acc::pre_sha3_512_40(ap_uint<256> header_hash_ap, + ap_uint<64> nonce_start_ap, + ap_uint<32> batch_cnt_ap, + + vpp_stream_256_4096& sha3_512_Strm0, + vpp_stream_256_4096& sha3_512_Strm1) { +#ifndef __SYNTHESIS__ + std::cout << "pre sha3_512_40 start.\n"; +#endif + for (ap_uint<32> i = 0; i < batch_cnt_ap * BATCH_SIZE; i++) { +#pragma HLS PIPELINE off + ap_uint<512> s0; + s0.range(255, 0) = header_hash_ap; + s0.range(319, 256) = nonce_start_ap + i; + ap_uint<512> tmp = sha3_512_40(s0); + sha3_512_Strm0.write(tmp.range(255, 0)); + sha3_512_Strm1.write(tmp.range(511, 256)); + } +#ifndef __SYNTHESIS__ + std::cout << "pre sha3_512_40 end.\n"; +#endif +} + +void ethash_acc::compress(ap_uint<32> batch_cnt_ap, + vpp_stream_256_32& mixStrm00, + vpp_stream_256_32& mixStrm01, + vpp_stream_256_32& mixStrm10, + vpp_stream_256_32& mixStrm11, + + vpp_stream_256_4096& compressStrm) { +#ifndef __SYNTHESIS__ + std::cout << "compress start.\n"; +#endif + ap_uint<512> s_mix[2] = {0, 0}; + ap_uint<32> s0; + ap_uint<256> res_hash; + + for (int i = 0; i < batch_cnt_ap * BATCH_SIZE; i++) { +#pragma HLS PIPELINE II = 1 + s_mix[0].range(255, 0) = mixStrm00.read(); + s_mix[0].range(511, 256) = mixStrm01.read(); + s_mix[1].range(255, 0) = mixStrm10.read(); + s_mix[1].range(511, 256) = mixStrm11.read(); + + for (int w = 0; w < MIX_WORDS; w += 4) { +#pragma HLS unroll + const ap_uint<32> t1 = w / NODE_WORDS; + const ap_uint<32> t2 = w % NODE_WORDS; + const ap_uint<512> local_mix = t1 == 0 ? s_mix[0] : s_mix[1]; + + ap_uint<32> reduction = local_mix.range(t2 * 32 + 31, t2 * 32); + reduction = fnv_hash(reduction, local_mix.range((t2 + 1) * 32 + 31, (t2 + 1) * 32)); + reduction = fnv_hash(reduction, local_mix.range((t2 + 2) * 32 + 31, (t2 + 2) * 32)); + reduction = fnv_hash(reduction, local_mix.range((t2 + 3) * 32 + 31, (t2 + 3) * 32)); + res_hash.range((w / 4) * 32 + 31, (w / 4) * 32) = reduction; + } + compressStrm.write(res_hash); + } +#ifndef __SYNTHESIS__ + std::cout << "compress end.\n"; +#endif +} + +void ethash_acc::post_sha3_512_40(ap_uint<256> header_hash_ap, + ap_uint<64> nonce_start_ap, + ap_uint<32> batch_cnt_ap, + vpp_stream_256_4096& compressStrm, + + vpp_stream_256_32& sha512Strm0, + vpp_stream_256_32& sha512Strm1, + vpp_stream_256_32& mixStrm) { +#ifndef __SYNTHESIS__ + std::cout << "post sha3_512_40 start.\n"; +#endif + for (int i = 0; i < batch_cnt_ap * BATCH_SIZE; i++) { +#pragma HLS PIPELINE off + ap_uint<512> s0; + s0.range(255, 0) = header_hash_ap; + s0.range(319, 256) = nonce_start_ap + i; + ap_uint<512> tmp = sha3_512_40(s0); + + sha512Strm0.write(tmp.range(255, 0)); + sha512Strm1.write(tmp.range(511, 256)); + mixStrm.write(compressStrm.read()); + } +#ifndef __SYNTHESIS__ + std::cout << "post sha3_512_40 end.\n"; +#endif +} + +void ethash_acc::sha3_256_96_unit(ap_uint<32> batch_cnt_ap, + vpp_stream_256_32& sha512Strm0, + vpp_stream_256_32& sha512Strm1, + vpp_stream_256_32& mixStrm, + + vpp_stream_256_32& mixhashStrm, + vpp_stream_256_32& resultStrm) { +#ifndef __SYNTHESIS__ + std::cout << "sha3_256_96 start.\n"; +#endif + for (int i = 0; i < batch_cnt_ap * BATCH_SIZE; i++) { +#pragma HLS PIPELINE off + ap_uint<512> s0; + ap_uint<512> mix; + ap_uint<32> nonce; + s0.range(255, 0) = sha512Strm0.read(); + s0.range(511, 256) = sha512Strm1.read(); + mix.range(255, 0) = mixStrm.read(); + mix.range(511, 256) = 0; + ap_uint<256> tmp = sha3_256_96(s0, mix); + mixhashStrm.write(mix.range(255, 0)); + resultStrm.write(tmp); + } +#ifndef __SYNTHESIS__ + std::cout << "sha3_256_96 end.\n"; +#endif +} + +void ethash_acc::check(ap_uint<32> batch_cnt_ap, + unsigned index, + vpp_stream_256_32& mixhashStrm, + vpp_stream_256_32& resultStrm, + ap_uint<512>* dram3_ret) { +#ifndef __SYNTHESIS__ + std::cout << "check start.\n"; +#endif + ap_uint<32> sum = 0; + for (int i = 0; i < batch_cnt_ap * BATCH_SIZE; i++) { +#pragma HLS PIPELINE II = 1 + ap_uint<512> tmp; + tmp.range(255, 0) = resultStrm.read(); + tmp.range(511, 256) = mixhashStrm.read(); + sum = sum + tmp.range(31, 0); + } + dram3_ret[(256UL * 1024UL * 1024UL - 4096UL) / 64].range((index + 1) * 32 - 1, index * 32) = sum; +#ifndef __SYNTHESIS__ + std::cout << "check end.\n"; +#endif +} + +void ethash_acc::fsk_passback(vpp_stream_32_4096& s0pongStrm, + vpp_stream_512_4096& smix0pongStrm, + vpp_stream_512_4096& smix1pongStrm, + + vpp_stream_32_4096& s0pingStrm, + vpp_stream_512_4096& smix0pingStrm, + vpp_stream_512_4096& smix1pingStrm) { +#pragma HLS PIPELINE enable_flush II = 1 + ap_uint<32> s0 = s0pongStrm.read(); + ap_uint<512> smix0 = smix0pongStrm.read(); + ap_uint<512> smix1 = smix1pongStrm.read(); + s0pingStrm.write(s0); + smix0pingStrm.write(smix0); + smix1pingStrm.write(smix1); +} + +void ethash_acc::compute(unsigned index, + unsigned full_size, + ap_uint<256> header_hash, + ap_uint<64> nonce_start, + unsigned batch_cnt, + + ap_uint<512>* dram0, + ap_uint<512>* dram1, + ap_uint<512>* dram2, + ap_uint<512>* dram3_ret) { + ap_uint<32> full_size_ap = full_size; + ap_uint<256> header_hash_ap = header_hash; + ap_uint<64> nonce_start_ap = nonce_start; + ap_uint<32> batch_cnt_ap = batch_cnt; + + STATIC vpp_stream_256_4096 sha3_512_Strm0; + STATIC vpp_stream_256_4096 sha3_512_Strm1; + + pre_sha3_512_40(header_hash_ap, nonce_start_ap, batch_cnt_ap, sha3_512_Strm0, sha3_512_Strm1); + + STATIC vpp_stream_256_32 mixStrm00; + STATIC vpp_stream_256_32 mixStrm01; + STATIC vpp_stream_256_32 mixStrm10; + STATIC vpp_stream_256_32 mixStrm11; + + STATIC vpp_stream_32_4096 s0pingStrm; + STATIC vpp_stream_512_4096 smix0pingStrm; + STATIC vpp_stream_512_4096 smix1pingStrm; + STATIC vpp_stream_32_4096 s0pongStrm; + STATIC vpp_stream_512_4096 smix0pongStrm; + STATIC vpp_stream_512_4096 smix1pongStrm; + + STATIC vpp_stream_2_1024 orderpreStrm; + STATIC vpp_stream_25_1024 indexpreStrm0; + STATIC vpp_stream_25_1024 indexpreStrm1; + STATIC vpp_stream_25_1024 indexpreStrm2; + STATIC vpp_stream_25_1024 indexpreStrm3; + STATIC vpp_stream_32_1024 s0preStrm0; + STATIC vpp_stream_256_1024 smix0preStrm0; + STATIC vpp_stream_256_1024 smix0preStrm1; + STATIC vpp_stream_256_1024 smix1preStrm0; + STATIC vpp_stream_256_1024 smix1preStrm1; + + prefnv(full_size, batch_cnt_ap, sha3_512_Strm0, sha3_512_Strm1, s0pingStrm, smix0pingStrm, smix1pingStrm, + orderpreStrm, indexpreStrm0, indexpreStrm1, indexpreStrm2, indexpreStrm3, s0preStrm0, smix0preStrm0, + smix0preStrm1, smix1preStrm0, smix1preStrm1); + + STATIC vpp_stream_256_32 dagStrm00; + STATIC vpp_stream_256_32 dagStrm01; + STATIC vpp_stream_256_32 dagStrm02; + STATIC vpp_stream_256_32 dagStrm03; + STATIC vpp_stream_256_32 dagStrm10; + STATIC vpp_stream_256_32 dagStrm11; + STATIC vpp_stream_256_32 dagStrm12; + STATIC vpp_stream_256_32 dagStrm13; + STATIC vpp_stream_256_32 dagStrm20; + STATIC vpp_stream_256_32 dagStrm21; + STATIC vpp_stream_256_32 dagStrm22; + STATIC vpp_stream_256_32 dagStrm23; + STATIC vpp_stream_256_32 dagStrm30; + STATIC vpp_stream_256_32 dagStrm31; + STATIC vpp_stream_256_32 dagStrm32; + STATIC vpp_stream_256_32 dagStrm33; + + nodeLookup0(dram0, indexpreStrm0, dagStrm00, dagStrm01, dagStrm02, dagStrm03); + nodeLookup1(dram1, indexpreStrm1, dagStrm10, dagStrm11, dagStrm12, dagStrm13); + nodeLookup2(dram2, indexpreStrm2, dagStrm20, dagStrm21, dagStrm22, dagStrm23); + nodeLookup3(dram3_ret, indexpreStrm3, dagStrm30, dagStrm31, dagStrm32, dagStrm33); + + postfnv(batch_cnt_ap, s0preStrm0, smix0preStrm0, smix0preStrm1, smix1preStrm0, smix1preStrm1, orderpreStrm, + dagStrm00, dagStrm01, dagStrm02, dagStrm03, dagStrm10, dagStrm11, dagStrm12, dagStrm13, dagStrm20, + dagStrm21, dagStrm22, dagStrm23, dagStrm30, dagStrm31, dagStrm32, dagStrm33, s0pongStrm, smix0pongStrm, + smix1pongStrm, mixStrm00, mixStrm01, mixStrm10, mixStrm11); + + fsk_passback(s0pongStrm, smix0pongStrm, smix1pongStrm, s0pingStrm, smix0pingStrm, smix1pingStrm); + + STATIC vpp_stream_256_4096 compressStrm; + + compress(batch_cnt_ap, mixStrm00, mixStrm01, mixStrm10, mixStrm11, compressStrm); + + STATIC vpp_stream_256_32 sha512Strm0; + STATIC vpp_stream_256_32 sha512Strm1; + STATIC vpp_stream_256_32 mixStrm; + + post_sha3_512_40(header_hash_ap, nonce_start_ap, batch_cnt_ap, compressStrm, sha512Strm0, sha512Strm1, mixStrm); + + STATIC vpp_stream_256_32 mixhashStrm("mixhash"); + STATIC vpp_stream_256_32 resultStrm("result"); + + sha3_256_96_unit(batch_cnt_ap, sha512Strm0, sha512Strm1, mixStrm, mixhashStrm, resultStrm); + + check(batch_cnt_ap, index, mixhashStrm, resultStrm, dram3_ret); +} + +#endif diff --git a/security/L2/demos/ethash_sc/utils.mk b/security/L2/demos/ethash_sc/utils.mk new file mode 100644 index 0000000000..1937b53d2b --- /dev/null +++ b/security/L2/demos/ethash_sc/utils.mk @@ -0,0 +1,239 @@ +# +# Copyright 2019-2021 Xilinx, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# sc makefile-generator v1.0.0 +# +#+------------------------------------------------------------------------------- +# The following parameters are assigned with default values. These parameters can +# be overridden through the make command line +#+------------------------------------------------------------------------------- + +REPORT := no +PROFILE := no +DEBUG := no + +#'estimate' for estimate report generation +#'system' for system report generation +ifneq ($(REPORT), no) +VPP_LDFLAGS += --report estimate +VPP_LDFLAGS += --report system +endif + +#Generates profile summary report +ifeq ($(PROFILE), yes) +VPP_LDFLAGS += --profile_kernel data:all:all:all +endif + +#Generates debug summary report +ifeq ($(DEBUG), yes) +VPP_LDFLAGS += --dk protocol:all:all:all +endif + +#Check environment setup +ifndef XILINX_VITIS + XILINX_VITIS = /opt/xilinx/Vitis/$(TOOL_VERSION) + export XILINX_VITIS +endif +ifndef XILINX_XRT + XILINX_XRT = /opt/xilinx/xrt + export XILINX_XRT +endif + +check_device: + @set -eu; \ + inallowlist=False; \ + inblocklist=False; \ + for dev in $(PLATFORM_ALLOWLIST); \ + do if [[ $$(echo $(PLATFORM_NAME) | grep $$dev) != "" ]]; \ + then inallowlist=True; fi; \ + done ;\ + for dev in $(PLATFORM_BLOCKLIST); \ + do if [[ $$(echo $(PLATFORM_NAME) | grep $$dev) != "" ]]; \ + then inblocklist=True; fi; \ + done ;\ + if [[ $$inallowlist == False ]]; \ + then echo "[Warning]: The device $(PLATFORM_NAME) not in allowlist."; \ + fi; \ + if [[ $$inblocklist == True ]]; \ + then echo "[ERROR]: The device $(PLATFORM_NAME) in blocklist."; exit 1;\ + fi; + +#get HOST_ARCH by PLATFORM +ifneq (,$(PLATFORM)) +HOST_ARCH_temp = $(shell platforminfo -p $(PLATFORM) | grep 'CPU Type' | sed 's/.*://' | sed '/ai_engine/d' | sed 's/^[[:space:]]*//') +ifeq ($(HOST_ARCH_temp), x86) +HOST_ARCH := x86 +else ifeq ($(HOST_ARCH_temp), cortex-a9) +HOST_ARCH := aarch32 +else ifneq (,$(findstring cortex-a, $(HOST_ARCH_temp))) +HOST_ARCH := aarch64 +endif +endif + +#Checks for Device Family +ifeq ($(HOST_ARCH), aarch32) + DEV_FAM = 7Series +else ifeq ($(HOST_ARCH), aarch64) + DEV_FAM = Ultrascale +endif + +#Checks for Correct architecture +ifneq ($(HOST_ARCH), $(filter $(HOST_ARCH),aarch64 aarch32 x86)) +$(error HOST_ARCH variable not set, please set correctly and rerun) +endif + +check_version: +ifneq (, $(shell which git)) +ifneq (,$(wildcard $(XFLIB_DIR)/.git)) + @cd $(XFLIB_DIR) && git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit -n 1 && cd - +endif +endif + +#Checks for SYSROOT +check_sysroot: +ifneq ($(HOST_ARCH), x86) +ifndef SYSROOT + $(error SYSROOT ENV variable is not set, please set ENV variable correctly and rerun) +endif +endif + +#Checks for g++ +CXX := g++ +CXX_REQ := $(shell echo $(GCC_INTOOL) | cut -f 1 -d ".") +ifeq ($(HOST_ARCH), x86) +ifneq ($(shell expr $(shell echo "__GNUG__" | g++ -E -x c++ - | tail -1) \>= $(CXX_REQ)), 1) +ifndef XILINX_VIVADO +$(error [ERROR]: g++ version too old. Please use $(CXX_REQ) or above) +else +CXX := $(XILINX_VIVADO)/tps/lnx64/gcc-$(GCC_INTOOL)/bin/g++ +ifeq ($(LD_LIBRARY_PATH),) +export LD_LIBRARY_PATH := $(XILINX_VIVADO)/tps/lnx64/gcc-$(GCC_INTOOL)/lib64 +else +export LD_LIBRARY_PATH := $(XILINX_VIVADO)/tps/lnx64/gcc-$(GCC_INTOOL)/lib64:$(LD_LIBRARY_PATH) +endif +$(warning [WARNING]: g++ version too old. Using g++ provided by the tool: $(CXX)) +endif +endif +else ifeq ($(HOST_ARCH), aarch64) +CXX := $(XILINX_VITIS)/gnu/aarch64/lin/aarch64-linux/bin/aarch64-linux-gnu-g++ +else ifeq ($(HOST_ARCH), aarch32) +CXX := $(XILINX_VITIS)/gnu/aarch32/lin/gcc-arm-linux-gnueabi/bin/arm-linux-gnueabihf-g++ +endif + +#check binutils +BINUTILS := $(shell ld -v | cut -f 4 -d " " | cut -f 1 -d "-") +BINUTILS_REQ := $(BINUTILS_INTOOL) +ifneq ($(shell expr $(BINUTILS) \>= $(BINUTILS_REQ)), 1) +export PATH := $(XILINX_VIVADO)/tps/lnx64/binutils-$(BINUTILS_INTOOL)/bin:$(PATH) +endif + +#Setting VPP +VPP := v++ + +#Cheks for aiecompiler +AIECXX := aiecompiler +AIESIMULATOR := aiesimulator +X86SIMULATOR := x86simulator + +.PHONY: check_vivado +check_vivado: +ifeq (,$(wildcard $(XILINX_VIVADO)/bin/vivado)) + @echo "Cannot locate Vivado installation. Please set XILINX_VIVADO variable." && false +endif + +.PHONY: check_vpp +check_vpp: +ifeq (,$(wildcard $(XILINX_VITIS)/bin/v++)) + @echo "Cannot locate Vitis installation. Please set XILINX_VITIS variable." && false +endif + +.PHONY: check_xrt +check_xrt: +ifeq (,$(wildcard $(XILINX_XRT)/lib/libxilinxopencl.so)) + @echo "Cannot locate XRT installation. Please set XILINX_XRT variable." && false +endif + +export PATH := $(XILINX_VITIS)/bin:$(XILINX_XRT)/bin:$(PATH) +ifeq ($(HOST_ARCH), x86) +ifeq (,$(LD_LIBRARY_PATH)) +LD_LIBRARY_PATH := $(XILINX_XRT)/lib +else +LD_LIBRARY_PATH := $(XILINX_XRT)/lib:$(LD_LIBRARY_PATH) +endif +endif + +ifneq (,$(wildcard $(PLATFORM))) +# Use PLATFORM as a file path +XPLATFORM := $(PLATFORM) +else +# Use PLATFORM as a file name pattern +# 1. search paths specified by variable +ifneq (,$(PLATFORM_REPO_PATHS)) +# 1.1 as exact name +XPLATFORM := $(strip $(foreach p, $(subst :, ,$(PLATFORM_REPO_PATHS)), $(wildcard $(p)/$(PLATFORM)/$(PLATFORM).xpfm))) +# 1.2 as a pattern +ifeq (,$(XPLATFORM)) +XPLATFORMS := $(foreach p, $(subst :, ,$(PLATFORM_REPO_PATHS)), $(wildcard $(p)/*/*.xpfm)) +XPLATFORM := $(strip $(foreach p, $(XPLATFORMS), $(shell echo $(p) | awk '$$1 ~ /$(PLATFORM)/'))) +endif # 1.2 +endif # 1 +# 2. search Vitis installation +ifeq (,$(XPLATFORM)) +# 2.1 as exact name +XPLATFORM := $(strip $(wildcard $(XILINX_VITIS)/platforms/$(PLATFORM)/$(PLATFORM).xpfm)) +# 2.2 as a pattern +ifeq (,$(XPLATFORM)) +XPLATFORMS := $(wildcard $(XILINX_VITIS)/platforms/*/*.xpfm) +XPLATFORM := $(strip $(foreach p, $(XPLATFORMS), $(shell echo $(p) | awk '$$1 ~ /$(PLATFORM)/'))) +endif # 2.2 +endif # 2 +# 3. search default locations +ifeq (,$(XPLATFORM)) +# 3.1 as exact name +XPLATFORM := $(strip $(wildcard /opt/xilinx/platforms/$(PLATFORM)/$(PLATFORM).xpfm)) +# 3.2 as a pattern +ifeq (,$(XPLATFORM)) +XPLATFORMS := $(wildcard /opt/xilinx/platforms/*/*.xpfm) +XPLATFORM := $(strip $(foreach p, $(XPLATFORMS), $(shell echo $(p) | awk '$$1 ~ /$(PLATFORM)/'))) +endif # 3.2 +endif # 3 +endif + +define MSG_PLATFORM +No platform matched pattern '$(PLATFORM)'. +Available platforms are: $(XPLATFORMS) +To add more platform directories, set the PLATFORM_REPO_PATHS variable or point PLATFORM variable to the full path of platform .xpfm file. +endef +export MSG_PLATFORM + + +.PHONY: check_platform +check_platform: +ifeq (,$(XPLATFORM)) + @echo "$${MSG_PLATFORM}" && false +endif +#Check ends + +# device2xsa - create a filesystem friendly name from device name +# $(1) - full name of device +PLATFORM_NAME = $(strip $(patsubst %.xpfm, % , $(shell basename $(PLATFORM)))) + + +# Cleaning stuff +RM = rm -f +RMDIR = rm -rf + +MV = mv -f +CP = cp -rf +ECHO:= @echo diff --git a/security/L2/include/xf_security/README.md b/security/L2/include/xf_security/README.md new file mode 100644 index 0000000000..bc8a6ac237 --- /dev/null +++ b/security/L2/include/xf_security/README.md @@ -0,0 +1 @@ +This folder contains headers of predefined kernels. diff --git a/security/L2/include/xf_security/crc32c_krl.hpp b/security/L2/include/xf_security/crc32c_krl.hpp new file mode 100644 index 0000000000..d843317683 --- /dev/null +++ b/security/L2/include/xf_security/crc32c_krl.hpp @@ -0,0 +1,129 @@ +/* + * Copyright 2022 Xilinx, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file crc32_krl.hpp + * @brief header file for crc32_krl. + * This file part of Vitis Security Library. + * + */ + +#ifndef _XF_SECURITY_CRC32C_KERNEL_HPP_ +#define _XF_SECURITY_CRC32C_KERNEL_HPP_ + +#pragma once + +#include "vpp_acc.hpp" +#include +#include +#include "xf_security/crc32c.hpp" + +#if !defined(__SYNTHESIS__) +#include +#endif + +class crc32c_acc : public VPP_ACC { + // port bindings + ZERO_COPY(in_buff); + ZERO_COPY(len_buff); + ZERO_COPY(out_buff); + + // for both U.2 and U200 + SYS_PORT(in_buff, bank0); + SYS_PORT(len_buff, bank0); + SYS_PORT(out_buff, bank0); + // for U50 + SYS_PORT_PFM(u50, in_buff, HBM[0]); + SYS_PORT_PFM(u50, len_buff, HBM[1]); + SYS_PORT_PFM(u50, out_buff, HBM[2]); + + public: + /** + * @brief top of the compute. + * + * @param in_buff input buffer providing the data that needs to be calculated. + * @param len_buff length of each data in bytes from address 1 to N, address 0 used to save the number of input + * data. + * @param out_buff output result buffer. + * + */ + static void compute(ap_uint<512>* in_buff, ap_uint<32>* len_buff, ap_uint<32>* out_buff); + /** + * @brief top of the HLS kernel. + * + * @param in_buff input buffer providing the data that needs to be calculated. + * @param len_buff length of each data in bytes from address 1 to N, address 0 used to save the number of input + * data. + * @param out_buff output result buffer. + * + */ + static void hls_top(ap_uint<512>* in_buff, ap_uint<32>* len_buff, ap_uint<32>* out_buff); +}; + +/** + * @brief scan module for reading the input data. + * + * @param in_buff input buffer providing the data that needs to be calculated. + * @param len_buff length of each data in bytes from address 1 to N, address 0 used to save the number of input + * data. + * @param in_strm input stream to feed to crc32c primitive. + * @param init_strm initialization stream to feed to crc32c primitive. + * @param len_strm length stream to feed to crc32c primitive. + * @param end_len_strm end flag of len_strm. + * + */ +static void scan(ap_uint<512>* in_buff, + ap_uint<32>* len_buff, + hls::stream >& in_strm, + hls::stream >& init_strm, + hls::stream >& len_strm, + hls::stream& end_len_strm) { + ap_uint<32> idx = 0; + ap_uint<32> num = len_buff[0]; + + for (int i = 0; i < num; i++) { + ap_uint<32> len = len_buff[i + 1]; + init_strm.write(~0); + len_strm.write(len); + end_len_strm.write(false); + ap_uint<32> len_blk = len / sizeof(ap_uint<512>) + ((len % sizeof(ap_uint<512>)) > 0); + for (int j = 0; j < len_blk; j++) { +#pragma HLS pipeline II = 1 + in_strm.write(in_buff[idx++]); + } + } + end_len_strm.write(true); +} + +/** + * @brief scan module for reading the input data. + * + * @param out_strm output stream to get from crc32c primitive. + * @param end_out_strm end flag of out_strm. + * @param out_buff output result buffer. + * + */ +static void write(hls::stream >& out_strm, hls::stream& end_out_strm, ap_uint<32>* out_buff) { + bool end = end_out_strm.read(); + ap_uint<32> idx = 0; + while (!end) { +#pragma HLS pipeline II = 1 + out_buff[idx++] = out_strm.read(); + end = end_out_strm.read(); + } +} + +#endif // _XF_SECURITY_CRC32C_KERNEL_HPP_ diff --git a/security/L2/include/xf_security/ethash_krl.hpp b/security/L2/include/xf_security/ethash_krl.hpp new file mode 100644 index 0000000000..c401a38b1b --- /dev/null +++ b/security/L2/include/xf_security/ethash_krl.hpp @@ -0,0 +1,267 @@ +/* + * Copyright 2022 Xilinx, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef _XF_SECURITY_ETHASH_KERNEL_HPP_ +#define _XF_SECURITY_ETHASH_KERNEL_HPP_ + +#pragma once + +#include "vpp_acc.hpp" +#include "vpp_stream.hpp" +#include "ap_int.h" + +const int NODE_WORDS = 64 / 4; // 16 +const int ETHASH_MIX_BYTES = 128; +const int MIX_WORDS = ETHASH_MIX_BYTES / 4; // 32 +const int MIX_NODES = MIX_WORDS / NODE_WORDS; // 2 +const int CHANNEL_NODES = (1 << 28) / 64; + +// WA for XidanePass memory blowup for static streams +#ifdef TARGET_FLOW_sw_emu +#define STATIC static +#else +#define STATIC +#endif + +typedef vpp::stream, 1024> vpp_stream_2_1024; +typedef vpp::stream, 1024> vpp_stream_25_1024; +typedef vpp::stream, 1024> vpp_stream_32_1024; +typedef vpp::stream, 4096> vpp_stream_32_4096; +typedef vpp::stream, 32> vpp_stream_256_32; +typedef vpp::stream, 1024> vpp_stream_256_1024; +typedef vpp::stream, 4096> vpp_stream_256_4096; +typedef vpp::stream, 4096> vpp_stream_512_4096; + +/** + * + * @param x input operand x. + * @param y input operand y. + * + * @return (x * FNV_PRIME) xor y. + * + */ +static ap_uint<32> fnv_hash(ap_uint<32> x, ap_uint<32> y) { + const ap_uint<25> FNV_PRIME = 0x01000193; + ap_uint<32> tmp = x * FNV_PRIME; + return tmp ^ y; +} + +/** + * + * @tparam W bit width of b. + * + * @param a input operand a. + * @param b input operand b. + * + * @return a % b, but b[24] must be 1. + * + */ +template +inline ap_uint special_mod(ap_uint<32> a, ap_uint b) { + ap_uint<33> tmp = a; + for (int i = 0; i < (33 - W); i++) { + if (tmp.range(32, 32 - W) >= b) { + tmp.range(32, 32 - W) = tmp.range(32, 32 - W) - b; + } + tmp <<= 1; + } + return tmp.range(32, 33 - W); +} + +class ethash_acc : public VPP_ACC { // number of CU + // binding specific device buffer to a specific off-chip memory bank + ZERO_COPY(dram0); + ZERO_COPY(dram1); + ZERO_COPY(dram2); + ZERO_COPY(dram3_ret); + + FREE_RUNNING(fsk_passback); + + SYS_PORT(dram0, DDR[0]); + SYS_PORT(dram1, DDR[1]); + SYS_PORT(dram2, DDR[2]); + SYS_PORT(dram3_ret, DDR[3]); + + SYS_PORT_PFM(u50, dram0, (HBM[0] : HBM[4])); + SYS_PORT_PFM(u50, dram1, (HBM[1] : HBM[5])); + SYS_PORT_PFM(u50, dram2, (HBM[2] : HBM[6])); + SYS_PORT_PFM(u50, dram3_ret, (HBM[3] : HBM[7])); + + SYS_PORT_PFM(u55n, dram0, (HBM[0] : HBM[4])); + SYS_PORT_PFM(u55n, dram1, (HBM[1] : HBM[5])); + SYS_PORT_PFM(u55n, dram2, (HBM[2] : HBM[6])); + SYS_PORT_PFM(u55n, dram3_ret, (HBM[3] : HBM[7])); + + ASSIGN_SLR(prefnv, (SLR0 : SLR1)); + ASSIGN_SLR(nodeLookup0, (SLR0 : SLR1)); + ASSIGN_SLR(nodeLookup1, (SLR0 : SLR1)); + ASSIGN_SLR(nodeLookup2, (SLR0 : SLR1)); + ASSIGN_SLR(nodeLookup3, (SLR0 : SLR1)); + ASSIGN_SLR(postfnv, (SLR0 : SLR1)); + ASSIGN_SLR(pre_sha3_512_40, (SLR0 : SLR1)); + ASSIGN_SLR(compress, (SLR0 : SLR1)); + ASSIGN_SLR(post_sha3_512_40, (SLR0 : SLR1)); + ASSIGN_SLR(sha3_256_96_unit, (SLR0 : SLR1)); + ASSIGN_SLR(check, (SLR0 : SLR1)); + ASSIGN_SLR(fsk_passback, (SLR0 : SLR1)); + + public: + static void prefnv(ap_uint<32> full_size, + ap_uint<32> batch_cnt_ap, + + vpp_stream_256_4096& sha3_512_Strm0, + vpp_stream_256_4096& sha3_512_Strm1, + + vpp_stream_32_4096& s0pingStrm, + vpp_stream_512_4096& smix0pingStrm, + vpp_stream_512_4096& smix1pingStrm, + + vpp_stream_2_1024& orderpreStrm, + vpp_stream_25_1024& indexpreStrm0, + vpp_stream_25_1024& indexpreStrm1, + vpp_stream_25_1024& indexpreStrm2, + vpp_stream_25_1024& indexpreStrm3, + + vpp_stream_32_1024& s0preStrm0, + vpp_stream_256_1024& smix0preStrm0, + vpp_stream_256_1024& smix0preStrm1, + vpp_stream_256_1024& smix1preStrm0, + vpp_stream_256_1024& smix1preStrm1); + + static void nodeLookup0(ap_uint<512>* dram0, + vpp_stream_25_1024& indexpreStrm0, + vpp_stream_256_32& dagStrm00, + vpp_stream_256_32& dagStrm01, + vpp_stream_256_32& dagStrm02, + vpp_stream_256_32& dagStrm03); + + static void nodeLookup1(ap_uint<512>* dram1, + vpp_stream_25_1024& indexpreStrm1, + vpp_stream_256_32& dagStrm10, + vpp_stream_256_32& dagStrm11, + vpp_stream_256_32& dagStrm12, + vpp_stream_256_32& dagStrm13); + + static void nodeLookup2(ap_uint<512>* dram2, + vpp_stream_25_1024& indexpreStrm2, + vpp_stream_256_32& dagStrm20, + vpp_stream_256_32& dagStrm21, + vpp_stream_256_32& dagStrm22, + vpp_stream_256_32& dagStrm23); + + static void nodeLookup3(ap_uint<512>* dram3_ret, + vpp_stream_25_1024& indexpreStrm3, + vpp_stream_256_32& dagStrm30, + vpp_stream_256_32& dagStrm31, + vpp_stream_256_32& dagStrm32, + vpp_stream_256_32& dagStrm33); + + static void postfnv(ap_uint<32> batch_cnt_ap, + + vpp_stream_32_1024& s0preStrm0, + vpp_stream_256_1024& smix0preStrm0, + vpp_stream_256_1024& smix0preStrm1, + vpp_stream_256_1024& smix1preStrm0, + vpp_stream_256_1024& smix1preStrm1, + + vpp_stream_2_1024& orderpreStrm, + vpp_stream_256_32& dagStrm00, + vpp_stream_256_32& dagStrm01, + vpp_stream_256_32& dagStrm02, + vpp_stream_256_32& dagStrm03, + + vpp_stream_256_32& dagStrm10, + vpp_stream_256_32& dagStrm11, + vpp_stream_256_32& dagStrm12, + vpp_stream_256_32& dagStrm13, + + vpp_stream_256_32& dagStrm20, + vpp_stream_256_32& dagStrm21, + vpp_stream_256_32& dagStrm22, + vpp_stream_256_32& dagStrm23, + + vpp_stream_256_32& dagStrm30, + vpp_stream_256_32& dagStrm31, + vpp_stream_256_32& dagStrm32, + vpp_stream_256_32& dagStrm33, + + vpp_stream_32_4096& s0pongStrm, + vpp_stream_512_4096& smix0pongStrm, + vpp_stream_512_4096& smix1pongStrm, + + vpp_stream_256_32& mixStrm00, + vpp_stream_256_32& mixStrm01, + vpp_stream_256_32& mixStrm10, + vpp_stream_256_32& mixStrm11); + + static void pre_sha3_512_40(ap_uint<256> header_hash_ap, + ap_uint<64> nonce_start_ap, + ap_uint<32> batch_cnt_ap, + + vpp_stream_256_4096& sha3_512_Strm0, + vpp_stream_256_4096& sha3_512_Strm1); + + static void compress(ap_uint<32> batch_cnt_ap, + vpp_stream_256_32& mixStrm00, + vpp_stream_256_32& mixStrm01, + vpp_stream_256_32& mixStrm10, + vpp_stream_256_32& mixStrm11, + + vpp_stream_256_4096& compressStrm); + + static void post_sha3_512_40(ap_uint<256> header_hash_ap, + ap_uint<64> nonce_start_ap, + ap_uint<32> batch_cnt_ap, + vpp_stream_256_4096& compressStrm, + + vpp_stream_256_32& sha512Strm0, + vpp_stream_256_32& sha512Strm1, + vpp_stream_256_32& mixStrm); + + static void sha3_256_96_unit(ap_uint<32> batch_cnt_ap, + vpp_stream_256_32& sha512Strm0, + vpp_stream_256_32& sha512Strm1, + vpp_stream_256_32& mixStrm, + + vpp_stream_256_32& mixhashStrm, + vpp_stream_256_32& resultStrm); + + static void check(ap_uint<32> batch_cnt_ap, + unsigned index, + vpp_stream_256_32& mixhashStrm, + vpp_stream_256_32& resultStrm, + ap_uint<512>* dram3_ret); + + static void fsk_passback(vpp_stream_32_4096& s0pongStrm, + vpp_stream_512_4096& smix0pongStrm, + vpp_stream_512_4096& smix1pongStrm, + + vpp_stream_32_4096& s0pingStrm, + vpp_stream_512_4096& smix0pingStrm, + vpp_stream_512_4096& smix1pingStrm); + + static void compute(unsigned index, + unsigned full_size, + ap_uint<256> header_hash, + ap_uint<64> nonce_start, + unsigned batch_cnt, + ap_uint<512>* dram0, + ap_uint<512>* dram1, + ap_uint<512>* dram2, + ap_uint<512>* dram3_ret); +}; + +#endif // _XF_SECURITY_ETHASH_KERNEL_HPP_ diff --git a/security/L3/README.md b/security/L3/README.md new file mode 100644 index 0000000000..1d8631d20c --- /dev/null +++ b/security/L3/README.md @@ -0,0 +1,3 @@ +# L3 Overlay APIs + +APIs in L3 layer is build upon predefined security kernels in L2, and it shows how to perform the entire execution pipeline with both software and FPGA components. diff --git a/security/L3/include/xf_security/crc32c_sc.hpp b/security/L3/include/xf_security/crc32c_sc.hpp new file mode 100644 index 0000000000..e0ae5cfb3b --- /dev/null +++ b/security/L3/include/xf_security/crc32c_sc.hpp @@ -0,0 +1,72 @@ +/* + * Copyright 2022 Xilinx, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "xf_security/crc32c_krl.hpp" + +#include +#include + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +/** + * @brief calculates the CRC32C of the data provided in input file vector, the results are emitted to the output result + * vector. + * + * @param in_file input file vector. + * @param in_size size of each input file in bytes. + * @param out_result output result vector. + * + * @return 0 if run succeed, otherwise returns non-zero values. + */ +int crc32c_run(std::vector in_file, std::vector in_size, std::vector& out_result); + +/** + * @brief aligned memory allocator. + * + * @tparam T data type of the element. + * + * @param num number of the elements in the buffer. + * + * @return the pointer to the allocated buffer. + */ +template +T* aligned_alloc(std::size_t num) { + void* ptr = nullptr; + if (posix_memalign(&ptr, 4096, num * sizeof(T))) throw std::bad_alloc(); + return reinterpret_cast(ptr); +} + +/** + * @brief time counter + * + * @param tv0 start time. + * @prram tv1 end time. + * + * @return number of us of the duration. + */ +inline int tvdiff(struct timeval* tv0, struct timeval* tv1) { + return (tv1->tv_sec - tv0->tv_sec) * 1000000 + (tv1->tv_usec - tv0->tv_usec); +} diff --git a/security/L3/src/xf_security/crc32c_sc.cpp b/security/L3/src/xf_security/crc32c_sc.cpp new file mode 100644 index 0000000000..6fbfd55072 --- /dev/null +++ b/security/L3/src/xf_security/crc32c_sc.cpp @@ -0,0 +1,93 @@ +/* + * Copyright 2022 Xilinx, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "xf_security/crc32c_sc.hpp" + +int crc32c_run(std::vector in_file, std::vector in_size, std::vector& out_result) { + // get the number of input files + uint32_t num = in_file.size(); + uint32_t num2 = in_size.size(); + if (num != num2) { + std::cout << "ERROR: size of in_file have to be equal to size of in_size.\n"; + return 1; + } + + int* fd = (int*)malloc(sizeof(int) * num); + for (int i = 0; i < num; i++) { + fd[i] = open(in_file[i].c_str(), O_RDONLY | O_DIRECT, S_IRWXU); + if (fd[i] < 0) { + std::cout << "ERROR: Open file \"" << in_file[i] << "\" failed.\n"; + } + } + + // total number of bytes of input + uint32_t total_size = 0; +#ifdef USE_P2P + auto in_buff_pool = crc32c_acc::create_bufpool(vpp::input, vpp::p2p); +#else + auto in_buff_pool = crc32c_acc::create_bufpool(vpp::input); +#endif + auto len_buff_pool = crc32c_acc::create_bufpool(vpp::input); + auto out_buff_pool = crc32c_acc::create_bufpool(vpp::output); + uint32_t index = 0; + // send task requests + crc32c_acc::send_while([&]() -> bool { + struct stat sb; + fstat(fd[index], &sb); + uint32_t file_size = sb.st_size; + total_size += file_size; +#ifdef USE_P2P + ap_uint<512>* acc_in_buff = (ap_uint<512>*)crc32c_acc::file_buf(in_buff_pool, fd[index], file_size, 0, 0); +#else + ap_uint<512>* acc_in_buff = (ap_uint<512>*)crc32c_acc::alloc_buf(in_buff_pool, file_size); + pread(fd[index], acc_in_buff, file_size, 0); +#endif + ap_uint<32>* acc_len_buff = (ap_uint<32>*)crc32c_acc::alloc_buf(len_buff_pool, sizeof(ap_uint<32>) * 2); + acc_len_buff[0] = 1; + acc_len_buff[1] = file_size; + ap_uint<32>* acc_out_buff = (ap_uint<32>*)crc32c_acc::alloc_buf(out_buff_pool, sizeof(ap_uint<32>)); + + crc32c_acc::compute(acc_in_buff, acc_len_buff, acc_out_buff); + + index++; + return index < num; + }); + + // send result receiving requests + uint32_t order = 0; + ap_uint<32>* out_buff = aligned_alloc >(num); + crc32c_acc::receive_all_in_order([&]() { + ap_uint<32>* acc_ret_out_buff = (ap_uint<32>*)crc32c_acc::get_buf(out_buff_pool); + memcpy(&out_buff[order++], acc_ret_out_buff, sizeof(ap_uint<32>)); + }); + + std::cout << "Starting crc32c_acc::join()\n"; + struct timeval start_time, end_time; + gettimeofday(&start_time, 0); + crc32c_acc::join(); + gettimeofday(&end_time, 0); + for (int i = 0; i < num; i++) { + out_result.push_back((uint32_t)out_buff[i]); + } + + std::cout << "Finishing crc32c_acc::join()\n"; + std::cout << "Total execution time " << tvdiff(&start_time, &end_time) / 1000 << "ms" << std::endl; + std::cout << "End-to-end throughput " + << ((double)total_size / 1024.0 / 1024.0 / 1024.0) / (tvdiff(&start_time, &end_time) / 1000000.0) + << " GB/s.\n"; + + return 0; +} diff --git a/security/L3/tests/crc32c_sc/Makefile b/security/L3/tests/crc32c_sc/Makefile new file mode 100644 index 0000000000..a534a736e2 --- /dev/null +++ b/security/L3/tests/crc32c_sc/Makefile @@ -0,0 +1,276 @@ +# Copyright 2019-2021 Xilinx, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# sc makefile-generator v1.0.0 + +############################## Help Section ############################## +.PHONY: help + +help:: + $(ECHO) "Makefile Usage:" + $(ECHO) " make all TARGET= PLATFORM= HOST_ARCH=" + $(ECHO) " Command to generate the design for specified Target and Shell." + $(ECHO) " By default, HOST_ARCH=. HOST_ARCH is required for SoC shells" + $(ECHO) "" + $(ECHO) " make run TARGET= PLATFORM= HOST_ARCH=" + $(ECHO) " Command to run application in emulation." + $(ECHO) " By default, HOST_ARCH=. HOST_ARCH required for SoC shells" + $(ECHO) "" + $(ECHO) " make host HOST_ARCH=" + $(ECHO) " Command to build host application." + $(ECHO) " By default, HOST_ARCH=. HOST_ARCH is required for SoC shells" + $(ECHO) "" + $(ECHO) " make clean " + $(ECHO) " Command to remove the generated non-hardware files." + $(ECHO) "" + $(ECHO) " make cleanall" + $(ECHO) " Command to remove all the generated files." + $(ECHO) "" + +############################## Setting up Project Variables ############################## + +MK_PATH := $(abspath $(lastword $(MAKEFILE_LIST))) +XF_PROJ_ROOT ?= $(shell bash -c 'export MK_PATH=$(MK_PATH); echo $${MK_PATH%/L3/*}') +CUR_DIR := $(patsubst %/,%,$(dir $(MK_PATH))) +XFLIB_DIR = $(XF_PROJ_ROOT) + +# setting devault value +TARGET ?= sw_emu +HOST_ARCH ?= + +#setting PLATFORM +ifeq ($(PLATFORM),) +PLATFORM := $(DEVICE) +endif +ifeq ($(PLATFORM),) +PLATFORM := samsung_U2 +endif + +# #################### Checking if PLATFORM in whitelist ############################ +PLATFORM_ALLOWLIST += samsung_U2 u200 +PLATFORM_BLOCKLIST += zc + +GCC_INTOOL := 8.3.0 +BINUTILS_INTOOL := 2.37 +include ./utils.mk +TEMP_DIR := _x_temp.$(TARGET).$(PLATFORM_NAME) +TEMP_REPORT_DIR := $(CUR_DIR)/reports/_x.$(TARGET).$(PLATFORM_NAME) +BUILD_DIR := build_dir.$(TARGET).$(PLATFORM_NAME) +BUILD_REPORT_DIR := $(CUR_DIR)/reports/_build.$(TARGET).$(PLATFORM_NAME) +EMCONFIG := $(BUILD_DIR)/emconfig.json +XCLBIN_DIR := $(CUR_DIR)/$(BUILD_DIR) +export XCL_BINDIR = $(XCLBIN_DIR) + +EXE_FILE_DEPS := +BINARY_CONTAINERS_DEPS := +RUN_DEPS := + +# set debug switch +ifneq ($(debug),yes) +CXXFLAGS += -O3 +endif + +# get global setting +ifdef XILINX_SC_PFM_CONFIG +CXXFLAGS += -DXILINX_SC_PFM_CONFIG=$(XILINX_SC_PFM_CONFIG) +endif +ifdef XILINX_SC_PFM_EXT +CXXFLAGS += -DXILINX_SC_PFM_EXT=$(XILINX_SC_PFM_EXT) +endif +ifeq ($(HOST_ARCH), x86) +CXXFLAGS += -I $(XILINX_VITIS)/system_compiler/include -I $(XILINX_HLS)/include +LDFLAGS += -L$(XILINX_XRT)/lib -L$(XILINX_VITIS)/system_compiler/lib/x86 -lvpp_acc -l$(LIB_XRT) -lxrt_coreutil -Wl,-rpath=$(XILINX_VITIS)/system_compiler/lib/x86:$(XILINX_XRT)/lib:$(GCC_HOME)/lib64 -Wl,--enable-new-dtags -lpthread +VPP_FLAGS += -t $(TARGET) --platform $(XPLATFORM) --temp_dir $(TEMP_DIR) --save-temps -g -I $(XILINX_VITIS)/system_compiler/include +VPP_LDFLAGS += +else ifeq ($(HOST_ARCH), aarch64) +CXXFLAGS += +LDFLAGS += +VPP_FLAGS += +VPP_LDFLAGS += +endif +CXXFLAGS += $(EXTRA_CXXFLAGS) +VPP_FLAGS += $(EXTRA_VPP_FLAGS) + +ifeq ($(TARGET),sw) + $(error Error: The sw target is not supported anymore. Please use sw_emu instead) +else ifeq ($(TARGET),sw_emu) + LIB_XRT := xrt_swemu + HOST_PREAMBLE := XCL_EMULATION_MODE=sw_emu +else ifeq ($(TARGET),hw_emu) + LIB_XRT := xrt_hwemu + HOST_PREAMBLE := XCL_EMULATION_MODE=hw_emu + ifneq (,$(findstring -g,$(EXTRA_VPPFLAGS) $(CXXFLAGS))) + # for sourcing pre/post xsim scripts + ifneq ($(XILINX_SC_HW_EMU),0) + HOST_PREAMBLE += XILINX_SC_HW_EMU=1 XILINX_SC_BUILD_DIR=$(PWD)/$(BUILD_DIR) + endif + endif +else ifeq ($(TARGET),hw) + LIB_XRT := xrt_core +endif + +########################## Setting up Host Variables ########################## + +#Inclue Required Host Source Files +ifneq (,$(shell echo $(XPLATFORM) | awk '/samsung_U2/')) +HOST_SRCS += $(CUR_DIR)/host/main.cpp $(XFLIB_DIR)/L3/src/xf_security/crc32c_sc.cpp +CXXFLAGS += -D USE_P2P +CXXFLAGS += -I $(XFLIB_DIR)/L1/include -I $(XFLIB_DIR)/L2/include -I $(XFLIB_DIR)/L3/include -I $(XFLIB_DIR)/ext/xcl2 +CXXFLAGS += -O3 + +else +HOST_SRCS += $(CUR_DIR)/host/main.cpp $(XFLIB_DIR)/L3/src/xf_security/crc32c_sc.cpp +CXXFLAGS += -I $(XFLIB_DIR)/L1/include -I $(XFLIB_DIR)/L2/include -I $(XFLIB_DIR)/L3/include -I $(XFLIB_DIR)/ext/xcl2 +CXXFLAGS += -O3 + +endif +EXE_NAME := host.exe +EXE_OBJS := $(addprefix $(TEMP_DIR)/, $(addsuffix .o,$(basename $(HOST_SRCS)))) +EXE_FILE := $(BUILD_DIR)/$(EXE_NAME) +EXE_FILE_DEPS := $(EXE_OBJS) +MAKEDEPEND = $(CXX) $< -MM -MP -MF $(basename $@).d -MT $@ $(CXXFLAGS) + +HOST_ARGS := -testfile $(XFLIB_DIR)/L3/tests/crc32c_sc/test.dat -n 2 +ifneq ($(HOST_ARCH), x86) +PKG_HOST_ARGS = $(foreach args,$(HOST_ARGS),$(subst $(dir $(patsubst %/,%,$(args))),,$(args))) +endif + +########################## Kernel compiler global settings ########################## +VPP_FLAGS += -I $(XFLIB_DIR)/L1/include -I $(XFLIB_DIR)/L2/include -I $(XFLIB_DIR)/L1/include + +######################### binary container global settings ########################## +VPP_FLAGS_kernel_crc32c += --hls.clock 300000000:kernel_crc32c +ifneq ($(HOST_ARCH), x86) +VPP_LDFLAGS_kernel_crc32c += --clock.defaultFreqHz 300000000 +else +VPP_LDFLAGS_kernel_crc32c += --kernel_frequency 300 +endif + +ifeq ($(HOST_ARCH), x86) +BINARY_CONTAINERS_TMP := $(BUILD_DIR)/$(TARGET).o +BINARY_CONTAINERS := $(BUILD_DIR)/$(TARGET).xclbin +ifeq ($(TARGET),sw_emu) + BINARY_CONTAINERS_TMP := +endif +else +# placeholder for non_x86 +endif + +.SECONDEXPANSION: +# ################ Setting Rules for Binary Containers (Building Kernels) ################ +ACC_SRCS_kernel_crc32c += $(CUR_DIR)/kernel/crc32c_krl.cpp +ACC_OBJS_kernel_crc32c := $(addprefix $(TEMP_DIR)/, $(addsuffix .o,$(basename $(ACC_SRCS_kernel_crc32c)))) +$(ACC_OBJS_kernel_crc32c): $(TEMP_DIR)/%.o : %.cpp $$(@D)/.f + @echo "--> Making $@ from: $?" + $(MAKEDEPEND) + $(VPP) $(VPP_FLAGS) $(VPP_FLAGS_kernel_crc32c) -o $@ -c $< +BINARY_CONTAINERS_DEPS += $(ACC_OBJS_kernel_crc32c) +$(BINARY_CONTAINERS_TMP) : $(BINARY_CONTAINERS_DEPS) + @echo "--> Making $@ from: $?" + $(VPP) $(VPP_FLAGS) $(VPP_LDFLAGS) -o $(BINARY_CONTAINERS) -l $^ +EXE_FILE_DEPS += $(BINARY_CONTAINERS_TMP) +EXE_FILE_DEPS += $(BINARY_CONTAINERS_DEPS) + +############################## Setting Rules for Host (Building Host Executable) ############################## +ifeq ($(HOST_ARCH), x86) +$(TEMP_DIR)/%.o : %.cpp $$(@D)/.f + @echo "--> Making $@ from: $?" + mkdir -p $(BUILD_DIR) + $(MAKEDEPEND) + $(CXX) -o $@ $(CXXFLAGS) -I . -c $< +$(EXE_FILE): $(EXE_FILE_DEPS) + mkdir -p $(BUILD_DIR) + $(CXX) -o $@ $^ $(CXXFLAGS) $(LDFLAGS) +else +# place holder for arch64 +endif + +$(EMCONFIG): + emconfigutil --platform $(XPLATFORM) --od $(BUILD_DIR) + +%/.f: + mkdir -p $(dir $@) + touch $@ + +.PRECIOUS: %/.f + +RUN_DEPS += $(EXE_FILE) $(EMCONFIG) + +run: check_device $(RUN_DEPS) +#sw_emu +ifneq (,$(filter sw_emu, $(TARGET))) +ifeq ($(HOST_ARCH), x86) + LD_LIBRARY_PATH=$(LIBRARY_PATH):$$LD_LIBRARY_PATH \ + $(HOST_PREAMBLE) $(EXE_FILE) $(HOST_ARGS) + +else +# place holder for arch64 +endif +endif + +#hw_emu +ifneq (,$(filter hw_emu, $(TARGET))) +ifeq ($(HOST_ARCH), x86) + LD_LIBRARY_PATH=$(LIBRARY_PATH):$$LD_LIBRARY_PATH \ + $(HOST_PREAMBLE) $(EXE_FILE) $(HOST_ARGS) + +else +# place holder for arch64 +endif +endif + +#hw +ifeq ($(TARGET), hw) +ifeq ($(HOST_ARCH), x86) + LD_LIBRARY_PATH=$(LIBRARY_PATH):$$LD_LIBRARY_PATH \ + $(HOST_PREAMBLE) $(EXE_FILE) $(HOST_ARGS) + +else +# place holder for arch64 +endif +endif + +############################## Setting Targets ############################## + +.PHONY: all clean cleanall emconfig +emconfig: $(EMCONFIG) +ifeq ($(HOST_ARCH), x86) +all: check_vpp check_platform check_xrt $(EXE_FILE) $(BINARY_CONTAINERS) emconfig +else +all: check_vpp check_platform check_sysroot $(EXE_FILE) $(BINARY_CONTAINERS) emconfig sd_card +endif + +.PHONY: host xclbin +ifeq ($(HOST_ARCH), x86) +host: check_xrt $(EXE_FILE) +else +host: check_sysroot $(EXE_FILE) +endif +xclbin: $(BINARY_CONTAINERS_TMP) + +############################## Cleaning Rules ############################## +cleanh: + -$(RMDIR) $(EXE_FILE) vitis_* TempConfig system_estimate.xtxt *.rpt .run/ + -$(RMDIR) src/*.ll _xocc_* .Xil dltmp* xmltmp* *.log *.jou *.wcfg *.wdb sample_link.ini sample_compile.ini obj* bin* *.csv *.jpg *.jpeg *.png + +cleank: + -$(RMDIR) $(BUILD_DIR)/*.xclbin _vimage *xclbin.run_summary qemu-memory-_* emulation/ _vimage/ pl*start_simulation. sh *.xclbin + -$(RMDIR) _x_temp.*/_x.* _x_temp.*/.Xil _x_temp.*/profile_summary.* xo_* _x* + -$(RMDIR) _x_temp.*/dltmp* _x_temp.*/kernel_info.dat _x_temp.*/*.log + -$(RMDIR) _x_temp.* + +cleanall: cleanh cleank + -$(RMDIR) $(BUILD_DIR) build_dir.* emconfig.json *.html $(TEMP_DIR) $(CUR_DIR)/reports *.csv *.run_summary $(CUR_DIR)/*.raw package_* $(BUILD_DIR)/run_script.sh .ipcache *.str + -$(RMDIR) $(XFLIB_DIR)/common/data/*.xe2xd* $(XFLIB_DIR)/common/data/*.orig* + +clean: cleanh \ No newline at end of file diff --git a/security/L3/tests/crc32c_sc/description.json b/security/L3/tests/crc32c_sc/description.json new file mode 100644 index 0000000000..3e892abe74 --- /dev/null +++ b/security/L3/tests/crc32c_sc/description.json @@ -0,0 +1,91 @@ +{ + "gui": false, + "name": "Xilinx L3 CRC32C (SC) Test", + "description": "A SystemCompiler example for CRC32C acceleration.", + "flow": "vitis", + "platform_allowlist": [ + "samsung_U2", + "u200" + ], + "platform_blocklist": [ + "zc" + ], + "platform_properties": { + "samsung_U2": { + "host": { + "compiler": { + "symbols": [ + "USE_P2P" + ] + } + } + } + }, + "launch": [ + { + "cmd_args": "-testfile LIB_DIR/L3/tests/crc32c_sc/test.dat -n 2", + "name": "generic launch for all flows" + } + ], + "host": { + "host_exe": "host.exe", + "compiler": { + "sources": [ + "host/main.cpp", + "LIB_DIR/L3/src/xf_security/crc32c_sc.cpp" + ], + "includepaths": [ + "LIB_DIR/L1/include", + "LIB_DIR/L2/include", + "LIB_DIR/L3/include" + ], + "options": "-O3" + } + }, + "v++": { + "compiler": { + "includepaths": [ + "LIB_DIR/L1/include", + "LIB_DIR/L2/include" + ] + } + }, + "containers": [ + { + "accelerators": [ + { + "location": "kernel/crc32c_krl.cpp", + "frequency": 300.0, + "name": "kernel_crc32c" + } + ], + "frequency": 300.0, + "name": "kernel_crc32c" + } + ], + "testinfo": { + "disable": false, + "jobs": [ + { + "index": 0, + "dependency": [], + "env": "", + "cmd": "", + "max_memory_MB": 32768, + "max_time_min": { + "vitis_hw_build": 470, + "vitis_hw_emu": 300, + "vitis_sw_emu": 60, + "vitis_hw_run": 10 + } + } + ], + "targets": [ + "vitis_sw_emu", + "vitis_hw_emu", + "vitis_hw_build", + "vitis_hw_run" + ], + "category": "canary" + } +} diff --git a/security/L3/tests/crc32c_sc/host/main.cpp b/security/L3/tests/crc32c_sc/host/main.cpp new file mode 100644 index 0000000000..904a65165e --- /dev/null +++ b/security/L3/tests/crc32c_sc/host/main.cpp @@ -0,0 +1,107 @@ +/* + * Copyright 2022 Xilinx, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "xf_security/crc32c_sc.hpp" + +#include +#include + +#include +#include +#include +#include +#include + +#include +#include +#include + +class ArgParser { + public: + ArgParser(int& argc, const char** argv) { + for (int i = 1; i < argc; ++i) mTokens.push_back(std::string(argv[i])); + } + bool getCmdOption(const std::string option, std::string& value) const { + std::vector::const_iterator itr; + itr = std::find(this->mTokens.begin(), this->mTokens.end(), option); + if (itr != this->mTokens.end() && ++itr != this->mTokens.end()) { + value = *itr; + return true; + } + return false; + } + + private: + std::vector mTokens; +}; + +int main(int argc, char* argv[]) { + ArgParser parser(argc, (const char**)argv); + + std::string testfile_path; + if (!parser.getCmdOption("-testfile", testfile_path)) { + std::cout << "ERROR: testfile path is not set!\n"; + return 1; + } + + std::string cnt_str; + if (!parser.getCmdOption("-n", cnt_str)) { + std::cout << "ERROR: number of test is not set!\n"; + return 1; + } + uint32_t num = std::stoi(cnt_str); // total number of tasks + + // push back file path & size + std::vector in_file; + std::vector in_size; + std::vector out_result; + for (int i = 0; i < num; i++) { + std::string file_name = testfile_path + std::to_string(i); + std::ifstream ifs(file_name, std::ios::binary); + if (!ifs) { + std::cout << "ERROR: open testfile failed.\n"; + return 1; + } + uint32_t size; + ifs.seekg(0, std::ios::end); + size = ifs.tellg(); + ifs.seekg(0, std::ios::beg); + + in_file.push_back(file_name); + in_size.push_back(size); + } + + // run CRC32C calculation + int run_status = crc32c_run(in_file, in_size, out_result); + + // check results + std::cout << "============================================================" << std::endl; + uint32_t golden = 0x2589b2e0; + uint32_t err = 0; + for (int i = 0; i < num; i++) { + if (out_result[i] != golden) { + printf("out_result[%d] = %08x\n", i, out_result[i]); + err++; + } + } + if (err) { + std::cout << "Test failed.\n"; + } else { + std::cout << "Test passed.\n"; + } + + return err; +} diff --git a/security/L3/tests/crc32c_sc/kernel/crc32c_krl.cpp b/security/L3/tests/crc32c_sc/kernel/crc32c_krl.cpp new file mode 100644 index 0000000000..7e11cde458 --- /dev/null +++ b/security/L3/tests/crc32c_sc/kernel/crc32c_krl.cpp @@ -0,0 +1,80 @@ +/* + * Copyright 2022 Xilinx, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "xf_security/crc32c_krl.hpp" + +void crc32c_acc::compute(ap_uint<512>* in_buff, ap_uint<32>* len_buff, ap_uint<32>* out_buff) { + hls_top(in_buff, len_buff, out_buff); +} + +void crc32c_acc::hls_top(ap_uint<512>* in_buff, ap_uint<32>* len_buff, ap_uint<32>* out_buff) { +#pragma HLS INTERFACE m_axi offset = direct latency = 32 num_read_outstanding = 2 max_read_burst_length = 128 bundle = \ + gmem0 port = in_buff +#pragma HLS INTERFACE m_axi offset = direct latency = 32 num_read_outstanding = 2 max_read_burst_length = 128 bundle = \ + gmem1 port = len_buff +#pragma HLS INTERFACE m_axi offset = direct latency = 64 num_write_outstanding = 2 max_write_burst_length = \ + 128 bundle = gmem2 port = out_buff + +#pragma HLS dataflow + + hls::stream > init_strm("init_strm"); +#pragma HLS STREAM variable = init_strm depth = 32 +#pragma HLS BIND_STORAGE variable = init_strm type = FIFO impl = LUTRAM + hls::stream > in_strm("in_strm"); +#pragma HLS STREAM variable = in_strm depth = 256 +#pragma HLS BIND_STORAGE variable = in_strm type = FIFO impl = BRAM + hls::stream > len_strm("len_strm"); +#pragma HLS STREAM variable = len_strm depth = 32 +#pragma HLS BIND_STORAGE variable = len_strm type = FIFO impl = LUTRAM + hls::stream end_len_strm("end_len_strm"); +#pragma HLS STREAM variable = end_len_strm depth = 32 +#pragma HLS BIND_STORAGE variable = end_len_strm type = FIFO impl = SRL + hls::stream > out_strm("out_strm"); +#pragma HLS STREAM variable = out_strm depth = 256 +#pragma HLS BIND_STORAGE variable = out_strm type = FIFO impl = BRAM + hls::stream end_out_strm("end_out_strm"); +#pragma HLS STREAM variable = end_out_strm depth = 256 +#pragma HLS BIND_STORAGE variable = end_out_strm type = FIFO impl = SRL + + scan(in_buff, len_buff, in_strm, init_strm, len_strm, end_len_strm); +#ifndef __SYNTHESIS__ + std::cout << "End scan...\n"; + std::cout << "in_strm.size() = " << in_strm.size() << std::endl; + std::cout << "init_strm.size() = " << init_strm.size() << std::endl; + std::cout << "len_strm.size() = " << len_strm.size() << std::endl; + std::cout << "end_len_strm.size() = " << end_len_strm.size() << std::endl; +#endif + xf::security::crc32c)>(init_strm, in_strm, len_strm, end_len_strm, out_strm, end_out_strm); +#ifndef __SYNTHESIS__ + std::cout << "End crc32c...\n"; + std::cout << "init_strm.size() = " << init_strm.size() << std::endl; + std::cout << "in_strm.size() = " << in_strm.size() << std::endl; + std::cout << "len_strm.size() = " << len_strm.size() << std::endl; + std::cout << "end_len_strm.size() = " << end_len_strm.size() << std::endl; + std::cout << "out_strm.size() = " << out_strm.size() << std::endl; + std::cout << "end_out_strm.size() = " << end_out_strm.size() << std::endl; +#endif + write(out_strm, end_out_strm, out_buff); +#ifndef __SYNTHESIS__ + std::cout << "End write...\n"; + std::cout << "init_strm.size() = " << init_strm.size() << std::endl; + std::cout << "in_strm.size() = " << in_strm.size() << std::endl; + std::cout << "len_strm.size() = " << len_strm.size() << std::endl; + std::cout << "end_len_strm.size() = " << end_len_strm.size() << std::endl; + std::cout << "out_strm.size() = " << out_strm.size() << std::endl; + std::cout << "end_out_strm.size() = " << end_out_strm.size() << std::endl; +#endif +} diff --git a/security/L3/tests/crc32c_sc/test.dat0 b/security/L3/tests/crc32c_sc/test.dat0 new file mode 100644 index 0000000000..913ad1c049 Binary files /dev/null and b/security/L3/tests/crc32c_sc/test.dat0 differ diff --git a/security/L3/tests/crc32c_sc/test.dat1 b/security/L3/tests/crc32c_sc/test.dat1 new file mode 100644 index 0000000000..913ad1c049 Binary files /dev/null and b/security/L3/tests/crc32c_sc/test.dat1 differ diff --git a/security/L3/tests/crc32c_sc/utils.mk b/security/L3/tests/crc32c_sc/utils.mk new file mode 100644 index 0000000000..17354308c6 --- /dev/null +++ b/security/L3/tests/crc32c_sc/utils.mk @@ -0,0 +1,238 @@ +# +# Copyright 2019-2021 Xilinx, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# vitis makefile-generator v2.0.4 +# +#+------------------------------------------------------------------------------- +# The following parameters are assigned with default values. These parameters can +# be overridden through the make command line +#+------------------------------------------------------------------------------- + +REPORT := no +PROFILE := no +DEBUG := no + +#'estimate' for estimate report generation +#'system' for system report generation +ifneq ($(REPORT), no) +VPP_LDFLAGS += --report estimate +VPP_LDFLAGS += --report system +endif + +#Generates profile summary report +ifeq ($(PROFILE), yes) +VPP_LDFLAGS += --profile_kernel data:all:all:all +endif + +#Generates debug summary report +ifeq ($(DEBUG), yes) +VPP_LDFLAGS += --dk protocol:all:all:all +endif + +#Check environment setup +ifndef XILINX_VITIS + XILINX_VITIS = /opt/xilinx/Vitis/$(TOOL_VERSION) + export XILINX_VITIS +endif +ifndef XILINX_XRT + XILINX_XRT = /opt/xilinx/xrt + export XILINX_XRT +endif + +check_device: + @set -eu; \ + inallowlist=False; \ + inblocklist=False; \ + for dev in $(PLATFORM_ALLOWLIST); \ + do if [[ $$(echo $(PLATFORM_NAME) | grep $$dev) != "" ]]; \ + then inallowlist=True; fi; \ + done ;\ + for dev in $(PLATFORM_BLOCKLIST); \ + do if [[ $$(echo $(PLATFORM_NAME) | grep $$dev) != "" ]]; \ + then inblocklist=True; fi; \ + done ;\ + if [[ $$inallowlist == False ]]; \ + then echo "[Warning]: The device $(PLATFORM_NAME) not in allowlist."; \ + fi; \ + if [[ $$inblocklist == True ]]; \ + then echo "[ERROR]: The device $(PLATFORM_NAME) in blocklist."; exit 1;\ + fi; + +#get HOST_ARCH by PLATFORM +HOST_ARCH_temp = $(shell platforminfo -p $(PLATFORM) | grep 'CPU Type' | sed 's/.*://' | sed '/ai_engine/d' | sed 's/^[[:space:]]*//') +$(warning HOST_ARCH_temp:$(HOST_ARCH_temp)) +ifeq ($(HOST_ARCH_temp), x86) +HOST_ARCH := x86 +else ifeq ($(HOST_ARCH_temp), cortex-a9) +HOST_ARCH := aarch32 +else ifeq ($(HOST_ARCH_temp), cortex-a*) +HOST_ARCH := aarch64 +endif + +#Checks for Device Family +ifeq ($(HOST_ARCH), aarch32) + DEV_FAM = 7Series +else ifeq ($(HOST_ARCH), aarch64) + DEV_FAM = Ultrascale +endif + +#Checks for Correct architecture +ifneq ($(HOST_ARCH), $(filter $(HOST_ARCH),aarch64 aarch32 x86)) +$(error HOST_ARCH variable not set, please set correctly and rerun) +endif + +check_version: +ifneq (, $(shell which git)) +ifneq (,$(wildcard $(XFLIB_DIR)/.git)) + @cd $(XFLIB_DIR) && git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit -n 1 && cd - +endif +endif + +#Checks for SYSROOT +check_sysroot: +ifneq ($(HOST_ARCH), x86) +ifndef SYSROOT + $(error SYSROOT ENV variable is not set, please set ENV variable correctly and rerun) +endif +endif + +#Checks for g++ +CXX := g++ +CXX_REQ := $(shell echo $(GCC_INTOOL) | cut -f 1 -d ".") +ifeq ($(HOST_ARCH), x86) +ifneq ($(shell expr $(shell echo "__GNUG__" | g++ -E -x c++ - | tail -1) \>= $(CXX_REQ)), 1) +ifndef XILINX_VIVADO +$(error [ERROR]: g++ version too old. Please use $(CXX_REQ) or above) +else +CXX := $(XILINX_VIVADO)/tps/lnx64/gcc-$(GCC_INTOOL)/bin/g++ +ifeq ($(LD_LIBRARY_PATH),) +export LD_LIBRARY_PATH := $(XILINX_VIVADO)/tps/lnx64/gcc-$(GCC_INTOOL)/lib64 +else +export LD_LIBRARY_PATH := $(XILINX_VIVADO)/tps/lnx64/gcc-$(GCC_INTOOL)/lib64:$(LD_LIBRARY_PATH) +endif +$(warning [WARNING]: g++ version too old. Using g++ provided by the tool: $(CXX)) +endif +endif +else ifeq ($(HOST_ARCH), aarch64) +CXX := $(XILINX_VITIS)/gnu/aarch64/lin/aarch64-linux/bin/aarch64-linux-gnu-g++ +else ifeq ($(HOST_ARCH), aarch32) +CXX := $(XILINX_VITIS)/gnu/aarch32/lin/gcc-arm-linux-gnueabi/bin/arm-linux-gnueabihf-g++ +endif + +#check binutils +BINUTILS := $(shell ld -v | cut -f 4 -d " " | cut -f 1 -d "-") +BINUTILS_REQ := $(BINUTILS_INTOOL) +ifneq ($(shell expr $(BINUTILS) \>= $(BINUTILS_REQ)), 1) +export PATH := $(XILINX_VIVADO)/tps/lnx64/binutils-$(BINUTILS_INTOOL)/bin:$(PATH) +endif + +#Setting VPP +VPP := v++ + +#Cheks for aiecompiler +AIECXX := aiecompiler +AIESIMULATOR := aiesimulator +X86SIMULATOR := x86simulator + +.PHONY: check_vivado +check_vivado: +ifeq (,$(wildcard $(XILINX_VIVADO)/bin/vivado)) + @echo "Cannot locate Vivado installation. Please set XILINX_VIVADO variable." && false +endif + +.PHONY: check_vpp +check_vpp: +ifeq (,$(wildcard $(XILINX_VITIS)/bin/v++)) + @echo "Cannot locate Vitis installation. Please set XILINX_VITIS variable." && false +endif + +.PHONY: check_xrt +check_xrt: +ifeq (,$(wildcard $(XILINX_XRT)/lib/libxilinxopencl.so)) + @echo "Cannot locate XRT installation. Please set XILINX_XRT variable." && false +endif + +export PATH := $(XILINX_VITIS)/bin:$(XILINX_XRT)/bin:$(PATH) +ifeq ($(HOST_ARCH), x86) +ifeq (,$(LD_LIBRARY_PATH)) +LD_LIBRARY_PATH := $(XILINX_XRT)/lib +else +LD_LIBRARY_PATH := $(XILINX_XRT)/lib:$(LD_LIBRARY_PATH) +endif +endif + +ifneq (,$(wildcard $(PLATFORM))) +# Use PLATFORM as a file path +XPLATFORM := $(PLATFORM) +else +# Use PLATFORM as a file name pattern +# 1. search paths specified by variable +ifneq (,$(PLATFORM_REPO_PATHS)) +# 1.1 as exact name +XPLATFORM := $(strip $(foreach p, $(subst :, ,$(PLATFORM_REPO_PATHS)), $(wildcard $(p)/$(PLATFORM)/$(PLATFORM).xpfm))) +# 1.2 as a pattern +ifeq (,$(XPLATFORM)) +XPLATFORMS := $(foreach p, $(subst :, ,$(PLATFORM_REPO_PATHS)), $(wildcard $(p)/*/*.xpfm)) +XPLATFORM := $(strip $(foreach p, $(XPLATFORMS), $(shell echo $(p) | awk '$$1 ~ /$(PLATFORM)/'))) +endif # 1.2 +endif # 1 +# 2. search Vitis installation +ifeq (,$(XPLATFORM)) +# 2.1 as exact name +XPLATFORM := $(strip $(wildcard $(XILINX_VITIS)/platforms/$(PLATFORM)/$(PLATFORM).xpfm)) +# 2.2 as a pattern +ifeq (,$(XPLATFORM)) +XPLATFORMS := $(wildcard $(XILINX_VITIS)/platforms/*/*.xpfm) +XPLATFORM := $(strip $(foreach p, $(XPLATFORMS), $(shell echo $(p) | awk '$$1 ~ /$(PLATFORM)/'))) +endif # 2.2 +endif # 2 +# 3. search default locations +ifeq (,$(XPLATFORM)) +# 3.1 as exact name +XPLATFORM := $(strip $(wildcard /opt/xilinx/platforms/$(PLATFORM)/$(PLATFORM).xpfm)) +# 3.2 as a pattern +ifeq (,$(XPLATFORM)) +XPLATFORMS := $(wildcard /opt/xilinx/platforms/*/*.xpfm) +XPLATFORM := $(strip $(foreach p, $(XPLATFORMS), $(shell echo $(p) | awk '$$1 ~ /$(PLATFORM)/'))) +endif # 3.2 +endif # 3 +endif + +define MSG_PLATFORM +No platform matched pattern '$(PLATFORM)'. +Available platforms are: $(XPLATFORMS) +To add more platform directories, set the PLATFORM_REPO_PATHS variable or point PLATFORM variable to the full path of platform .xpfm file. +endef +export MSG_PLATFORM + + +.PHONY: check_platform +check_platform: +ifeq (,$(XPLATFORM)) + @echo "$${MSG_PLATFORM}" && false +endif +#Check ends + +# device2xsa - create a filesystem friendly name from device name +# $(1) - full name of device +PLATFORM_NAME = $(strip $(patsubst %.xpfm, % , $(shell basename $(PLATFORM)))) + + +# Cleaning stuff +RM = rm -f +RMDIR = rm -rf + +MV = mv -f +CP = cp -rf +ECHO:= @echo diff --git a/security/docs/images/pipeline_processing.png b/security/docs/images/pipeline_processing.png new file mode 100644 index 0000000000..b7e76e61c0 Binary files /dev/null and b/security/docs/images/pipeline_processing.png differ diff --git a/security/docs/index.rst b/security/docs/index.rst index 252f817a9d..6713c8c486 100644 --- a/security/docs/index.rst +++ b/security/docs/index.rst @@ -32,6 +32,12 @@ Since all the primitive code is developed in HLS C++ with the permissive Apache advanced users can easily tailor, optimize or assemble property logic. Benchmarks of 4 different acceleration applications are also provided with the library for easy on-boarding and comparison. +.. toctree:: + :caption: Tutorial + :maxdepth: 1 + tutorial.rst + + Library Contents ================ diff --git a/security/docs/tutorial.rst b/security/docs/tutorial.rst new file mode 100644 index 0000000000..9d7313d4df --- /dev/null +++ b/security/docs/tutorial.rst @@ -0,0 +1,92 @@ +.. + Copyright 2019-2020 Xilinx, Inc. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +.. meta:: + :keywords: Vitis, Security, Vitis Security Library, Alveo + :description: Vitis Security Library is an open-sourced Vitis library written in C++ for accelerating security applications in a variety of use cases. + :xlnxdocumentclass: Document + :xlnxdocumenttype: Tutorials + +.. _brief: + +================================ +Vitis Security Library Tutorial +================================ + + +Crypto Algorithm Hardware Acceleration +======================================= + +Crypto algorithms plays an important roll in transfer, verification, storage and processing of data. +Crypto application includes encryption/decryption, checksum, hash, signature/verification, etc. +Modern crypto algorithms are complicated and keep evovling, especially in new area like block-chain application. +FPGA is suitable for a wide variety of crypto algortihm and able to provide competitive or even better performance than CPU. +It is also convenient to construct a processing pipeline while crypto processing is one of the pipeline stage, which will save bandwidth cost and improve performance. +Last but not the least, FPGA could have multiple compute unit working in parallel, which will also improve total performance. + +.. image:: /images/pipeline_processing.png + :alt: Execution Plan + :scale: 20% + :align: center + +How Vitis Security Library Works +================================== + +Vitis security library targets to help Vitis kernel developers to accelerate crypto algorithms. +It provides three layers of APIs, namely L1 / L2 / L3. +L1 APIs are the core for acceleration while L2 and L3 only contains a few specialized cases. + +L1 API +======= + +Target Audience and Major Features +------------------------------------ + +Target audience of L1 API are users who is familiar with HLS programming and want to tests / profile / modify operators or add new APIs. +With the HLS test project provided in L1 layer, user could get: + +(1) Function correctness tests, both in c-simulation and co-simulation +(2) Performance profiling from HLS synthesis report and co-simulaiton +(3) Resource and timing from Vivado synthesis. + + +Input / output interface +-------------------------- + +For easy connection with other HLS component, most of security library L1 API takes hls::stream interface. +For APIs which could take variable length of input, API will include either scalar parameter for input length or "end flag" stream working with data stream in a 1:1 fashion to tell if this is the last block of input data. +For details of interface definition and how padding will happen in stream interface, please take reference of documentation and corresponding test cases. + +Command to Run L1 cases +------------------------- + +.. code-block:: shell + + cd L1/tests/hls_case_folder + + make run CSIM=1 CSYNTH=0 COSIM=0 VIVADO_SYN=0 VIVADO_IMPL=0 \ + DEVICE=/path/to/xilinx_u280_xdma_201920_3.xpfm + +Test control variables are: + +* ``CSIM`` for high level simulation. +* ``CSYNTH`` for high level synthesis to RTL. +* ``COSIM`` for co-simulation between software test bench and generated RTL. +* ``VIVADO_SYN`` for synthesis by Vivado. +* ``VIVADO_IMPL`` for implementation by Vivado. + +For all these variables, setting to ``1`` indicates execution while ``0`` for skipping. +The default value of all these control variables are ``0``, so they can be omitted from command line +if the corresponding step is not wanted. diff --git a/security/library.json b/security/library.json index 725276dd6a..c84a5848ae 100644 --- a/security/library.json +++ b/security/library.json @@ -18,8 +18,6 @@ ], "libraries": [ - "ssl", - "crypto" ] } }