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
Refer to this page for XRT documentation. Refer to this page for details of host application programming.
Switch |
Description |
|---|---|
-O | Optimize. |
Optimizing compilation takes more time and 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 longer compilation time. |
-D__linux__ |
|
-DXAIE_DEBUG |
Enable debug interface capabilities where certain core status, event status, or stack trace can be dumped. |
-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 for matrix multiplication. |
$(HOST_APP_SRC)/output_data.h |
Golden data to which the DUT output is compared. |
The following is a description of the output objects that results from executing the cross-compiler command with the preceding inputs and options.
Output Objects |
Description |
|---|---|
$(BUILD_TARGET_DIR)/gemm_dsp_xrt.elf |
The executable that runs on an A72 processor. |