From 8c83263771c0ae58aeda86a077e4e535d95711fa Mon Sep 17 00:00:00 2001 From: max Date: Wed, 20 Dec 2023 00:13:40 -0600 Subject: [PATCH] fix cpp --- .github/workflows/buildAndTestAieTools.yml | 2 + .github/workflows/buildAndTestRyzenAI.yml | 6 +- .../MM_2x2/circuit_switched_version/test.cpp | 58 ++++++++++--------- .../aie.mlir | 2 +- .../test.cpp | 58 ++++++++++--------- .../MM_2x2/packet_switched_version/test.cpp | 58 ++++++++++--------- .../objectFifo_version/aie.mlir | 4 +- .../objectFifo_version/test.cpp | 21 ++++--- reference_designs/autocorrelation/test.cpp | 21 ++++--- .../horizontal_diffusion/lit.local.cfg | 8 +++ reference_designs/prime_sieve_large/aie.mlir | 3 +- .../prime_sieve_large/lit.local.cfg | 8 +++ runtime_lib/test_lib/memory_allocator.h | 1 + 13 files changed, 140 insertions(+), 110 deletions(-) create mode 100644 reference_designs/horizontal_diffusion/lit.local.cfg create mode 100644 reference_designs/prime_sieve_large/lit.local.cfg diff --git a/.github/workflows/buildAndTestAieTools.yml b/.github/workflows/buildAndTestAieTools.yml index 4bc11871ce..75570b4129 100644 --- a/.github/workflows/buildAndTestAieTools.yml +++ b/.github/workflows/buildAndTestAieTools.yml @@ -117,4 +117,6 @@ jobs: fi sed -i.bak 's/-sv --timeout 600/-sv --timeout 600 -j1/g' ../test/CMakeLists.txt + sed -i.bak 's/-sv --timeout 300/-sv --timeout 600 -j1 --show-unsupported/g' ../reference_designs/CMakeLists.txt LIT_FILTER="$LIT_FILTER" PATH=/opt/Xilinx/Vitis/2023.2/aietools/bin:$PATH ninja check-aie + PATH=/opt/Xilinx/Vitis/2023.2/aietools/bin:$PATH ninja check-reference-designs diff --git a/.github/workflows/buildAndTestRyzenAI.yml b/.github/workflows/buildAndTestRyzenAI.yml index c23c78cc38..c5f16dd78b 100644 --- a/.github/workflows/buildAndTestRyzenAI.yml +++ b/.github/workflows/buildAndTestRyzenAI.yml @@ -13,10 +13,7 @@ defaults: shell: bash concurrency: - # A PR number if a pull request and otherwise the commit hash. This cancels - # queued and in-progress runs for the same PR (presubmit) or commit - # (postsubmit). - group: ci-build-test-ryzenai-${{ github.event.number || github.sha }} + group: ci-build-test-ryzenai env: DEBIAN_FRONTEND: noninteractive @@ -74,5 +71,6 @@ jobs: ninja install sed -i.bak 's/-sv --timeout 600/-sv --timeout 600 -j12 --show-unsupported/g' $PWD/../test/CMakeLists.txt + sed -i.bak 's/-sv --timeout 300/-sv --timeout 600 -j12 --show-unsupported/g' $PWD/../reference_designs/CMakeLists.txt ninja check-aie ninja check-reference-designs diff --git a/reference_designs/MM_2x2/circuit_switched_version/test.cpp b/reference_designs/MM_2x2/circuit_switched_version/test.cpp index beea80387f..5484c43f87 100755 --- a/reference_designs/MM_2x2/circuit_switched_version/test.cpp +++ b/reference_designs/MM_2x2/circuit_switched_version/test.cpp @@ -8,7 +8,9 @@ // //===----------------------------------------------------------------------===// +#include "memory_allocator.h" #include "test_library.h" + #include #include #include @@ -46,19 +48,19 @@ int main(int argc, char *argv[]) { usleep(sleep_u); printf("before configure DMA\n"); mlir_aie_configure_dmas(_xaie); - mlir_aie_init_mems(_xaie, 8); int errors = 0; printf("Finish configure\n"); #define DMA_COUNT 1024 - int *mem_ptr0 = mlir_aie_mem_alloc(_xaie, 0, DMA_COUNT); - int *mem_ptr1 = mlir_aie_mem_alloc(_xaie, 1, DMA_COUNT); - int *mem_ptr2 = mlir_aie_mem_alloc(_xaie, 2, DMA_COUNT); - int *mem_ptr3 = mlir_aie_mem_alloc(_xaie, 3, DMA_COUNT); - int *mem_ptr4 = mlir_aie_mem_alloc(_xaie, 4, DMA_COUNT); - int *mem_ptr5 = mlir_aie_mem_alloc(_xaie, 5, DMA_COUNT); - int *mem_ptr6 = mlir_aie_mem_alloc(_xaie, 6, DMA_COUNT); - int *mem_ptr7 = mlir_aie_mem_alloc(_xaie, 7, DMA_COUNT); + ext_mem_model_t buf0, buf1, buf2, buf3, buf4, buf5, buf6, buf7; + int *mem_ptr0 = mlir_aie_mem_alloc(_xaie, buf0, DMA_COUNT); + int *mem_ptr1 = mlir_aie_mem_alloc(_xaie, buf1, DMA_COUNT); + int *mem_ptr2 = mlir_aie_mem_alloc(_xaie, buf2, DMA_COUNT); + int *mem_ptr3 = mlir_aie_mem_alloc(_xaie, buf3, DMA_COUNT); + int *mem_ptr4 = mlir_aie_mem_alloc(_xaie, buf4, DMA_COUNT); + int *mem_ptr5 = mlir_aie_mem_alloc(_xaie, buf5, DMA_COUNT); + int *mem_ptr6 = mlir_aie_mem_alloc(_xaie, buf6, DMA_COUNT); + int *mem_ptr7 = mlir_aie_mem_alloc(_xaie, buf7, DMA_COUNT); // initialize the external buffers for (int i = 0; i < DMA_COUNT; i++) { @@ -72,23 +74,23 @@ int main(int argc, char *argv[]) { *(mem_ptr7 + i) = 99; // Out_tile1 } - mlir_aie_sync_mem_dev(_xaie, 0); // only used in libaiev2 - mlir_aie_sync_mem_dev(_xaie, 1); // only used in libaiev2 - mlir_aie_sync_mem_dev(_xaie, 2); // only used in libaiev2 - mlir_aie_sync_mem_dev(_xaie, 3); // only used in libaiev2 - mlir_aie_sync_mem_dev(_xaie, 4); // only used in libaiev2 - mlir_aie_sync_mem_dev(_xaie, 5); // only used in libaiev2 - mlir_aie_sync_mem_dev(_xaie, 6); // only used in libaiev2 - mlir_aie_sync_mem_dev(_xaie, 7); // only used in libaiev2 - - mlir_aie_external_set_addr_LHS_tile0((u64)mem_ptr0); - mlir_aie_external_set_addr_LHS_tile1((u64)mem_ptr1); - mlir_aie_external_set_addr_RHS_tile0((u64)mem_ptr2); - mlir_aie_external_set_addr_RHS_tile1((u64)mem_ptr3); - mlir_aie_external_set_addr_RHS_tile2((u64)mem_ptr4); - mlir_aie_external_set_addr_RHS_tile3((u64)mem_ptr5); - mlir_aie_external_set_addr_Out_tile0((u64)mem_ptr6); - mlir_aie_external_set_addr_Out_tile1((u64)mem_ptr7); + mlir_aie_sync_mem_dev(buf0); // only used in libaiev2 + mlir_aie_sync_mem_dev(buf1); // only used in libaiev2 + mlir_aie_sync_mem_dev(buf2); // only used in libaiev2 + mlir_aie_sync_mem_dev(buf3); // only used in libaiev2 + mlir_aie_sync_mem_dev(buf4); // only used in libaiev2 + mlir_aie_sync_mem_dev(buf5); // only used in libaiev2 + mlir_aie_sync_mem_dev(buf6); // only used in libaiev2 + mlir_aie_sync_mem_dev(buf7); // only used in libaiev2 + + mlir_aie_external_set_addr_LHS_tile0(_xaie, (u64)mem_ptr0); + mlir_aie_external_set_addr_LHS_tile1(_xaie, (u64)mem_ptr1); + mlir_aie_external_set_addr_RHS_tile0(_xaie, (u64)mem_ptr2); + mlir_aie_external_set_addr_RHS_tile1(_xaie, (u64)mem_ptr3); + mlir_aie_external_set_addr_RHS_tile2(_xaie, (u64)mem_ptr4); + mlir_aie_external_set_addr_RHS_tile3(_xaie, (u64)mem_ptr5); + mlir_aie_external_set_addr_Out_tile0(_xaie, (u64)mem_ptr6); + mlir_aie_external_set_addr_Out_tile1(_xaie, (u64)mem_ptr7); mlir_aie_configure_shimdma_60(_xaie); mlir_aie_configure_shimdma_70(_xaie); mlir_aie_configure_shimdma_100(_xaie); @@ -141,8 +143,8 @@ int main(int argc, char *argv[]) { mlir_aie_acquire_Out_tile0_lock(_xaie, 0, 0); mlir_aie_acquire_Out_tile1_lock(_xaie, 0, 0); - mlir_aie_sync_mem_cpu(_xaie, 6); // only used in libaiev2 - mlir_aie_sync_mem_cpu(_xaie, 7); // only used in libaiev2 + mlir_aie_sync_mem_cpu(buf6); // only used in libaiev2 + mlir_aie_sync_mem_cpu(buf7); // only used in libaiev2 for (int idx0 = 0; idx0 < 1024; ++idx0) { if (mem_ptr6[idx0] != 352) { diff --git a/reference_designs/MM_2x2/objectFifo_circuit_switched_version/aie.mlir b/reference_designs/MM_2x2/objectFifo_circuit_switched_version/aie.mlir index 1ef7ebc1bc..990ae2573e 100755 --- a/reference_designs/MM_2x2/objectFifo_circuit_switched_version/aie.mlir +++ b/reference_designs/MM_2x2/objectFifo_circuit_switched_version/aie.mlir @@ -15,7 +15,7 @@ // RUN: aiecc.py %VitisSysrootFlag% --host-target=%aieHostTargetTriplet% %s -I%host_runtime_lib%/test_lib/include %extraAieCcFlags% -L%host_runtime_lib%/test_lib/lib -ltest_lib %S/test.cpp -o test.elf // RUN: %run_on_board ./test.elf -module @MM_2x2 { +AIE.device(xcvc1902) { %t60 = AIE.tile(6, 0) %t63 = AIE.tile(6, 3) %t64 = AIE.tile(6, 4) diff --git a/reference_designs/MM_2x2/objectFifo_circuit_switched_version/test.cpp b/reference_designs/MM_2x2/objectFifo_circuit_switched_version/test.cpp index 94b0647cf5..d30acc9831 100755 --- a/reference_designs/MM_2x2/objectFifo_circuit_switched_version/test.cpp +++ b/reference_designs/MM_2x2/objectFifo_circuit_switched_version/test.cpp @@ -8,7 +8,9 @@ // //===----------------------------------------------------------------------===// +#include "memory_allocator.h" #include "test_library.h" + #include #include #include @@ -46,19 +48,19 @@ int main(int argc, char *argv[]) { usleep(sleep_u); printf("before configure DMA\n"); mlir_aie_configure_dmas(_xaie); - mlir_aie_init_mems(_xaie, 8); int errors = 0; printf("Finish configure\n"); #define DMA_COUNT 1024 - int *mem_ptr0 = mlir_aie_mem_alloc(_xaie, 0, DMA_COUNT); - int *mem_ptr1 = mlir_aie_mem_alloc(_xaie, 1, DMA_COUNT); - int *mem_ptr2 = mlir_aie_mem_alloc(_xaie, 2, DMA_COUNT); - int *mem_ptr3 = mlir_aie_mem_alloc(_xaie, 3, DMA_COUNT); - int *mem_ptr4 = mlir_aie_mem_alloc(_xaie, 4, DMA_COUNT); - int *mem_ptr5 = mlir_aie_mem_alloc(_xaie, 5, DMA_COUNT); - int *mem_ptr6 = mlir_aie_mem_alloc(_xaie, 6, DMA_COUNT); - int *mem_ptr7 = mlir_aie_mem_alloc(_xaie, 7, DMA_COUNT); + ext_mem_model_t buf0, buf1, buf2, buf3, buf4, buf5, buf6, buf7; + int *mem_ptr0 = mlir_aie_mem_alloc(_xaie, buf0, DMA_COUNT); + int *mem_ptr1 = mlir_aie_mem_alloc(_xaie, buf1, DMA_COUNT); + int *mem_ptr2 = mlir_aie_mem_alloc(_xaie, buf2, DMA_COUNT); + int *mem_ptr3 = mlir_aie_mem_alloc(_xaie, buf3, DMA_COUNT); + int *mem_ptr4 = mlir_aie_mem_alloc(_xaie, buf4, DMA_COUNT); + int *mem_ptr5 = mlir_aie_mem_alloc(_xaie, buf5, DMA_COUNT); + int *mem_ptr6 = mlir_aie_mem_alloc(_xaie, buf6, DMA_COUNT); + int *mem_ptr7 = mlir_aie_mem_alloc(_xaie, buf7, DMA_COUNT); // initialize the external buffers for (int i = 0; i < DMA_COUNT; i++) { @@ -72,23 +74,23 @@ int main(int argc, char *argv[]) { *(mem_ptr7 + i) = 99; // Out_tile1 } - mlir_aie_sync_mem_dev(_xaie, 0); // only used in libaiev2 - mlir_aie_sync_mem_dev(_xaie, 1); // only used in libaiev2 - mlir_aie_sync_mem_dev(_xaie, 2); // only used in libaiev2 - mlir_aie_sync_mem_dev(_xaie, 3); // only used in libaiev2 - mlir_aie_sync_mem_dev(_xaie, 4); // only used in libaiev2 - mlir_aie_sync_mem_dev(_xaie, 5); // only used in libaiev2 - mlir_aie_sync_mem_dev(_xaie, 6); // only used in libaiev2 - mlir_aie_sync_mem_dev(_xaie, 7); // only used in libaiev2 - - mlir_aie_external_set_addr_LHS_tile0((u64)mem_ptr0); - mlir_aie_external_set_addr_LHS_tile1((u64)mem_ptr1); - mlir_aie_external_set_addr_RHS_tile0((u64)mem_ptr2); - mlir_aie_external_set_addr_RHS_tile1((u64)mem_ptr3); - mlir_aie_external_set_addr_RHS_tile2((u64)mem_ptr4); - mlir_aie_external_set_addr_RHS_tile3((u64)mem_ptr5); - mlir_aie_external_set_addr_Out_tile0((u64)mem_ptr6); - mlir_aie_external_set_addr_Out_tile1((u64)mem_ptr7); + mlir_aie_sync_mem_dev(buf0); // only used in libaiev2 + mlir_aie_sync_mem_dev(buf1); // only used in libaiev2 + mlir_aie_sync_mem_dev(buf2); // only used in libaiev2 + mlir_aie_sync_mem_dev(buf3); // only used in libaiev2 + mlir_aie_sync_mem_dev(buf4); // only used in libaiev2 + mlir_aie_sync_mem_dev(buf5); // only used in libaiev2 + mlir_aie_sync_mem_dev(buf6); // only used in libaiev2 + mlir_aie_sync_mem_dev(buf7); // only used in libaiev2 + + mlir_aie_external_set_addr_LHS_tile0(_xaie, (u64)mem_ptr0); + mlir_aie_external_set_addr_LHS_tile1(_xaie, (u64)mem_ptr1); + mlir_aie_external_set_addr_RHS_tile0(_xaie, (u64)mem_ptr2); + mlir_aie_external_set_addr_RHS_tile1(_xaie, (u64)mem_ptr3); + mlir_aie_external_set_addr_RHS_tile2(_xaie, (u64)mem_ptr4); + mlir_aie_external_set_addr_RHS_tile3(_xaie, (u64)mem_ptr5); + mlir_aie_external_set_addr_Out_tile0(_xaie, (u64)mem_ptr6); + mlir_aie_external_set_addr_Out_tile1(_xaie, (u64)mem_ptr7); mlir_aie_configure_shimdma_60(_xaie); mlir_aie_configure_shimdma_70(_xaie); mlir_aie_configure_shimdma_100(_xaie); @@ -108,8 +110,8 @@ int main(int argc, char *argv[]) { mlir_aie_acquire_of_out0_cons_lock_0(_xaie, 1, 0); mlir_aie_acquire_of_out1_cons_lock_0(_xaie, 1, 0); - mlir_aie_sync_mem_cpu(_xaie, 6); // only used in libaiev2 - mlir_aie_sync_mem_cpu(_xaie, 7); // only used in libaiev2 + mlir_aie_sync_mem_cpu(buf6); // only used in libaiev2 + mlir_aie_sync_mem_cpu(buf7); // only used in libaiev2 for (int idx0 = 0; idx0 < 1024; ++idx0) { if (mem_ptr6[idx0] != 352) { diff --git a/reference_designs/MM_2x2/packet_switched_version/test.cpp b/reference_designs/MM_2x2/packet_switched_version/test.cpp index 125832fe61..34258d0ffe 100644 --- a/reference_designs/MM_2x2/packet_switched_version/test.cpp +++ b/reference_designs/MM_2x2/packet_switched_version/test.cpp @@ -8,7 +8,9 @@ // //===----------------------------------------------------------------------===// +#include "memory_allocator.h" #include "test_library.h" + #include #include #include @@ -52,19 +54,19 @@ int main(int argc, char *argv[]) { printf("before configure DMA\n"); mlir_aie_configure_dmas(_xaie); - mlir_aie_init_mems(_xaie, 8); int errors = 0; printf("Finish configure\n"); #define DMA_COUNT 1024 - int *mem_ptr0 = mlir_aie_mem_alloc(_xaie, 0, DMA_COUNT); - int *mem_ptr1 = mlir_aie_mem_alloc(_xaie, 1, DMA_COUNT); - int *mem_ptr2 = mlir_aie_mem_alloc(_xaie, 2, DMA_COUNT); - int *mem_ptr3 = mlir_aie_mem_alloc(_xaie, 3, DMA_COUNT); - int *mem_ptr4 = mlir_aie_mem_alloc(_xaie, 4, DMA_COUNT); - int *mem_ptr5 = mlir_aie_mem_alloc(_xaie, 5, DMA_COUNT); - int *mem_ptr6 = mlir_aie_mem_alloc(_xaie, 6, DMA_COUNT + 1); - int *mem_ptr7 = mlir_aie_mem_alloc(_xaie, 7, DMA_COUNT + 1); + ext_mem_model_t buf0, buf1, buf2, buf3, buf4, buf5, buf6, buf7; + int *mem_ptr0 = mlir_aie_mem_alloc(_xaie, buf0, DMA_COUNT); + int *mem_ptr1 = mlir_aie_mem_alloc(_xaie, buf1, DMA_COUNT); + int *mem_ptr2 = mlir_aie_mem_alloc(_xaie, buf2, DMA_COUNT); + int *mem_ptr3 = mlir_aie_mem_alloc(_xaie, buf3, DMA_COUNT); + int *mem_ptr4 = mlir_aie_mem_alloc(_xaie, buf4, DMA_COUNT); + int *mem_ptr5 = mlir_aie_mem_alloc(_xaie, buf5, DMA_COUNT); + int *mem_ptr6 = mlir_aie_mem_alloc(_xaie, buf6, DMA_COUNT + 1); + int *mem_ptr7 = mlir_aie_mem_alloc(_xaie, buf7, DMA_COUNT + 1); // initialize the external buffers for (int i = 0; i < DMA_COUNT + 1; i++) { @@ -83,23 +85,23 @@ int main(int argc, char *argv[]) { } } - mlir_aie_sync_mem_dev(_xaie, 0); // only used in libaiev2 - mlir_aie_sync_mem_dev(_xaie, 1); // only used in libaiev2 - mlir_aie_sync_mem_dev(_xaie, 2); // only used in libaiev2 - mlir_aie_sync_mem_dev(_xaie, 3); // only used in libaiev2 - mlir_aie_sync_mem_dev(_xaie, 4); // only used in libaiev2 - mlir_aie_sync_mem_dev(_xaie, 5); // only used in libaiev2 - mlir_aie_sync_mem_dev(_xaie, 6); // only used in libaiev2 - mlir_aie_sync_mem_dev(_xaie, 7); // only used in libaiev2 - - mlir_aie_external_set_addr_LHS_tile0((u64)mem_ptr0); - mlir_aie_external_set_addr_LHS_tile1((u64)mem_ptr1); - mlir_aie_external_set_addr_RHS_tile0((u64)mem_ptr2); - mlir_aie_external_set_addr_RHS_tile1((u64)mem_ptr3); - mlir_aie_external_set_addr_RHS_tile2((u64)mem_ptr4); - mlir_aie_external_set_addr_RHS_tile3((u64)mem_ptr5); - mlir_aie_external_set_addr_Out_tile0((u64)mem_ptr6); - mlir_aie_external_set_addr_Out_tile1((u64)mem_ptr7); + mlir_aie_sync_mem_dev(buf0); // only used in libaiev2 + mlir_aie_sync_mem_dev(buf1); // only used in libaiev2 + mlir_aie_sync_mem_dev(buf2); // only used in libaiev2 + mlir_aie_sync_mem_dev(buf3); // only used in libaiev2 + mlir_aie_sync_mem_dev(buf4); // only used in libaiev2 + mlir_aie_sync_mem_dev(buf5); // only used in libaiev2 + mlir_aie_sync_mem_dev(buf6); // only used in libaiev2 + mlir_aie_sync_mem_dev(buf7); // only used in libaiev2 + + mlir_aie_external_set_addr_LHS_tile0(_xaie, (u64)mem_ptr0); + mlir_aie_external_set_addr_LHS_tile1(_xaie, (u64)mem_ptr1); + mlir_aie_external_set_addr_RHS_tile0(_xaie, (u64)mem_ptr2); + mlir_aie_external_set_addr_RHS_tile1(_xaie, (u64)mem_ptr3); + mlir_aie_external_set_addr_RHS_tile2(_xaie, (u64)mem_ptr4); + mlir_aie_external_set_addr_RHS_tile3(_xaie, (u64)mem_ptr5); + mlir_aie_external_set_addr_Out_tile0(_xaie, (u64)mem_ptr6); + mlir_aie_external_set_addr_Out_tile1(_xaie, (u64)mem_ptr7); mlir_aie_configure_shimdma_70(_xaie); mlir_aie_configure_shimdma_60(_xaie); @@ -147,8 +149,8 @@ int main(int argc, char *argv[]) { errors); } - mlir_aie_sync_mem_cpu(_xaie, 6); // only used in libaiev2 - mlir_aie_sync_mem_cpu(_xaie, 7); // only used in libaiev2 + mlir_aie_sync_mem_cpu(buf6); // only used in libaiev2 + mlir_aie_sync_mem_cpu(buf7); // only used in libaiev2 // Check if the external buffer receives the correct result int Header0 = mem_ptr6[0] & 31; diff --git a/reference_designs/autocorrelation/objectFifo_version/aie.mlir b/reference_designs/autocorrelation/objectFifo_version/aie.mlir index 1dd425bfeb..f05e051f54 100755 --- a/reference_designs/autocorrelation/objectFifo_version/aie.mlir +++ b/reference_designs/autocorrelation/objectFifo_version/aie.mlir @@ -10,7 +10,9 @@ // REQUIRES: valid_xchess_license // RUN: aiecc.py %VitisSysrootFlag% --host-target=%aieHostTargetTriplet% %s -I%host_runtime_lib%/test_lib/include %extraAieCcFlags% -L%host_runtime_lib%/test_lib/lib -ltest_lib %S/test.cpp -o test.elf -// RUN: %run_on_board ./test.elf +// RUN: %run_on_board ./test.elf + +// XFAIL: * module @autocorrelation { %tile0_1 = AIE.tile(2, 1) diff --git a/reference_designs/autocorrelation/objectFifo_version/test.cpp b/reference_designs/autocorrelation/objectFifo_version/test.cpp index fe6997d10e..d04adf29dc 100755 --- a/reference_designs/autocorrelation/objectFifo_version/test.cpp +++ b/reference_designs/autocorrelation/objectFifo_version/test.cpp @@ -8,7 +8,9 @@ // //===----------------------------------------------------------------------===// +#include "memory_allocator.h" #include "test_library.h" + #include #include #include @@ -37,12 +39,13 @@ int main(int argc, char *argv[]) { int errors = 0; - mlir_aie_init_mems(_xaie, 2); - int *input = mlir_aie_mem_alloc(_xaie, 0, 1024); - int *output = mlir_aie_mem_alloc(_xaie, 1, 1024); +#define DMA_COUNT 1024 + ext_mem_model_t buf0, buf1; + int *input = mlir_aie_mem_alloc(_xaie, buf0, DMA_COUNT); + int *output = mlir_aie_mem_alloc(_xaie, buf1, DMA_COUNT); - mlir_aie_external_set_addr_input((u64)input); - mlir_aie_external_set_addr_output((u64)output); + mlir_aie_external_set_addr_input(_xaie, (u64)input); + mlir_aie_external_set_addr_output(_xaie, (u64)output); mlir_aie_configure_shimdma_70(_xaie); mlir_aie_start_cores(_xaie); @@ -51,8 +54,8 @@ int main(int argc, char *argv[]) { input[i] = rand() & 0xFF; } - mlir_aie_sync_mem_dev(_xaie, 0); // only used in libaiev2 - mlir_aie_sync_mem_dev(_xaie, 1); // only used in libaiev2 + mlir_aie_sync_mem_dev(buf0); // only used in libaiev2 + mlir_aie_sync_mem_dev(buf1); // only used in libaiev2 mlir_aie_release_of_in_lock_0(_xaie, 1, 10000); @@ -61,8 +64,8 @@ int main(int argc, char *argv[]) { printf("ERROR: timeout hit!\n"); } - mlir_aie_sync_mem_dev(_xaie, 0); // only used in libaiev2 - mlir_aie_sync_mem_dev(_xaie, 1); // only used in libaiev2 + mlir_aie_sync_mem_dev(buf0); // only used in libaiev2 + mlir_aie_sync_mem_dev(buf1); // only used in libaiev2 for (int i = 0; i < 64; i++) { printf("output[%d] = %d\n", i, output[i]); diff --git a/reference_designs/autocorrelation/test.cpp b/reference_designs/autocorrelation/test.cpp index 3d958b0aa4..9d98e26d52 100755 --- a/reference_designs/autocorrelation/test.cpp +++ b/reference_designs/autocorrelation/test.cpp @@ -8,7 +8,9 @@ // //===----------------------------------------------------------------------===// +#include "memory_allocator.h" #include "test_library.h" + #include #include #include @@ -37,12 +39,13 @@ int main(int argc, char *argv[]) { int errors = 0; - mlir_aie_init_mems(_xaie, 2); - int *input = mlir_aie_mem_alloc(_xaie, 0, 1024); - int *output = mlir_aie_mem_alloc(_xaie, 1, 1024); +#define DMA_COUNT 1024 + ext_mem_model_t buf0, buf1; + int *input = mlir_aie_mem_alloc(_xaie, buf0, DMA_COUNT); + int *output = mlir_aie_mem_alloc(_xaie, buf1, DMA_COUNT); - mlir_aie_external_set_addr_input((u64)input); - mlir_aie_external_set_addr_output((u64)output); + mlir_aie_external_set_addr_input(_xaie, (u64)input); + mlir_aie_external_set_addr_output(_xaie, (u64)output); mlir_aie_configure_shimdma_70(_xaie); mlir_aie_start_cores(_xaie); @@ -51,8 +54,8 @@ int main(int argc, char *argv[]) { input[i] = rand() & 0xFF; } - mlir_aie_sync_mem_dev(_xaie, 0); // only used in libaiev2 - mlir_aie_sync_mem_dev(_xaie, 1); // only used in libaiev2 + mlir_aie_sync_mem_dev(buf0); // only used in libaiev2 + mlir_aie_sync_mem_dev(buf1); // only used in libaiev2 mlir_aie_release_input_lock(_xaie, 1, 10000); @@ -61,8 +64,8 @@ int main(int argc, char *argv[]) { printf("ERROR: timeout hit!\n"); } - mlir_aie_sync_mem_dev(_xaie, 0); // only used in libaiev2 - mlir_aie_sync_mem_dev(_xaie, 1); // only used in libaiev2 + mlir_aie_sync_mem_dev(buf0); // only used in libaiev2 + mlir_aie_sync_mem_dev(buf1); // only used in libaiev2 for (int i = 0; i < 64; i++) { printf("output[%d] = %d\n", i, output[i]); diff --git a/reference_designs/horizontal_diffusion/lit.local.cfg b/reference_designs/horizontal_diffusion/lit.local.cfg new file mode 100644 index 0000000000..15dcd63dc2 --- /dev/null +++ b/reference_designs/horizontal_diffusion/lit.local.cfg @@ -0,0 +1,8 @@ +# +# 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 AMD Inc. + +config.unsupported = ['horizontal_diffusion'] diff --git a/reference_designs/prime_sieve_large/aie.mlir b/reference_designs/prime_sieve_large/aie.mlir index 5d3d3a2f47..fe0dbeb139 100644 --- a/reference_designs/prime_sieve_large/aie.mlir +++ b/reference_designs/prime_sieve_large/aie.mlir @@ -13,8 +13,7 @@ // by specifying different rows and cols value in code_gen.py // RUN: aiecc.py %VitisSysrootFlag% --host-target=%aieHostTargetTriplet% %s -I%host_runtime_lib%/test_lib/include %extraAieCcFlags% -L%host_runtime_lib%/test_lib/lib -ltest_lib %S/test.cpp -o test.elf -// RUN: %run_on_board ./test.elf - +// RUN: %run_on_board ./test.elf module @test16_prime_sieve_large { %tile0_1 = AIE.tile(0, 1) diff --git a/reference_designs/prime_sieve_large/lit.local.cfg b/reference_designs/prime_sieve_large/lit.local.cfg new file mode 100644 index 0000000000..8a357c3301 --- /dev/null +++ b/reference_designs/prime_sieve_large/lit.local.cfg @@ -0,0 +1,8 @@ +# +# 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 AMD Inc. + +config.unsupported = ['prime_sieve_large'] diff --git a/runtime_lib/test_lib/memory_allocator.h b/runtime_lib/test_lib/memory_allocator.h index 56295735ba..60e74c92f7 100644 --- a/runtime_lib/test_lib/memory_allocator.h +++ b/runtime_lib/test_lib/memory_allocator.h @@ -13,6 +13,7 @@ #define AIE_MEMORY_ALLOCATOR_H #include "target.h" + #include #include #include