From f316dea48c23182fe230673fca44091d8d6a41f6 Mon Sep 17 00:00:00 2001 From: tangxifan Date: Tue, 26 Nov 2024 23:09:17 -0800 Subject: [PATCH 1/2] [core] unique block capn will update only on demand --- CMakeLists.txt | 1 + libs/libopenfpgacapnproto/CMakeLists.txt | 12 ++++++------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 76e27b7e9..9b670000d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -71,6 +71,7 @@ option(OPENFPGA_WITH_TEST "Enable testing build for codebase. Once enabled, make option(OPENFPGA_WITH_VERSION "Enable version always-up-to-date when building codebase. Disable only when you do not care an accurate version number" ON) option(OPENFPGA_WITH_SWIG "Enable SWIG interface when building codebase. Disable when you do not need high-level interfaces, such as Tcl/Python" ON) option(OPENFPGA_ENABLE_STRICT_COMPILE "Specifies whether compiler warnings should be treated as errors (e.g. -Werror)" OFF) +option(OPENFPGA_UPDATE_UNIQUE_BLOCK_CAPN "Specifies whether to update capn'proto files required by unique block. Recommend only after any modification on unique block parsers and data structures" OFF) # Options pass on to VTR set(WITH_ABC ON CACHE BOOL "Enable building ABC in Verilog-to-Routing") diff --git a/libs/libopenfpgacapnproto/CMakeLists.txt b/libs/libopenfpgacapnproto/CMakeLists.txt index c81ab82f3..af1532d0c 100644 --- a/libs/libopenfpgacapnproto/CMakeLists.txt +++ b/libs/libopenfpgacapnproto/CMakeLists.txt @@ -32,11 +32,11 @@ add_library(libopenfpgacapnproto STATIC ${IC_SRCS} ) - -add_dependencies(libopenfpgacapnproto - generate_unique_block_capnp - ) - +if (OPENFPGA_UPDATE_UNIQUE_BLOCK_CAPN) + add_dependencies(libopenfpgacapnproto + generate_unique_block_capnp + ) +endif() target_include_directories(libopenfpgacapnproto PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} @@ -64,4 +64,4 @@ add_custom_target( COMMAND ${CMAKE_COMMAND} -E copy unique_blocks_capnproto_generate/unique_blocks_uxsdcxx.capnp ${CMAKE_CURRENT_SOURCE_DIR}/gen DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/gen/unique_blocks.xsd WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} -) \ No newline at end of file +) From 174a81a77728bc5b4c2d77f65d41c338fc2bf73f Mon Sep 17 00:00:00 2001 From: tangxifan Date: Tue, 26 Nov 2024 23:12:29 -0800 Subject: [PATCH 2/2] [ci] add new test to validate when capn proto is on --- .github/workflows/build.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e97ead79f..a712b81f7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -210,6 +210,11 @@ jobs: cxx: g++-11 cmake_flags: "-DOPENFPGA_WITH_SWIG=OFF" dependency_version: "ubuntu22p04" + - name: "Build with capnproto update (Ubuntu 22.04)" + cc: gcc-11 + cxx: g++-11 + cmake_flags: "-DOPENFPGA_UPDATE_UNIQUE_BLOCK_CAPN=ON" + dependency_version: "ubuntu22p04" # Define the steps to run the build job env: CC: ${{ matrix.config.cc }}