Skip to content

Commit 489abe4

Browse files
authored
Merge branch 'The-OpenROAD-Project:master' into gui_ruler
2 parents 2b5c1d5 + ff8e011 commit 489abe4

File tree

246 files changed

+10608
-12532
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

246 files changed

+10608
-12532
lines changed

.bazelrc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,14 @@ build --cxxopt "-std=c++20" --host_cxxopt "-std=c++20"
1616
build --cxxopt "-xc++" --host_cxxopt "-xc++"
1717
build --cxxopt "-DBAZEL_BUILD" --host_cxxopt "-DBAZEL_BUILD"
1818

19+
# Default to optimized build (-c opt), O3
20+
build -c opt
21+
build:opt --copt=-O3
22+
23+
# Enable Full-LTO (Link Time Optimization)
24+
build:opt --copt=-flto
25+
build:opt --linkopt=-flto
26+
1927
# Needed for floating point stability in FFT (fft_test will check this).
2028
# See also https://kristerw.github.io/2021/11/09/fp-contract/
2129
build --cxxopt "-ffp-contract=off" --host_cxxopt "-ffp-contract=off"

CMakeLists.txt

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,51 @@ message(STATUS "C++ Standard: ${CMAKE_CXX_STANDARD}")
108108
message(STATUS "C++ Standard Required: ${CMAKE_CXX_STANDARD_REQUIRED}")
109109
message(STATUS "C++ Extensions: ${CMAKE_CXX_EXTENSIONS}")
110110

111+
# Detect OS distribution and version from /etc/os-release
112+
# LTO is known to cause build errors on Debian 11 and Rocky Linux 8
113+
set(LTO_UNSUPPORTED_OS FALSE)
114+
if(EXISTS "/etc/os-release")
115+
file(STRINGS "/etc/os-release" OS_RELEASE_CONTENTS)
116+
set(OS_ID "")
117+
set(OS_VERSION_ID "")
118+
foreach(line ${OS_RELEASE_CONTENTS})
119+
if(line MATCHES "^ID=(.*)$")
120+
string(REGEX REPLACE "^ID=\"?([^\"]*)\"?$" "\\1" OS_ID "${line}")
121+
endif()
122+
if(line MATCHES "^VERSION_ID=(.*)$")
123+
string(REGEX REPLACE "^VERSION_ID=\"?([^\"]*)\"?$" "\\1" OS_VERSION_ID "${line}")
124+
endif()
125+
endforeach()
126+
127+
# Check for unsupported OS for LTO
128+
if((OS_ID STREQUAL "debian" AND OS_VERSION_ID STREQUAL "11") OR
129+
(OS_ID STREQUAL "rocky" AND OS_VERSION_ID MATCHES "^8"))
130+
set(LTO_UNSUPPORTED_OS TRUE)
131+
message(STATUS "Detected unsupported OS (${OS_ID} ${OS_VERSION_ID}): LTO will be disabled due to known build issues")
132+
endif()
133+
endif()
134+
135+
option(LINK_TIME_OPTIMIZATION "Flag to control link time optimization: on by default" ON)
136+
set(LTO_STATUS "disabled")
137+
if (LINK_TIME_OPTIMIZATION AND NOT LTO_UNSUPPORTED_OS)
138+
include(CheckIPOSupported)
139+
check_ipo_supported(RESULT lto_supported OUTPUT lto_error)
140+
if(lto_supported)
141+
# LTO is enabled globally for Release build
142+
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_RELEASE TRUE)
143+
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_RELWITHDEBINFO FALSE)
144+
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_DEBUG FALSE)
145+
146+
string(TOUPPER "${CMAKE_BUILD_TYPE}" UPPER_BUILD_TYPE)
147+
if(UPPER_BUILD_TYPE STREQUAL "RELEASE")
148+
set(LTO_STATUS "enabled")
149+
endif()
150+
else()
151+
set(LTO_STATUS "not supported: ${lto_error}")
152+
endif()
153+
endif()
154+
message(STATUS "LTO/IPO is ${LTO_STATUS}")
155+
111156
# configure a header file to pass some of the CMake settings
112157
configure_file(
113158
${OPENROAD_HOME}/include/ord/Version.hh.cmake

MODULE.bazel

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ bazel_dep(name = "bazel-orfs")
146146
# To bump version, run: bazelisk run @bazel-orfs//:bump
147147
git_override(
148148
module_name = "bazel-orfs",
149-
commit = "1e862b169d97dc0fec5db106559640886e7fd7d0",
149+
commit = "0d60cb111de10491753102112223fb3799a98369",
150150
remote = "https://github.com/The-OpenROAD-Project/bazel-orfs.git",
151151
)
152152

@@ -155,10 +155,10 @@ orfs = use_extension("@bazel-orfs//:extension.bzl", "orfs_repositories")
155155
# To bump version, run: bazelisk run @bazel-orfs//:bump
156156
orfs.default(
157157
# Official image https://hub.docker.com/r/openroad/orfs/tags
158-
image = "docker.io/openroad/orfs:v3.0-4367-g79b6a48ab",
158+
image = "docker.io/openroad/orfs:v3.0-4512-g528ad3d8a",
159159
# Use OpenROAD of this repo instead of from the docker image
160160
openroad = "//:openroad",
161-
sha256 = "0d0dd3d8d346360a71f6325ce776a984c5a6296fc6e51956b53f136e1dd13462",
161+
sha256 = "087122e12c90edcb3ebfc452a3238417fbc78e1135f5b43feaf7162d885cada1",
162162
)
163163
use_repo(orfs, "com_github_nixos_patchelf_download")
164164
use_repo(orfs, "docker_orfs")

MODULE.bazel.lock

Lines changed: 5 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

etc/DependencyInstaller.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -819,7 +819,7 @@ _install_ubuntu_packages() {
819819
_execute "Installing base packages..." apt-get -y install --no-install-recommends \
820820
automake autotools-dev binutils bison build-essential ccache clang \
821821
debhelper devscripts flex g++ gcc git groff lcov libffi-dev libfl-dev \
822-
libgomp1 libomp-dev libpcre2-dev libpcre3-dev libreadline-dev pandoc \
822+
libgomp1 libomp-dev libpcre2-dev libreadline-dev pandoc \
823823
pkg-config python3-dev python3-click qt5-image-formats-plugins tcl tcl-dev tcl-tclreadline \
824824
tcllib unzip wget libyaml-cpp-dev zlib1g-dev tzdata
825825

@@ -858,7 +858,7 @@ _install_rhel_packages() {
858858
_execute "Installing EPEL release..." yum -y install "https://dl.fedoraproject.org/pub/epel/epel-release-latest-${rhel_version}.noarch.rpm"
859859
_execute "Installing base packages..." yum -y install \
860860
autoconf automake clang clang-devel gcc gcc-c++ gdb git glibc-devel \
861-
libffi-devel libtool llvm llvm-devel llvm-libs make pcre-devel \
861+
libffi-devel libtool llvm llvm-devel llvm-libs make \
862862
pcre2-devel pkg-config pkgconf pkgconf-m4 pkgconf-pkg-config python3 \
863863
python3-devel python3-pip python3-click qt5-qtbase-devel qt5-qtcharts-devel \
864864
qt5-qtimageformats readline tcl-devel tcl-tclreadline \
@@ -898,7 +898,7 @@ _install_opensuse_packages() {
898898
_execute "Installing base packages..." zypper -n install \
899899
binutils clang gcc gcc11-c++ git groff gzip lcov libffi-devel \
900900
libgomp1 libomp11-devel libpython3_6m1_0 libqt5-creator libqt5-qtbase \
901-
libqt5-qtstyleplugins libstdc++6-devel-gcc8 llvm pandoc pcre-devel \
901+
libqt5-qtstyleplugins libstdc++6-devel-gcc8 llvm pandoc \
902902
pcre2-devel pkg-config python3-devel python3-pip python3-click qimgv readline-devel tcl \
903903
tcl-devel tcllib wget yaml-cpp-devel zlib-devel
904904

@@ -946,7 +946,7 @@ _install_debian_packages() {
946946
_execute "Installing base packages..." apt-get -y install --no-install-recommends \
947947
automake autotools-dev binutils bison build-essential clang debhelper \
948948
devscripts flex g++ gcc git groff lcov libffi-dev libfl-dev libgomp1 \
949-
libomp-dev libpcre2-dev libpcre3-dev libreadline-dev "libtcl${tcl_ver}" \
949+
libomp-dev libpcre2-dev libreadline-dev "libtcl${tcl_ver}" \
950950
pandoc pkg-config python3-dev python3-click qt5-image-formats-plugins tcl-dev tcl-tclreadline \
951951
tcllib unzip wget libyaml-cpp-dev zlib1g-dev tzdata
952952

src/Exception-py.i

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
#endif
2424

2525
%exception {
26-
try { $function }
26+
try { $action }
2727
catch (std::bad_alloc &) {
2828
fprintf(stderr, "Error: out of memory.");
2929
abort();

src/Exception.i

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
%}
2626

2727
%exception {
28-
try { $function }
28+
try { $action }
2929
catch (std::bad_alloc &) {
3030
fprintf(stderr, "Error: out of memory.");
3131
abort();

src/ant/test/BUILD

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -25,21 +25,7 @@ filegroup(
2525
# but at least it is not a glob of everything and there are
2626
# per test glob patterns below.
2727
srcs = [
28-
"gcd_sky130.def",
2928
"helpers.tcl",
30-
"merged_spacing.lef",
31-
"sky130hs/sky130_fd_sc_hs__tt_025C_1v80.lib",
32-
"sky130hs/sky130_fd_sc_hs_merged.lef",
33-
"sky130hs/sky130hs.pdn.tcl",
34-
"sky130hs/sky130hs.rc",
35-
"sky130hs/sky130hs.rcx_rules",
36-
"sky130hs/sky130hs.tlef",
37-
"sky130hs/sky130hs.tracks",
38-
"sky130hs/sky130hs.vars",
39-
"sky130hs/sky130hs_ip_global.cfg",
40-
"sky130hs/sky130hs_std_cell.lef",
41-
"sky130hs/sky130hs_tt.lib",
42-
"sw130_random.def",
4329
],
4430
)
4531

@@ -55,6 +41,25 @@ filegroup(
5541
"ant_check.lef",
5642
"ant_check.def",
5743
],
44+
"check_api1": [
45+
"merged_spacing.lef",
46+
"sw130_random.def",
47+
],
48+
"check_drt1": [
49+
"merged_spacing.lef",
50+
"sw130_random.def",
51+
],
52+
"check_grt1": [
53+
"gcd_sky130.def",
54+
"sky130hs/sky130hs_tt.lib",
55+
"sky130hs/sky130hs_std_cell.lef",
56+
"sky130hs/sky130hs.tlef",
57+
],
58+
"no-check_grt1": [
59+
"gcd_sky130.def",
60+
"sky130hs/sky130hs_tt.lib",
61+
"sky130hs/sky130hs_std_cell.lef",
62+
],
5863
}.get(test_name, []),
5964
)
6065
for test_name in ALL_TESTS

src/cgt/test/BUILD

Lines changed: 21 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -16,52 +16,7 @@ filegroup(
1616
# but at least it is not a glob of everything and there are
1717
# per test glob patterns below.
1818
srcs = [
19-
"Nangate45/Nangate45.lef",
20-
"Nangate45/Nangate45.pdn.tcl",
21-
"Nangate45/Nangate45.rc",
22-
"Nangate45/Nangate45.rcx_rules",
23-
"Nangate45/Nangate45.tracks",
24-
"Nangate45/Nangate45.vars",
25-
"Nangate45/Nangate45_fast.lib",
26-
"Nangate45/Nangate45_lvt.lef",
27-
"Nangate45/Nangate45_lvt.lib",
28-
"Nangate45/Nangate45_slow.lib",
29-
"Nangate45/Nangate45_stdcell.lef",
30-
"Nangate45/Nangate45_tech.lef",
31-
"Nangate45/Nangate45_typ.lib",
32-
"Nangate45/fake_macros.lef",
33-
"Nangate45/fake_macros.lib",
34-
"Nangate45/fakeram45.cfg",
35-
"Nangate45/fakeram45_1024x32.lef",
36-
"Nangate45/fakeram45_1024x32.lib",
37-
"Nangate45/fakeram45_256x16.lef",
38-
"Nangate45/fakeram45_256x16.lib",
39-
"Nangate45/fakeram45_512x64.lef",
40-
"Nangate45/fakeram45_512x64.lib",
41-
"Nangate45/fakeram45_64x32.lef",
42-
"Nangate45/fakeram45_64x32.lib",
43-
"Nangate45/fakeram45_64x7.lef",
44-
"Nangate45/fakeram45_64x7.lib",
45-
"Nangate45/fakeram45_64x96.lef",
46-
"Nangate45/fakeram45_64x96.lib",
47-
"Nangate45/work_around_yosys/cells.v",
48-
"asap7/asap7_tech_1x_201209.lef",
49-
"asap7/asap7sc7p5t_28_R_1x_220121a.lef",
50-
"asap7/asap7sc7p5t_AO_RVT_FF_nldm_211120.lib.gz",
51-
"asap7/asap7sc7p5t_AO_RVT_SS_nldm_211120.lib.gz",
52-
"asap7/asap7sc7p5t_INVBUF_RVT_FF_nldm_220122.lib.gz",
53-
"asap7/asap7sc7p5t_INVBUF_RVT_SS_nldm_220122.lib.gz",
54-
"asap7/asap7sc7p5t_OA_RVT_FF_nldm_211120.lib.gz",
55-
"asap7/asap7sc7p5t_OA_RVT_SS_nldm_211120.lib.gz",
56-
"asap7/asap7sc7p5t_SEQ_RVT_FF_nldm_220123.lib",
57-
"asap7/asap7sc7p5t_SEQ_RVT_SS_nldm_220123.lib",
58-
"asap7/asap7sc7p5t_SIMPLE_RVT_FF_nldm_211120.lib.gz",
59-
"asap7/asap7sc7p5t_SIMPLE_RVT_SS_nldm_211120.lib.gz",
60-
"asap7/setRC.tcl",
6119
"helpers.tcl",
62-
"sky130hd/sky130_fd_sc_hd__ss_n40C_1v40.lib",
63-
"sky130hd/sky130hd.tlef",
64-
"sky130hd/sky130hd_std_cell.lef",
6520
],
6621
)
6722

@@ -71,7 +26,27 @@ filegroup(
7126
srcs = [":regression_resources"] + glob(
7227
[
7328
test_name + "*",
74-
],
29+
] + {
30+
"aes_nangate45": [
31+
"Nangate45/Nangate45.lef",
32+
"Nangate45/Nangate45_stdcell.lef",
33+
"Nangate45/Nangate45_typ.lib",
34+
],
35+
"countdown_asap7": [
36+
"asap7/asap7_tech_1x_201209.lef",
37+
"asap7/asap7sc7p5t_28_R_1x_220121a.lef",
38+
"asap7/asap7sc7p5t_AO_RVT_FF_nldm_211120.lib.gz",
39+
"asap7/asap7sc7p5t_INVBUF_RVT_FF_nldm_220122.lib.gz",
40+
"asap7/asap7sc7p5t_OA_RVT_FF_nldm_211120.lib.gz",
41+
"asap7/asap7sc7p5t_SEQ_RVT_FF_nldm_220123.lib",
42+
"asap7/asap7sc7p5t_SIMPLE_RVT_FF_nldm_211120.lib.gz",
43+
],
44+
"ibex_sky130hd": [
45+
"sky130hd/sky130_fd_sc_hd__ss_n40C_1v40.lib",
46+
"sky130hd/sky130hd.tlef",
47+
"sky130hd/sky130hd_std_cell.lef",
48+
],
49+
}.get(test_name, []),
7550
),
7651
)
7752
for test_name in TESTS

src/cmake/swig_lib.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ function(swig_lib)
109109
set_property(TARGET ${ARG_NAME} PROPERTY SWIG_COMPILE_OPTIONS -flatstaticmethod)
110110
endif()
111111

112-
swig_link_libraries(${ARG_NAME}
112+
target_link_libraries(${ARG_NAME}
113113
PUBLIC
114114
Python3::Python
115115
)

0 commit comments

Comments
 (0)