Skip to content

Commit

Permalink
update runtime_lib to support vitis 2024.* (#1491)
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenneuendorffer authored May 15, 2024
1 parent aba1887 commit 71c9229
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 20 deletions.
17 changes: 0 additions & 17 deletions runtime_lib/xaiengine/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand All @@ -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)
5 changes: 3 additions & 2 deletions runtime_lib/xaiengine/aiert.cmake
Original file line number Diff line number Diff line change
@@ -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)

Expand Down Expand Up @@ -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()
Expand Down
20 changes: 19 additions & 1 deletion runtime_lib/xaiengine/lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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})

Expand Down

0 comments on commit 71c9229

Please sign in to comment.