From bf3038194d5f1ca0783fc657de94e8a04eca86e1 Mon Sep 17 00:00:00 2001 From: Stephen Neuendorffer Date: Mon, 21 Aug 2023 22:06:42 -0700 Subject: [PATCH] [aiecc] Add aie2 test (#594) --- test/aiecc/simple_aie2.mlir | 40 +++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 test/aiecc/simple_aie2.mlir diff --git a/test/aiecc/simple_aie2.mlir b/test/aiecc/simple_aie2.mlir new file mode 100644 index 0000000000..81df4c8bb9 --- /dev/null +++ b/test/aiecc/simple_aie2.mlir @@ -0,0 +1,40 @@ +//===- simple.mlir ---------------------------------------------*- MLIR -*-===// +// +// This file is licensed under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// (c) Copyright 2023 Xilinx Inc. +// +//===----------------------------------------------------------------------===// + +// RUN: aiecc.py --compile --xchesscc --no-link -nv --sysroot=%VITIS_SYSROOT% --host-target=aarch64-linux-gnu %s -I%aie_runtime_lib% %aie_runtime_lib%/test_library.cpp %S/test.cpp -o test.elf | FileCheck %s --check-prefix=XCHESSCC +// RUN: aiecc.py --compile --no-xchesscc --no-link -nv --sysroot=%VITIS_SYSROOT% --host-target=aarch64-linux-gnu %s -I%aie_runtime_lib% %aie_runtime_lib%/test_library.cpp %S/test.cpp -o test.elf | FileCheck %s --check-prefix=PEANO +// RUN: aiecc.py --no-compile --no-link -nv --sysroot=%VITIS_SYSROOT% --host-target=aarch64-linux-gnu %s -I%aie_runtime_lib% %aie_runtime_lib%/test_library.cpp %S/test.cpp -o test.elf | FileCheck %s --check-prefix=NOCOMPILE +// RUN: aiecc.py --no-unified --compile --no-link --xchesscc -nv --sysroot=%VITIS_SYSROOT% --host-target=aarch64-linux-gnu %s -I%aie_runtime_lib% %aie_runtime_lib%/test_library.cpp %S/test.cpp -o test.elf | FileCheck %s --check-prefix=XCHESSCC +// RUN: aiecc.py --no-unified --compile --no-link --no-xchesscc -nv --sysroot=%VITIS_SYSROOT% --host-target=aarch64-linux-gnu %s -I%aie_runtime_lib% %aie_runtime_lib%/test_library.cpp %S/test.cpp -o test.elf | FileCheck %s --check-prefix=PEANO +// RUN: aiecc.py --no-unified --no-compile --no-link -nv --sysroot=%VITIS_SYSROOT% --host-target=aarch64-linux-gnu %s -I%aie_runtime_lib% %aie_runtime_lib%/test_library.cpp %S/test.cpp -o test.elf | FileCheck %s --check-prefix=NOCOMPILE + +// Note that llc determines the architecture from the llvm IR. +// XCHESSCC-NOT: {{^llc}} +// XCHESSCC: xchesscc_wrapper aie2 +// XCHESSCC-NOT: {{^llc}} +// PEANO-NOT: xchesscc_wrapper +// PEANO: {{^llc}} +// PEANO-SAME: --march=aie2 +// PEANO-NOT: xchesscc_wrapper +// NOCOMPILE-NOT: xchesscc_wrapper +// NOCOMPILE-NOT: {{^llc}} + +module { + AIE.device(xcve2302) { + %12 = AIE.tile(1, 2) + %buf = AIE.buffer(%12) : memref<256xi32> + %4 = AIE.core(%12) { + %0 = arith.constant 0 : i32 + %1 = arith.constant 0 : index + memref.store %0, %buf[%1] : memref<256xi32> + AIE.end + } + } +}