Skip to content

Commit 7d6e164

Browse files
committed
Merge remote-tracking branch 'private/master' into gpl-update-large-tests
2 parents 0ceb946 + 3ed3271 commit 7d6e164

File tree

30 files changed

+579
-448
lines changed

30 files changed

+579
-448
lines changed

.bazelrc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ test --build_tests_only
7575
build --jobs=200
7676

7777
# Enable local disk caching to supplement the remote cache.
78-
# The location can be overridden by setting the OPENROAD_BAZEL_CACHE env variable.
79-
build --disk_cache=$(OPENROAD_BAZEL_CACHE:-~/.cache/bazel-disk-cache)
78+
build --disk_cache=~/.cache/bazel-disk-cache
79+
build --repository_cache=~/.cache/bazel-repository-cache
8080

8181
# --- CI Settings (write access) ---
8282
build:ci --remote_cache=https://storage.googleapis.com/openroad-bazel-cache
@@ -94,5 +94,7 @@ build:openroad-dev --remote_upload_local_results=false
9494
# Developers need the actual output files to run and use them.
9595
build:openroad-dev --remote_download_toplevel
9696
build:openroad-dev --google_default_credentials=true
97+
build:openroad-dev --disk_cache=/workspace/.cache/bazel-disk-cache
98+
build:openroad-dev --repository_cache=/workspace/.cache/bazel-repository-cache
9799

98100
try-import %workspace%/user.bazelrc

Jenkinsfile

Lines changed: 20 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -250,27 +250,25 @@ def getParallelTests(String image) {
250250
}
251251

252252
def bazelTest = {
253-
stage ('Build with Bazel') {
254-
node {
255-
stage('Setup Bazel Build') {
256-
checkout scm;
257-
sh label: 'Setup Docker Image', script: 'docker build -f docker/Dockerfile.bazel -t openroad/bazel-ci .';
258-
}
259-
withDockerContainer(args: '-u root -v /var/run/docker.sock:/var/run/docker.sock', image: 'openroad/bazel-ci:latest') {
260-
stage('Bazel Build') {
261-
withCredentials([file(credentialsId: 'bazel-cache-sa', variable: 'GCS_SA_KEY')]) {
262-
timeout(time: 120, unit: 'MINUTES') {
263-
def cmd = 'bazelisk test --config=ci --show_timestamps --test_output=errors --curses=no --force_pic';
264-
if (env.BRANCH_NAME != 'master') {
265-
cmd += ' --remote_upload_local_results=false';
266-
}
267-
cmd += ' --google_credentials=$GCS_SA_KEY';
268-
try {
269-
sh label: 'Bazel Build', script: cmd + ' ...';
270-
} catch (e) {
271-
currentBuild.result = 'FAILURE';
272-
sh label: 'Bazel Build (keep_going)', script: cmd + ' --keep_going ...';
273-
}
253+
node {
254+
stage('Setup') {
255+
checkout scm;
256+
sh label: 'Setup Docker Image', script: 'docker build -f docker/Dockerfile.bazel -t openroad/bazel-ci .';
257+
}
258+
withDockerContainer(args: '-u root -v /var/run/docker.sock:/var/run/docker.sock', image: 'openroad/bazel-ci:latest') {
259+
stage('bazelisk test ...') {
260+
withCredentials([file(credentialsId: 'bazel-cache-sa', variable: 'GCS_SA_KEY')]) {
261+
timeout(time: 120, unit: 'MINUTES') {
262+
def cmd = 'bazelisk test --config=ci --show_timestamps --test_output=errors --curses=no --force_pic';
263+
if (env.BRANCH_NAME != 'master') {
264+
cmd += ' --remote_upload_local_results=false';
265+
}
266+
cmd += ' --google_credentials=$GCS_SA_KEY';
267+
try {
268+
sh label: 'Bazel Build', script: cmd + ' ...';
269+
} catch (e) {
270+
currentBuild.result = 'FAILURE';
271+
sh label: 'Bazel Build (keep_going)', script: cmd + ' --keep_going ...';
274272
}
275273
}
276274
}
@@ -323,7 +321,7 @@ node {
323321
))
324322
]);
325323
parallel(
326-
"Bazel Tests": bazelTest,
324+
"Bazel": bazelTest,
327325
"Docker Tests": dockerTests
328326
);
329327
stage('Send Email Report') {

bazel/openmp/bundled.BUILD.bazel

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ cc_library(
8585
"runtime/src/ompt-event-specific.h",
8686
"runtime/src/ompt-general.cpp",
8787
"runtime/src/ompt-internal.h",
88-
"runtime/src/ompt-specific.cpp",
8988
"runtime/src/ompt-specific.h",
9089
"runtime/src/test-touch.c",
9190
"runtime/src/z_Linux_asm.S",

etc/DependencyInstaller.sh

Lines changed: 24 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ _equivalenceDeps() {
2222
cd yosys
2323
# use of no-register flag is required for some compilers,
2424
# e.g., gcc and clang from RHEL8
25-
make -j $(nproc) PREFIX="${yosysPrefix}" ABC_ARCHFLAGS=-Wno-register
25+
make -j ${numThreads} PREFIX="${yosysPrefix}" ABC_ARCHFLAGS=-Wno-register
2626
make install
2727
) fi
2828

@@ -33,7 +33,7 @@ _equivalenceDeps() {
3333
git clone --depth=1 -b "${yosysVersion}" https://github.com/YosysHQ/eqy
3434
cd eqy
3535
export PATH="${yosysPrefix}/bin:${PATH}"
36-
make -j $(nproc) PREFIX="${eqyPrefix}"
36+
make -j ${numThreads} PREFIX="${eqyPrefix}"
3737
make install PREFIX="${eqyPrefix}"
3838
)
3939
fi
@@ -45,7 +45,7 @@ _equivalenceDeps() {
4545
git clone --depth=1 -b "${yosysVersion}" --recursive https://github.com/YosysHQ/sby
4646
cd sby
4747
export PATH="${eqyPrefix}/bin:${PATH}"
48-
make -j $(nproc) PREFIX="${sbyPrefix}" install
48+
make -j ${numThreads} PREFIX="${sbyPrefix}" install
4949
)
5050
fi
5151
}
@@ -64,8 +64,8 @@ _installCommonDev() {
6464
cmakeVersionSmall=${cmakeVersionBig}.6
6565
pcreVersion=10.42
6666
pcreChecksum="37d2f77cfd411a3ddf1c64e1d72e43f7"
67-
swigVersion=4.1.0
68-
swigChecksum="794433378154eb61270a3ac127d9c5f3"
67+
swigVersion=4.3.0
68+
swigChecksum="9f74c7f402aa28d9f75e67d1990ee6fb"
6969
boostVersionBig=1.86
7070
boostVersionSmall=${boostVersionBig}.0
7171
boostChecksum="ac857d73bb754b718a039830b07b9624"
@@ -112,7 +112,7 @@ _installCommonDev() {
112112
tar xf bison-${bisonVersion}.tar.gz
113113
cd bison-${bisonVersion}
114114
./configure --prefix=${bisonPrefix}
115-
make -j install
115+
make -j ${numThreads} install
116116
echo "bison ${bisonVersion} installed (from ${bisonInstalledVersion})."
117117
else
118118
echo "bison ${bisonVersion} already installed."
@@ -128,8 +128,8 @@ _installCommonDev() {
128128
tar xf flex-${flexVersion}.tar.gz
129129
cd flex-${flexVersion}
130130
./configure --prefix=${flexPrefix}
131-
make -j $(nproc)
132-
make -j $(nproc) install
131+
make -j ${numThreads}
132+
make -j ${numThreads} install
133133
else
134134
echo "Flex already installed."
135135
fi
@@ -154,8 +154,8 @@ _installCommonDev() {
154154
fi
155155
./autogen.sh
156156
./configure --prefix=${swigPrefix}
157-
make -j $(nproc)
158-
make -j $(nproc) install
157+
make -j ${numThreads}
158+
make -j ${numThreads} install
159159
else
160160
echo "Swig already installed."
161161
fi
@@ -171,7 +171,7 @@ _installCommonDev() {
171171
tar -xf boost_${boostVersionUnderscore}.tar.gz
172172
cd boost_${boostVersionUnderscore}
173173
./bootstrap.sh --prefix="${boostPrefix}"
174-
./b2 install --with-iostreams --with-test --with-serialization --with-system --with-thread -j $(nproc)
174+
./b2 install --with-iostreams --with-test --with-serialization --with-system --with-thread -j ${numThreads}
175175
else
176176
echo "Boost already installed."
177177
fi
@@ -184,7 +184,7 @@ _installCommonDev() {
184184
git clone --depth=1 -b ${eigenVersion} https://gitlab.com/libeigen/eigen.git
185185
cd eigen
186186
${cmakePrefix}/bin/cmake -DCMAKE_INSTALL_PREFIX="${eigenPrefix}" -B build .
187-
${cmakePrefix}/bin/cmake --build build -j $(nproc) --target install
187+
${cmakePrefix}/bin/cmake --build build -j ${numThreads} --target install
188188
else
189189
echo "Eigen already installed."
190190
fi
@@ -198,7 +198,7 @@ _installCommonDev() {
198198
cd cudd
199199
autoreconf
200200
./configure --prefix=${cuddPrefix}
201-
make -j $(nproc) install
201+
make -j ${numThreads} install
202202
else
203203
echo "Cudd already installed."
204204
fi
@@ -223,7 +223,7 @@ _installCommonDev() {
223223
git clone --depth=1 -b ${lemonVersion} https://github.com/The-OpenROAD-Project/lemon-graph.git
224224
cd lemon-graph
225225
${cmakePrefix}/bin/cmake -DCMAKE_INSTALL_PREFIX="${lemonPrefix}" -B build .
226-
${cmakePrefix}/bin/cmake --build build -j $(nproc) --target install
226+
${cmakePrefix}/bin/cmake --build build -j ${numThreads} --target install
227227
else
228228
echo "Lemon already installed."
229229
fi
@@ -240,7 +240,7 @@ _installCommonDev() {
240240
git clone --depth=1 -b "v${spdlogVersion}" https://github.com/gabime/spdlog.git
241241
cd spdlog
242242
${cmakePrefix}/bin/cmake -DCMAKE_INSTALL_PREFIX="${spdlogPrefix}" -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DSPDLOG_BUILD_EXAMPLE=OFF -B build .
243-
${cmakePrefix}/bin/cmake --build build -j $(nproc) --target install
243+
${cmakePrefix}/bin/cmake --build build -j ${numThreads} --target install
244244
echo "spdlog ${spdlogVersion} installed (from ${spdlogInstalledVersion})."
245245
else
246246
echo "spdlog ${spdlogVersion} already installed."
@@ -329,7 +329,7 @@ _installOrTools() {
329329
git clone --depth=1 -b "v${orToolsVersionBig}" https://github.com/google/or-tools.git
330330
cd or-tools
331331
${cmakePrefix}/bin/cmake -S. -Bbuild -DBUILD_DEPS:BOOL=ON -DBUILD_EXAMPLES:BOOL=OFF -DBUILD_SAMPLES:BOOL=OFF -DBUILD_TESTING:BOOL=OFF -DCMAKE_INSTALL_PREFIX=${orToolsPath} -DCMAKE_CXX_FLAGS="-w" -DCMAKE_C_FLAGS="-w"
332-
${cmakePrefix}/bin/cmake --build build --config Release --target install -v -j $(nproc)
332+
${cmakePrefix}/bin/cmake --build build --config Release --target install -v -j ${numThreads}
333333
else
334334
if [[ $osVersion == rodete ]]; then
335335
osVersion=11
@@ -587,16 +587,13 @@ Then, rerun this script.
587587
EOF
588588
exit 1
589589
fi
590-
brew install bison boost cmake eigen flex fmt groff libomp or-tools pandoc pyqt5 python spdlog tcl-tk zlib
590+
brew install bison boost cmake eigen flex fmt groff libomp or-tools pandoc pyqt5 python spdlog tcl-tk zlib swig
591591

592592
# Some systems need this to correctly find OpenMP package during build
593593
brew link --force libomp
594594

595595
# Lemon is not in the homebrew-core repo
596596
brew install The-OpenROAD-Project/lemon-graph/lemon-graph
597-
598-
# Install swig 4.1.1
599-
_installHomebrewPackage "swig" "c83c8aaa6505c3ea28c35bc45a54234f79e46c5d" "s/"
600597
}
601598

602599
_installDebianCleanUp() {
@@ -774,6 +771,9 @@ Usage: $0 -all
774771
$0 -constant-build-dir
775772
# Use constant build directory, instead of
776773
# random one.
774+
$0 -threads=<N> #
775+
# Limit number of compiling threads. Default is
776+
# all available numThreads.
777777
778778
EOF
779779
exit "${1:-1}"
@@ -786,6 +786,7 @@ isLocal="false"
786786
equivalenceDeps="no"
787787
CI="no"
788788
saveDepsPrefixes=""
789+
numThreads=$(nproc)
789790
# temp dir to download and compile
790791
baseDir=$(mktemp -d /tmp/DependencyInstaller-XXXXXX)
791792

@@ -862,6 +863,9 @@ while [ "$#" -gt 0 ]; do
862863
-save-deps-prefixes=*)
863864
saveDepsPrefixes=$(realpath ${1#-save-deps-prefixes=})
864865
;;
866+
-threads=*)
867+
numThreads=${1}
868+
;;
865869
*)
866870
echo "unknown option: ${1}" >&2
867871
_help

src/cts/BUILD

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ cc_library(
2424
"src/Util.h",
2525
],
2626
visibility = ["//visibility:private"],
27+
deps = ["//src/sta:opensta_lib"],
2728
)
2829

2930
cc_library(
@@ -77,6 +78,7 @@ cc_library(
7778
],
7879
includes = ["include"],
7980
deps = [
81+
":cts",
8082
":private_hdrs",
8183
"//:ord",
8284
"//src/dbSta",

src/cts/src/TritonCTS.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2359,7 +2359,7 @@ bool TritonCTS::propagateClock(odb::dbITerm* input)
23592359

23602360
// Clock Gater / Latch improvised as clock gater
23612361
if (inputPort) {
2362-
return inputPort->isClockGateClock() || libertyCell->isLatchData(inputPort);
2362+
return inputPort->isClockGateClock() || inputPort->isLatchData();
23632363
}
23642364

23652365
return false;

src/cts/test/BUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,8 @@ cc_test(
166166
linkstatic = True, # TODO: remove once deps define all symbols
167167
deps = [
168168
"//src/cts",
169-
"//src/grt",
170169
"//src/utl",
170+
"//src/grt", # work around cyclic dependncy between rsz and grt
171171
"@googletest//:gtest",
172172
"@googletest//:gtest_main",
173173
],

src/dbSta/src/dbSta.cc

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,9 @@ class dbStaCbk : public dbBlockCallBackObj
166166
void inDbBTermSetSigType(dbBTerm* bterm, const dbSigType& sig_type) override;
167167

168168
private:
169+
// for inDbInstSwapMasterBefore/inDbInstSwapMasterAfter
170+
bool swap_master_arcs_equiv_ = false;
171+
169172
dbSta* sta_;
170173
dbNetwork* network_ = nullptr;
171174
Logger* logger_;
@@ -724,17 +727,10 @@ void dbSta::deleteInstance(Instance* inst)
724727

725728
void dbSta::replaceCell(Instance* inst, Cell* to_cell, LibertyCell* to_lib_cell)
726729
{
730+
// do not call `Sta::replaceCell` as sta's before/after hooks are called
731+
// from db callbacks
727732
NetworkEdit* network = networkCmdEdit();
728-
LibertyCell* from_lib_cell = network->libertyCell(inst);
729-
if (sta::equivCells(from_lib_cell, to_lib_cell)) {
730-
replaceEquivCellBefore(inst, to_lib_cell);
731-
network->replaceCell(inst, to_cell);
732-
replaceEquivCellAfter(inst);
733-
} else {
734-
replaceCellBefore(inst, to_lib_cell);
735-
network->replaceCell(inst, to_cell);
736-
replaceCellAfter(inst);
737-
}
733+
network->replaceCell(inst, to_cell);
738734
}
739735

740736
void dbSta::deleteNet(Net* net)
@@ -933,20 +929,25 @@ void dbStaCbk::inDbInstSwapMasterBefore(dbInst* inst, dbMaster* master)
933929
LibertyCell* to_lib_cell = network_->libertyCell(network_->dbToSta(master));
934930
LibertyCell* from_lib_cell = network_->libertyCell(inst);
935931
Instance* sta_inst = network_->dbToSta(inst);
936-
if (sta::equivCells(from_lib_cell, to_lib_cell)) {
932+
933+
swap_master_arcs_equiv_ = sta::equivCellsArcs(from_lib_cell, to_lib_cell);
934+
935+
if (swap_master_arcs_equiv_) {
937936
sta_->replaceEquivCellBefore(sta_inst, to_lib_cell);
938937
} else {
939-
logger_->error(STA,
940-
1000,
941-
"instance {} swap master {} is not equivalent",
942-
inst->getConstName(),
943-
master->getConstName());
938+
sta_->replaceCellBefore(sta_inst, to_lib_cell);
944939
}
945940
}
946941

947942
void dbStaCbk::inDbInstSwapMasterAfter(dbInst* inst)
948943
{
949-
sta_->replaceEquivCellAfter(network_->dbToSta(inst));
944+
Instance* sta_inst = network_->dbToSta(inst);
945+
946+
if (swap_master_arcs_equiv_) {
947+
sta_->replaceEquivCellAfter(sta_inst);
948+
} else {
949+
sta_->replaceCellAfter(sta_inst);
950+
}
950951
}
951952

952953
void dbStaCbk::inDbNetDestroy(dbNet* db_net)

src/dft/BUILD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ cc_library(
5252
"include",
5353
],
5454
deps = [
55+
":dft",
5556
"//:ord",
5657
"//src/dbSta",
5758
"//src/dft/src/architect",

src/drt/BUILD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,7 @@ cc_library(
270270
],
271271
deps = [
272272
":db_hdrs",
273+
":drt",
273274
"//:ord",
274275
"//src/dst",
275276
"//src/gui",

0 commit comments

Comments
 (0)