Skip to content

Commit

Permalink
[aiecc] Add aie2 test (#594)
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenneuendorffer authored Aug 22, 2023
1 parent b94b170 commit bf30381
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions test/aiecc/simple_aie2.mlir
Original file line number Diff line number Diff line change
@@ -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
}
}
}

0 comments on commit bf30381

Please sign in to comment.