Skip to content

Commit

Permalink
Update XCLBinGen.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
makslevental committed Aug 17, 2024
1 parent fc00b67 commit 45f0dbb
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
5 changes: 2 additions & 3 deletions build_tools/cmake/iree_aie_bootgen.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ replace_string_in_file(${_BOOTGEN_SOURCE_DIR}/cdo-alloc.c "#include <malloc.h>"
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();")

Expand Down Expand Up @@ -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
$<$<COMPILE_LANGUAGE:C>:${_bootgen_c_warning_ignores}>
$<$<COMPILE_LANGUAGE:CXX>:${_bootgen_c_warning_ignores};${_bootgen_cxx_warning_ignores}>)

Expand Down Expand Up @@ -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
Expand Down
17 changes: 12 additions & 5 deletions compiler/plugins/target/AMD-AIE/iree-amd-aie/Target/XCLBinGen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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();
}
Expand Down

0 comments on commit 45f0dbb

Please sign in to comment.