Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 20 additions & 11 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.14)
cmake_policy(SET CMP0086 NEW)
endif()

project(STA VERSION 3.0.0
project(STA VERSION 3.0.1
LANGUAGES CXX
)

Expand Down Expand Up @@ -89,13 +89,17 @@ endif()
set(STA_SOURCE
app/StaMain.cc

dcalc/ArcDelayCalc.cc
dcalc/ArcDcalcWaveforms.cc
dcalc/ArcDelayCalc.cc
dcalc/ArnoldiDelayCalc.cc
dcalc/ArnoldiReduce.cc
dcalc/CcsCeffDelayCalc.cc
dcalc/Delay.cc
dcalc/DelayCalc.cc
dcalc/DelayCalcBase.cc
dcalc/DelayNormal.cc
dcalc/DelayScalar.cc
dcalc/DelaySkewNormal.cc
dcalc/DmpCeff.cc
dcalc/DmpDelayCalc.cc
dcalc/FindRoot.cc
Expand All @@ -106,9 +110,6 @@ set(STA_SOURCE
dcalc/PrimaDelayCalc.cc
dcalc/UnitDelayCalc.cc

graph/DelayFloat.cc
graph/DelayNormal1.cc
graph/DelayNormal2.cc
graph/Graph.cc
graph/GraphCmp.cc

Expand Down Expand Up @@ -206,6 +207,7 @@ set(STA_SOURCE
search/PathEnum.cc
search/PathExpanded.cc
search/PathGroup.cc
search/PocvMode.cc
search/Property.cc
search/ReportPath.cc
search/Search.cc
Expand Down Expand Up @@ -408,12 +410,18 @@ find_package(Threads)

find_package(Eigen3 REQUIRED)

include(cmake/FindCUDD.cmake)

if("${SSTA}" STREQUAL "")
set(SSTA 0)
# fmt library: fallback when std::format is not available (e.g. GCC 11 on Ubuntu 22.04)
find_package(fmt QUIET)
if(NOT fmt_FOUND)
include(FetchContent)
FetchContent_Declare(fmt
GIT_REPOSITORY https://github.com/fmtlib/fmt.git
GIT_TAG 10.2.1
)
FetchContent_MakeAvailable(fmt)
endif()
message(STATUS "SSTA: ${SSTA}")

include(cmake/FindCUDD.cmake)

# configure a header file to pass some of the CMake settings
configure_file(${STA_HOME}/util/StaConfig.hh.cmake
Expand Down Expand Up @@ -528,6 +536,7 @@ target_sources(OpenSTA

target_link_libraries(OpenSTA
Eigen3::Eigen
fmt::fmt
${TCL_LIBRARY}
${CMAKE_THREAD_LIBS_INIT}
${CUDD_LIB}
Expand Down Expand Up @@ -561,7 +570,7 @@ endif()

# common to gcc/clang
set(CXX_FLAGS -Wall -Wextra -pedantic -Wcast-qual -Wredundant-decls
-Wformat-security -Werror=misleading-indentation)
-Wformat-security -Werror=misleading-indentation -Wundef)

if(ENABLE_TSAN)
message(STATUS "Thread sanitizer: ${ENABLE_TSAN}")
Expand Down
9 changes: 4 additions & 5 deletions app/StaMain.cc
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,10 @@ sourceTclFile(const char *filename,
bool verbose,
Tcl_Interp *interp)
{
std::string cmd;
stringPrint(cmd, "sta::include_file %s %s %s",
filename,
echo ? "1" : "0",
verbose ? "1" : "0");
std::string cmd = sta::format("sta::include_file {} {} {}",
filename,
echo ? "1" : "0",
verbose ? "1" : "0");
int code = Tcl_Eval(interp, cmd.c_str());
const char *result = Tcl_GetStringResult(interp);
if (result[0] != '\0')
Expand Down
5 changes: 3 additions & 2 deletions dcalc/ArcDcalcWaveforms.cc
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,9 @@ ArcDcalcWaveforms::inputWaveform(ArcDcalcArg &dcalc_arg,
bool vdd_exists;
library->supplyVoltage("VDD", vdd, vdd_exists);
if (!vdd_exists)
report->error(1751, "VDD not defined in library %s", library->name());
Waveform in_waveform = driver_waveform->waveform(delayAsFloat(in_slew));
report->error(1751, "VDD not defined in library {}", library->name());
float slew1 = delayAsFloat(in_slew, min_max, sta);
Waveform in_waveform = driver_waveform->waveform(slew1);
// Delay time axis.
FloatSeq time_values;
for (float time : in_waveform.axis1()->values())
Expand Down
24 changes: 12 additions & 12 deletions dcalc/ArcDelayCalc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -94,24 +94,24 @@ makeArcDcalcArg(const char *inst_name,
else {
const Network *network = sta->network();
const Instance *inst = network->instance(in_pin);
report->warn(2100, "no timing arc for %s input/driver pins.",
report->warn(2100, "no timing arc for {} input/driver pins.",
network->pathName(inst));
}
}
else
report->warn(2101, "%s not a valid rise/fall.", drvr_rf_name);
report->warn(2101, "{} not a valid rise/fall.", drvr_rf_name);
}
else
report->warn(2102, "Pin %s/%s not found.", inst_name, drvr_port_name);
report->warn(2102, "Pin {}/{} not found.", inst_name, drvr_port_name);
}
else
report->warn(2103, "%s not a valid rise/fall.", in_rf_name);
report->warn(2103, "{} not a valid rise/fall.", in_rf_name);
}
else
report->warn(2104, "Pin %s/%s not found.", inst_name, in_port_name);
report->warn(2104, "Pin {}/{} not found.", inst_name, in_port_name);
}
else
report->warn(2105, "Instance %s not found.", inst_name);
report->warn(2105, "Instance {} not found.", inst_name);
return ArcDcalcArg();
}

Expand Down Expand Up @@ -257,26 +257,26 @@ ArcDcalcResult::ArcDcalcResult(size_t load_count) :
}

void
ArcDcalcResult::setGateDelay(ArcDelay gate_delay)
ArcDcalcResult::setGateDelay(const ArcDelay &gate_delay)
{
gate_delay_ = gate_delay;
}

void
ArcDcalcResult::setDrvrSlew(Slew drvr_slew)
ArcDcalcResult::setDrvrSlew(const Slew &drvr_slew)
{
drvr_slew_ = drvr_slew;
}

ArcDelay
const ArcDelay &
ArcDcalcResult::wireDelay(size_t load_idx) const
{
return wire_delays_[load_idx];
}

void
ArcDcalcResult::setWireDelay(size_t load_idx,
ArcDelay wire_delay)
const ArcDelay &wire_delay)
{
wire_delays_[load_idx] = wire_delay;
}
Expand All @@ -288,15 +288,15 @@ ArcDcalcResult::setLoadCount(size_t load_count)
load_slews_.resize(load_count);
}

Slew
const Slew &
ArcDcalcResult::loadSlew(size_t load_idx) const
{
return load_slews_[load_idx];
}

void
ArcDcalcResult::setLoadSlew(size_t load_idx,
Slew load_slew)
const Slew &load_slew)
{
load_slews_[load_idx] = load_slew;
}
Expand Down
49 changes: 21 additions & 28 deletions dcalc/ArnoldiDelayCalc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,6 @@ class ArnoldiDelayCalc : public LumpedCapDelayCalc
ArnoldiReduce *reduce_;
delay_work *delay_work_;
std::vector<rcmodel*> unsaved_parasitics_;
bool pocv_enabled_;
};

ArcDelayCalc *
Expand Down Expand Up @@ -397,7 +396,6 @@ ArnoldiDelayCalc::gateDelay(const Pin *drvr_pin,
ConcreteParasitic *cparasitic =
reinterpret_cast<ConcreteParasitic*>(const_cast<Parasitic*>(parasitic));
rcmodel_ = dynamic_cast<rcmodel*>(cparasitic);
pocv_enabled_ = variables_->pocvEnabled();
GateTableModel *table_model = arc->gateTableModel(scene, min_max);
if (table_model && rcmodel_) {
const Pvt *pvt = pinPvt(drvr_pin, scene, min_max);
Expand Down Expand Up @@ -453,8 +451,8 @@ ArnoldiDelayCalc::gateDelaySlew(const LibertyCell *drvr_cell,
auto load_idx_itr = load_pin_index_map.find(load_pin);
if (load_idx_itr != load_pin_index_map.end()) {
size_t load_idx = load_idx_itr->second;
ArcDelay wire_delay = _delayV[i] - _delayV[0];
Slew load_slew = _slewV[i];
double wire_delay = _delayV[i] - _delayV[0];
double load_slew = _slewV[i];
thresholdAdjust(load_pin, drvr_library, rf, wire_delay, load_slew);
dcalc_result.setWireDelay(load_idx, wire_delay);
dcalc_result.setLoadSlew(load_idx, load_slew);
Expand Down Expand Up @@ -1158,7 +1156,7 @@ ra_hinv(double y,
ex = exp(-x);
f = x+ex-1.0-y;
if (f<-1e-8 || f>1e-8)
debugPrint(debug, "arnoldi", 1, "y f %g %g", y, f);
debugPrint(debug, "arnoldi", 1, "y f {:g} {:g}", y, f);
return x;
}

Expand Down Expand Up @@ -1292,7 +1290,7 @@ ArnoldiDelayCalc::ra_solve_for_s(delay_work *D,
s = s - f/df;

if (std::abs(f)>.5e-12) // .5ps
debugPrint(debug_, "arnoldi", 1, "ra_solve_for_s p %g tlohi %s err %s",
debugPrint(debug_, "arnoldi", 1, "ra_solve_for_s p {:g} tlohi {} err {}",
p,
units_->timeUnit()->asString(tlohi),
units_->timeUnit()->asString(f));
Expand Down Expand Up @@ -1325,9 +1323,8 @@ ArnoldiDelayCalc::ra_get_r(delay_work *D,
float c1;
double tlohi,r;
c1 = ctot;
ArcDelay d1;
Slew s1;
tab->table->gateDelay(tab->pvt, tab->in_slew, c1, pocv_enabled_, d1, s1);
float d1, s1;
tab->table->gateDelay(tab->pvt, tab->in_slew, c1, d1, s1);
tlohi = slew_derate*delayAsFloat(s1);
r = tlohi/(c_log*c1);
if (rdelay>0.0 && r > rdelay)
Expand All @@ -1346,9 +1343,8 @@ ArnoldiDelayCalc::ra_get_s(delay_work *D,
double c_log = con->vlg;
double c_smin = con->smin;
double tlohi,smin,s;
ArcDelay d1;
Slew s1;
tab->table->gateDelay(tab->pvt, tab->in_slew, c, pocv_enabled_, d1, s1);
float d1, s1;
tab->table->gateDelay(tab->pvt, tab->in_slew, c, d1, s1);
tlohi = slew_derate*delayAsFloat(s1);
smin = r*c*c_smin; // c_smin = ra_hinv((1-vhi)/vhi-log(vhi)) + log(vhi);
if (c_log*r*c >= tlohi) {
Expand Down Expand Up @@ -1378,10 +1374,9 @@ ArnoldiDelayCalc::ra_rdelay_1(timing_table *tab,
float c2 = 0.5*c1;
if (c1==c2)
return 0.0;
ArcDelay d1, d2;
Slew s1, s2;
tab->table->gateDelay(tab->pvt, tab->in_slew, c1, pocv_enabled_, d1, s1);
tab->table->gateDelay(tab->pvt, tab->in_slew, c2, pocv_enabled_, d2, s2);
float d1, d2, s1, s2;
tab->table->gateDelay(tab->pvt, tab->in_slew, c1, d1, s1);
tab->table->gateDelay(tab->pvt, tab->in_slew, c2, d2, s2);
double dt50 = delayAsFloat(d1)-delayAsFloat(d2);
if (dt50 <= 0.0)
return 0.0;
Expand All @@ -1402,10 +1397,9 @@ ArnoldiDelayCalc::ar1_ceff_delay(delay_work *D,
double vlo = con->vlo;
double ctot = mod->ctot;
double ceff,tlohi,t50_sy,r,s,t50_sr,rdelay;
ArcDelay df;
Slew sf;
float df, sf;

debugPrint(debug_, "arnoldi", 1, "ctot=%s",
debugPrint(debug_, "arnoldi", 1, "ctot={}",
units_->capacitanceUnit()->asString(ctot));

rdelay = ra_rdelay_1(tab,ctot);
Expand All @@ -1427,24 +1421,23 @@ ArnoldiDelayCalc::ar1_ceff_delay(delay_work *D,
if (debug_->check("arnoldi", 1)) {
double p = 1.0/(r*ctot);
double thix,tlox;
debugPrint(debug_, "arnoldi", 1, "at r=%s s=%s",
debugPrint(debug_, "arnoldi", 1, "at r={} s={}",
units_->resistanceUnit()->asString(r),
units_->timeUnit()->asString(s));
thix = ra_solve_for_t(p,s,vhi);
tlox = ra_solve_for_t(p,s,vlo);
tab->table->gateDelay(tab->pvt,tab->in_slew, ctot, pocv_enabled_, df, sf);
debugPrint(debug_, "arnoldi", 1, "table slew (in_slew %s ctot %s) = %s",
tab->table->gateDelay(tab->pvt,tab->in_slew, ctot, df, sf);
debugPrint(debug_, "arnoldi", 1, "table slew (in_slew {} ctot {}) = {}",
units_->timeUnit()->asString(tab->in_slew),
units_->capacitanceUnit()->asString(ctot),
delayAsString(sf, this));
tlohi = slew_derate*delayAsFloat(sf);
debugPrint(debug_, "arnoldi", 1, "tlohi %s %s",
debugPrint(debug_, "arnoldi", 1, "tlohi {} {}",
units_->timeUnit()->asString(tlohi),
units_->timeUnit()->asString(tlox-thix));
}
ceff = ctot;
tab->table->gateDelay(tab->pvt, tab->in_slew, ceff, pocv_enabled_,
df, sf);
tab->table->gateDelay(tab->pvt, tab->in_slew, ceff, df, sf);
t50_sy = delayAsFloat(df);
t50_sr = ra_solve_for_t(1.0/(r*ceff),s,0.5);

Expand Down Expand Up @@ -1475,17 +1468,17 @@ ArnoldiDelayCalc::ar1_ceff_delay(delay_work *D,

// new mvs at ceff
s = ra_get_s(D,tab,r,ceff);
debugPrint(debug_, "arnoldi", 1, "new mvs s = %s",
debugPrint(debug_, "arnoldi", 1, "new mvs s = {}",
units_->timeUnit()->asString(s));
}
}
debugPrint(debug_, "arnoldi", 1, "r %s s %s ceff_time %s ceff %s",
debugPrint(debug_, "arnoldi", 1, "r {} s {} ceff_time {} ceff {}",
units_->resistanceUnit()->asString(r),
units_->timeUnit()->asString(s),
units_->timeUnit()->asString(ceff_time),
units_->capacitanceUnit()->asString(ceff));

tab->table->gateDelay(tab->pvt, tab->in_slew, ceff, pocv_enabled_, df, sf);
tab->table->gateDelay(tab->pvt, tab->in_slew, ceff, df, sf);
t50_sy = delayAsFloat(df);
t50_sr = ra_solve_for_t(1.0/(r*ceff),s,0.5);
for (j=0;j<mod->n;j++) {
Expand Down
Loading
Loading