This repository has been archived by the owner on Jan 26, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
/
CMakeLists.txt
167 lines (132 loc) · 3.51 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
cmake_minimum_required(VERSION 3.1)
project(TritonFPlan)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_GLIBCXX_USE_CXX11_ABI=1 -O3")
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -ggdb -D_GLIBCXX_USE_CXX11_ABI=1")
set(CMAKE_CXX_FLAGS_DEBUG "-g -ggdb")
set(CMAKE_CXX_FLAGS_RELEASE "-O3")
set(THREADS_PREFER_PTHREAD_FLAG ON)
set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
set(MPLACE_HOME ${PROJECT_SOURCE_DIR} )
set(DEFLIB_HOME
${PROJECT_SOURCE_DIR}/module/def
)
set(LEFLIB_HOME
${PROJECT_SOURCE_DIR}/module/lef
)
set(OPENSTA_HOME
${PROJECT_SOURCE_DIR}/module/OpenSTA
)
set(EIGEN_HOME
${PROJECT_SOURCE_DIR}/module/eigen
)
set(ABKCOMMON_HOME
${PROJECT_SOURCE_DIR}/module/ABKCommon
)
set( PARQUET_HOME
${PROJECT_SOURCE_DIR}/module/ParquetFP
)
add_subdirectory(${DEFLIB_HOME})
add_subdirectory(${LEFLIB_HOME})
add_subdirectory(${OPENSTA_HOME})
add_subdirectory(${ABKCOMMON_HOME})
add_subdirectory(${PARQUET_HOME})
set(ENV{TYPE_CALL} library)
## configure settings
find_package(TCL REQUIRED)
find_package(ZLIB REQUIRED)
find_package(SWIG REQUIRED)
find_package(BISON REQUIRED)
find_package(FLEX REQUIRED)
# for cimg
find_package(Boost REQUIRED)
find_package(Threads REQUIRED)
set (MPLACE_SRC
src/circuit.cpp
src/defParser.cpp
src/lefParser.cpp
src/main.cpp
src/timingSta.cpp
src/partition.cpp
src/parse.cpp
src/graph.cpp
src/lefdefIO.cpp
src/macro.cpp
src/mPlace_wrap.cpp
src/mPlaceExternal.cpp
src/mPlace.cpp
)
set (MPLACE_HEADER
)
############################################################
# include directories
############################################################
include_directories(
${BOOST_INCLUDEDIR}
${EIGEN_HOME}
${ABKCOMMON_HOME}
${PARQUET_HOME}/src
${DEFLIB_HOME}/def
${DEFLIB_HOME}/defzlib
${LEFLIB_HOME}/lef
${LEFLIB_HOME}/lefzlib
${OPENSTA_HOME}/app
${OPENSTA_HOME}/dcalc
${OPENSTA_HOME}/graph
${OPENSTA_HOME}/liberty
${OPENSTA_HOME}/network
${OPENSTA_HOME}/parasitics
${OPENSTA_HOME}/sdc
${OPENSTA_HOME}/sdf
${OPENSTA_HOME}/search
${OPENSTA_HOME}/tcl
${OPENSTA_HOME}/util
${OPENSTA_HOME}/verilog
)
############################################################
# Create a library
############################################################
add_library( mplacelib STATIC
${MPLACE_SRC}
)
set_target_properties( mplacelib
PROPERTIES OUTPUT_NAME "TritonFPlan"
)
add_custom_command(OUTPUT ${MPLACE_HOME}/src/mPlace_wrap.cpp
COMMAND ${SWIG_EXECUTABLE} -tcl8 -c++ -o ${MPLACE_HOME}/src/mPlace_wrap.cpp ${MPLACE_HOME}/src/mPlace.i
WORKING_DIRECTORY ${MPLACE_HOME}
DEPENDS ${MPLACE_HOME}/src/mPlace.i "src/mPlaceExternal.cpp" "src/mPlaceExternal.h"
)
############################################################
# Create an executable
############################################################
add_executable( mplace
${MPLACE_SRC}
)
add_dependencies( mplace sta )
add_dependencies( mplace def )
add_dependencies( mplace lef )
add_dependencies( mplacelib sta )
add_dependencies( mplacelib def )
add_dependencies( mplacelib lef )
target_link_libraries( mplace
PUBLIC
OpenSTA
def
defzlib
lef
lefzlib
ParquetFP
ABKCommon
${ZLIB_LIBRARIES}
${TCL_LIB}
Threads::Threads
)
############################################################
# Install
############################################################
install(FILES ${MPLACE_HEADER} DESTINATION include)
install(TARGETS mplace DESTINATION bin)
install(TARGETS mplacelib DESTINATION lib)