Skip to content

Commit f7d663c

Browse files
authored
Merge pull request #304 from The-OpenROAD-Project-staging/update-upstream
Update upstream
2 parents 5e9e9db + 2b9035c commit f7d663c

107 files changed

Lines changed: 5021 additions & 8014 deletions

File tree

Some content is hidden

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

.github/dependabot.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: github-actions
4+
directory: "/"
5+
schedule:
6+
interval: "daily"

.github/workflows/ci.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
jobs:
8+
build:
9+
if: github.repository_owner != 'The-OpenROAD-Project-private'
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v6
14+
with:
15+
submodules: true
16+
17+
- name: Set up dependencies
18+
run: |
19+
sudo apt-get update && sudo apt-get install -y flex libfl-dev bison tcl-dev tcl-tclreadline libeigen3-dev ninja-build
20+
21+
- name: Set up cudd-3.0.0
22+
run: |
23+
wget https://github.com/oscc-ip/artifact/releases/download/cudd-3.0.0/build.tar.gz
24+
mkdir -p cudd
25+
tar -zxvf build.tar.gz -Ccudd
26+
27+
- name: Build
28+
run: |
29+
mkdir build
30+
cd build
31+
cmake .. -G Ninja -DCUDD_DIR=$(pwd)/../cudd -DCMAKE_INSTALL_PREFIX=$(pwd)/install -DCMAKE_BUILD_TYPE=Release
32+
cmake --build . --target all -- -j $(nproc)
33+
cmake --install .
34+
tar -zcvf build.tar.gz -Cinstall .
35+
36+
- name: Test
37+
run: |
38+
cd test
39+
./regression
40+
41+
- name: Upload Artifacts
42+
uses: actions/upload-artifact@v7
43+
if: ${{ !cancelled() }}
44+
with:
45+
name: artifact
46+
path: |
47+
build/install/*
48+
49+
- name: Upload Test Result
50+
uses: actions/upload-artifact@v7
51+
if: ${{ !cancelled() }}
52+
with:
53+
name: result
54+
path: |
55+
test/results/*

CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,6 @@ set(STA_SOURCE
244244
util/StringSeq.cc
245245
util/StringSet.cc
246246
util/StringUtil.cc
247-
util/TokenParser.cc
248247
util/Transition.cc
249248

250249
verilog/VerilogReader.cc

Dockerfile.ubuntu22.04

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@ LABEL maintainer="James Cherry <cherry@parallaxsw.com>"
66
ARG DEBIAN_FRONTEND=noninteractive
77
RUN apt-get update && \
88
apt-get install -y \
9+
git \
910
wget \
1011
cmake \
1112
gcc \
13+
gdb \
1214
tcl-dev \
1315
tcl-tclreadline \
1416
libeigen3-dev \

app/Main.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ namespace sta {
3939
extern const char *tcl_inits[];
4040
}
4141

42-
using std::string;
4342
using sta::stringEq;
4443
using sta::findCmdLineFlag;
4544
using sta::Sta;
@@ -129,7 +128,7 @@ staTclAppInit(int argc,
129128
if (!findCmdLineFlag(argc, argv, "-no_init")) {
130129
const char *home = getenv("HOME");
131130
if (home) {
132-
string init_path = home;
131+
std::string init_path = home;
133132
init_path += "/";
134133
init_path += init_filename;
135134
if (std::filesystem::is_regular_file(init_path.c_str()))

dcalc/ArcDcalcWaveforms.cc

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@
3535

3636
namespace sta {
3737

38-
using std::make_shared;
39-
4038
Waveform
4139
ArcDcalcWaveforms::inputWaveform(ArcDcalcArg &dcalc_arg,
4240
const Scene *scene,
@@ -68,8 +66,8 @@ ArcDcalcWaveforms::inputWaveform(ArcDcalcArg &dcalc_arg,
6866
FloatSeq time_values;
6967
for (float time : in_waveform.axis1()->values())
7068
time_values.push_back(time + dcalc_arg.inputDelay());
71-
TableAxisPtr time_axis = make_shared<TableAxis>(TableAxisVariable::time,
72-
std::move(time_values));
69+
TableAxisPtr time_axis = std::make_shared<TableAxis>(TableAxisVariable::time,
70+
std::move(time_values));
7371
// Scale the waveform from 0:vdd.
7472
FloatSeq *scaled_values = new FloatSeq;
7573
for (float value : *in_waveform.values()) {

dcalc/ArnoldiDelayCalc.cc

Lines changed: 23 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,6 @@ namespace sta {
6363
// ra_get_r
6464
// ra_get_s
6565

66-
using std::string;
67-
using std::abs;
68-
using std::vector;
69-
7066
struct delay_work;
7167
struct delay_c;
7268

@@ -151,15 +147,15 @@ class ArnoldiDelayCalc : public LumpedCapDelayCalc
151147
const LoadPinIndexMap &load_pin_index_map,
152148
const Scene *scene,
153149
const MinMax *min_max) override;
154-
string reportGateDelay(const Pin *drvr_pin,
155-
const TimingArc *arc,
156-
const Slew &in_slew,
157-
float load_cap,
158-
const Parasitic *parasitic,
159-
const LoadPinIndexMap &load_pin_index_map,
160-
const Scene *scene,
161-
const MinMax *min_max,
162-
int digits) override;
150+
std::string reportGateDelay(const Pin *drvr_pin,
151+
const TimingArc *arc,
152+
const Slew &in_slew,
153+
float load_cap,
154+
const Parasitic *parasitic,
155+
const LoadPinIndexMap &load_pin_index_map,
156+
const Scene *scene,
157+
const MinMax *min_max,
158+
int digits) override;
163159
void finishDrvrPin() override;
164160
void delay_work_set_thresholds(delay_work *D,
165161
double lo,
@@ -240,7 +236,7 @@ class ArnoldiDelayCalc : public LumpedCapDelayCalc
240236
int pin_n_;
241237
ArnoldiReduce *reduce_;
242238
delay_work *delay_work_;
243-
vector<rcmodel*> unsaved_parasitics_;
239+
std::vector<rcmodel*> unsaved_parasitics_;
244240
bool pocv_enabled_;
245241
};
246242

@@ -469,7 +465,7 @@ ArnoldiDelayCalc::gateDelaySlew(const LibertyCell *drvr_cell,
469465
return dcalc_result;
470466
}
471467

472-
string
468+
std::string
473469
ArnoldiDelayCalc::reportGateDelay(const Pin *drvr_pin,
474470
const TimingArc *arc,
475471
const Slew &in_slew,
@@ -610,7 +606,8 @@ delay_work_get_residues(delay_work *D,int term_index)
610606
// calculate_poles_res
611607
//
612608

613-
void arnoldi1::calculate_poles_res(delay_work *D,double rdrive)
609+
void arnoldi1::calculate_poles_res(delay_work *D,
610+
double rdrive)
614611
{
615612
if (n > D->nmax) delay_work_alloc(D,n);
616613
double *p = D->poles;
@@ -689,7 +686,7 @@ tridiagEV(int n,double *din,double *ein,double *d,double **v)
689686
e[0] = 0.0;
690687
for (h=n-1;h>=1;h--) {
691688
iter = 0;
692-
while (abs(e[h])>1e-18) { // 1e-6ps
689+
while (std::abs(e[h])>1e-18) { // 1e-6ps
693690
m=0;
694691
if (m != h) {
695692
if (iter++ == 20)
@@ -819,14 +816,14 @@ solve_t_bracketed(double s,int order,double *p,double *rr,
819816
if (0.0<f2) return x2;
820817
if (f1<0.0) return x1;
821818
}
822-
dxold = abs(x2-x1);
819+
dxold = std::abs(x2-x1);
823820
dx = dxold;
824821
get_dv(rts,s,order,p,rr,&f,&df);
825822
f -= val;
826823
double flast = 0.0;
827824
for (j=1;j<10;j++) {
828825
if ((((rts-xh)*df-f)*((rts-xl)*df-f) >= 0.0)
829-
|| (abs(2.0*f) > abs(dxold*df))) {
826+
|| (std::abs(2.0*f) > std::abs(dxold*df))) {
830827
dxold = dx;
831828
dx = 0.5*(xh-xl);
832829
if (flast*f >0.0) {
@@ -850,7 +847,7 @@ solve_t_bracketed(double s,int order,double *p,double *rr,
850847
return rts;
851848
}
852849
}
853-
if (abs(dx) < xacc) {
850+
if (std::abs(dx) < xacc) {
854851
return rts;
855852
}
856853
get_dv(rts,s,order,p,rr,&f,&df); f -= val;
@@ -859,7 +856,7 @@ solve_t_bracketed(double s,int order,double *p,double *rr,
859856
else
860857
xh = rts;
861858
}
862-
if (abs(f)<1e-6) // 1uV
859+
if (std::abs(f)<1e-6) // 1uV
863860
return rts;
864861
return 0.5*(xl+xh);
865862
}
@@ -1265,36 +1262,36 @@ ArnoldiDelayCalc::ra_solve_for_s(delay_work *D,
12651262
f = (ptlo-pthi)/p - tlohi;
12661263
df = dlo-dhi;
12671264
s = s - f/df;
1268-
if (abs(f)<.001e-12) return; // .001ps
1265+
if (std::abs(f)<.001e-12) return; // .001ps
12691266

12701267
ra_solve_for_pt(p*s,vlo,&ptlo,&dlo);
12711268
ra_solve_for_pt(p*s,vhi,&pthi,&dhi);
12721269
f = (ptlo-pthi)/p - tlohi;
12731270
df = dlo-dhi;
12741271
s = s - f/df;
1275-
if (abs(f)<.001e-12) return; // .001ps
1272+
if (std::abs(f)<.001e-12) return; // .001ps
12761273

12771274
ra_solve_for_pt(p*s,vlo,&ptlo,&dlo);
12781275
ra_solve_for_pt(p*s,vhi,&pthi,&dhi);
12791276
f = (ptlo-pthi)/p - tlohi;
12801277
df = dlo-dhi;
12811278
s = s - f/df;
1282-
if (abs(f)<.001e-12) return; // .001ps
1279+
if (std::abs(f)<.001e-12) return; // .001ps
12831280

12841281
ra_solve_for_pt(p*s,vlo,&ptlo,&dlo);
12851282
ra_solve_for_pt(p*s,vhi,&pthi,&dhi);
12861283
f = (ptlo-pthi)/p - tlohi;
12871284
df = dlo-dhi;
12881285
s = s - f/df;
1289-
if (abs(f)<.001e-12) return; // .001ps
1286+
if (std::abs(f)<.001e-12) return; // .001ps
12901287

12911288
ra_solve_for_pt(p*s,vlo,&ptlo,&dlo);
12921289
ra_solve_for_pt(p*s,vhi,&pthi,&dhi);
12931290
f = (ptlo-pthi)/p - tlohi;
12941291
df = dlo-dhi;
12951292
s = s - f/df;
12961293

1297-
if (abs(f)>.5e-12) // .5ps
1294+
if (std::abs(f)>.5e-12) // .5ps
12981295
debugPrint(debug_, "arnoldi", 1, "ra_solve_for_s p %g tlohi %s err %s",
12991296
p,
13001297
units_->timeUnit()->asString(tlohi),

dcalc/ArnoldiReduce.cc

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@
3838

3939
namespace sta {
4040

41-
using std::string;
42-
4341
rcmodel::rcmodel() :
4442
pinV(nullptr)
4543
{
@@ -621,7 +619,7 @@ ArnoldiReduce::makeRcmodelFromTs()
621619
report_->reportLine(" d[%d] %s",
622620
h,
623621
units_->timeUnit()->asString(d[h]));
624-
string line = stdstrPrint("U[%d]",h);
622+
std::string line = stdstrPrint("U[%d]",h);
625623
for (i=0;i<nterms;i++)
626624
line += stdstrPrint(" %6.2e",U[h][i]);
627625
report_->reportLineString(line);

dcalc/CcsCeffDelayCalc.cc

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424

2525
#include "CcsCeffDelayCalc.hh"
2626

27+
#include <cmath>
28+
2729
#include "Debug.hh"
2830
#include "Units.hh"
2931
#include "Liberty.hh"
@@ -38,17 +40,11 @@
3840

3941
namespace sta {
4042

41-
using std::string;
42-
4343
// Implementaion based on:
4444
// "Gate Delay Estimation with Library Compatible Current Source Models
4545
// and Effective Capacitance", D. Garyfallou et al,
4646
// IEEE Transactions on Very Large Scale Integration (VLSI) Systems, March 2021
4747

48-
using std::abs;
49-
using std::exp;
50-
using std::make_shared;
51-
5248
ArcDelayCalc *
5349
makeCcsCeffDelayCalc(StaState *sta)
5450
{
@@ -144,7 +140,7 @@ CcsCeffDelayCalc::gateDelaySlew(const LibertyLibrary *drvr_library,
144140
findCsmWaveform();
145141
ref_time_ = output_waveforms_->referenceTime(in_slew_);
146142
gate_delay = region_times_[region_vth_idx_] - ref_time_;
147-
drvr_slew = abs(region_times_[region_vh_idx_] - region_times_[region_vl_idx_]);
143+
drvr_slew = std::abs(region_times_[region_vh_idx_] - region_times_[region_vl_idx_]);
148144
debugPrint(debug_, "ccs_dcalc", 2,
149145
"gate_delay %s drvr_slew %s (initial)",
150146
delayAsString(gate_delay, this),
@@ -184,12 +180,12 @@ CcsCeffDelayCalc::gateDelaySlew(const LibertyLibrary *drvr_library,
184180
}
185181
findCsmWaveform();
186182
gate_delay = region_times_[region_vth_idx_] - ref_time_;
187-
drvr_slew = abs(region_times_[region_vh_idx_] - region_times_[region_vl_idx_]);
183+
drvr_slew = std::abs(region_times_[region_vh_idx_] - region_times_[region_vl_idx_]);
188184
debugPrint(debug_, "ccs_dcalc", 2,
189185
"gate_delay %s drvr_slew %s",
190186
delayAsString(gate_delay, this),
191187
delayAsString(drvr_slew, this));
192-
if (abs(delayAsFloat(drvr_slew) - prev_drvr_slew) < .01 * prev_drvr_slew)
188+
if (std::abs(delayAsFloat(drvr_slew) - prev_drvr_slew) < .01 * prev_drvr_slew)
193189
break;
194190
prev_drvr_slew = delayAsFloat(drvr_slew);
195191
}
@@ -529,8 +525,8 @@ CcsCeffDelayCalc::drvrWaveform()
529525
drvr_volts->push_back(v);
530526
}
531527
}
532-
TableAxisPtr drvr_time_axis = make_shared<TableAxis>(TableAxisVariable::time,
533-
std::move(*drvr_times));
528+
TableAxisPtr drvr_time_axis = std::make_shared<TableAxis>(TableAxisVariable::time,
529+
std::move(*drvr_times));
534530
delete drvr_times;
535531
Table drvr_table(drvr_volts, drvr_time_axis);
536532
return drvr_table;
@@ -561,8 +557,8 @@ CcsCeffDelayCalc::loadWaveform(const Pin *load_pin)
561557
double v1 = (drvr_rf_ == RiseFall::rise()) ? v : vdd_ - v;
562558
load_volts->push_back(v1);
563559
}
564-
TableAxisPtr load_time_axis = make_shared<TableAxis>(TableAxisVariable::time,
565-
std::move(*load_times));
560+
TableAxisPtr load_time_axis = std::make_shared<TableAxis>(TableAxisVariable::time,
561+
std::move(*load_times));
566562
delete load_times;
567563
Table load_table(load_volts, load_time_axis);
568564
return load_table;
@@ -606,8 +602,8 @@ CcsCeffDelayCalc::drvrRampWaveform(const Pin *in_pin,
606602
double v1 = (drvr_rf == RiseFall::rise()) ? v : vdd_ - v;
607603
load_volts->push_back(v1);
608604
}
609-
TableAxisPtr load_time_axis = make_shared<TableAxis>(TableAxisVariable::time,
610-
std::move(*load_times));
605+
TableAxisPtr load_time_axis = std::make_shared<TableAxis>(TableAxisVariable::time,
606+
std::move(*load_times));
611607
delete load_times;
612608
Table load_table(load_volts, load_time_axis);
613609
return load_table;
@@ -663,7 +659,7 @@ CcsCeffDelayCalc::makeWaveformPreamble(const Pin *in_pin,
663659

664660
////////////////////////////////////////////////////////////////
665661

666-
string
662+
std::string
667663
CcsCeffDelayCalc::reportGateDelay(const Pin *drvr_pin,
668664
const TimingArc *arc,
669665
const Slew &in_slew,
@@ -680,7 +676,7 @@ CcsCeffDelayCalc::reportGateDelay(const Pin *drvr_pin,
680676
pi_elmore = parasitics_->reduceToPiElmore(parasitic, drvr_pin_, rf,
681677
scene, min_max);
682678
}
683-
string report = table_dcalc_->reportGateDelay(drvr_pin, arc, in_slew, load_cap,
679+
std::string report = table_dcalc_->reportGateDelay(drvr_pin, arc, in_slew, load_cap,
684680
pi_elmore, load_pin_index_map,
685681
scene, min_max, digits);
686682
parasitics_->deleteDrvrReducedParasitics(drvr_pin);

0 commit comments

Comments
 (0)