make graph: Creating the AI Engine ADF Graph for Vitis Compiler Flow - make graph: Creating the AI Engine ADF Graph for Vitis Compiler Flow - 2025.2 English - XD100

Vitis Tutorials: AI Engine Development (XD100)

Document ID
XD100
Release Date
2026-03-27
Version
2025.2 English

You can connect an ADF graph to an extensible Vitis platform. Connect the graph I/Os either to platform ports or to ports on Vitis kernels. Use Vitis compiler connectivity directives for the connections.

  • The AI Engine ADF C++ graph of the design contains AI Engine kernels and PL kernels

  • The C++ graph defines all interconnects between kernels

  • All interconnections to external I/O are fully specified in the C++ simulation test bench (graph.cpp) that instantiates the C++ ADF graph object

To compile the graph using the Makefile flow type (default TARGET=hw_emu, GEMM_INSTS=1, GEMM_SIZE=32, ITER_CNT=1 and EN_TRACE=0):

make graph

The following AI Engine compiler command and the options used, compiles the AI Engine design graph:

...
AIE_FLAGS := -include=$(AIE_SRC_REPO)
AIE_FLAGS += -include=$(DSPLIB_ROOT)/L1/include/aie
AIE_FLAGS += -include=$(DSPLIB_ROOT)/L1/src/aie
AIE_FLAGS += -include=$(DSPLIB_ROOT)/L1/tests/aie/inc
AIE_FLAGS += -include=$(DSPLIB_ROOT)/L1/tests/aie/src
AIE_FLAGS += -include=$(DSPLIB_ROOT)/L2/include/aie
AIE_FLAGS += -include=$(DSPLIB_ROOT)/L2/tests/aie/common/inc
AIE_FLAGS += --verbose
AIE_FLAGS += --Xpreproc="-DITER_CNT=$(ITER_CNT)"
AIE_FLAGS += --Xpreproc="-DGRAPH_ITER_CNT=$(GRAPH_ITER_CNT)"
AIE_FLAGS += --Xpreproc="-DGEMM_SIZE=$(GEMM_SIZE)"
AIE_FLAGS += --Xpreproc="-DGEMM_INSTS=$(GEMM_INSTS)"
AIE_FLAGS += --platform=$(PLATFORM)
#AIE_FLAGS += --target=$(TARGET)

AIE_FLAGS += --log-level=5
#AIE_FLAGS += --test-iterations=2
AIE_FLAGS += --pl-freq=$(PL_FREQ)
#AIE_FLAGS += --dataflow

#AIE_FLAGS += --constraints=$(AIE_SRC_REPO)/constraints.aiecst

AIE_FLAGS += --Xmapper=BufferOptLevel9
AIE_FLAGS += --Xrouter=DMAFIFOsInFreeBankOnly


AIE_FLAGS += --workdir=$(WORK_DIR)

AIE_SIM_FLAGS := --pkg-dir $(WORK_DIR)/
AIE_SIM_FLAGS += -i=$(AIE_SIM_IO_DIR)

...
graph: $(LIBADF_A)

$(LIBADF_A):  $(AIE_SRC_REPO)/graph.*
	mkdir -p $(BUILD_TARGET_DIR); \
	cd $(BUILD_TARGET_DIR); \
	aiecompiler $(AIE_FLAGS) $(GRAPH_SRC_CPP) 2>&1 | tee -a aiecompiler.log

Refer to this page for full AI Engine programming environment documentation.

The following table provides a summary of the switches used.

Switch

Description

–include=<string>

Specify compile-time include directory (zero or more).

–verbose|-v

Verbose output of the AI Engine compiler emits compiler messages at various stages of compilation. These debug and tracing logs provide useful messages on the compilation process.

–Xpreproc=“-D<Pre-processor Macro String>”

Specify compile time macro.

–Xchess=“<Chess Make Options>”

Specify compile time chess make options; “main:bridge.llibs=softfloat m” enables floating point operations.

–heapsize=<int>

Heap size in bytes.

–log-level=<int>

Log level for verbose logging (default=1).

–workdir=<string>

By default, the compiler writes all outputs to a sub-directory of the current directory, called Work. Use this option to specify a different output directory.

The following is a description of the output objects that results from executing the AI Engine compiler (aiecompiler) command.

Inputs Sources

Description

$(AIE_SRC_REPO)/graph.cpp

Defines the GeMM graph objects

Output Objects

Description

$(BUILD_TARGET_DIR)/libadf.a

Compiled AI Engine design graph

$(BUILD_TARGET_DIR)/Work/

Directory that contains all outputs of the AI Engine compiler