Skip to content

Commit

Permalink
Merge pull request #754 from os-fpga/tmp_copypatch_VPR_CMakefile
Browse files Browse the repository at this point in the history
tmp switch to copy-patch VPR CMakefile
  • Loading branch information
serge-dsa committed Jul 10, 2024
2 parents 37df416 + 4108eea commit 5eec62a
Show file tree
Hide file tree
Showing 5 changed files with 70 additions and 18 deletions.
10 changes: 7 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -221,9 +221,13 @@ file(COPY
message(STATUS "NOTE: ADDED to VPR-root: VPR_CMake_RS1.cmake")
message(STATUS "NOTE: VPR-root= ${VPR_DEST_DIR}\n")

message(STATUS "NOTE: PATCHING VPR CMakefile..")
set(DIFF_FILE ${PATCH_DIR}/CMAKE_fix/VPR_CMake.diff)
apply_patch(${DIFF_FILE} ${CMAKE_CURRENT_SOURCE_DIR}/OpenFPGA/vtr-verilog-to-routing/vpr "VPR CMakefile")
message(STATUS "NOTE: COPY-PATCHING VPR CMakefile..")
#set(DIFF_FILE ${PATCH_DIR}/CMAKE_fix/VPR_CMake.diff)
#apply_patch(${DIFF_FILE} ${CMAKE_CURRENT_SOURCE_DIR}/OpenFPGA/vtr-verilog-to-routing/vpr "VPR CMakefile")
file(COPY
${PATCH_DIR}/CMAKE_fix/PATCHED_VPR/CMakeLists.txt
DESTINATION
${VPR_DEST_DIR})

#FILE(COPY ${PLACER_SRC_DIR}/move_generator.h
# ## ${PLACER_SRC_DIR}/place.cpp
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.9)
cmake_minimum_required(VERSION 3.16)

project("vpr")

Expand Down Expand Up @@ -32,6 +32,25 @@ else()
message(STATUS "EZGL: graphics disabled")
endif()


#Handle server setup
set(SERVER_DEFINES "")

set(SERVER_DISABILED_REASON "")
if (VPR_USE_SERVER)
if (VPR_USE_EZGL STREQUAL "off")
set(SERVER_DISABILED_REASON ", due to EZGL being disabled")
set(VPR_USE_SERVER OFF)
endif()
endif()

if (VPR_USE_SERVER)
message(STATUS "Server mode is enabled")
else()
list(APPEND SERVER_DEFINES "-DNO_SERVER")
message(STATUS "Server mode is disabled${SERVER_DISABILED_REASON}")
endif()

# 1st RS patch
include("${CMAKE_CURRENT_LIST_DIR}/VPR_CMake_RS1.cmake")
message(STATUS "NOTE: INCLUDED VPR_CMake_RS1.cmake\n")
Expand Down Expand Up @@ -65,10 +84,6 @@ list (APPEND LIB_HEADERS ${READ_EDIF_SRC_DIR}/src/edif_blif.hpp)

files_to_dirs(LIB_HEADERS LIB_INCLUDE_DIRS)

if(${VTR_ENABLE_CAPNPROTO})
add_definitions("-DVTR_ENABLE_CAPNPROTO")
endif()

if(${VPR_DEBUG_PARTITION_TREE})
message(STATUS "VPR: Partition tree debug logs: enabled")
add_definitions("-DVPR_DEBUG_PARTITION_TREE")
Expand All @@ -84,7 +99,7 @@ add_library(libvpr STATIC
target_include_directories(libvpr PUBLIC ${LIB_INCLUDE_DIRS})
target_include_directories(libvpr PUBLIC ${READ_EDIF_SRC_DIR})

#VPR_ANALYTIC_PLACE is inisitalized in the root CMakeLists
#VPR_ANALYTIC_PLACE is initialized in the root CMakeLists
#Check Eigen dependency
if(${VPR_ANALYTIC_PLACE})
message(STATUS "VPR Analytic Placement: Requested")
Expand All @@ -100,12 +115,43 @@ if(${VPR_ANALYTIC_PLACE})
endif(TARGET Eigen3::Eigen)
endif()

if (${VPR_ENABLE_NOC_SAT_ROUTING})
message(STATUS "VPR NoC SAT Routing: Requested")
find_package(ortools CONFIG REQUIRED)
if (TARGET ortools::ortools)
message(STATUS "VPR NoC SAT Routing dependency (or-tools): Found")
message(STATUS "VPR NoC SAT Routing: Enabled")
target_link_libraries(libvpr ortools::ortools)
target_compile_definitions(libvpr PUBLIC -DENABLE_NOC_SAT_ROUTING)
else ()
message(STATUS "VPR NoC SAT Routing dependency (or-tools): Not Found (You may need to set CMAKE_PREFIX_PATH in order for CMake to find your OR-Tools installation)")
message(STATUS "VPR NoC SAT Routing: Disabled")
endif (TARGET ortools::ortools)
endif ()

set_target_properties(libvpr PROPERTIES PREFIX "") #Avoid extra 'lib' prefix

#Specify link-time dependancies
# 2nd RS patch - PRODUCTION_BUILD #TODO disable
#include("${CMAKE_CURRENT_LIST_DIR}/VPR_CMake_PRODUCTION_BUILD_RS2.cmake")
#message(STATUS "NOTE: INCLUDED VPR_CMake_PRODUCTION_BUILD_RS2.cmake\n")
#Specify link-time dependencies
target_link_libraries(libvpr
libvtrutil
libarchfpga
libsdcparse
libblifparse
libtatum
libargparse
libpugixml
librrgraph
libreadedif
${OPENSSL_LIBRARIES}
${VERIFIC_LIBS} dl
)

if(VPR_USE_SERVER)
target_link_libraries(libvpr
sockpp-static
-lz
)
endif()

#link graphics library only when graphics set to on
if (VPR_USE_EZGL STREQUAL "on")
Expand Down Expand Up @@ -143,18 +189,19 @@ if (VPR_USE_EZGL STREQUAL "on")

endif()

target_compile_definitions(libvpr PUBLIC ${GRAPHICS_DEFINES})
target_compile_definitions(libvpr PUBLIC ${GRAPHICS_DEFINES} ${SERVER_DEFINES})

if(${VTR_ENABLE_CAPNPROTO})
target_link_libraries(libvpr libvtrcapnproto)
target_compile_definitions(libvpr PRIVATE VTR_ENABLE_CAPNPROTO)
endif()

add_executable(vpr ${EXEC_SOURCES})

target_link_libraries(vpr libvpr)


#Supress IPO link warnings if IPO is enabled
#Suppress IPO link warnings if IPO is enabled
get_target_property(VPR_USES_IPO vpr INTERPROCEDURAL_OPTIMIZATION)
if (VPR_USES_IPO)
set_property(TARGET vpr APPEND PROPERTY LINK_FLAGS ${IPO_LINK_WARN_SUPRESS_FLAGS})
Expand Down Expand Up @@ -265,14 +312,15 @@ endif()
# Signal handler configuration
#
if (VPR_USE_SIGNAL_HANDLER)
#Check wheter VPR can use sigaction to handle signals (only supported by POSIX)
#Check whether VPR can use sigaction to handle signals (only supported by POSIX)
CHECK_CXX_SYMBOL_EXISTS(sigaction csignal HAVE_SIGACTION)
if(HAVE_SIGACTION)
target_compile_definitions(libvpr PRIVATE VPR_USE_SIGACTION)
endif()
endif()

install(TARGETS vpr libvpr DESTINATION bin)
install(FILES ${LIB_HEADERS} DESTINATION include/libvpr)


#
Expand All @@ -284,7 +332,7 @@ target_link_libraries(test_vpr
Catch2::Catch2WithMain
libvpr)

#Supress IPO link warnings if IPO is enabled
#Suppress IPO link warnings if IPO is enabled
get_target_property(TEST_VPR_USES_IPO vpr INTERPROCEDURAL_OPTIMIZATION)
if (TEST_VPR_USES_IPO)
set_property(TARGET test_vpr APPEND PROPERTY LINK_FLAGS ${IPO_LINK_WARN_SUPRESS_FLAGS})
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion planning/src/main.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
static const char* _pln_VERSION_STR = "pln0245";
static const char* _pln_VERSION_STR = "pln0246";

#include "RS/rsEnv.h"
#include "util/pln_log.h"
Expand Down

0 comments on commit 5eec62a

Please sign in to comment.