From 71c92296473c97ae0ffac6708426fc8d1809d6af Mon Sep 17 00:00:00 2001 From: Stephen Neuendorffer Date: Wed, 15 May 2024 15:12:45 -0700 Subject: [PATCH] update runtime_lib to support vitis 2024.* (#1491) --- runtime_lib/xaiengine/CMakeLists.txt | 17 ----------------- runtime_lib/xaiengine/aiert.cmake | 5 +++-- runtime_lib/xaiengine/lib/CMakeLists.txt | 20 +++++++++++++++++++- 3 files changed, 22 insertions(+), 20 deletions(-) diff --git a/runtime_lib/xaiengine/CMakeLists.txt b/runtime_lib/xaiengine/CMakeLists.txt index 3d31afa742..3efb146601 100644 --- a/runtime_lib/xaiengine/CMakeLists.txt +++ b/runtime_lib/xaiengine/CMakeLists.txt @@ -10,26 +10,10 @@ project("xaiengine lib for ${AIE_RUNTIME_TARGET}") include("aiert.cmake") if (${CMAKE_CROSSCOMPILING}) - - #tmp path to header files since we use an older (3_0) version of xaiengine. need to fix when we upgrade to 2023.1 - if(${Vitis_VERSION_MAJOR} EQUAL "2022") - set(aieRTIncludePath "${VITIS_ROOT}/data/embeddedsw/XilinxProcessorIPLib/drivers/aienginev2_v3_0/src" CACHE STRING "AIE-RT include path") - elseif(${Vitis_VERSION_MAJOR} EQUAL "2023") - set(aieRTIncludePath "${VITIS_AIETOOLS_DIR}/include/drivers/aiengine" CACHE STRING "AIE-RT include path") - else() - message(FATAL_ERROR "Unsupported Vitis version: ${Vitis_VERSION_MAJOR}") - endif() - message("Building xaiengine for ${AIE_RUNTIME_TARGET} from Vitis at ${VITIS_ROOT}.") - add_aiert_headers(xaiengine - ${aieRTIncludePath} - ${CMAKE_CURRENT_BINARY_DIR}/include - ${CMAKE_INSTALL_PREFIX}/runtime_lib/${AIE_RUNTIME_TARGET}/xaiengine/include) - add_subdirectory(lib) else() - message("Copying xaiengine for ${AIE_RUNTIME_TARGET} from ${AIERT_LIBS}.") add_aiert_headers(xaiengine ${AIERT_INCLUDE_DIR} @@ -47,7 +31,6 @@ else() # install library and headers install(FILES ${libs} DESTINATION ${CMAKE_INSTALL_PREFIX}/runtime_lib/${AIE_RUNTIME_TARGET}/xaiengine/lib) - endif() add_subdirectory(cdo) \ No newline at end of file diff --git a/runtime_lib/xaiengine/aiert.cmake b/runtime_lib/xaiengine/aiert.cmake index db7c5ef41b..966979feb8 100644 --- a/runtime_lib/xaiengine/aiert.cmake +++ b/runtime_lib/xaiengine/aiert.cmake @@ -1,6 +1,6 @@ function(add_aiert_headers TARGET SRCPATH BUILDPATH INSTALLPATH) - message("${TARGET} ${SRCPATH} ${BUILDPATH}") + message("Installing aie-rt includes for ${TARGET} from ${SRCPATH} in ${BUILDPATH}") file(GLOB libheaders ${SRCPATH}/*.h) file(GLOB libheadersSub ${SRCPATH}/*/*.h) @@ -37,7 +37,8 @@ function(add_aiert_headers TARGET SRCPATH BUILDPATH INSTALLPATH) endfunction() function(add_aiert_library TARGET XAIE_SOURCE) - cmake_parse_arguments(ARG "STATIC" "" "" ${ARGN}) +message("Building aie-rt library for ${TARGET} from ${SRCPATH}") +cmake_parse_arguments(ARG "STATIC" "" "" ${ARGN}) if(ARG_STATIC) set(LIBTYPE STATIC) else() diff --git a/runtime_lib/xaiengine/lib/CMakeLists.txt b/runtime_lib/xaiengine/lib/CMakeLists.txt index e823fea2f1..fc15e941f0 100644 --- a/runtime_lib/xaiengine/lib/CMakeLists.txt +++ b/runtime_lib/xaiengine/lib/CMakeLists.txt @@ -6,7 +6,25 @@ include("../aiert.cmake") -set(XAIE_SOURCE ${VITIS_ROOT}/data/embeddedsw/XilinxProcessorIPLib/drivers/aienginev2_v3_0/src) +#tmp path to header files since we use an older (3_0) version of xaiengine. need to fix when we upgrade to 2023.1 +if(${Vitis_VERSION_MAJOR} EQUAL "2022") + set(XAIE_SOURCE ${VITIS_ROOT}/data/embeddedsw/XilinxProcessorIPLib/drivers/aienginev2_v3_0/src) + set(aieRTIncludePath "${XAIE_SOURCE}") +elseif(${Vitis_VERSION_MAJOR} EQUAL "2023") + set(XAIE_SOURCE ${VITIS_ROOT}/data/embeddedsw/XilinxProcessorIPLib/drivers/aienginev2_v3_0/src) + set(aieRTIncludePath "${VITIS_AIETOOLS_DIR}/include/drivers/aiengine") +elseif(${Vitis_VERSION_MAJOR} EQUAL "2024") + set(XAIE_SOURCE ${VITIS_ROOT}/data/embeddedsw/XilinxProcessorIPLib/drivers/aienginev2_v3_5/src) + set(aieRTIncludePath "${VITIS_AIETOOLS_DIR}/include/drivers/aiengine") +else() + message(FATAL_ERROR "Unsupported Vitis version: ${Vitis_VERSION_MAJOR}") +endif() + +message("Building xaiengine for ${AIE_RUNTIME_TARGET} from Vitis at ${VITIS_ROOT}.") +add_aiert_headers(xaiengine + ${aieRTIncludePath} + ${CMAKE_CURRENT_BINARY_DIR}/include + ${CMAKE_INSTALL_PREFIX}/runtime_lib/${AIE_RUNTIME_TARGET}/xaiengine/include) add_aiert_library(xaiengine ${XAIE_SOURCE})