From 45f0dbb128433416f4cc8d7fbf59dc75f337248d Mon Sep 17 00:00:00 2001 From: Maksim Levental Date: Sat, 17 Aug 2024 14:19:59 -0500 Subject: [PATCH] Update XCLBinGen.cpp --- build_tools/cmake/iree_aie_bootgen.cmake | 5 ++--- .../AMD-AIE/iree-amd-aie/Target/XCLBinGen.cpp | 17 ++++++++++++----- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/build_tools/cmake/iree_aie_bootgen.cmake b/build_tools/cmake/iree_aie_bootgen.cmake index cea68c67b..245f9c195 100644 --- a/build_tools/cmake/iree_aie_bootgen.cmake +++ b/build_tools/cmake/iree_aie_bootgen.cmake @@ -15,7 +15,7 @@ replace_string_in_file(${_BOOTGEN_SOURCE_DIR}/cdo-alloc.c "#include " replace_string_in_file("${_BOOTGEN_SOURCE_DIR}/main.cpp" "#include \"openssl/ms/applink.c\"" "//#include \"openssl/ms/applink.c\"") replace_string_in_file("${_BOOTGEN_SOURCE_DIR}/main.cpp" - "int main" "int iree_aie_bootgen") + "int main" "int iree_aie_bootgen_main") replace_string_in_file("${_BOOTGEN_SOURCE_DIR}/main.cpp" "DisplayBanner();" "//DisplayBanner();") @@ -45,7 +45,7 @@ elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang|GNU") -Wno-deprecated-copy -Wno-non-virtual-dtor -Wno-overloaded-virtual -Wno-register -Wno-reorder -Wno-suggest-override) endif() -target_compile_options(iree-aie-bootgen PUBLIC +target_compile_options(iree-aie-bootgen PRIVATE $<$:${_bootgen_c_warning_ignores}> $<$:${_bootgen_c_warning_ignores};${_bootgen_cxx_warning_ignores}>) @@ -80,7 +80,6 @@ target_include_directories(iree-aie-bootgen PUBLIC ${OPENSSL_INCLUDE_DIR}) target_compile_definitions(iree-aie-bootgen PUBLIC OPENSSL_USE_APPLINK) target_link_libraries(iree-aie-bootgen PUBLIC OpenSSL::SSL OpenSSL::applink) -target_compile_options(iree-aie-bootgen PRIVATE -fexceptions) iree_install_targets( TARGETS iree-aie-bootgen diff --git a/compiler/plugins/target/AMD-AIE/iree-amd-aie/Target/XCLBinGen.cpp b/compiler/plugins/target/AMD-AIE/iree-amd-aie/Target/XCLBinGen.cpp index c914ad2a4..d672d58a8 100644 --- a/compiler/plugins/target/AMD-AIE/iree-amd-aie/Target/XCLBinGen.cpp +++ b/compiler/plugins/target/AMD-AIE/iree-amd-aie/Target/XCLBinGen.cpp @@ -33,7 +33,7 @@ #define DEBUG_TYPE "amdaie-xclbingen" -extern int iree_aie_bootgen(int argc, const char *argv[]); +extern int iree_aie_bootgen_main(int argc, const char *argv[]); // https://stackoverflow.com/a/60198074 namespace uuid { @@ -862,12 +862,19 @@ static LogicalResult generateXCLBin( // Execute the bootgen command. { - const char *flags[] = {"", "-arch", "versal", - "-image", designBifFile.string().c_str(), - "-o", (tempDir / "design.pdi").string().c_str(), + std::string designBifFileStr = designBifFile.string(); + std::string designPdiStr = (tempDir / "design.pdi").string(); + // first element is empty because iree_aie_bootgen_main is _the_ main + const char *flags[] = {"", + "-arch", + "versal", + "-image", + designBifFileStr.c_str(), + "-o", + designPdiStr.c_str(), "-w"}; - if (iree_aie_bootgen(7 + 1, flags)) { + if (iree_aie_bootgen_main(1 + 7, flags)) { llvm::errs() << "failed to execute bootgen"; return failure(); }