aboutsummaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorDavid Shah <dave@ds0.me>2019-02-25 11:56:10 +0000
committerDavid Shah <dave@ds0.me>2019-03-22 10:31:54 +0000
commit7142db28a8b828da557729a706c20c8f330ba129 (patch)
treead9898be5e31227bcfeabde06b4c24c5455d143b /CMakeLists.txt
parent1c824709e21b18073bfdc182793351e40269c373 (diff)
downloadnextpnr-7142db28a8b828da557729a706c20c8f330ba129.tar.gz
nextpnr-7142db28a8b828da557729a706c20c8f330ba129.tar.bz2
nextpnr-7142db28a8b828da557729a706c20c8f330ba129.zip
HeAP: Make HeAP placer optional
A CMake option 'BUILD_HEAP' (default on) configures building of the HeAP placer and the associated Eigen3 dependency. Default for the iCE40 is SA placer, with --heap-placer to use HeAP Default for the ECP5 is HeAP placer, as SA placer can take 1hr+ for large ECP5 designs and HeAP tends to give better QoR. --sa-placer can be used to use SA instead, and auto-fallback to SA if HeAP not built. Signed-off-by: David Shah <dave@ds0.me>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt27
1 files changed, 19 insertions, 8 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 69089c4c..ade76d60 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -5,6 +5,8 @@ project(nextpnr)
option(BUILD_GUI "Build GUI" ON)
option(BUILD_PYTHON "Build Python Integration" ON)
option(BUILD_TESTS "Build GUI" OFF)
+option(BUILD_HEAP "Build HeAP analytic placer" ON)
+option(USE_OPENMP "Use OpenMP to accelerate analytic placer" OFF)
option(COVERAGE "Add code coverage info" OFF)
option(STATIC_BUILD "Create static build" OFF)
option(EXTERNAL_CHIPDB "Create build with pre-built chipdb binaries" OFF)
@@ -53,12 +55,16 @@ endforeach()
set(CMAKE_CXX_STANDARD 11)
if (MSVC)
-set(CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE STRING "" FORCE)
-set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /D_DEBUG /W4 /wd4100 /wd4244 /wd4125 /wd4800 /wd4456 /wd4458 /wd4305 /wd4459 /wd4121 /wd4996")
-set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /W4 /wd4100 /wd4244 /wd4125 /wd4800 /wd4456 /wd4458 /wd4305 /wd4459 /wd4121 /wd4996 /wd4127")
+ set(CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE STRING "" FORCE)
+ set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /D_DEBUG /W4 /wd4100 /wd4244 /wd4125 /wd4800 /wd4456 /wd4458 /wd4305 /wd4459 /wd4121 /wd4996")
+ set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /W4 /wd4100 /wd4244 /wd4125 /wd4800 /wd4456 /wd4458 /wd4305 /wd4459 /wd4121 /wd4996 /wd4127")
else()
-set(CMAKE_CXX_FLAGS_DEBUG "-Wall -fPIC -ggdb -pipe")
-set(CMAKE_CXX_FLAGS_RELEASE "-Wall -fPIC -O3 -g -pipe -fopenmp")
+ set(CMAKE_CXX_FLAGS_DEBUG "-Wall -fPIC -ggdb -pipe")
+ if (USE_OPENMP)
+ set(CMAKE_CXX_FLAGS_RELEASE "-Wall -fPIC -O3 -g -pipe -fopenmp")
+ else()
+ set(CMAKE_CXX_FLAGS_RELEASE "-Wall -fPIC -O3 -g -pipe")
+ endif()
endif()
set(CMAKE_DEFIN)
@@ -180,10 +186,15 @@ if (BUILD_PYTHON)
endif ()
endif()
-find_package (Eigen3 REQUIRED NO_MODULE)
+include_directories(common/ json/ ${Boost_INCLUDE_DIRS} ${PYTHON_INCLUDE_DIRS})
+
+if(BUILD_HEAP)
+ find_package (Eigen3 REQUIRED NO_MODULE)
+ include_directories(${EIGEN3_INCLUDE_DIRS})
+ add_definitions(${EIGEN3_DEFINITIONS})
+ add_definitions(-DWITH_HEAP)
+endif()
-include_directories(common/ json/ ${Boost_INCLUDE_DIRS} ${PYTHON_INCLUDE_DIRS} ${EIGEN3_INCLUDE_DIRS})
-add_definitions(${EIGEN3_DEFINITIONS})
aux_source_directory(common/ COMMON_SRC_FILES)
aux_source_directory(json/ JSON_PARSER_FILES)
set(COMMON_FILES ${COMMON_SRC_FILES} ${JSON_PARSER_FILES})