From a3a6ee5e2ace3b0197bb2abfdcdaa3f6dc75273b Mon Sep 17 00:00:00 2001 From: AlexandreSinger Date: Thu, 21 Mar 2024 22:20:12 -0400 Subject: [PATCH 1/3] [Warnings] Removed Unused Variables When Capnproto is Disabled A few variables were left unused when CAPNPROTO was disabled which were giving warnings on the CI. Commented these unused variables out. --- vpr/src/route/router_lookahead_extended_map.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vpr/src/route/router_lookahead_extended_map.cpp b/vpr/src/route/router_lookahead_extended_map.cpp index db71adc6a8d..ce109f9777e 100644 --- a/vpr/src/route/router_lookahead_extended_map.cpp +++ b/vpr/src/route/router_lookahead_extended_map.cpp @@ -606,10 +606,10 @@ float ExtendedMapLookahead::get_expected_cost( #ifndef VTR_ENABLE_CAPNPROTO -void ExtendedMapLookahead::read(const std::string& file) { +void ExtendedMapLookahead::read(const std::string& /*file*/) { VPR_THROW(VPR_ERROR_ROUTE, "MapLookahead::read not implemented"); } -void ExtendedMapLookahead::write(const std::string& file) const { +void ExtendedMapLookahead::write(const std::string& /*file*/) const { VPR_THROW(VPR_ERROR_ROUTE, "MapLookahead::write not implemented"); } From ad2a4045a4a91720ba9a516dae7dfde442e75b2a Mon Sep 17 00:00:00 2001 From: AlexandreSinger Date: Thu, 21 Mar 2024 22:48:08 -0400 Subject: [PATCH 2/3] [libvtrutil][CMake] Updated Deprecated exec_program There were some CMake warnings during compile-time which were complaining about exec_program being deprecated. Replaced with execute_process which is a more verbose command to use anyways. --- .../cmake/modules/configure_version.cmake | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/libs/libvtrutil/cmake/modules/configure_version.cmake b/libs/libvtrutil/cmake/modules/configure_version.cmake index 8c7fbf17ed9..ab944548080 100644 --- a/libs/libvtrutil/cmake/modules/configure_version.cmake +++ b/libs/libvtrutil/cmake/modules/configure_version.cmake @@ -4,10 +4,11 @@ #Figure out the git revision find_package(Git QUIET) if(GIT_FOUND) - exec_program(${GIT_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR} - ARGS describe --always --long --dirty - OUTPUT_VARIABLE VTR_VCS_REVISION - RETURN_VALUE GIT_DESCRIBE_RETURN_VALUE) + execute_process(COMMAND ${GIT_EXECUTABLE} describe --always --long --dirty + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + OUTPUT_VARIABLE VTR_VCS_REVISION + OUTPUT_STRIP_TRAILING_WHITESPACE + RESULT_VARIABLE GIT_DESCRIBE_RETURN_VALUE) if(NOT GIT_DESCRIBE_RETURN_VALUE EQUAL 0) #Git describe failed, usually this means we @@ -18,10 +19,12 @@ if(GIT_FOUND) #Call again with exclude to get the revision excluding any tags #(i.e. just the commit ID and dirty flag) - exec_program(${GIT_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR} - ARGS describe --always --long --dirty --exclude '*' - OUTPUT_VARIABLE VTR_VCS_REVISION_SHORT - RETURN_VALUE GIT_DESCRIBE_RETURN_VALUE) + execute_process(COMMAND ${GIT_EXECUTABLE} describe --always --long --dirty --exclude '*' + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + OUTPUT_VARIABLE VTR_VCS_REVISION_SHORT + OUTPUT_STRIP_TRAILING_WHITESPACE + RESULT_VARIABLE GIT_DESCRIBE_RETURN_VALUE) + if(NOT GIT_DESCRIBE_RETURN_VALUE EQUAL 0) #Git describe failed, usually this means we #aren't in a git repo -- so don't set a VCS From b2697ff28e6a5d4e973cd1ee7cf3c370c9566219 Mon Sep 17 00:00:00 2001 From: AlexandreSinger Date: Fri, 22 Mar 2024 17:29:20 -0400 Subject: [PATCH 3/3] [CAPNPROTO] Cleaned Up Lookahead IFDEFs Instead of having two implementations of the same functions, it is cleaner and would prevent regressions if there was a single implementation with IFDEFs inside of it. Combined the implementations of the ExtendedMapLookaead's read and write methods. --- .../route/router_lookahead_extended_map.cpp | 23 +++++++++---------- 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/vpr/src/route/router_lookahead_extended_map.cpp b/vpr/src/route/router_lookahead_extended_map.cpp index ce109f9777e..6db4c4ff7bc 100644 --- a/vpr/src/route/router_lookahead_extended_map.cpp +++ b/vpr/src/route/router_lookahead_extended_map.cpp @@ -604,26 +604,25 @@ float ExtendedMapLookahead::get_expected_cost( } } -#ifndef VTR_ENABLE_CAPNPROTO - -void ExtendedMapLookahead::read(const std::string& /*file*/) { - VPR_THROW(VPR_ERROR_ROUTE, "MapLookahead::read not implemented"); -} -void ExtendedMapLookahead::write(const std::string& /*file*/) const { - VPR_THROW(VPR_ERROR_ROUTE, "MapLookahead::write not implemented"); -} - -#else - void ExtendedMapLookahead::read(const std::string& file) { +#ifndef VTR_ENABLE_CAPNPROTO cost_map_.read(file); this->src_opin_delays = util::compute_router_src_opin_lookahead(is_flat_); this->chan_ipins_delays = util::compute_router_chan_ipin_lookahead(); +#else // VTR_ENABLE_CAPNPROTO + (void)file; + VPR_THROW(VPR_ERROR_ROUTE, "MapLookahead::read not implemented"); +#endif // VTR_ENABLE_CAPNPROTO } + void ExtendedMapLookahead::write(const std::string& file) const { +#ifndef VTR_ENABLE_CAPNPROTO cost_map_.write(file); +#else // VTR_ENABLE_CAPNPROTO + (void)file; + VPR_THROW(VPR_ERROR_ROUTE, "MapLookahead::write not implemented"); +#endif // VTR_ENABLE_CAPNPROTO } -#endif