Skip to content

Commit 41e8a8e

Browse files
authored
Merge pull request #264 from proppy/fix-openroad-mpl2
pnr/openroad: proper mpl2 patch
2 parents c082c4d + cfdeaa8 commit 41e8a8e

File tree

2 files changed

+30
-47
lines changed

2 files changed

+30
-47
lines changed

pnr/openroad/build.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,5 @@ cmake -B build -DCMAKE_INSTALL_PREFIX=$PREFIX .
2222
cmake --build build -j $CPU_COUNT --target install
2323

2424
cd $SRC_DIR
25-
cmake -B build -DCMAKE_FIND_ROOT_PATH="$BUILD_PREFIX;$PREFIX" -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY -DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=ONLY -DUSE_SYSTEM_BOOST=ON -DINSTALL_LIBOPENSTA=OFF -DBUILD_GUI=OFF -DCMAKE_INSTALL_PREFIX=$PREFIX .
25+
cmake -B build -DCMAKE_FIND_ROOT_PATH="$BUILD_PREFIX;$PREFIX" -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY -DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=ONLY -DUSE_SYSTEM_BOOST=ON -DINSTALL_LIBOPENSTA=OFF -DBUILD_GUI=OFF -DBUILD_MPL2=OFF -DCMAKE_INSTALL_PREFIX=$PREFIX .
2626
cmake --build build -j $CPU_COUNT --target install

pnr/openroad/disable-mpl2.patch

+29-46
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,39 @@
11
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
2-
index 99752d275..74a1ef540 100755
2+
index 3383cc173..79e66cecb 100755
33
--- a/src/CMakeLists.txt
44
+++ b/src/CMakeLists.txt
5-
@@ -244,7 +244,6 @@ add_subdirectory(cts)
5+
@@ -168,6 +168,8 @@ message(STATUS "boost: ${Boost_VERSION}")
6+
find_package(Python3 COMPONENTS Development REQUIRED)
7+
option(BUILD_PYTHON "Build the Python3 interface" ON)
8+
9+
+option(BUILD_MPL2 "Build MPL2 macro placer" ON)
10+
+
11+
option(ALLOW_WARNINGS "Flag to allow compilation with compiler warnings: on by default" ON)
12+
if (NOT ALLOW_WARNINGS)
13+
add_compile_options(
14+
@@ -250,7 +252,9 @@ add_subdirectory(cts)
615
add_subdirectory(grt)
716
add_subdirectory(tap)
817
add_subdirectory(mpl)
918
-add_subdirectory(mpl2)
19+
+if ((NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin") AND BUILD_MPL2)
20+
+ add_subdirectory(mpl2)
21+
+endif()
1022
add_subdirectory(rcx)
1123
add_subdirectory(psm)
1224
add_subdirectory(par)
13-
@@ -309,7 +308,6 @@ target_link_libraries(openroad
14-
drt
15-
dst
16-
mpl
17-
- mpl2
18-
psm
19-
ant
20-
par
21-
diff --git a/src/OpenRoad.cc b/src/OpenRoad.cc
22-
index dcf1ae707..0f0341ddb 100644
23-
--- a/src/OpenRoad.cc
24-
+++ b/src/OpenRoad.cc
25-
@@ -57,7 +57,6 @@
26-
#include "gui/MakeGui.h"
27-
#include "ifp//MakeInitFloorplan.hh"
28-
#include "mpl/MakeMacroPlacer.h"
29-
-#include "mpl2/MakeMacroPlacer.h"
30-
#include "odb/cdl.h"
31-
#include "odb/db.h"
32-
#include "odb/defin.h"
33-
@@ -160,7 +159,6 @@ OpenRoad::~OpenRoad()
34-
deleteTritonCts(tritonCts_);
35-
deleteTapcell(tapcell_);
36-
deleteMacroPlacer(macro_placer_);
37-
- deleteMacroPlacer2(macro_placer2_);
38-
deleteOpenRCX(extractor_);
39-
deleteTritonRoute(detailed_router_);
40-
deleteReplace(replace_);
41-
@@ -213,7 +211,6 @@ void OpenRoad::init(Tcl_Interp* tcl_interp)
42-
tritonCts_ = makeTritonCts();
43-
tapcell_ = makeTapcell();
44-
macro_placer_ = makeMacroPlacer();
45-
- macro_placer2_ = makeMacroPlacer2();
46-
extractor_ = makeOpenRCX();
47-
detailed_router_ = makeTritonRoute();
48-
replace_ = makeReplace();
49-
@@ -247,7 +244,6 @@ void OpenRoad::init(Tcl_Interp* tcl_interp)
50-
initTritonCts(this);
51-
initTapcell(this);
52-
initMacroPlacer(this);
53-
- initMacroPlacer2(this);
54-
initOpenRCX(this);
55-
initPad(this);
56-
initRestructure(this);
25+
@@ -325,12 +329,12 @@ target_link_libraries(openroad
26+
${CMAKE_THREAD_LIBS_INIT}
27+
)
28+
29+
-if (NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
30+
+if ((NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin") AND BUILD_MPL2)
31+
# mpl2 aborts with link error on darwin so do not link it.
32+
target_link_libraries(openroad mpl2)
33+
target_compile_definitions(openroad PRIVATE ENABLE_MPL2)
34+
else()
35+
- message(STATUS "Removing MPL2 to avoid run time fatal error.")
36+
+ message(STATUS "MPL2 macro placer disabled.")
37+
endif()
38+
39+
# tclReadline

0 commit comments

Comments
 (0)