Skip to content

Commit

Permalink
Remove AIEBU_FULL (#67)
Browse files Browse the repository at this point in the history
All code protected by AIEBU_FULL=ON is now default enabled.

This builds upon #65 where generated header files are checked in.

This PR removes build of src/python/ and scripts/.  Please acknowledge
that is is desired.

Signed-off-by: Soren Soe <2106410+stsoe@users.noreply.github.com>
  • Loading branch information
stsoe authored Feb 27, 2025
1 parent 7a1cabd commit 305562d
Show file tree
Hide file tree
Showing 19 changed files with 58 additions and 132 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ jobs:
python -m pip install --upgrade pip
pip install pyyaml jinja2 Markdown pylint colorama gitPython wrapt
cmake -B ${{github.workspace}}/build/Release \
-DAIEBU_FULL=ON \
-DCMAKE_BUILD_TYPE=Release
- name: Save Python Path for ise with CMake
Expand All @@ -69,7 +68,6 @@ jobs:
# configure cmake specifying path to python
cmake -B ${{github.workspace}}/build/Release `
-DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake `
-DAIEBU_FULL=ON `
-DCMAKE_BUILD_TYPE=Release `
-DPython3_EXECUTABLE=${{ env.PYTHON_EXECUTABLE }}
Expand Down
5 changes: 0 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,6 @@ include(cmake/settings.cmake)

add_subdirectory(src/cpp/aiebu)

if (AIEBU_FULL STREQUAL "ON")
add_subdirectory(src/python)
add_subdirectory(scripts)
endif()

add_subdirectory(specification)

add_subdirectory(lib)
Expand Down
9 changes: 0 additions & 9 deletions build/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,6 @@ function compile {
local build=$2
local cmakeflags="-DCMAKE_BUILD_TYPE=$config"

if [[ $build == "aie2" ]]; then
cmakeflags="$cmakeflags -DAIEBU_FULL=OFF"
else
cmakeflags="$cmakeflags -DAIEBU_FULL=ON"
fi

mkdir -p $config
cd $config
if [[ $config == "Debug" ]]; then
Expand All @@ -35,9 +29,6 @@ function compile {
cmake $cmakeflags ../../

make -j $CORE VERBOSE=1
if [[ $build != "aie2" ]]; then
make -j $CORE VERBOSE=1 isa-spec
fi
make -j $CORE VERBOSE=1 install
make -j $CORE VERBOSE=1 test
make -j $CORE VERBOSE=1 test ARGS="-L memcheck -T memcheck"
Expand Down
15 changes: 0 additions & 15 deletions build/build22.bat
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,6 @@ REM --------------------------------------------------------------------------
:DebugBuild
echo ====================== Windows Debug Build ============================
set CMAKEFLAGS=%CMAKEFLAGS% -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=%BUILDDIR%/WDebug
if [%AIEBU_BUILD%] == ["aie2"] (
set CMAKEFLAGS=%CMAKEFLAGS% -DAIEBU_FULL=OFF
) else (
set CMAKEFLAGS=%CMAKEFLAGS% -DAIEBU_FULL=ON
)

ECHO CMAKEFLAGS=%CMAKEFLAGS%

Expand Down Expand Up @@ -147,11 +142,6 @@ REM --------------------------------------------------------------------------
:ReleaseBuild
ECHO ====================== Windows Release Build ============================
set CMAKEFLAGS=%CMAKEFLAGS% -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=%BUILDDIR%/WRelease
if [%AIEBU_BUILD%] == ["aie2"] (
set CMAKEFLAGS=%CMAKEFLAGS% -DAIEBU_FULL=OFF
) else (
set CMAKEFLAGS=%CMAKEFLAGS% -DAIEBU_FULL=ON
)
ECHO CMAKEFLAGS=%CMAKEFLAGS%

MKDIR %BUILDDIR%\WRelease
Expand All @@ -162,11 +152,6 @@ if [%NOCMAKE%] == [0] (
IF errorlevel 1 (POPD & exit /B %errorlevel%)
)

if not [%AIEBU_BUILD%] == ["aie2"] (
cmake --build . --verbose --config Release --target cpp-assembler-stubs
IF errorlevel 1 (POPD & exit /B %errorlevel%)
)

cmake --build . --verbose --config Release
IF errorlevel 1 (POPD & exit /B %errorlevel%)

Expand Down
6 changes: 1 addition & 5 deletions cmake/linux.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,5 @@ find_package(PkgConfig REQUIRED)
pkg_check_modules(LIBELF REQUIRED libelf)
message("-- Libelf version: ${LIBELF_VERSION}")

if (AIEBU_FULL STREQUAL "ON")
find_program (READELF eu-readelf REQUIRED)
message("-- Readelf path: ${READELF}")
endif()

find_program (READELF eu-readelf REQUIRED)
add_compile_options(-Wall -Wextra -Werror)
14 changes: 6 additions & 8 deletions cmake/python.cmake
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
# SPDX-License-Identifier: MIT
# Copyright (C) 2025 Advanced Micro Devices, Inc. All rights reserved.
if (AIEBU_FULL STREQUAL "ON")
find_program (PYLINT pylint REQUIRED)
message("-- Pylint path: ${PYLINT}")
find_program (PYLINT pylint REQUIRED)
message("-- Pylint path: ${PYLINT}")

message("-- Python executable: ${Python3_EXECUTABLE}")
find_package(Python3 COMPONENTS Interpreter REQUIRED)
message("-- Python executable: ${Python3_EXECUTABLE}")
message("-- Python version: ${Python3_VERSION}")
endif()
message("-- Python executable: ${Python3_EXECUTABLE}")
find_package(Python3 COMPONENTS Interpreter REQUIRED)
message("-- Python executable: ${Python3_EXECUTABLE}")
message("-- Python version: ${Python3_VERSION}")
4 changes: 0 additions & 4 deletions cmake/settings.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,6 @@ message("-- Using ELFIO from ${AIEBU_ELFIO_SRC_DIR}")
################################################################
# Global compile options
################################################################
if (AIEBU_FULL STREQUAL "ON")
add_compile_options(-DAIEBU_FULL)
endif()

if (MSVC)
include(cmake/windows.cmake)
else()
Expand Down
28 changes: 13 additions & 15 deletions src/cpp/aiebu/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,21 +47,19 @@ set_target_properties(aiebu_library_objects PROPERTIES

add_dependencies(aiebu_library_objects ctrlcodelib)

if (AIEBU_FULL STREQUAL "ON")
target_sources(aiebu_library_objects
PRIVATE
encoder/aie2ps/aie2ps_encoder.cpp
preprocessor/aie2ps/aie2ps_preprocessor_input.cpp
preprocessor/asm/pager.cpp
)
target_include_directories(aiebu_library_objects
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/preprocessor/aie2ps
${CMAKE_CURRENT_SOURCE_DIR}/encoder/aie2ps
${CMAKE_CURRENT_SOURCE_DIR}/elf/aie2ps
${CMAKE_CURRENT_BINARY_DIR}
)
endif()
target_sources(aiebu_library_objects
PRIVATE
encoder/aie2ps/aie2ps_encoder.cpp
preprocessor/aie2ps/aie2ps_preprocessor_input.cpp
preprocessor/asm/pager.cpp
)
target_include_directories(aiebu_library_objects
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/preprocessor/aie2ps
${CMAKE_CURRENT_SOURCE_DIR}/encoder/aie2ps
${CMAKE_CURRENT_SOURCE_DIR}/elf/aie2ps
${CMAKE_CURRENT_BINARY_DIR}
)

add_library(aiebu SHARED
$<TARGET_OBJECTS:aiebu_library_objects>
Expand Down
2 changes: 0 additions & 2 deletions src/cpp/aiebu/src/assembler/aiebu_assembler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,11 @@ aiebu_assembler(buffer_type type,
aiebu::assembler a(assembler::elf_type::aie2_asm);
elf_data = a.process(buffer1, libs, libpaths, patch_json, buffer2, ctrlpkt);
}
#ifdef AIEBU_FULL
else if (type == buffer_type::asm_aie2ps)
{
aiebu::assembler a(assembler::elf_type::aie2ps_asm);
elf_data = a.process(buffer1, libs, libpaths, patch_json);
}
#endif
else {
throw error(error::error_code::invalid_buffer_type, "Buffer_type not supported !!!");
}
Expand Down
5 changes: 0 additions & 5 deletions src/cpp/aiebu/src/assembler/assembler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,9 @@
#include "aie2_asm_preprocessor.h"
#include "aie2_blob_encoder.h"
#include "aie2_blob_elfwriter.h"

#ifdef AIEBU_FULL
#include "aie2ps_preprocessor.h"
#include "aie2ps_encoder.h"
#include "aie2ps_elfwriter.h"
#endif

#include "aiebu_error.h"

Expand Down Expand Up @@ -45,15 +42,13 @@ assembler(const elf_type type)
m_elfwriter = std::make_unique<aie2_blob_elf_writer>();
m_ppi = std::make_shared<aie2_asm_preprocessor_input>();
}
#ifdef AIEBU_FULL
else if (type == elf_type::aie2ps_asm)
{
m_preprocessor = std::make_unique<aie2ps_preprocessor>();
m_enoder = std::make_unique<aie2ps_encoder>();
m_elfwriter = std::make_unique<aie2ps_elf_writer>();
m_ppi = std::make_shared<aie2ps_preprocessor_input>();
}
#endif
else {
throw error(error::error_code::invalid_buffer_type ,"Invalid elf type!!!");
}
Expand Down
2 changes: 0 additions & 2 deletions src/cpp/aiebu/src/assembler/assembler.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@ class assembler
{
aie2_transaction_blob,
aie2_dpu_blob,
#ifdef AIEBU_FULL
aie2ps_asm,
#endif
aie2_asm
};

Expand Down
2 changes: 0 additions & 2 deletions src/cpp/aiebu/src/include/aiebu.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,7 @@ enum aiebu_assembler_buffer_type {
aiebu_assembler_buffer_type_blob_instr_prepost,
aiebu_assembler_buffer_type_blob_instr_transaction,
aiebu_assembler_buffer_type_blob_control_packet,
#ifdef AIEBU_FULL
aiebu_assembler_buffer_type_asm_aie2ps
#endif
};

struct pm_ctrlpkt {
Expand Down
2 changes: 0 additions & 2 deletions src/cpp/aiebu/src/include/aiebu_assembler.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,7 @@ class aiebu_assembler {
blob_instr_prepost,
blob_instr_transaction,
blob_control_packet,
#ifdef AIEBU_FULL
asm_aie2ps,
#endif
asm_aie2
};

Expand Down
6 changes: 0 additions & 6 deletions src/cpp/aiebu/utils/asm/asm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,7 @@ void main_helper(int argc, char** argv,
.allow_unrecognised_options()
.add_options()
("h,help", "show help message and exit", cxxopts::value<bool>()->default_value("false"))
#ifdef AIEBU_FULL
("t,target", "supported targets aie2ps/aie2asm/aie2txn/aie2dpu", cxxopts::value<decltype(target_name)>())
#else
("t,target", "supported targets aie2txn/aie2dpu/aie2asm", cxxopts::value<decltype(target_name)>())
#endif
;

auto result = global_options.parse(argc, argv);
Expand Down Expand Up @@ -82,9 +78,7 @@ int main( int argc, char** argv )
const std::string executable = "aiebu-asm";

{
#ifdef AIEBU_FULL
targets.emplace_back(std::make_shared<aiebu::utilities::target_aie2ps>(executable));
#endif
targets.emplace_back(std::make_shared<aiebu::utilities::target_aie2>(executable));
targets.emplace_back(std::make_shared<aiebu::utilities::target_aie2blob_transaction>(executable));
targets.emplace_back(std::make_shared<aiebu::utilities::target_aie2blob_dpu>(executable));
Expand Down
2 changes: 0 additions & 2 deletions src/cpp/aiebu/utils/target/target.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,6 @@ target_aie2::assemble(const sub_cmd_options &_options)
}
}

#ifdef AIEBU_FULL
void
aiebu::utilities::
target_aie2ps::assemble(const sub_cmd_options &_options)
Expand Down Expand Up @@ -263,4 +262,3 @@ target_aie2ps::assemble(const sub_cmd_options &_options)
throw std::runtime_error(errMsg.str());
}
}
#endif
3 changes: 0 additions & 3 deletions src/cpp/aiebu/utils/target/target.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ class target

};

#ifdef AIEBU_FULL
class target_aie2ps: public target
{
public:
Expand All @@ -70,8 +69,6 @@ class target_aie2ps: public target
target_aie2ps(const std::string& name): target(name, "aie2ps", "aie2ps asm assembler") {}
};

#endif

class target_aie2blob: public target
{
protected:
Expand Down
6 changes: 2 additions & 4 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@

project(tests CXX C)

if (AIEBU_FULL STREQUAL "ON")
if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
add_subdirectory(aie2ps-ctrlcode)
endif()
if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
add_subdirectory(aie2ps-ctrlcode)
endif()
add_subdirectory(aie2-ctrlcode)
add_subdirectory(cpp_test)
Expand Down
18 changes: 8 additions & 10 deletions test/cpp_test/c_api/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,11 @@ target_link_libraries(${AIE2_TESTNAME}

target_include_directories(${AIE2_TESTNAME} PRIVATE ${AIEBU_SOURCE_DIR}/src/cpp/aiebu/src/include)

if (AIEBU_FULL STREQUAL "ON")
set(AIE2PS_TESTNAME "aie2ps_c.out")
add_executable(${AIE2PS_TESTNAME} aie2ps_test.c)
target_link_libraries(${AIE2PS_TESTNAME}
PRIVATE
aiebu_static
)

target_include_directories(${AIE2PS_TESTNAME} PRIVATE ${AIEBU_SOURCE_DIR}/src/cpp/aiebu/src/include)
endif()
set(AIE2PS_TESTNAME "aie2ps_c.out")
add_executable(${AIE2PS_TESTNAME} aie2ps_test.c)
target_link_libraries(${AIE2PS_TESTNAME}
PRIVATE
aiebu_static
)

target_include_directories(${AIE2PS_TESTNAME} PRIVATE ${AIEBU_SOURCE_DIR}/src/cpp/aiebu/src/include)
59 changes: 28 additions & 31 deletions test/cpp_test/cpp_api/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,44 +13,41 @@ target_link_libraries(${AIE2_TESTNAME}
)
target_include_directories(${AIE2_TESTNAME} PRIVATE ${AIEBU_SOURCE_DIR}/src/cpp/aiebu/src/include)

if (AIEBU_FULL STREQUAL "ON")
set(AIE2PS_TESTNAME "aie2ps_cpp")
set(CHECKSUMS_FILE "${CMAKE_CURRENT_BINARY_DIR}/checksums.txt")
add_executable(${AIE2PS_TESTNAME} aie2ps_test.cpp)
target_link_libraries(${AIE2PS_TESTNAME}
PRIVATE
aiebu_static
)
target_include_directories(${AIE2PS_TESTNAME} PRIVATE ${AIEBU_SOURCE_DIR}/src/cpp/aiebu/src/include)
set(AIE2PS_TESTNAME "aie2ps_cpp")
set(CHECKSUMS_FILE "${CMAKE_CURRENT_BINARY_DIR}/checksums.txt")
add_executable(${AIE2PS_TESTNAME} aie2ps_test.cpp)
target_link_libraries(${AIE2PS_TESTNAME}
PRIVATE
aiebu_static
)
target_include_directories(${AIE2PS_TESTNAME} PRIVATE ${AIEBU_SOURCE_DIR}/src/cpp/aiebu/src/include)

add_custom_command(OUTPUT ctrl_pkt0.bin
COMMAND ${CMAKE_COMMAND} -P "${AIEBU_SOURCE_DIR}/cmake/b64.cmake" -d "${AIEBU_SOURCE_DIR}/test/cpp_test/aie2ps/eff_net_ctrlpacket/ctrl_pkt/ctrl_pkt0.b64" ctrl_pkt0.bin
# COMMAND ${CMAKE_COMMAND} -E copy "ctrl_pkt0.bin" "${AIEBU_SOURCE_DIR}/test/cpp_test/aie2ps/eff_net_ctrlpacket/ctrl_pkt/"
DEPENDS "${AIEBU_SOURCE_DIR}/test/cpp_test/aie2ps/eff_net_ctrlpacket/ctrl_pkt/ctrl_pkt0.b64"
COMMENT "Decoding base64 ctrlcode and ctrlpkt to binary in ${AIEBU_SOURCE_DIR}/test/cpp_test/aie2ps/eff_net_ctrlpacket"
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
VERBATIM)
add_custom_command(OUTPUT ctrl_pkt0.bin
COMMAND ${CMAKE_COMMAND} -P "${AIEBU_SOURCE_DIR}/cmake/b64.cmake" -d "${AIEBU_SOURCE_DIR}/test/cpp_test/aie2ps/eff_net_ctrlpacket/ctrl_pkt/ctrl_pkt0.b64" ctrl_pkt0.bin
# COMMAND ${CMAKE_COMMAND} -E copy "ctrl_pkt0.bin" "${AIEBU_SOURCE_DIR}/test/cpp_test/aie2ps/eff_net_ctrlpacket/ctrl_pkt/"
DEPENDS "${AIEBU_SOURCE_DIR}/test/cpp_test/aie2ps/eff_net_ctrlpacket/ctrl_pkt/ctrl_pkt0.b64"
COMMENT "Decoding base64 ctrlcode and ctrlpkt to binary in ${AIEBU_SOURCE_DIR}/test/cpp_test/aie2ps/eff_net_ctrlpacket"
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
VERBATIM)

add_custom_target(aie2psbins ALL
add_custom_target(aie2psbins ALL
DEPENDS ctrl_pkt0.bin)

add_test(NAME "aie2ps_cpp_eff_net_coal"
COMMAND ${AIE2PS_TESTNAME} "eff_net_coal" "${AIEBU_SOURCE_DIR}/test/cpp_test/aie2ps/eff_net_coal/"
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})

# add_test(NAME "aie2ps_cpp_eff_net_ctrlpacket"
# COMMAND ${AIE2PS_TESTNAME} "eff_net_ctrlpacket" "${AIEBU_SOURCE_DIR}/test/cpp_test/aie2ps/eff_net_ctrlpacket/"
# WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
add_test(NAME "aie2ps_cpp_eff_net_coal"
COMMAND ${AIE2PS_TESTNAME} "eff_net_coal" "${AIEBU_SOURCE_DIR}/test/cpp_test/aie2ps/eff_net_coal/"
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})

add_test(NAME "aie2ps_cpp_eff_net_coal_md5sum"
COMMAND cmake -P "${AIEBU_SOURCE_DIR}/cmake/md5sum-compare.cmake" "${CMAKE_CURRENT_BINARY_DIR}/eff_net_coal.elf" "${AIEBU_SOURCE_DIR}/test/cpp_test/aie2ps/eff_net_coal/gold.md5"
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
# add_test(NAME "aie2ps_cpp_eff_net_ctrlpacket"
# COMMAND ${AIE2PS_TESTNAME} "eff_net_ctrlpacket" "${AIEBU_SOURCE_DIR}/test/cpp_test/aie2ps/eff_net_ctrlpacket/"
# WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})

# add_test(NAME "aie2ps_cpp_eff_net_ctrlpacket_md5sum"
# COMMAND cmake -P "${AIEBU_SOURCE_DIR}/cmake/md5sum-compare.cmake" "${CMAKE_CURRENT_BINARY_DIR}/eff_net_ctrlpacket.elf" "${AIEBU_SOURCE_DIR}/test/cpp_test/aie2ps/eff_net_ctrlpacket/gold.md5"
# WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
add_test(NAME "aie2ps_cpp_eff_net_coal_md5sum"
COMMAND cmake -P "${AIEBU_SOURCE_DIR}/cmake/md5sum-compare.cmake" "${CMAKE_CURRENT_BINARY_DIR}/eff_net_coal.elf" "${AIEBU_SOURCE_DIR}/test/cpp_test/aie2ps/eff_net_coal/gold.md5"
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})

endif()
# add_test(NAME "aie2ps_cpp_eff_net_ctrlpacket_md5sum"
# COMMAND cmake -P "${AIEBU_SOURCE_DIR}/cmake/md5sum-compare.cmake" "${CMAKE_CURRENT_BINARY_DIR}/eff_net_ctrlpacket.elf" "${AIEBU_SOURCE_DIR}/test/cpp_test/aie2ps/eff_net_ctrlpacket/gold.md5"
# WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})

add_test(NAME "aie2_cpp_4x4"
COMMAND ${AIE2_TESTNAME} "${AIEBU_BINARY_DIR}/lib/gen/preempt_restore_stx_4x4.bin"
Expand Down

0 comments on commit 305562d

Please sign in to comment.