Skip to content

Commit

Permalink
Enable lit testing in vck5000-dynamic-dma-config branch (#1124)
Browse files Browse the repository at this point in the history
  • Loading branch information
fifield authored and eddierichter-amd committed Mar 20, 2024
1 parent a4acefb commit 5983c89
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 11 deletions.
1 change: 1 addition & 0 deletions reference_designs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ find_package(Vitis 2023.2 COMPONENTS AIE AIE2)
find_package(Python3 COMPONENTS Interpreter)
find_package(XRT)
find_package(OpenCV)
find_package(hsa-runtime64)

# Look for LibXAIE
if (DEFINED LibXAIE_${AIE_RUNTIME_TEST_TARGET}_DIR)
Expand Down
3 changes: 3 additions & 0 deletions reference_designs/dynamic_dma_config_add_one/aie.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
//
//===----------------------------------------------------------------------===//

// RUN: aiecc.py --link_against_hsa %S/aie.mlir -I%HSA_DIR%/include -L%HSA_DIR%/lib -lhsa-runtime64 -I%host_runtime_lib%/test_lib/include -L%host_runtime_lib%/test_lib/lib -ltest_lib %S/test.cpp -o %T/test.elf
// RUN: %run_on_board %T/test.elf

module {
%t70 = aie.tile(6, 0)
%t71 = aie.tile(6, 1)
Expand Down
10 changes: 0 additions & 10 deletions reference_designs/dynamic_dma_config_add_one/run.lit

This file was deleted.

13 changes: 12 additions & 1 deletion reference_designs/lit.cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,20 @@
# for python
llvm_config.with_environment("PYTHONPATH", os.path.join(config.aie_obj_root, "python"))

if config.hsa_found:
if not "hsa" in config.aieHostTarget:
print("ROCm found, but disabled because host target '{config.aieHostTarget}'")
# Getting the path to the ROCm directory. hsa-runtime64 points to the cmake
# directory so need to go up three directories
rocm_root = os.path.join(config.hsa_dir, "..", "..", "..")
print("Found ROCm:", rocm_root)
config.substitutions.append(('%HSA_DIR%', "{}".format(rocm_root)))
else:
print("ROCm not found")

if config.enable_board_tests:
config.substitutions.append(
("%run_on_board", "echo %T >> /home/xilinx/testlog | sync | sudo")
("%run_on_board", "sudo flock /tmp/board.lock")
)
else:
config.substitutions.append(("%run_on_board", "echo"))
Expand Down
4 changes: 4 additions & 0 deletions reference_designs/lit.site.cfg.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
@LIT_SITE_CFG_IN_HEADER@

import sys
import lit.util

config.host_triple = "@LLVM_HOST_TRIPLE@"
config.target_triple = "@TARGET_TRIPLE@"
Expand Down Expand Up @@ -50,6 +51,9 @@ config.aie_obj_root = "@AIE_BINARY_DIR@"
# test_exec_root: The root path where tests should be run.
config.test_exec_root = "@CMAKE_CURRENT_BINARY_DIR@"

config.hsa_dir = "@hsa-runtime64_DIR@"
config.hsa_found = lit.util.pythonize_bool("@hsa-runtime64_FOUND@")

# pass on vitis settings
config.enable_chess_tests = @CONFIG_ENABLE_CHESS_TESTS@
config.enable_board_tests = @CONFIG_ENABLE_BOARD_TESTS@
Expand Down

0 comments on commit 5983c89

Please sign in to comment.