Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
6b41874
Peano lit enablement No1
thomthehound May 15, 2026
929c351
Merge branch 'main' into peano-lit-enablement-no1
thomthehound May 15, 2026
4ccf15e
formatting
thomthehound May 15, 2026
f2a47d1
centralize tool subs
thomthehound May 16, 2026
f7cb070
centralize tool subs2
thomthehound May 16, 2026
34f72bb
Do not let Peano force NPU2 simply by existing
thomthehound May 18, 2026
33775b3
Merge branch 'main' into peano-lit-enablement-no1
thomthehound May 18, 2026
ed512db
Merge branch 'main' into peano-lit-enablement-no1
thomthehound May 18, 2026
f812a3d
Merge branch 'main' into peano-lit-enablement-no1
thomthehound May 18, 2026
cd19a84
Merge branch 'main' into peano-lit-enablement-no1
thomthehound May 19, 2026
3134e85
Merge branch 'main' into peano-lit-enablement-no1
thomthehound May 20, 2026
c0f6262
Merge branch 'main' into peano-lit-enablement-no1
thomthehound May 20, 2026
edf4056
Merge branch 'main' into peano-lit-enablement-no1
thomthehound May 20, 2026
63cd86f
Merge branch 'main' into peano-lit-enablement-no1
thomthehound May 20, 2026
f2ad590
Merge branch 'main' into peano-lit-enablement-no1
thomthehound May 20, 2026
fe29d10
Merge branch 'main' into peano-lit-enablement-no1
thomthehound May 20, 2026
457e26b
Merge branch 'main' into peano-lit-enablement-no1
thomthehound May 21, 2026
4e98042
Merge branch 'main' into peano-lit-enablement-no1
thomthehound May 21, 2026
f5f300a
Merge branch 'main' into peano-lit-enablement-no1
thomthehound May 21, 2026
9525f66
Merge branch 'main' into peano-lit-enablement-no1
thomthehound May 21, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions mlir_exercises/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,6 @@ set(CMAKE_CXX_STANDARD_REQUIRED YES)
option(LLVM_INCLUDE_TOOLS "Generate build targets for the LLVM tools." ON)
option(LLVM_BUILD_TOOLS "Build the LLVM tools. If OFF, just generate build targets." ON)

if(Vitis_FOUND)
set(DEFAULT_ENABLE_CHESS_TESTS ON)
else()
set(DEFAULT_ENABLE_CHESS_TESTS OFF)
endif()
option(ENABLE_CHESS_TESTS "Enable backend tests using xchesscc" ${DEFAULT_ENABLE_CHESS_TESTS})

if(${CMAKE_HOST_SYSTEM_PROCESSOR} STREQUAL aarch64)
set(DEFAULT_ENABLE_BOARD_TESTS ON)
else()
Expand All @@ -72,12 +65,18 @@ set(LLVM_LIBRARY_OUTPUT_INTDIR ${CMAKE_BINARY_DIR}/lib)
set(MLIR_BINARY_DIR ${CMAKE_BINARY_DIR})

find_package(Vitis 2023.2 COMPONENTS ${AIE_VITIS_COMPONENTS})
if(Vitis_FOUND)
set(DEFAULT_ENABLE_CHESS_TESTS ON)
else()
set(DEFAULT_ENABLE_CHESS_TESTS OFF)
endif()
option(ENABLE_CHESS_TESTS "Enable backend tests using xchesscc" ${DEFAULT_ENABLE_CHESS_TESTS})
find_package(Python3 COMPONENTS Interpreter)

# Look for LibXAIE
if (DEFINED LibXAIE_${AIE_RUNTIME_TEST_TARGET}_DIR)
message("Tutorials using xaiengine from LibXAIE_${AIE_RUNTIME_TEST_TARGET}_DIR=${LibXAIE_${AIE_RUNTIME_TEST_TARGET}_DIR}")
set(LibXAIE_ROOT ${LibXAIE_${target}_DIR})
set(LibXAIE_ROOT ${LibXAIE_${AIE_RUNTIME_TEST_TARGET}_DIR})
find_package(LibXAIE)
else()
if(DEFINED VITIS_ROOT)
Expand Down Expand Up @@ -126,6 +125,7 @@ configure_lit_site_cfg(
set(TEST_DEPENDS
FileCheck count not
AIEPythonModules
aiecc
aie-opt
aie-translate
)
Expand Down
14 changes: 14 additions & 0 deletions mlir_exercises/lit.cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@

# Basic substitutions
config.substitutions.append(("%extraAieCcFlags%", config.extraAieCcFlags))
config.substitutions.append(
("%aie_runtime_lib%", os.path.join(config.aie_obj_root, "aie_runtime_lib"))
)
config.substitutions.append(
(
"%host_runtime_lib%",
Expand Down Expand Up @@ -89,6 +92,9 @@
LitConfigHelper.prepend_path(llvm_config, config.vitis_aietools_bin)
llvm_config.with_environment("VITIS", config.vitis_root)

# Add Vitis components as features
LitConfigHelper.add_vitis_components_features(config, config.vitis_components)

# Detect Peano backend
peano_config = LitConfigHelper.detect_peano(
peano_tools_dir, config.peano_install_dir, llvm_config
Expand All @@ -108,6 +114,11 @@
},
)

LitConfigHelper.setup_host_compiler_substitutions(config)
LitConfigHelper.setup_aiecc_substitution(config)
LitConfigHelper.setup_backend_flags_substitution(config)
LitConfigHelper.setup_host_link_substitution(config)

tool_dirs = [config.aie_tools_dir, peano_tools_dir, config.llvm_tools_dir]
tools = [
"aie-opt",
Expand All @@ -122,6 +133,9 @@

llvm_config.add_tool_substitutions(tools, tool_dirs)

if os.name == "nt":
LitConfigHelper.add_python_tool_substitutions(config, ["aiecc.py"])

if config.enable_board_tests:
lit_config.parallelism_groups["board"] = 1
config.parallelism_group = "board"
16 changes: 8 additions & 8 deletions programming_examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,6 @@ set(CMAKE_CXX_STANDARD_REQUIRED YES)
option(LLVM_INCLUDE_TOOLS "Generate build targets for the LLVM tools." ON)
option(LLVM_BUILD_TOOLS "Build the LLVM tools. If OFF, just generate build targets." ON)

if(Vitis_FOUND)
set(DEFAULT_ENABLE_CHESS_TESTS ON)
else()
set(DEFAULT_ENABLE_CHESS_TESTS OFF)
endif()
option(ENABLE_CHESS_TESTS "Enable backend tests using xchesscc" ${DEFAULT_ENABLE_CHESS_TESTS})

if(${CMAKE_HOST_SYSTEM_PROCESSOR} STREQUAL aarch64)
set(DEFAULT_ENABLE_BOARD_TESTS ON)
endif()
Expand All @@ -70,6 +63,12 @@ set(LLVM_LIBRARY_OUTPUT_INTDIR ${CMAKE_BINARY_DIR}/lib)
set(MLIR_BINARY_DIR ${CMAKE_BINARY_DIR})

find_package(Vitis 2023.2 COMPONENTS ${AIE_VITIS_COMPONENTS})
if(Vitis_FOUND)
set(DEFAULT_ENABLE_CHESS_TESTS ON)
else()
set(DEFAULT_ENABLE_CHESS_TESTS OFF)
endif()
option(ENABLE_CHESS_TESTS "Enable backend tests using xchesscc" ${DEFAULT_ENABLE_CHESS_TESTS})
find_package(Python3 COMPONENTS Interpreter)
find_package(XRT)
find_package(OpenCV)
Expand All @@ -78,7 +77,7 @@ find_package(hsa-runtime64)
# Look for LibXAIE
if (DEFINED LibXAIE_${AIE_RUNTIME_TEST_TARGET}_DIR)
message("Ref designs using xaiengine from LibXAIE_${AIE_RUNTIME_TEST_TARGET}_DIR=${LibXAIE_${AIE_RUNTIME_TEST_TARGET}_DIR}")
set(LibXAIE_ROOT ${LibXAIE_${target}_DIR})
set(LibXAIE_ROOT ${LibXAIE_${AIE_RUNTIME_TEST_TARGET}_DIR})
find_package(LibXAIE)
else()
if(DEFINED VITIS_ROOT)
Expand Down Expand Up @@ -127,6 +126,7 @@ configure_lit_site_cfg(
set(TEST_DEPENDS
FileCheck count not
AIEPythonModules
aiecc
aie-opt
aie-translate
)
Expand Down
43 changes: 31 additions & 12 deletions programming_examples/lit.cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@

# Basic substitutions
config.substitutions.append(("%extraAieCcFlags%", config.extraAieCcFlags))
config.substitutions.append(
("%aie_runtime_lib%", os.path.join(config.aie_obj_root, "aie_runtime_lib"))
)
config.substitutions.append(
(
"%host_runtime_lib%",
Expand All @@ -56,13 +59,10 @@
config.hsa_dir, config.aieHostTarget, config.enable_board_tests
)

# Detect XRT and Ryzen AI NPU devices
xrt_config = LitConfigHelper.detect_xrt(
config.xrt_lib_dir,
config.xrt_include_dir,
config.xrt_bin_dir,
config.aie_src_root,
config.vitis_components,
# Detect Peano before XRT feature gating for systems without Chess/AIETOOLS
early_peano_tools_dir = os.path.join(config.peano_install_dir, "bin")
early_peano_config = LitConfigHelper.detect_peano(
early_peano_tools_dir, config.peano_install_dir, llvm_config
)

# Detect OpenCV
Expand Down Expand Up @@ -108,18 +108,32 @@
LitConfigHelper.prepend_path(llvm_config, peano_tools_dir)
config.substitutions.append(("%LLVM_TOOLS_DIR", config.llvm_tools_dir))

tool_dirs = [config.aie_tools_dir, config.llvm_tools_dir]
tool_dirs = [config.aie_tools_dir]
if early_peano_config.found:
tool_dirs.append(peano_tools_dir)
tool_dirs.append(config.llvm_tools_dir)

# Detect Peano backend
peano_config = LitConfigHelper.detect_peano(
peano_tools_dir, config.peano_install_dir, llvm_config
)
# Reuse the earlier Peano probe after path setup.
peano_config = early_peano_config

# Detect Chess compiler
chess_config = LitConfigHelper.detect_chess(
config.vitis_root, config.enable_chess_tests, llvm_config
)

# Peano may gate Ryzen AI features only when it is the active fallback backend.
can_use_peano_feature_gate = early_peano_config.found and not chess_config.found

# Detect XRT and Ryzen AI NPU devices
xrt_config = LitConfigHelper.detect_xrt(
config.xrt_lib_dir,
config.xrt_include_dir,
config.xrt_bin_dir,
config.aie_src_root,
config.vitis_components,
can_use_peano_feature_gate=can_use_peano_feature_gate,
)

# Apply all hardware/tool configurations
LitConfigHelper.apply_config_to_lit(
config,
Expand All @@ -132,6 +146,11 @@
},
)

LitConfigHelper.setup_host_compiler_substitutions(config)
LitConfigHelper.setup_aiecc_substitution(config)
LitConfigHelper.setup_backend_flags_substitution(config)
LitConfigHelper.setup_host_link_substitution(config)

tools = [
"aie-opt",
"aie-translate",
Expand Down
18 changes: 9 additions & 9 deletions programming_guide/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,6 @@ set(CMAKE_CXX_STANDARD_REQUIRED YES)
option(LLVM_INCLUDE_TOOLS "Generate build targets for the LLVM tools." ON)
option(LLVM_BUILD_TOOLS "Build the LLVM tools. If OFF, just generate build targets." ON)

if(Vitis_FOUND)
set(DEFAULT_ENABLE_CHESS_TESTS ON)
else()
set(DEFAULT_ENABLE_CHESS_TESTS OFF)
endif()
option(ENABLE_CHESS_TESTS "Enable backend tests using xchesscc" ${DEFAULT_ENABLE_CHESS_TESTS})

if(${CMAKE_HOST_SYSTEM_PROCESSOR} STREQUAL aarch64)
set(DEFAULT_ENABLE_BOARD_TESTS ON)
endif()
Expand All @@ -70,6 +63,12 @@ set(LLVM_LIBRARY_OUTPUT_INTDIR ${CMAKE_BINARY_DIR}/lib)
set(MLIR_BINARY_DIR ${CMAKE_BINARY_DIR})

find_package(Vitis 2023.2 COMPONENTS ${AIE_VITIS_COMPONENTS})
if(Vitis_FOUND)
set(DEFAULT_ENABLE_CHESS_TESTS ON)
else()
set(DEFAULT_ENABLE_CHESS_TESTS OFF)
endif()
option(ENABLE_CHESS_TESTS "Enable backend tests using xchesscc" ${DEFAULT_ENABLE_CHESS_TESTS})
find_package(Python3 COMPONENTS Interpreter)
find_package(XRT)
find_package(OpenCV)
Expand All @@ -78,7 +77,7 @@ find_package(hsa-runtime64)
# Look for LibXAIE
if (DEFINED LibXAIE_${AIE_RUNTIME_TEST_TARGET}_DIR)
message("Ref designs using xaiengine from LibXAIE_${AIE_RUNTIME_TEST_TARGET}_DIR=${LibXAIE_${AIE_RUNTIME_TEST_TARGET}_DIR}")
set(LibXAIE_ROOT ${LibXAIE_${target}_DIR})
set(LibXAIE_ROOT ${LibXAIE_${AIE_RUNTIME_TEST_TARGET}_DIR})
find_package(LibXAIE)
else()
if(DEFINED VITIS_ROOT)
Expand Down Expand Up @@ -127,6 +126,7 @@ configure_lit_site_cfg(
set(TEST_DEPENDS
FileCheck count not
AIEPythonModules
aiecc
aie-opt
aie-translate
)
Expand All @@ -136,4 +136,4 @@ add_lit_testsuite(check-programming-guide "Running the programming guide code sa
DEPENDS ${TEST_DEPENDS}
ARGS "-sv --timeout 600"
)
set_target_properties(check-reference-designs PROPERTIES FOLDER "Programming Guide")
set_target_properties(check-programming-guide PROPERTIES FOLDER "Programming Guide")
56 changes: 44 additions & 12 deletions programming_guide/lit.cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,29 @@
llvm_config, config, config.aie_obj_root, config.vitis_aietools_dir
)

# Basic substitutions
config.substitutions.append(("%extraAieCcFlags%", config.extraAieCcFlags))
config.substitutions.append(
("%aie_runtime_lib%", os.path.join(config.aie_obj_root, "aie_runtime_lib"))
)
config.substitutions.append(
(
"%host_runtime_lib%",
os.path.join(config.aie_obj_root, "runtime_lib", config.aieHostTarget),
)
)
config.substitutions.append(("%aietools", config.vitis_aietools_dir))

# Not using run_on_board anymore, need more specific per-platform commands
config.substitutions.append(("%run_on_board", "echo"))

# Add Vitis components as features
LitConfigHelper.add_vitis_components_features(config, config.vitis_components)

# Detect XRT and Ryzen AI NPU devices
xrt_config = LitConfigHelper.detect_xrt(
config.xrt_lib_dir,
config.xrt_include_dir,
config.xrt_bin_dir,
config.aie_src_root,
config.vitis_components,
# Detect Peano before XRT feature gating for systems without Chess/AIETOOLS
early_peano_tools_dir = os.path.join(config.peano_install_dir, "bin")
early_peano_config = LitConfigHelper.detect_peano(
early_peano_tools_dir, config.peano_install_dir, llvm_config
)

llvm_config.use_default_substitutions()
Expand All @@ -71,18 +84,32 @@
LitConfigHelper.prepend_path(llvm_config, peano_tools_dir)
config.substitutions.append(("%LLVM_TOOLS_DIR", config.llvm_tools_dir))

tool_dirs = [config.aie_tools_dir, config.llvm_tools_dir]
tool_dirs = [config.aie_tools_dir]
if early_peano_config.found:
tool_dirs.append(peano_tools_dir)
tool_dirs.append(config.llvm_tools_dir)

# Detect Peano backend
peano_config = LitConfigHelper.detect_peano(
peano_tools_dir, config.peano_install_dir, llvm_config
)
# Reuse the earlier Peano probe after path setup.
peano_config = early_peano_config

# Detect Chess compiler
chess_config = LitConfigHelper.detect_chess(
config.vitis_root, config.enable_chess_tests, llvm_config
)

# Peano may gate Ryzen AI features only when it is the active fallback backend.
can_use_peano_feature_gate = early_peano_config.found and not chess_config.found

# Detect XRT and Ryzen AI NPU devices
xrt_config = LitConfigHelper.detect_xrt(
config.xrt_lib_dir,
config.xrt_include_dir,
config.xrt_bin_dir,
config.aie_src_root,
config.vitis_components,
can_use_peano_feature_gate=can_use_peano_feature_gate,
)

# Apply all hardware/tool configurations
LitConfigHelper.apply_config_to_lit(
config,
Expand All @@ -93,6 +120,11 @@
},
)

LitConfigHelper.setup_host_compiler_substitutions(config)
LitConfigHelper.setup_aiecc_substitution(config)
LitConfigHelper.setup_backend_flags_substitution(config)
LitConfigHelper.setup_host_link_substitution(config)

tools = [
"aie-opt",
"aie-translate",
Expand Down
Loading
Loading