You can compile the host application by following the typical cross-compilation flow for the Cortex A72. To build the application, run the following command (default TARGET=hw_emu, GEMM_INSTS=1, GEMM_SIZE=32, ITER_CNT=1 and EN_TRACE=0):
make application
or,
application: graph $(BUILD_TARGET_DIR)/$(APP_ELF)
REG_GCC_FLAGS := $(GCC_FLAGS)
REG_GCC_FLAGS += -DITER_CNT=$(ITER_CNT)
REG_GCC_FLAGS += -DGRAPH_ITER_CNT=$(GRAPH_ITER_CNT)
$(BUILD_TARGET_DIR)/$(APP_ELF): $(HOST_APP_SRC)/* $(LIBADF_A)
@rm -rf $(BUILD_TARGET_DIR)/app_control.o $(BUILD_TARGET_DIR)/gemm_aie_app.o $(BUILD_TARGET_DIR)/$(APP_ELF)
$(CXX) $(REG_GCC_FLAGS) $(GCC_INC_FLAGS) $(AIE_CONTROL_CPP) -o $(BUILD_TARGET_DIR)/app_control.o
$(CXX) $(REG_GCC_FLAGS) $(GCC_INC_FLAGS) $(APP_SRC_CPP) -o $(BUILD_TARGET_DIR)/gemm_aie_app.o $(GCC_INC_LIB) $(GCC_LIB)
$(CXX) $(BUILD_TARGET_DIR)/app_control.o $(BUILD_TARGET_DIR)/gemm_aie_app.o $(GCC_INC_LIB) $(GCC_LIB) -o $(BUILD_TARGET_DIR)/$(APP_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 a lot more memory for a large function. With -O, the compiler tries to reduce code size and execution time, without performing any of the 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. |
-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 AI Engine compiler command.
Inputs Sources |
Description |
|---|---|
$(HOST_APP_SRC_REPO)/gemm_aie_app.cpp |
Source application file for the |
$(BUILD_TARGET_DIR)/Work/ps/c_rts/aie_control_xrt.cpp |
This is the AI Engine control code generated implementing the graph APIs for the GeMM graph. |
The following is a description of the output objects that results from executing the AI Engine compiler command with the above inputs and options.
Output Objects |
Description |
|---|---|
$(BUILD_TARGET_DIR)/gemm_aie_xrt.elf |
The executable that runs on an A72 processor. |