Skip to content

Enable dynamic lock acquisition for ObjectFIFO acquire/release in cores #14746

Enable dynamic lock acquisition for ObjectFIFO acquire/release in cores

Enable dynamic lock acquisition for ObjectFIFO acquire/release in cores #14746

# Copyright (C) 2021 Xilinx, Inc.
# Copyright (C) 2022-2026 Advanced Micro Devices, Inc.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
name: Build and Test across Python versions
permissions:
contents: read
on:
push:
branches:
- main
pull_request:
types: [assigned, opened, synchronize, reopened]
workflow_dispatch:
merge_group:
schedule:
# Runs at midnight (00:00) every day
- cron: '0 0 * * *'
env:
# Run apt package manager in the CI in non-interactive mode.
# Otherwise, on Ubuntu 20.04 the installation of tzdata asking question
DEBIAN_FRONTEND: noninteractive
concurrency:
# A PR number if a pull request and otherwise the commit hash. This cancels
# queued and in-progress runs for the same PR (presubmit) or commit
# (postsubmit).
group: ci-build-test-pythons-cpp-linux-${{ github.event.number || github.sha }}-${{ github.event_name }}
cancel-in-progress: true
jobs:
build-repo:
name: Build and Test
runs-on: ubuntu-${{ matrix.ubuntu_version }}
strategy:
# Run all the test even if there are some which fail
fail-fast: false
# Run the tests on the Cartesian product of the following
matrix:
build_type: [ Assert, Release ]
ubuntu_version: [ 22.04, 24.04 ]
python_version: [ "3.11", "3.12", "3.13", "3.14" ]
steps:
# Clone the repo and its submodules. Do shallow clone to save clone
# time.
- name: Get the project repository
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
fetch-depth: 2
submodules: "true"
- uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6
with:
python-version: ${{ matrix.python_version }}
- name: Install Python packages
run: |
pip install --upgrade pip
python utils/mlir_aie_wheels/vendor_eudsl.py \
--requirements python/requirements.txt \
--install-non-eudsl
pip install -r python/requirements_notebook.txt
python -m pip install --require-hashes -r python/requirements_dev.lock
- name: Install packages
run: |
sudo apt-get install -y ninja-build clang lld
- name: Get MLIR
id: mlir-wheels
run: |
VERSION=$(utils/clone-llvm.sh --get-wheel-version)
for attempt in 1 2 3; do
rm -f mlir-*.whl
if pip -q download mlir==$VERSION \
-f https://github.com/Xilinx/mlir-aie/releases/expanded_assets/mlir-distro; then
break
fi
if [ "$attempt" -eq 3 ]; then
echo "Failed to download MLIR wheel after ${attempt} attempts" >&2
exit 1
fi
sleep $((attempt * 5))
done
unzip -q mlir-*.whl
- name: Ccache for C++ compilation
uses: hendrikmuhs/ccache-action@d62db5f07c26379fc4b4e0916f098a92573c3b03 # v1.2.23
with:
# Since there are now several compilation jobs running in parallel,
# use a different key per job to avoid a ccache writing race condition
key: ${{ matrix.build_type }}-${{ runner.os }}-${{ matrix.ubuntu_version }}
max-size: 1G
# Build the repo test target in debug mode to build and test.
- name: Build and test (Assert)
if: matrix.build_type == 'Assert'
run: |
mkdir -p build_assert/install
cd build_assert
cmake .. \
-GNinja \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DCMAKE_EXE_LINKER_FLAGS_INIT="-fuse-ld=lld" -DCMAKE_MODULE_LINKER_FLAGS_INIT="-fuse-ld=lld" -DCMAKE_SHARED_LINKER_FLAGS_INIT="-fuse-ld=lld" \
-DCMAKE_PLATFORM_NO_VERSIONED_SONAME=ON \
-DCMAKE_VISIBILITY_INLINES_HIDDEN=ON \
-DCMAKE_C_VISIBILITY_PRESET=hidden \
-DCMAKE_CXX_VISIBILITY_PRESET=hidden \
-DCMAKE_INSTALL_PREFIX=$PWD/install \
-DAIE_COMPILER=NONE \
-DAIE_LINKER=NONE \
-DAIE_ENABLE_PYTHON_PASSES=OFF \
-DHOST_COMPILER=NONE \
-DLLVM_ENABLE_ASSERTIONS=ON \
-DLLVM_ENABLE_RTTI=ON \
-DCMAKE_MODULE_PATH=$PWD/../cmake/modulesXilinx \
-DMLIR_DIR=$PWD/../mlir/lib/cmake/mlir \
-DLLVM_DIR=$PWD/../mlir/lib/cmake/llvm \
-DLLVM_USE_LINKER=lld \
-DLLVM_EXTERNAL_LIT=$(which lit) \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON
ninja
# filter out slow tests (e.g. create-flows/vecmul_4x4_slow_test.mlir) due to timeout.
export LIT_OPTS="-sv --timeout 600 --filter-out slow_test"
ninja check-aie
ninja check-reference-designs
ninja check-programming-guide
# Build the repo test target in release mode to build and test.
- name: Build and test (Release)
if: matrix.build_type == 'Release'
run: |
mkdir -p build_release/install
cd build_release
cmake .. \
-G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DCMAKE_EXE_LINKER_FLAGS_INIT="-fuse-ld=lld" -DCMAKE_MODULE_LINKER_FLAGS_INIT="-fuse-ld=lld" -DCMAKE_SHARED_LINKER_FLAGS_INIT="-fuse-ld=lld" \
-DCMAKE_PLATFORM_NO_VERSIONED_SONAME=ON \
-DCMAKE_VISIBILITY_INLINES_HIDDEN=ON \
-DCMAKE_C_VISIBILITY_PRESET=hidden \
-DCMAKE_CXX_VISIBILITY_PRESET=hidden \
-DCMAKE_INSTALL_PREFIX=$PWD/install \
-DAIE_COMPILER=NONE \
-DAIE_LINKER=NONE \
-DAIE_ENABLE_PYTHON_PASSES=OFF \
-DHOST_COMPILER=NONE \
-DLLVM_ENABLE_ASSERTIONS=OFF \
-DLLVM_ENABLE_RTTI=ON \
-DCMAKE_MODULE_PATH=$PWD/../cmake/modulesXilinx \
-DMLIR_DIR=$PWD/../mlir/lib/cmake/mlir \
-DLLVM_DIR=$PWD/../mlir/lib/cmake/llvm \
-DLLVM_USE_LINKER=lld \
-DLLVM_EXTERNAL_LIT=$(which lit)
ninja
ninja check-aie
ninja check-reference-designs
ninja check-programming-guide