Skip to content

Commit

Permalink
update mlir-aie and llvm
Browse files Browse the repository at this point in the history
  • Loading branch information
fifield committed Oct 25, 2024
1 parent e7710d5 commit 3aa02bf
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 44 deletions.
53 changes: 32 additions & 21 deletions programming_examples/lit.cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@
)
config.substitutions.append(("%aietools", config.vitis_aietools_dir))

# for xchesscc_wrapper
llvm_config.with_environment("AIETOOLS", config.vitis_aietools_dir)

# XRT
if config.xrt_lib_dir and config.enable_run_xrt_tests:
print("xrt found at", os.path.dirname(config.xrt_lib_dir))
Expand Down Expand Up @@ -118,38 +121,46 @@
llvm_config.with_environment("PATH", config.aie_tools_dir, append_path=True)
llvm_config.with_environment("PATH", config.air_tools_dir, append_path=True)

# test if LM_LICENSE_FILE valid
if config.enable_chess_tests:
import shutil
if not config.enable_chess_tests:
print("Chess tests disabled")
else:
print("Looking for Chess...")

result = shutil.which("xchesscc")

import subprocess

if result != None:
result = subprocess.run(
["xchesscc", "+v"], stdout=subprocess.PIPE, stderr=subprocess.PIPE
)
validLMLicense = len(result.stderr.decode("utf-8")) == 0
else:
validLMLicense = False

if validLMLicense:
print("Chess found: " + result)
config.available_features.add("chess")
config.available_features.add("valid_xchess_license")
lm_license_file = os.getenv("LM_LICENSE_FILE")
if lm_license_file != None:
llvm_config.with_environment("LM_LICENSE_FILE", lm_license_file)
xilinxd_license_file = os.getenv("XILINXD_LICENSE_FILE")
if xilinxd_license_file != None:
llvm_config.with_environment("XILINXD_LICENSE_FILE", xilinxd_license_file)
else:
print(
"WARNING: no valid xchess license that is required by some of the lit tests"
)


if config.vitis_aietools_dir:
llvm_config.with_environment("CARDANO", config.vitis_aietools_dir)
# test if LM_LICENSE_FILE valid
validate_chess = False
if validate_chess:
import subprocess

result = subprocess.run(
["xchesscc", "+v"], stdout=subprocess.PIPE, stderr=subprocess.PIPE
)
validLMLicense = len(result.stderr.decode("utf-8")) == 0
else:
validLMLicense = lm_license_file or xilinxd_license_file

if not lm_license_file and not xilinxd_license_file:
print(
"WARNING: no valid xchess license that is required by some of the lit tests"
)
elif os.getenv("XILINXD_LICENSE_FILE") is not None:
print("Chess license found")
llvm_config.with_environment(
"XILINXD_LICENSE_FILE", os.getenv("XILINXD_LICENSE_FILE")
)
else:
print("Chess not found")

tool_dirs = [
config.peano_tools_dir,
Expand Down
53 changes: 32 additions & 21 deletions test/lit.cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import re
import subprocess
import tempfile

import shutil
import lit.formats
import lit.util

Expand Down Expand Up @@ -62,6 +62,9 @@
)
config.substitutions.append(("%aietools", config.vitis_aietools_dir))

# for xchesscc_wrapper
llvm_config.with_environment("AIETOOLS", config.vitis_aietools_dir)

if config.hsa_found:
# Getting the path to the ROCm directory. hsa-runtime64 points to the cmake
# directory so need to go up three directories
Expand Down Expand Up @@ -149,38 +152,46 @@
llvm_config.with_environment("PATH", config.aie_tools_dir, append_path=True)
llvm_config.with_environment("PATH", config.air_tools_dir, append_path=True)

# test if LM_LICENSE_FILE valid
if config.enable_chess_tests:
import shutil
if not config.enable_chess_tests:
print("Chess tests disabled")
else:
print("Looking for Chess...")

result = shutil.which("xchesscc")

import subprocess

if result != None:
result = subprocess.run(
["xchesscc", "+v"], stdout=subprocess.PIPE, stderr=subprocess.PIPE
)
validLMLicense = len(result.stderr.decode("utf-8")) == 0
else:
validLMLicense = False

if validLMLicense:
print("Chess found: " + result)
config.available_features.add("chess")
config.available_features.add("valid_xchess_license")
lm_license_file = os.getenv("LM_LICENSE_FILE")
if lm_license_file != None:
llvm_config.with_environment("LM_LICENSE_FILE", lm_license_file)
xilinxd_license_file = os.getenv("XILINXD_LICENSE_FILE")
if xilinxd_license_file != None:
llvm_config.with_environment("XILINXD_LICENSE_FILE", xilinxd_license_file)
else:
print(
"WARNING: no valid xchess license that is required by some of the lit tests"
)

# test if LM_LICENSE_FILE valid
validate_chess = False
if validate_chess:
import subprocess

result = subprocess.run(
["xchesscc", "+v"], stdout=subprocess.PIPE, stderr=subprocess.PIPE
)
validLMLicense = len(result.stderr.decode("utf-8")) == 0
else:
validLMLicense = lm_license_file or xilinxd_license_file

if config.vitis_aietools_dir:
llvm_config.with_environment("CARDANO", config.vitis_aietools_dir)
if not lm_license_file and not xilinxd_license_file:
print(
"WARNING: no valid xchess license that is required by some of the lit tests"
)
elif os.getenv("XILINXD_LICENSE_FILE") is not None:
print("Chess license found")
llvm_config.with_environment(
"XILINXD_LICENSE_FILE", os.getenv("XILINXD_LICENSE_FILE")
)
else:
print("Chess not found")

tool_dirs = [
config.peano_tools_dir,
Expand Down
2 changes: 1 addition & 1 deletion utils/clone-llvm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#
##===----------------------------------------------------------------------===##

export commithash=aa2c0f35a102b5afc128e19ccb2b9402026c531f
export commithash=7eb326441356f9e9aafa6d9f982c3c19ac6cad22
target_dir=llvm

# clone llvm if it is not there already
Expand Down
2 changes: 1 addition & 1 deletion utils/clone-mlir-aie.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#
##===----------------------------------------------------------------------===##

export HASH=5946b7dc1a583c04c5218f29f8fa4110a3516060
export HASH=088876dba42205b7dfcb94e5d1fc280f9d543c5b
target_dir=mlir-aie

if [[ ! -d $target_dir ]]; then
Expand Down

0 comments on commit 3aa02bf

Please sign in to comment.