Skip to content

Commit

Permalink
AIE/Feature/05-Integration: Updated Makefile with platform option and…
Browse files Browse the repository at this point in the history
… added description in readme.md (#288)

* Changed Make command from "compile" to "aie"
* Added --platform option to the compile command
* Update README.md for environment setup

Co-authored-by: viswanad <[email protected]>
  • Loading branch information
2 people authored and GitHub Enterprise committed May 25, 2022
1 parent 24ffd81 commit 5a84475
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 17 deletions.
Submodule Vitis_Libraries deleted from de67b5
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ SW_EMU_CMD := ./launch_sw_emu.sh
HW_EMU_CMD := ./launch_hw_emu.sh -aie-sim-options ../aiesimulator_output/aiesim_options.txt -add-env AIE_COMPILER_WORKDIR=../Work

AIE_INCLUDE_FLAGS := -include="$(XILINX_VITIS)/aietools/include" -include="./aie" -include="./data" -include="./aie/kernels" -include="./"
AIE_FLAGS := $(AIE_INCLUDE_FLAGS) -workdir=./Work
AIE_FLAGS := $(AIE_INCLUDE_FLAGS) --platform $(BASE_PLATFORM) -workdir=./Work

ifeq ($(TARGET),sw_emu)
AIE_FLAGS += --target=x86sim
Expand Down Expand Up @@ -63,7 +63,7 @@ endif
LDCLFLAGS := $(GCC_LIB)

.ONESHELL:
.PHONY: clean all kernels compile x86sim xsa host package run_emu
.PHONY: clean all kernels aie sim xsa host package run_emu

###
# Guarding Checks. Do not modify.
Expand Down Expand Up @@ -93,7 +93,7 @@ guard-SDKTARGETSYSROOT:

###

all: kernels compile sim xsa host package
all: kernels aie sim xsa host package
sd_card: all

######################################################
Expand All @@ -106,7 +106,7 @@ kernels: guard-PLATFORM_REPO_PATHS $(KERNEL_XO)
%.xo: pl_kernels/%.cpp
$(VPP) $(VPP_XO_FLAGS) -k $(basename $(notdir $<)) $< -o $@

compile: $(GRAPH_O)
aie: $(GRAPH_O)

#AIE or X86 Simulation
sim: $(GRAPH_O)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ SW_EMU_CMD := ./launch_sw_emu.sh
HW_EMU_CMD := ./launch_hw_emu.sh -aie-sim-options ../aiesimulator_output/aiesim_options.txt -add-env AIE_COMPILER_WORKDIR=../Work

AIE_INCLUDE_FLAGS := -include="$(XILINX_VITIS)/aietools/include" -include="./aie" -include="./data" -include="./aie/kernels" -include="./"
AIE_FLAGS := $(AIE_INCLUDE_FLAGS) -workdir=./Work
AIE_FLAGS := $(AIE_INCLUDE_FLAGS) --platform $(BASE_PLATFORM) -workdir=./Work

ifeq ($(TARGET),sw_emu)
AIE_FLAGS += --target=x86sim
Expand Down Expand Up @@ -63,7 +63,7 @@ endif
LDCLFLAGS := $(GCC_LIB)

.ONESHELL:
.PHONY: clean all kernels compile x86sim xsa host package run_emu
.PHONY: clean all kernels aie sim xsa host package run_emu

###
# Guarding Checks. Do not modify.
Expand Down Expand Up @@ -93,7 +93,7 @@ guard-SDKTARGETSYSROOT:

###

all: kernels compile sim xsa host package
all: kernels aie sim xsa host package
sd_card: all

######################################################
Expand All @@ -106,7 +106,7 @@ kernels: guard-PLATFORM_REPO_PATHS $(KERNEL_XO)
%.xo: pl_kernels/%.cpp
$(VPP) $(VPP_XO_FLAGS) -k $(basename $(notdir $<)) $< -o $@

compile: $(GRAPH_O)
aie: $(GRAPH_O)

#AIE or X86 Simulation
sim: $(GRAPH_O)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ VPP := v++
AIECC := aiecompiler

AIE_INCLUDE_FLAGS := -include="$(XILINX_VITIS)/aietools/include" -include="./aie" -include="./data" -include="./aie/kernels" -include="./"
AIE_FLAGS := --target=x86sim $(AIE_INCLUDE_FLAGS) -workdir=./Work
AIE_FLAGS := --target=x86sim $(AIE_INCLUDE_FLAGS) --platform $(BASE_PLATFORM) -workdir=./Work

VPP_XO_FLAGS := -c --platform $(BASE_PLATFORM) -t $(TARGET) --save-temps -g
VPP_LINK_FLAGS := -l --platform $(BASE_PLATFORM) $(KERNEL_XO) $(GRAPH_O) -t $(TARGET) --save-temps -g --config $(CONFIG_FILE) -o $(PFM).xsa
Expand Down Expand Up @@ -81,7 +81,7 @@ guard-SDKTARGETSYSROOT:

###

all: kernels compile x86sim xsa host package
all: kernels aie x86sim xsa host package
sd_card: all

######################################################
Expand All @@ -94,7 +94,7 @@ kernels: guard-PLATFORM_REPO_PATHS $(KERNEL_XO)
%.xo: pl_kernels/%.cpp
$(VPP) $(VPP_XO_FLAGS) -k $(basename $(notdir $<)) $< -o $@

compile: $(GRAPH_O)
aie: $(GRAPH_O)

x86sim: $(GRAPH_O)
x86simulator --pkg-dir=./Work
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</tr>
</table>

# Versal Integration for Hardware Emulation and Hardware
# AI Engine Versal Integration

***Version: Vitis 2022.1***

Expand Down Expand Up @@ -85,12 +85,12 @@ An ADF Graph can be connected to an extensible Vitis&trade; platform. That is, t
To compile the graph for x86 simulator, the target to be used is x86sim, use:

```bash
make compile
make aie
```
Or

```bash
aiecompiler --target=x86sim -include="$XILINX_VITIS/aietools/include" -include="./aie" -include="./data" -include="./aie/kernels" -include="./" -workdir=./Work aie/graph.cpp
aiecompiler --target=x86sim --platform $PLATFORM_REPO_PATHS/xilinx_vck190_base_202210_1/xilinx_vck190_base_202210_1.xpfm -include="$XILINX_VITIS/aietools/include" -include="./aie" -include="./data" -include="./aie/kernels" -include="./" -workdir=./Work aie/graph.cpp
```

| Flag | Description |
Expand All @@ -104,6 +104,10 @@ The generated output from `aiecompiler` is the `Work` directory, and the `libadf
#### Vitis Analyzer Compile Summary
Vitis&trade; Analyzer is used to view the AI Engine compilation results. Below is the `graph.aiecompile_summary` file generated by the `aiecompiler`, which is located in the `Work` directory.

To open the summary file, use the below command

`vitis_analyzer ./Work/graph.aiecompile_summary`

The **Summary** view displays compilation runtime, version of the compiler used, the platform targeted, kernels created, and the exact command-line used for the compilation.

![Vitis Analyzer Summary](./images/vitis_analyzer_x86.PNG)
Expand Down Expand Up @@ -448,18 +452,22 @@ cp Makefile.org Makefile
To compile the graph type to be used in either HW or HW_EMU, use:

```bash
make compile TARGET=hw
make aie TARGET=hw
```
Or
```bash
aiecompiler --target=hw -include="$XILINX_VITIS/aietools/include" -include="./aie" -include="./data" -include="./aie/kernels" -include="./" --xlopt=0 -workdir=./Work aie/graph.cpp
aiecompiler --target=hw --platform $PLATFORM_REPO_PATHS/xilinx_vck190_base_202210_1/xilinx_vck190_base_202210_1.xpfm -include="$XILINX_VITIS/aietools/include" -include="./aie" -include="./data" -include="./aie/kernels" -include="./" --xlopt=0 -workdir=./Work aie/graph.cpp
```

The generated output from `aiecompiler` is the `Work` directory, and the `libadf.a` file. This file contains the compiled AI Engine configuration, graph, and Kernel `.elf` files.

#### Vitis Analyzer Compile Summary
Vitis&trade; Analyzer is used to view the AI Engine compilation results. It highlights the state of compilation, display the graph solution in both the **Graph** and **Array** views, provides guidance around the kernel code, and allow you to open various reports produced by `aiecompiler`. Below is the `graph.aiecompile_summary` file generated by the `aiecompiler`, which is located in the `Work` directory.

To open the summary file, use the below command

`vitis_analyzer ./Work/graph.aiecompile_summary`

The **Summary View** displays compilation runtime, version of the compiler used, the platform targeted, kernels created, and the exact command-line used for the compilation.

![Vitis Analyzer Compile Summary](./images/vitis_analyzer_compile_summary.png)
Expand Down

0 comments on commit 5a84475

Please sign in to comment.