### Quick Start Environment Setup Source: https://xilinx.github.io/mlir-aie/dev/getting-started Initialize the IRON library and compiler toolchain using provided utility scripts. ```bash source utils/env_install.sh # one time / first time source utils/env_setup.sh # every time you open a new shell ``` -------------------------------- ### Run the SAXPY NPU example Source: https://xilinx.github.io/mlir-aie/dev/buildHostWinNative Executes the SAXPY example to verify the toolchain, XRT installation, and NPU connectivity. ```bash cd programming_examples\getting_started\01_SAXPY python saxpy.py ``` -------------------------------- ### Setup Python environment Source: https://xilinx.github.io/mlir-aie/dev/BuildingVersal Installs required Python packages into a virtual environment named 'sandbox'. ```bash source utils/setup_python_packages.sh ``` -------------------------------- ### Initialize IRON with custom XRT path Source: https://xilinx.github.io/mlir-aie/dev/buildHostWinNative Run the setup script specifying a non-default XRT SDK installation directory. ```cmd python utils\iron_setup.py --xrt-root D:\tools\XRT call .\iron_env.cmd ``` -------------------------------- ### Setup mlir-aie Environment Source: https://xilinx.github.io/mlir-aie/dev/buildHostWin Installs the mlir-aie wheel and configures the shell environment. ```bash source utils/env_install.sh # NOTE: this installs the mlir_aie wheel into the ironenv venv. source utils/env_setup.sh # This configures your shell against the newly installed environment. ``` -------------------------------- ### Install development environment Source: https://xilinx.github.io/mlir-aie/dev/CONTRIBUTING Run this command to install the toolchain and register pre-commit and pre-push hooks. ```bash source utils/env_install.sh --dev ``` -------------------------------- ### Install System Dependencies Source: https://xilinx.github.io/mlir-aie/dev/getting-started Install essential build tools and compilers required for the environment. ```bash sudo apt install \ build-essential clang clang-14 lld lld-14 cmake ninja-build python3-venv python3-pip uuid-dev ``` -------------------------------- ### Run IRON Design Examples Source: https://xilinx.github.io/mlir-aie/dev/Building Execute Python-based examples using the JIT compiler. ```bash cd programming_examples// python3 .py ``` -------------------------------- ### Install ML and Jupyter Dependencies Source: https://xilinx.github.io/mlir-aie/dev/getting-started Optional packages for machine learning examples and Jupyter notebook support. ```bash # Install Torch for ML examples python3 -m pip install -r python/requirements_ml.txt ``` ```bash # Install Jupyter Notebook python3 -m pip install -r python/requirements_notebook.txt # This creates an ipykernel (for use in notebooks) using the ironenv venv python3 -m ipykernel install --user --name ironenv # Only for Release v1.0 and non wheel-based installs: # The install generally captures in the $PYTHONPATH by the `env_setup.sh` script. # However, jupyter notebooks don't always get access to the PYTHONPATH (e.g., if they are run with # vscode) so we save the ${MLIR_AIE_INSTALL_DIR}/python in a .pth file in the site packages dir of the # ironenv venv; this allows the iron ipykernel to find the install dir regardless of if PYTHONPATH is # available or not. MLIR_AIE_INSTALL="$(pip show mlir_aie | grep ^Location: | awk '{print $2}')/mlir_aie" venv_site_packages="$(python3 -c 'import sysconfig; print(sysconfig.get_paths()["purelib"])')" echo "${MLIR_AIE_INSTALL}/python" > "$venv_site_packages/mlir-aie.pth" ``` -------------------------------- ### Boilerplate usage examples Source: https://xilinx.github.io/mlir-aie/dev/api/hostruntime Examples of how the helper replaces manual device resolution calls. ```python from_name(args.dev, n_cols=None) # "use all cols" from_name(args.dev, n_cols=1) # "single col" ``` -------------------------------- ### Install XRT Dependencies Source: https://xilinx.github.io/mlir-aie/dev/buildHostLin Runs the dependency installation script for XRT. ```bash cd $XDNA_SRC_DIR sudo ./tools/amdxdna_deps.sh ``` -------------------------------- ### Install MLIR-AIE Prerequisites Source: https://xilinx.github.io/mlir-aie/dev/Building Install required system packages for building MLIR-AIE. ```bash # Python versions 3.11, 3.12, 3.13, and 3.14 are currently supported by our wheels sudo apt install \ build-essential clang clang-14 lld lld-14 cmake ninja-build python3-venv python3-pip uuid-dev ``` -------------------------------- ### Start BD Chain Source: https://xilinx.github.io/mlir-aie/dev/AIEXDialect Materialize an abstract BD chain as a task and start it immediately. ```MLIR %t = aiex.dma_start_bd_chain @chain(%a) : (memref<32xi32>) on (%tile, MM2S, 0) ``` ```MLIR %t = aiex.dma_start_bd_chain_for @chain(%a) : (memref<32xi32>) for @alloc ``` -------------------------------- ### Install Toolchain and OpenCV Source: https://xilinx.github.io/mlir-aie/dev/buildHostLin Adds the Ubuntu toolchain PPA and installs GCC 13 and OpenCV. ```bash sudo add-apt-repository ppa:ubuntu-toolchain-r/test sudo apt update sudo apt install gcc-13 g++-13 -y sudo apt install libopencv-dev python3-opencv ``` -------------------------------- ### Install Compiled Kernel Source: https://xilinx.github.io/mlir-aie/dev/buildHostLin Install the newly built kernel packages and reboot the system. ```bash cd $LINUX_BUILD_DIR sudo apt reinstall ../linux-headers-6.10.0_6.10.0-1_amd64.deb ../linux-image-6.10.0_6.10.0-1_amd64.deb ../linux-libc-dev_6.10.0-1_amd64.deb sudo shutdown --reboot 0 ``` -------------------------------- ### Install CMake 3.28 Source: https://xilinx.github.io/mlir-aie/dev/buildHostLin Downloads and installs CMake 3.28.3 binaries to a local directory. ```bash mkdir cmake export NEW_CMAKE_DIR=$(realpath cmake) cd cmake wget https://github.com/Kitware/CMake/releases/download/v3.28.3/cmake-3.28.3-linux-x86_64.sh chmod +x ./cmake-3.28.3-linux-x86_64.sh ./cmake-3.28.3-linux-x86_64.sh ``` -------------------------------- ### Build and Install XRT Base Source: https://xilinx.github.io/mlir-aie/dev/buildHostLinNonUbuntu Compiles the XRT base driver from source and installs it to /opt/xilinx/xrt. ```bash cd xdna-driver/xrt/build ./build.sh -npu -opt -disable-werror -j "$(nproc)" # -disable-werror: GCC >= 14 + -Werror otherwise fails sudo make -C Release install # -> /opt/xilinx/xrt ``` -------------------------------- ### Build Toolchain from Source Source: https://xilinx.github.io/mlir-aie/dev/getting-started Install development dependencies and build the compiler toolchain. ```bash source utils/env_install.sh --dev # one time / first time source utils/env_setup.sh # every time you open a new shell ``` ```bash ./utils/build-mlir-aie-from-wheels.sh ``` -------------------------------- ### Install MLIR-AIE from latest wheel Source: https://xilinx.github.io/mlir-aie/dev/getting-started Installs the latest development wheel for the MLIR-AIE library. ```bash python3 -m pip install mlir_aie -f https://github.com/Xilinx/mlir-aie/releases/expanded_assets/latest-wheels-4 ``` -------------------------------- ### Example of aie.trace configuration Source: https://xilinx.github.io/mlir-aie/dev/AIEDialect Example showing how to define a trace configuration for a specific tile. ```MLIR %tile02 = aie.tile(0, 2) aie.trace @trace_tile02(%tile02) { aie.trace.mode "Event-Time" aie.trace.packet id=1 type=core aie.trace.event<"INSTR_EVENT_0"> aie.trace.event<"INSTR_VECTOR"> aie.trace.start broadcast=15 aie.trace.stop broadcast=14 } ``` -------------------------------- ### Vitis Environment Setup Script Header Source: https://xilinx.github.io/mlir-aie/dev/Building The beginning of the environment setup script for Vitis AIETools. ```bash #!/bin/bash ################################################################################# ``` -------------------------------- ### Install development tools via winget Source: https://xilinx.github.io/mlir-aie/dev/buildHostWinNative Use the Windows package manager to install Visual Studio, Python 3.13, CMake, and Git. ```batch REM Choose one: the full IDE or the matching Build Tools package winget install -e --id Microsoft.VisualStudio.Community REM winget install -e --id Microsoft.VisualStudio.BuildTools REM Python 3.13 (CPython) winget install -e --id Python.Python.3.13 REM CMake winget install -e --id Kitware.CMake REM Git (optional unless not selected in the Visual Studio installer) winget install -e --id Git.Git ``` -------------------------------- ### Install Linux Compilation Prerequisites Source: https://xilinx.github.io/mlir-aie/dev/buildHostLin Install essential packages required to compile the Linux kernel. ```bash sudo apt install \ build-essential debhelper flex bison libssl-dev libelf-dev libpython3.10-dev libsystemd-dev libtiff-dev libudev-dev ``` -------------------------------- ### Install Peano compiler dependencies Source: https://xilinx.github.io/mlir-aie/dev/getting-started Installs the Peano compiler and dependencies using the requirements file. ```bash # Install Peano from the llvm-aie wheel, pinned to the tested nightly in # utils/peano-requirements.txt (the same pin CI uses; bumped by the update-peano # workflow). To grab the latest nightly instead, install `llvm-aie` directly # with `-f https://github.com/Xilinx/llvm-aie/releases/expanded_assets/nightly`. python3 -m pip install -r utils/peano-requirements.txt ``` -------------------------------- ### Build and Install SHIM Plugin Source: https://xilinx.github.io/mlir-aie/dev/buildHostLinNonUbuntu Compiles the userspace SHIM plugin and installs it into the existing XRT directory. ```bash source /opt/xilinx/xrt/setup.sh cd xdna-driver/build ./build.sh -release -nokmod -j "$(nproc)" # -nokmod: do NOT touch the in-tree kernel module # The TGZ contains an opt/xilinx/xrt/... prefix; extract at / to install into /opt/xilinx/xrt: sudo tar xzf Release/xrt_plugin.*-amdxdna.tar.gz -C / ``` -------------------------------- ### Build LLVM Source: https://xilinx.github.io/mlir-aie/dev/BuildingVersal Compiles and installs LLVM into the local directory. ```bash ./utils/build-llvm-local.sh ``` -------------------------------- ### Install OpenCV Dependencies Source: https://xilinx.github.io/mlir-aie/dev/getting-started Optional installation of OpenCV libraries for vision programming examples. ```bash sudo apt install libopencv-dev python3-opencv ``` -------------------------------- ### Start a certification job Source: https://xilinx.github.io/mlir-aie/dev/AIEXDialect Initializes a job identified by a unique integer ID. ```mlir cert.job(42) { ... } ``` -------------------------------- ### Configure environment with setup.sh (Option A) Source: https://xilinx.github.io/mlir-aie/dev/buildHostLin Use this script for a quick setup of the environment variables and virtual environment activation. ```bash export LM_LICENSE_FILE=/opt/Xilinx.lic source /opt/xilinx/xrt/setup.sh export PATH="${NEW_CMAKE_DIR}/bin":"${PATH}" cd ${MLIR_AIE_BUILD_DIR} source ${MLIR_AIE_BUILD_DIR}/ironenv/bin/activate source ${MLIR_AIE_BUILD_DIR}/utils/env_setup.sh ${MLIR_AIE_BUILD_DIR}/my_install/mlir_aie ``` -------------------------------- ### Setup Environment Source: https://xilinx.github.io/mlir-aie/dev/getting-started Initializes the development environment using the provided shell script. ```bash source utils/env_setup.sh ``` -------------------------------- ### Initialize IRON environment Source: https://xilinx.github.io/mlir-aie/dev/buildHostWinNative Clone the repository and run the setup script to create the local environment and activate it. ```cmd REM Choose a working directory for the checkout. This example uses C:\dev mkdir C:\dev cd C:\dev git clone --recurse-submodules https://github.com/Xilinx/mlir-aie.git cd mlir-aie python utils\iron_setup.py call .\iron_env.cmd ``` -------------------------------- ### Configure environment with setup.sh (Option B) Source: https://xilinx.github.io/mlir-aie/dev/buildHostLin Use this script when the toolchain has been compiled from source. ```bash cd ${MLIR_AIE_BUILD_DIR} source ${MLIR_AIE_BUILD_DIR}/sandbox/bin/activate source /opt/xilinx/xrt/setup.sh source ${MLIR_AIE_BUILD_DIR}/utils/env_setup.sh ${MLIR_AIE_BUILD_DIR}/install ``` -------------------------------- ### ParameterScratchpad Usage Example Source: https://xilinx.github.io/mlir-aie/dev/doxygen/html/parameter__scratchpad_8h_source.html Demonstrates the basic workflow of initializing the scratchpad, writing parameters, and synchronizing. ```cpp auto params = test_utils::ParameterScratchpad(run, "params.txt"); params.write("foo", 42u); params.write("bar", std::bfloat16_t(3.14f)); params.sync(); ``` -------------------------------- ### Install Libidn11 Source: https://xilinx.github.io/mlir-aie/dev/buildHostLin Installs the libidn11-dev package. ```bash sudo apt install \ libidn11-dev ``` -------------------------------- ### setup_and_run_aie() Source: https://xilinx.github.io/mlir-aie/dev/doxygen/html/xrt__test__wrapper_8h.html Initializes XRT, loads kernels, and executes the AIE test sequence. ```APIDOC ## setup_and_run_aie(Verify verify_results, std::tuple< InBuf< TIns >... > inputs, OutBuf< TOut > output, struct args myargs, bool enable_ctrl_pkts, int num_trailing_params) ### Description Sets up the XRT environment, loads the specified kernel and instructions, and runs the AIE test with the provided input and output buffers. ### Parameters - **verify_results** (Verify) - Function or object used to verify test results. - **inputs** (std::tuple< InBuf< TIns >... >) - A tuple of input buffers. - **output** (OutBuf< TOut >) - The output buffer for the test. - **myargs** (struct args) - The configuration arguments parsed from the command line. - **enable_ctrl_pkts** (bool) - Optional flag to enable control packets (default: false). - **num_trailing_params** (int) - Optional number of trailing parameters (default: 0). ### Returns - **int** - Returns 0 on success, or an error code. ``` -------------------------------- ### Initialize Build Environment Source: https://xilinx.github.io/mlir-aie/dev/Platform Set up the necessary environment variables for Vitis and Petalinux before building. ```bash source /settings64.sh source /settings.sh ``` -------------------------------- ### Verify CMake Installation Source: https://xilinx.github.io/mlir-aie/dev/buildHostLin Checks the installed version of CMake. ```bash cmake --version ``` -------------------------------- ### Prepare Kernel Build Directory Source: https://xilinx.github.io/mlir-aie/dev/buildHostLin Create a build directory and initialize it with the current system configuration. ```bash mkdir linux-build export LINUX_BUILD_DIR=$(realpath linux-build) cp /boot/config-`uname -r` $LINUX_BUILD_DIR/.config ``` -------------------------------- ### Install XDNA Driver Source: https://xilinx.github.io/mlir-aie/dev/buildHostLin Installs the XDNA driver plugin package. ```bash cd $XDNA_SRC_DIR/build/Release sudo apt reinstall ./xrt_plugin.2.18.0_ubuntu22.04-x86_64-amdxdna.deb ``` -------------------------------- ### Install XRT Packages Source: https://xilinx.github.io/mlir-aie/dev/buildHostLin Installs the built XRT Debian packages. ```bash cd $XDNA_SRC_DIR/xrt/build/Release sudo apt reinstall ./xrt_202420.2.18.0_22.04-amd64-xrt.deb ./xrt_202420.2.18.0_22.04-amd64-xbflash.deb ``` -------------------------------- ### Setup Python Virtual Environment Source: https://xilinx.github.io/mlir-aie/dev/Building Create and activate a virtual environment for Python dependencies. ```bash python3 -m venv ironenv source ironenv/bin/activate python3 -m pip install --upgrade pip ``` -------------------------------- ### Install Python Dependencies Source: https://xilinx.github.io/mlir-aie/dev/Building Install base and development Python requirements. ```bash # Install basic Python requirements python3 -m pip install -r python/requirements.txt ``` ```bash # Install Python requirements for development and testing python3 -m pip install -r python/requirements_dev.txt # Install the pre-commit and pre-push hooks defined in .pre-commit-config.yaml # (pre-push runs clang-format/black/ruff/clang-tidy to catch formatting and # lint issues before CI) pre-commit install ``` -------------------------------- ### Read Scratchpad Parameter Example Source: https://xilinx.github.io/mlir-aie/dev/AIEXDialect Example usage of reading a runtime parameter. ```mlir %val = aiex.read_scratchpad_parameter @foo : i32 ``` -------------------------------- ### Configure Environment Variables for Quick Setup Source: https://xilinx.github.io/mlir-aie/dev/buildHostWin Use this script when utilizing precompiled MLIR-AIE binaries to initialize the required environment. ```bash # NOTE: if you did NOT exit the terminal you can skip this step. cd source /ironenv/bin/activate source yourVitisSetupScript (example shown above) source /utils/env_setup.sh ``` -------------------------------- ### Build Platform and Sysroot Source: https://xilinx.github.io/mlir-aie/dev/Platform Execute the build process for the VCK190 bare platform. ```bash cd platforms/vck190_bare_prod make all ``` -------------------------------- ### Initialize XRT Environment Source: https://xilinx.github.io/mlir-aie/dev/programming_guide/section-3 Sets up the XRT device and kernel objects using the provided XCLBIN and kernel name. ```cpp xrt::device device; xrt::kernel kernel; test_utils::init_xrt_load_kernel(device, kernel, verbosity, vm["xclbin"].as(), vm["kernel"].as()); ``` -------------------------------- ### Create NPU Kernel with Trace Configuration Source: https://xilinx.github.io/mlir-aie/dev/programming_guide/section-4/section-4b Recommended approach for creating NPU kernels and trace configurations using command-line arguments. ```Python import aie.utils.test as test_utils ... npu_opts = test_utils.create_npu_kernel(opts) res = DefaultNPURuntime.run_test(npu_opts.npu_kernel, ...) ``` -------------------------------- ### Install local wheels Source: https://xilinx.github.io/mlir-aie/dev/buildHostWinNative Installs the built wheels into the IRON environment and refreshes the shell. ```batch python utils\mlir_aie_wheels\scripts\build_local.py --cp313 python utils\mlir_aie_wheels\wheelhouse python utils\iron_setup.py --wheelhouse utils\mlir_aie_wheels\wheelhouse call .\iron_env.cmd ``` -------------------------------- ### Provisioning the HRX Release Source: https://xilinx.github.io/mlir-aie/dev/programming_guide/hrx_runtime Use the helper script to fetch and source the environment for the pinned HRX release. ```bash source "$(utils/fetch-hrx-release.sh)" # or, in one step: eval "$(utils/fetch-hrx-release.sh --print-env)" ``` -------------------------------- ### setup_and_run_aie (Template 2/3) Source: https://xilinx.github.io/mlir-aie/dev/doxygen/html/hrx__test__wrapper_8h.html Executes an AIE test using specific buffer initialization and verification function pointers. ```APIDOC ## int setup_and_run_aie(int _IN1_VOLUME_, int _OUT_VOLUME_, struct args _myargs_, bool _enable_ctrl_pkts_ = false) ### Description Configures and runs an AIE test using provided buffer volumes, arguments, and optional control packet enablement. ### Parameters - **_IN1_VOLUME_** (int) - Required - Volume for input buffer 1. - **_OUT_VOLUME_** (int) - Required - Volume for output buffer. - **_myargs_** (struct args) - Required - Configuration arguments including kernel, xclbin, and iteration settings. - **_enable_ctrl_pkts_** (bool) - Optional - Flag to enable control packets (default: false). ``` -------------------------------- ### setup_and_run_aie() Source: https://xilinx.github.io/mlir-aie/dev/doxygen/html/globals_func_s.html Initializes and executes the AIE (AI Engine) test environment. ```APIDOC ## setup_and_run_aie() ### Description Initializes the AIE environment and executes the test sequence. This function is defined in both hrx_test_wrapper.h and xrt_test_wrapper.h. ### Signature void setup_and_run_aie() ``` -------------------------------- ### Install specific version of MLIR-AIE Source: https://xilinx.github.io/mlir-aie/dev/getting-started Installs a specific version of the MLIR-AIE library from release wheels. ```bash # Install IRON library and mlir-aie from a specific release, # e.g., in the following command could be replaced with v1.1.3 python3 -m pip install mlir_aie -f https://github.com/Xilinx/mlir-aie/releases/expanded_assets/ git checkout ``` -------------------------------- ### Initialize Vitis Environment Source: https://xilinx.github.io/mlir-aie/dev/buildHostWin Script header for setting up the Vitis environment. ```bash #!/bin/bash ################################################################################# ``` -------------------------------- ### setup_and_run_aie (Template 3/3) Source: https://xilinx.github.io/mlir-aie/dev/doxygen/html/hrx__test__wrapper_8h.html Executes an AIE test using tuple-based input buffers and a verification functor. ```APIDOC ## int setup_and_run_aie(Verify _verify_results_, std::tuple< InBuf< TIns >... > _inputs_, OutBuf< TOut > _output_, struct args _myargs_, bool _enable_ctrl_pkts_ = false) ### Description Configures and runs an AIE test using a verification functor, a tuple of input buffers, and an output buffer. ### Parameters - **_verify_results_** (Verify) - Required - Functor used to verify test results. - **_inputs_** (std::tuple< InBuf< TIns >... >) - Required - Tuple containing input buffers. - **_output_** (OutBuf< TOut >) - Required - Output buffer configuration. - **_myargs_** (struct args) - Required - Configuration arguments including kernel, xclbin, and iteration settings. - **_enable_ctrl_pkts_** (bool) - Optional - Flag to enable control packets (default: false). ``` -------------------------------- ### Read instructions by file extension Source: https://xilinx.github.io/mlir-aie/dev/api/hostruntime Dispatches instruction loading based on the file extension. Currently supports .bin files via read_insts_binary. ```python @classmethod def read_insts(cls, insts_path: Path): """Read instructions from the given file. If the file extension is .bin, uses binary read. If the file extension is .txt, uses sequence (text) read. Args: insts_path (Path): Path to the instruction file. Returns: np.ndarray: Array of instructions. Raises: HostRuntimeError: If the file extension is not supported. """ ext = insts_path.suffix.lower() if ext == ".bin": return cls.read_insts_binary(insts_path) else: raise HostRuntimeError( "Unsupported file extension for instruction file: expected .bin" ) ``` -------------------------------- ### NpuDmaWaitOp Usage Example Source: https://xilinx.github.io/mlir-aie/dev/AIEXDialect Example showing the use of aiex.npu.dma_wait to synchronize with an ObjectFIFO DMA operation. ```mlir ... aie.objectfifo @out0(%tile_0_1, {%tile_0_0}, 4 : i32) : !aie.objectfifo> ... aiex.npu.dma_memcpy_nd(0, 0, %arg2[1, 1, 0, 0][1, 1, 32, 32][1, 1, 64, 1]) {id = 0 : i64, issue_token = true, metadata = @out0} : memref<32x64xi32> ... aiex.npu.dma_wait { symbol = @out0 } ``` -------------------------------- ### aiex.multicast Syntax and Example Source: https://xilinx.github.io/mlir-aie/dev/AIEXDialect Syntax and usage example for defining a multicast flow with multiple destinations. ```mlir operation ::= `aiex.multicast` `(` $tile `,` $bundle `:` $channel `)` regions attr-dict ``` ```mlir %70 = AIE.tile(7, 0) %73 = AIE.tile(7, 3) %74 = AIE.tile(7, 4) %63 = AIE.tile(6, 3) %64 = AIE.tile(6, 4) aiex.multicast(%70, "DMA" : 0){ aiex.multi_dest<%73, "DMA" : 0> aiex.multi_dest<%74, "DMA" : 0> aiex.multi_dest<%63, "DMA" : 0> aiex.multi_dest<%64, "DMA" : 0> } ``` -------------------------------- ### AIE Vector Shuffle Result Examples Source: https://xilinx.github.io/mlir-aie/dev/AIEVecDialect Example results for t32_4x8_lo and t32_4x8_hi shuffle modes. ```text result = [0, 8, 16, 24, 1, 9, 17, 25, ..., 3, 11, 19, 27] ``` ```text result = [4, 12, 20, 28, 5, 13, 21, 29, ..., 7, 15, 24, 31] ``` -------------------------------- ### Initialize NPU kernel and runtime Source: https://xilinx.github.io/mlir-aie/dev/programming_guide/section-3 Initializes the NPUKernel object with XCLBIN and instruction files, then loads it into the runtime. ```python npu_kernel = NPUKernel(opts.xclbin, opts.instr) kernel_handle = aie.utils.DefaultNPURuntime.load(npu_kernel) ``` -------------------------------- ### AIE Vector Shuffle Example Data Source: https://xilinx.github.io/mlir-aie/dev/AIEVecDialect Example input vectors for demonstrating shuffle operations. ```text lhs = [0, 1, 2, 3, ..., 15] rhs = [17, 18, 19, 20, ..., 31] ``` -------------------------------- ### Analysis Manager Setup Source: https://xilinx.github.io/mlir-aie/dev/doxygen/html/FoldMulAddChainToConvOp_8cpp_source.html Static member initialization for the analysis manager within the analysis structure. ```cpp 390 AnalysisManager *LongestConvMACChainAnalysis::am = nullptr; ``` -------------------------------- ### Install Development Dependencies Source: https://xilinx.github.io/mlir-aie/dev/getting-started Installs required Python packages and configures pre-commit hooks for linting and formatting. ```bash python3 -m pip install -r python/requirements_dev.txt # Install the pre-commit and pre-push hooks defined in .pre-commit-config.yaml # (pre-push runs clang-format/black/ruff to catch formatting and lint issues before CI) pre-commit install ``` -------------------------------- ### Install XRT Build Dependencies Source: https://xilinx.github.io/mlir-aie/dev/buildHostWin Installs the necessary packages to build XRT from source within WSL. ```bash sudo apt-get install \ cmake \ cppcheck \ curl \ dkms \ file \ g++ \ gcc \ gdb \ git \ gnuplot \ graphviz \ libboost-dev \ libboost-filesystem-dev \ libboost-program-options-dev \ libcurl4-openssl-dev \ libdrm-dev \ libdw-dev \ libelf-dev \ libffi-dev \ libgtest-dev \ libjpeg-dev \ libjson-glib-dev \ libncurses5-dev \ libopencv-core-dev \ libpng-dev \ libprotoc-dev \ libssl-dev \ libsystemd-dev \ libtiff5-dev \ libudev-dev \ libyaml-dev \ linux-libc-dev \ lm-sensors \ lsb-release \ make \ ocl-icd-dev \ ocl-icd-libopencl1 \ ocl-icd-opencl-dev \ opencl-headers \ pciutils \ perl \ pybind11-dev \ rapidjson-dev \ pkg-config \ protobuf-compiler \ pybind11-dev \ python3 \ libpython3-dev \ python3-breathe \ python3-pip \ python3-sphinx \ python3-sphinx-rtd-theme \ sphinx-common \ strace \ systemtap-sdt-dev \ unzip \ uuid-dev ``` -------------------------------- ### Configure environment and activate virtual environment Source: https://xilinx.github.io/mlir-aie/dev/BuildingVersal Sets up necessary paths for tools and activates the Python virtual environment. ```bash source utils/env_setup.sh /install /install ``` ```bash source ironenv/bin/activate ```