From 6a1d3fa5a2b0b0929274c0a2105ce2edbe2bb54f Mon Sep 17 00:00:00 2001 From: Larry Ruckman Date: Wed, 20 May 2026 15:54:48 -0700 Subject: [PATCH 1/7] feat(vitis/aie): Vitis Unified AIE archetype + helpers + Sphinx docs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds an end-to-end Vitis Unified AIE build archetype mirroring the existing `system_vitis_unified_hls.mk` conventions, so downstream firmware repos can drop locally-vendored AIE makefiles. * `system_vitis_unified_aie.mk` — proj/build/x86sim/package/program/ gui/interactive/test/clean targets driven by the Vitis 2025.1+ Unified Python API. Self-contained: `make package` writes the dynamic PDI to `$(PROJ_DIR)/ip/$(PROJECT)_aie_dynamic.pdi`. - Caller contract: exactly one of AIE_PLATFORM (xpfm) or AIE_PART (Versal device ID); AIE_SOURCES (whitespace-separated file/dir paths, directories imported flat and non-recursive); AIE_TOP_LEVEL_FILE basename; AIE_XSA_INPUT (package only) and AIE_DTBO/AIE_BOARD_IP (program only) at recipe time. - aie_config.cfg location hardcoded at `$(PROJ_DIR)/aie_config.cfg` matching the unified HLS hls_config.cfg convention. - TOP_DIR defaults to `$(PWD)/../..` for the standard firmware///Makefile layout. * vitis/aie/ helpers: - create_proj.py — Vitis Python API workspace + AIE component creation, idempotent. - build.py — hw target by default, --x86sim for the simulator. - package.sh — `v++ --package` primary, bootgen fallback when USE_BOOTGEN_FALLBACK=1. - program.sh — generic Versal/PetaLinux deploy (scp PDI+DTBO, reboot, verify fpga_manager state). Refuses *_static.pdi as a runtime overlay. Project-specific helpers override via AIE_PROGRAM_SCRIPT honoring the -p/-d/-i flag contract. * Sphinx docs: - docs/how-to/vitis_aie.rst — walkthrough, prerequisites, project layout, steps, deploy-step customisation, troubleshooting. - docs/reference/makefile_reference.rst — Vitis AIE targets table and per-variable reference for every AIE_* knob. * system_vitis_unified_hls.mk: add one-line comment clarifying that VIVADO_VERSION feeds BUILD_STRING in system_shared.mk; same shape as the comment in the new AIE Makefile fragment. Hardware-validated against Simple-VEK280-Example AIE-loopback: byte-identical *_aie_dynamic.pdi, end-to-end make build / package / program cycle with /sys/class/fpga_manager/fpga0/state == operating post-deploy. --- docs/how-to/index.rst | 1 + docs/how-to/vitis_aie.rst | 384 ++++++++++++++++++++++++++ docs/reference/makefile_reference.rst | 215 +++++++++++++- system_vitis_unified_aie.mk | 226 +++++++++++++++ system_vitis_unified_hls.mk | 1 + vitis/aie/build.py | 39 +++ vitis/aie/create_proj.py | 117 ++++++++ vitis/aie/package.sh | 93 +++++++ vitis/aie/program.sh | 207 ++++++++++++++ 9 files changed, 1279 insertions(+), 4 deletions(-) create mode 100644 docs/how-to/vitis_aie.rst create mode 100644 system_vitis_unified_aie.mk create mode 100644 vitis/aie/build.py create mode 100644 vitis/aie/create_proj.py create mode 100644 vitis/aie/package.sh create mode 100644 vitis/aie/program.sh diff --git a/docs/how-to/index.rst b/docs/how-to/index.rst index 8833eb6..dd315b8 100644 --- a/docs/how-to/index.rst +++ b/docs/how-to/index.rst @@ -11,6 +11,7 @@ setting up a project for the first time, see vivado_build vitis_hls + vitis_aie ghdl_simulation cadence_genus synopsys_dc diff --git a/docs/how-to/vitis_aie.rst b/docs/how-to/vitis_aie.rst new file mode 100644 index 0000000..6d8348b --- /dev/null +++ b/docs/how-to/vitis_aie.rst @@ -0,0 +1,384 @@ +How to Build a Vitis AI Engine (AIE) Graph +============================================ + +**Goal:** Compile an AI Engine graph from C++ sources, package the resulting +``libadf.a`` against a Vivado-built ``.xsa`` into a dynamic PDI, and (optionally) +deploy the PDI + matching device-tree overlay to a Versal/PetaLinux board. + +.. note:: + + This backend (``system_vitis_unified_aie.mk``) requires the **Vitis 2025.1 or + newer** unified toolchain. It is driven by the Vitis Python API + (``vitis -s