Skip to content

Commit d68bae8

Browse files
committed
Merge remote-tracking branch 'private/master' into gpl-filler-gcell-removal
2 parents 7b0410d + 9c4e436 commit d68bae8

15 files changed

Lines changed: 933 additions & 860 deletions

Jenkinsfile

Lines changed: 42 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -162,31 +162,6 @@ def getParallelTests(String image) {
162162
}
163163
},
164164

165-
'Build with Bazel': {
166-
node {
167-
withDockerContainer(args: '-u root -v /var/run/docker.sock:/var/run/docker.sock', image: image) {
168-
stage('Setup Bazel Build') {
169-
echo "Build with Bazel";
170-
sh label: 'Configure git', script: "git config --system --add safe.directory '*'";
171-
checkout scm;
172-
}
173-
stage('Bazel Build') {
174-
withCredentials([file(credentialsId: 'bazel-cache-sa', variable: 'GCS_SA_KEY')]) {
175-
timeout(time: 120, unit: 'MINUTES') {
176-
def cmd = 'bazelisk test --config=ci --show_timestamps --test_output=errors --curses=no --force_pic'
177-
178-
if (env.BRANCH_NAME != 'master') {
179-
cmd += ' --remote_upload_local_results=false'
180-
}
181-
182-
sh label: 'Bazel Build', script: cmd + ' --google_credentials=$GCS_SA_KEY ...'
183-
}
184-
}
185-
}
186-
}
187-
}
188-
},
189-
190165
'Check message IDs': {
191166
dir('src') {
192167
sh label: 'Find duplicated message IDs', script: '../etc/find_messages.py > messages.txt';
@@ -274,21 +249,31 @@ def getParallelTests(String image) {
274249
return ret;
275250
}
276251

277-
node {
278-
279-
def isDefaultBranch = (env.BRANCH_NAME == 'master')
280-
def daysToKeep = '20';
281-
def numToKeep = (isDefaultBranch ? '-1' : '10');
282-
283-
properties([
284-
buildDiscarder(logRotator(
285-
daysToKeepStr: daysToKeep,
286-
artifactDaysToKeepStr: daysToKeep,
252+
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+
sh label: 'Bazel Build', script: cmd + ' --google_credentials=$GCS_SA_KEY ...';
268+
}
269+
}
270+
}
271+
}
272+
}
273+
}
274+
}
287275

288-
numToKeepStr: numToKeep,
289-
artifactNumToKeepStr: numToKeep
290-
))
291-
]);
276+
def dockerTests = {
292277
stage('Checkout') {
293278
checkout scm;
294279
}
@@ -317,6 +302,24 @@ node {
317302
echo "Docker image is ${DOCKER_IMAGE}";
318303
}
319304
parallel(getParallelTests(DOCKER_IMAGE));
305+
}
306+
307+
node {
308+
def isDefaultBranch = (env.BRANCH_NAME == 'master')
309+
def daysToKeep = '20';
310+
def numToKeep = (isDefaultBranch ? '-1' : '10');
311+
properties([
312+
buildDiscarder(logRotator(
313+
daysToKeepStr: daysToKeep,
314+
artifactDaysToKeepStr: daysToKeep,
315+
numToKeepStr: numToKeep,
316+
artifactNumToKeepStr: numToKeep
317+
))
318+
]);
319+
parallel(
320+
"Bazel Tests": bazelTest,
321+
"Docker Tests": dockerTests
322+
);
320323
stage('Send Email Report') {
321324
sendEmail();
322325
}

MODULE.bazel

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ module(
77

88
bazel_dep(name = "platforms", version = "0.0.11")
99
bazel_dep(name = "bazel_skylib", version = "1.7.1")
10+
bazel_dep(name = "rules_cc", version = "0.1.2")
1011
bazel_dep(name = "rules_flex", version = "0.3.1")
1112
bazel_dep(name = "rules_bison", version = "0.3.1")
1213
bazel_dep(name = "rules_jvm_external", version = "6.4")
@@ -17,17 +18,6 @@ git_override(
1718
remote = "https://github.com/bazelbuild/rules_scala",
1819
)
1920

20-
# The current rules_cc 0.1.1 hardcodes script locations to `#!/bin/bash`
21-
# instead of using `#!/usr/bin/env bash`.
22-
# This is fixed by https://github.com/bazelbuild/rules_cc/pull/306 but
23-
# is not released yet. Use rules_cc from that commit.
24-
bazel_dep(name = "rules_cc", version = "0.1.1")
25-
git_override(
26-
module_name = "rules_cc",
27-
commit = "d74915024017250e46d95e91a3defc34174effe0",
28-
remote = "https://github.com/bazelbuild/rules_cc",
29-
)
30-
3121
bazel_dep(name = "rules_verilator", version = "5.034")
3222
single_version_override(
3323
module_name = "rules_verilator",

MODULE.bazel.lock

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

docker/Dockerfile.bazel

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
FROM ubuntu:24.04
2+
3+
ENV DEBIAN_FRONTEND=noninteractive
4+
5+
RUN apt-get -y update \
6+
&& apt-get -y install curl git
7+
8+
RUN curl -Lo bazelisk https://github.com/bazelbuild/bazelisk/releases/latest/download/bazelisk-linux-amd64 \
9+
&& chmod +x bazelisk \
10+
&& mv bazelisk /usr/local/bin/bazelisk
11+
12+
RUN install -m 0755 -d /etc/apt/keyrings \
13+
&& curl -fsSL https://download.docker.com/linux/ubuntu/gpg \
14+
-o /etc/apt/keyrings/docker.asc \
15+
&& chmod a+r /etc/apt/keyrings/docker.asc \
16+
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
17+
$(. /etc/os-release && echo "${VERSION_CODENAME}") stable" | \
18+
tee /etc/apt/sources.list.d/docker.list > /dev/null
19+
20+
RUN apt-get -y update \
21+
&& apt-get -y install --no-install-recommends \
22+
build-essential \
23+
clang \
24+
containerd.io \
25+
docker-buildx-plugin \
26+
docker-ce \
27+
docker-ce-cli \
28+
openjdk-21-jre-headless \
29+
python3 \
30+
python3-yaml \
31+
time

src/gpl/src/nesterovBase.cpp

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1110,6 +1110,10 @@ NesterovBaseCommon::NesterovBaseCommon(NesterovBaseVars nbVars,
11101110
gPinMap_[gPin.pin()] = &gPin;
11111111
if (gPin.pin()->isITerm()) {
11121112
db_iterm_to_index_map_[gPin.pin()->dbITerm()] = i;
1113+
} else if (gPin.pin()->isBTerm()) {
1114+
db_bterm_to_index_map_[gPin.pin()->dbBTerm()] = i;
1115+
} else {
1116+
debugPrint(log_, GPL, "callbacks", 1, "gPin neither bterm or iterm!");
11131117
}
11141118
}
11151119

@@ -1405,7 +1409,8 @@ FloatPoint NesterovBaseCommon::getWireLengthGradientPinWA(const GPin* gPin,
14051409
GPL,
14061410
"getGradientWAPin",
14071411
1,
1408-
"gradient: X[{:g} {:g}] Y[{:g} {:g}]",
1412+
"{}, X[{:g} {:g}] Y[{:g} {:g}]",
1413+
gPin->gCell()->name(),
14091414
gradientMinX,
14101415
gradientMaxX,
14111416
gradientMinY,
@@ -1540,13 +1545,18 @@ void NesterovBaseCommon::fixPointers()
15401545
gPins_.clear();
15411546
gPinMap_.clear();
15421547
db_iterm_to_index_map_.clear();
1548+
db_bterm_to_index_map_.clear();
15431549
gPins_.reserve(gPinStor_.size());
15441550
for (size_t i = 0; i < gPinStor_.size(); ++i) {
15451551
GPin& gPin = gPinStor_[i];
15461552
gPins_.push_back(&gPin);
15471553
gPinMap_[gPin.pin()] = &gPin;
15481554
if (gPin.pin()->isITerm()) {
15491555
db_iterm_to_index_map_[gPin.pin()->dbITerm()] = i;
1556+
} else if (gPin.pin()->isBTerm()) {
1557+
db_bterm_to_index_map_[gPin.pin()->dbBTerm()] = i;
1558+
} else {
1559+
debugPrint(log_, GPL, "callbacks", 1, "gPin neither bterm or iterm!");
15501560
}
15511561
}
15521562

@@ -1565,6 +1575,7 @@ void NesterovBaseCommon::fixPointers()
15651575
if (gCell.isFiller()) {
15661576
continue;
15671577
}
1578+
15681579
gCell.clearGPins();
15691580
for (Instance* inst : gCell.insts()) {
15701581
for (odb::dbITerm* iterm : inst->dbInst()->getITerms()) {
@@ -1632,6 +1643,26 @@ void NesterovBaseCommon::fixPointers()
16321643
}
16331644
}
16341645
}
1646+
1647+
for (odb::dbBTerm* bterm : gNet.net()->dbNet()->getBTerms()) {
1648+
if (isValidSigType(bterm->getSigType())) {
1649+
auto it = db_bterm_to_index_map_.find(bterm);
1650+
if (it != db_bterm_to_index_map_.end()) {
1651+
size_t gpin_index = it->second;
1652+
gNet.addGPin(&gPinStor_[gpin_index]);
1653+
if (gPinStor_[gpin_index].gCell()) {
1654+
gPinStor_[gpin_index].gCell()->addGPin(&gPinStor_[gpin_index]);
1655+
}
1656+
} else {
1657+
debugPrint(log_,
1658+
GPL,
1659+
"callbacks",
1660+
1,
1661+
"warning: gpin not found for BTerm: {}",
1662+
bterm->getName());
1663+
}
1664+
}
1665+
}
16351666
}
16361667
}
16371668

@@ -3532,7 +3563,6 @@ void NesterovBaseCommon::destroyCbkGNet(odb::dbNet* db_net)
35323563
}
35333564

35343565
void NesterovBaseCommon::destroyCbkITerm(odb::dbITerm* db_iterm)
3535-
35363566
{
35373567
debugPrint(log_, GPL, "callbacks", 2, "NesterovBaseCommon::destroyITerm");
35383568
auto db_it = db_iterm_to_index_map_.find(db_iterm);

src/gpl/src/nesterovBase.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -915,6 +915,7 @@ class NesterovBaseCommon
915915
std::unordered_map<odb::dbInst*, size_t> db_inst_to_nbc_index_map_;
916916
std::unordered_map<odb::dbNet*, size_t> db_net_to_index_map_;
917917
std::unordered_map<odb::dbITerm*, size_t> db_iterm_to_index_map_;
918+
std::unordered_map<odb::dbBTerm*, size_t> db_bterm_to_index_map_;
918919

919920
// These three deques should not be required if placerBase allows for dynamic
920921
// modifications on its vectors.

0 commit comments

Comments
 (0)