You can compile the host application by following the typical cross-compilation flow for the Cortex A72 processor. To build the application, run the following command
make application
or
cd $(BUILD_TARGET_DIR); \
aarch64-xilinx-linux-g++ -mcpu=cortex-a72.cortex-a53 -march=armv8-a+crc -fstack-protector-strong \
-D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=$(SDKTARGETSYSROOT) -O -c \
-std=c++14 -D__linux__ \
-DM_LARGE=$(GEMM_SIZE) -DN_LARGE=$(GEMM_SIZE) -DL_LARGE=$(GEMM_SIZE) \
-I$(SDKTARGETSYSROOT)/usr/include/xrt -I$(SDKTARGETSYSROOT)/usr/include -I$(SDKTARGETSYSROOT)/usr/lib -I$(HOST_APP_SRC)/$(MAT_DIMS) \
$(HOST_APP_SRC)/main.cpp -o $(BUILD_TARGET_DIR)/gemm_top_app.o \
-L$(SDKTARGETSYSROOT)/lib -lxrt_coreutil
aarch64-xilinx-linux-g++ -mcpu=cortex-a72.cortex-a53 -march=armv8-a+crc -fstack-protector-strong \
-D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=$(SDKTARGETSYSROOT) \
$(BUILD_TARGET_DIR)/gemm_top_app.o -L$(SDKTARGETSYSROOT)/usr/lib -lxrt_coreutil \
-o $(BUILD_TARGET_DIR)/gemm_dsp_xrt.elf
See this page for XRT documentation. See this page for details of host application programming.
Switch |
Description |
|---|---|
-O | Optimize. |
Optimizing compilation takes somewhat more time, and a lot more memory for a large function. With -O, the compiler tries to reduce code size and execution time, without performing any optimizations that can take a great deal of compilation time. |
-D__linux__ |
|
-DXAIE_DEBUG |
Enable debug interface capabilities where certain core status, event status, or stack trace can be dumped out. |
-D<Pre-processor Macro String>=<value> |
Pass Pre-processor Macro definitions to the cross-compiler. |
-I <dir> |
Add the directory |
-o <file> |
Place output in file |
–sysroot=<dir> |
Use |
-l<library> |
Search the library named |
-L <dir> |
Add directory |
The following is a description of the input sources compiled by the cross-compiler compiler command.
Inputs Sources |
Description |
|---|---|
$(HOST_APP_SRC)/main.cpp |
Source application file for the |
$(HOST_APP_SRC)/matrix_A_data.h, matrix_B_data.h |
Matrix A and B Data to be used for matrix multiplication. |
$(HOST_APP_SRC)/output_data.h |
Golden data to which DUT output will be compared. |
The following is a description of the output objects that results from executing the cross-compiler command with the above inputs and options.
Output Objects |
Description |
|---|---|
$(BUILD_TARGET_DIR)/gemm_dsp_xrt.elf |
The executable that will run on an A72 processor. |