Skip to content

Commit 30a92f4

Browse files
committed
Merge branch 'master' into speedup1
2 parents 6122d1c + d34d035 commit 30a92f4

19 files changed

Lines changed: 687 additions & 2024 deletions
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Quarterly Release Tag
2+
3+
on:
4+
schedule:
5+
# Midnight UTC on the first day of each quarter (Jan, Apr, Jul, Oct)
6+
- cron: '0 0 1 1,4,7,10 *'
7+
workflow_dispatch:
8+
9+
concurrency:
10+
group: quarterly-tag
11+
cancel-in-progress: false
12+
13+
jobs:
14+
create-tag:
15+
name: Create quarterly tag
16+
runs-on: ubuntu-latest
17+
permissions:
18+
contents: write
19+
steps:
20+
- name: Checkout repository
21+
uses: actions/checkout@v4
22+
23+
- name: Determine tag name
24+
id: tag
25+
run: |
26+
month=$(date -u +%-m)
27+
year=$(date -u +%y)
28+
case $month in
29+
1|2|3) quarter=1 ;;
30+
4|5|6) quarter=2 ;;
31+
7|8|9) quarter=3 ;;
32+
10|11|12) quarter=4 ;;
33+
esac
34+
tag="${year}Q${quarter}"
35+
echo "tag=$tag" >> "$GITHUB_OUTPUT"
36+
echo "Quarterly tag: $tag"
37+
38+
- name: Configure git user
39+
run: |
40+
git config user.name "github-actions[bot]"
41+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
42+
43+
- name: Create and push tag
44+
env:
45+
TAG: ${{ steps.tag.outputs.tag }}
46+
run: |
47+
if git ls-remote --tags origin "refs/tags/$TAG" | grep -q .; then
48+
echo "Tag $TAG already exists, skipping."
49+
exit 0
50+
fi
51+
git tag --annotate "$TAG" -m "Quarterly release $TAG"
52+
git push origin "$TAG"

BUILD.bazel

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,21 @@ OPENROAD_DEFINES = [
160160
"ABC_NAMESPACE=abc",
161161
]
162162

163+
cc_library(
164+
name = "tcl_readline_setup",
165+
srcs = ["src/tcl_readline_setup.cc"],
166+
hdrs = ["src/tcl_readline_setup.h"],
167+
visibility = ["//src/sta:__pkg__"],
168+
deps = [
169+
"@tcl_lang//:tcl",
170+
# tclreadline: provides ENABLE_READLINE define + links libtclreadline.
171+
# On systems without tclreadline these are empty stub targets (no-op).
172+
# See: https://github.com/The-OpenROAD-Project/OpenROAD/issues/7115
173+
"@tclreadline",
174+
"@tclreadline//:tclreadline_defs",
175+
],
176+
)
177+
163178
cc_binary(
164179
name = "openroad",
165180
srcs = [
@@ -177,19 +192,15 @@ cc_binary(
177192
":openroad_version",
178193
":opt_notification",
179194
":ord",
195+
":tcl_readline_setup",
180196
"//bazel:tcl_library_init",
181-
"@rules_cc//cc/runfiles", # sets BAZEL_CURRENT_REPOSITORY
182197
"//src/cut",
183198
"//src/gui",
184199
"//src/sta:opensta_lib",
185200
"//src/utl",
186201
"@boost.stacktrace",
202+
"@rules_cc//cc/runfiles", # sets BAZEL_CURRENT_REPOSITORY
187203
"@tcl_lang//:tcl",
188-
# tclreadline: provides ENABLE_READLINE define + links libtclreadline.
189-
# On systems without tclreadline these are empty stub targets (no-op).
190-
# See: https://github.com/The-OpenROAD-Project/OpenROAD/issues/7115
191-
"@tclreadline",
192-
"@tclreadline//:tclreadline_defs",
193204
],
194205
)
195206

etc/bazel-make-compilation-db.sh

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,9 @@ cat >> compile_flags.txt <<EOF
7070
-DBUILD_GUI=true
7171
EOF
7272

73-
# If there are two styles of comp-dbs, tools might have issues. Warn user.
74-
if [ -r compile_commands.json ]; then
75-
printf "\n\033[1;31mSuggest to remove old compile_commands.json to not interfere with compile_flags.txt\033[0m\n\n"
76-
fi
73+
# If there are two styles of comp-dbs, tools might choose wrong one. Warn user.
74+
for f in compile_commands.json build/compile_commands.json ; do
75+
if [ -r "$f" ]; then
76+
printf "\n\033[1;31mSuggest to remove old %s to not interfere with compile_flags.txt\033[0m\n\n" "$f"
77+
fi
78+
done

src/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ set(OPENROAD_SOURCE
3232
Design.cc
3333
Timing.cc
3434
Tech.cc
35+
tcl_readline_setup.cc
3536
OpenRoad.cc
3637
Main.cc
3738
)

src/Main.cc

Lines changed: 5 additions & 99 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,6 @@
1818

1919
#include "boost/stacktrace/stacktrace.hpp"
2020
#include "tcl.h"
21-
#ifdef ENABLE_READLINE
22-
// If you get an error on this include be sure you have
23-
// the package tcl-tclreadline-devel installed
24-
#include "tclreadline.h"
25-
#endif
2621
#ifdef ENABLE_PYTHON3
2722
#define PY_SSIZE_T_CLEAN
2823
#include "Python.h"
@@ -47,6 +42,8 @@
4742
#include "bazel/tcl_library_init.h"
4843
#endif
4944

45+
#include "tcl_readline_setup.h"
46+
5047
using sta::findCmdLineFlag;
5148
using sta::findCmdLineKey;
5249
using sta::sourceTclFile;
@@ -317,90 +314,7 @@ int main(int argc, char* argv[])
317314
}
318315

319316
#ifdef ENABLE_READLINE
320-
// A stopgap fallback from the hardcoded TCLRL_LIBRARY path for OpenROAD,
321-
// not essential for OpenSTA
322-
static std::string findPathToTclreadlineInit(Tcl_Interp* interp)
323-
{
324-
// TL;DR it is possible to run the OpenROAD binary from within the
325-
// official Docker image on a different distribution than the
326-
// distribution within the Docker image.
327-
//
328-
// In this case we have to look up
329-
// the location of the tclreadline scripts instead of using the hardcoded
330-
// path.
331-
//
332-
// It is helpful to use the official Docker image as CI infrastructure and
333-
// also because it is a good way to have as similar an environment as possible
334-
// during testing and deployment.
335-
//
336-
// See
337-
// https://github.com/The-OpenROAD-Project/bazel-orfs/blob/main/docker.BUILD.bazel
338-
// for the details on how this is done.
339-
//
340-
// Running Docker within a bazel isolated environment introduces lots of
341-
// problems and is not really done.
342-
const char* tcl_script = R"(
343-
namespace eval temp {
344-
# Check standard Bazel runfiles relative path
345-
set runfiles_path [file join [pwd] "external/tclreadline/tclreadlineInit.tcl"]
346-
if {[file exists $runfiles_path]} {
347-
return $runfiles_path
348-
}
349-
350-
# Check Bazel runfiles in adjacent directories for other run strategies
351-
set runfiles_execroot_path [file join [pwd] "../tclreadline/tclreadlineInit.tcl"]
352-
if {[file exists $runfiles_execroot_path]} {
353-
return $runfiles_execroot_path
354-
}
355-
356-
foreach dir $::auto_path {
357-
set folder [file join $dir]
358-
set path [file join $folder "tclreadline)" TCLRL_VERSION_STR
359-
R"(" "tclreadlineInit.tcl"]
360-
if {[file exists $path]} {
361-
return $path
362-
}
363-
}
364-
error "tclreadlineInit.tcl not found in any of the directories in auto_path"
365-
}
366-
)";
367-
368-
if (Tcl_Eval(interp, tcl_script) == TCL_ERROR) {
369-
std::cerr << "Tcl_Eval failed: " << Tcl_GetStringResult(interp) << '\n';
370-
return "";
371-
}
372-
373-
return Tcl_GetStringResult(interp);
374-
}
375-
376-
static bool TryReadlineStaticInit(Tcl_Interp* interp)
377-
{
378-
Tcl_StaticPackage(
379-
interp, "tclreadline", Tclreadline_Init, Tclreadline_SafeInit);
380-
381-
return Tcl_EvalFile(interp, TCLRL_LIBRARY "/tclreadlineInit.tcl") == TCL_OK;
382-
}
383-
384-
static bool TryTclBazelInit(Tcl_Interp* interp)
385-
{
386-
// Here, ::tclreadline::library is already set up by SetupTclEnvironment
387-
constexpr char kInitializeReadlineLib[] = R"(
388-
set ::tclreadline::setup_path [file join $::tclreadline::library "tclreadlineSetup.tcl"]
389-
set ::tclreadline::completer_path [file join $::tclreadline::library "tclreadlineCompleter.tcl"]
390-
if {[info commands history] == ""} { proc history {args} {} };
391-
source [file join $::tclreadline::library "tclreadlineInit.tcl"]
392-
)";
393-
394-
return Tcl_Eval(interp, kInitializeReadlineLib) == TCL_OK;
395-
}
396-
397-
static bool TrySearchPathManuallyInit(Tcl_Interp* interp)
398-
{
399-
const std::string path = findPathToTclreadlineInit(interp);
400-
return !path.empty() && Tcl_EvalFile(interp, path.c_str()) == TCL_OK;
401-
}
402-
403-
static int tclReadlineInit(Tcl_Interp* interp)
317+
static int tclOrdReadlineInit(Tcl_Interp* interp)
404318
{
405319
std::array<const char*, 2> readline_cmds
406320
= {"ord::setup_tclreadline", "::tclreadline::Loop"};
@@ -452,19 +366,11 @@ static int tclAppInit(int& argc,
452366
}
453367
#endif
454368

455-
#ifdef ENABLE_READLINE
456369
if (!exit_after_cmd_file) {
457-
if (Tclreadline_Init(interp) == TCL_ERROR) {
458-
return TCL_ERROR;
459-
}
460-
461-
if (!TryReadlineStaticInit(interp) && //
462-
!TryTclBazelInit(interp) && //
463-
!TrySearchPathManuallyInit(interp)) {
370+
if (ord::SetupTclReadlineLibrary(interp) == TCL_ERROR) {
464371
printf("Failed to load tclreadline\n");
465372
}
466373
}
467-
#endif
468374

469375
ord::initOpenRoad(
470376
interp, log_filename, metrics_filename, exit_after_cmd_file);
@@ -545,7 +451,7 @@ static int tclAppInit(int& argc,
545451
}
546452
#ifdef ENABLE_READLINE
547453
if (!gui::Gui::enabled() && !exit_after_cmd_file) {
548-
return tclReadlineInit(interp);
454+
return tclOrdReadlineInit(interp);
549455
}
550456
#endif
551457
return TCL_OK;

src/cts/src/TechChar.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
#include "sta/Sdc.hh"
3333
#include "sta/Search.hh"
3434
#include "sta/SearchClass.hh"
35+
#include "sta/StringUtil.hh"
3536
#include "sta/TableModel.hh"
3637
#include "sta/TimingArc.hh"
3738
#include "sta/TimingModel.hh"

src/drt/src/dr/FlexDR_init.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2732,16 +2732,12 @@ void FlexDRWorker::initMazeCost_fixedObj(const frDesign* design)
27322732
switch (obj->typeId()) {
27332733
case frcBTerm: { // term no bloat
27342734
auto* net = static_cast<frBTerm*>(obj)->getNet();
2735-
if (net != nullptr) {
2736-
frNet2Terms[net].insert(obj);
2737-
}
2735+
frNet2Terms[net].insert(obj);
27382736
break;
27392737
}
27402738
case frcInstTerm: {
27412739
auto* net = static_cast<frInstTerm*>(obj)->getNet();
2742-
if (net != nullptr) {
2743-
frNet2Terms[net].insert(obj);
2744-
}
2740+
frNet2Terms[net].insert(obj);
27452741
if (isRoutingLayer) {
27462742
// unblock planar edge for obs over pin, ap will unblock via edge
27472743
// for legal pin access

src/drt/test/down_access_term.defok

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,20 +39,20 @@ NETS 1 ;
3939
NEW met1 ( 135120 155955 ) ( * 158175 )
4040
NEW met1 ( 112080 155955 ) ( 135120 * )
4141
NEW met1 ( 112080 155215 ) ( * 155955 )
42-
NEW met1 ( 1680 155215 ) ( 112080 * )
43-
NEW met1 ( 144720 158175 ) ( 145200 * )
42+
NEW met1 ( 135600 158175 ) ( 144240 * )
43+
NEW met1 ( 144240 158175 ) ( 145200 * )
4444
NEW met2 ( 145200 144855 ) ( * 158175 )
45-
NEW met1 ( 135600 158175 ) ( 144720 * )
45+
NEW met1 ( 1680 155215 ) ( 112080 * )
46+
NEW li1 ( 145200 144855 ) L1M1_PR_MR
47+
NEW met1 ( 145200 144855 ) M1M2_PR
4648
NEW met3 ( 1440 155030 ) M3M4_PR
4749
NEW met4 ( 1440 155030 ) M4M5_PR
4850
NEW met2 ( 1680 155030 ) M2M3_PR
4951
NEW met1 ( 1680 155215 ) M1M2_PR
5052
NEW li1 ( 112080 154845 ) L1M1_PR_MR
5153
NEW li1 ( 135600 158175 ) L1M1_PR_MR
52-
NEW li1 ( 144720 158175 ) L1M1_PR_MR
54+
NEW li1 ( 144240 158175 ) L1M1_PR_MR
5355
NEW met1 ( 145200 158175 ) M1M2_PR
54-
NEW li1 ( 145200 144855 ) L1M1_PR_MR
55-
NEW met1 ( 145200 144855 ) M1M2_PR
5656
NEW met3 ( 1440 155030 ) RECT ( -380 -150 0 150 ) ;
5757
END NETS
5858
END DESIGN

src/drt/test/gcTest.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include <vector>
1010

1111
#include "db/obj/frMarker.h"
12+
#include "db/obj/frNet.h"
1213
#include "db/tech/frConstraint.h"
1314
#include "db/tech/frViaDef.h"
1415
#include "fixture.h"

0 commit comments

Comments
 (0)