Merge remote-tracking branch 'opensta/master' into secure-sta-test-by-opus

Signed-off-by: Jaehyun Kim <jhkim@precisioninno.com>
This commit is contained in:
Jaehyun Kim
2026-03-21 18:54:37 +09:00
176 changed files with 13586 additions and 13837 deletions

View File

@@ -410,8 +410,10 @@ const char *
ConcreteParasiticNode::name(const Network *network) const
{
if (is_net_) {
const char *net_name = network->pathName(net_pin_.net_);
return stringPrintTmp("%s:%d", net_name, id_);
std::string name = std::string(network->pathName(net_pin_.net_))
+ ':'
+ std::to_string(id_);
return makeTmpString(name);
}
else
return network->pathName(net_pin_.pin_);

View File

@@ -1,25 +1,25 @@
// OpenSTA, Static Timing Analyzer
// Copyright (c) 2026, Parallax Software, Inc.
//
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
//
//
// The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software.
//
//
// Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
//
//
// This notice may not be removed or altered from any source distribution.
#include "Parasitics.hh"
@@ -49,38 +49,29 @@ Parasitics::report(const Parasitic *parasitic) const
{
if (isParasiticNetwork(parasitic)) {
const Unit *cap_unit = units_->capacitanceUnit();
report_->reportLine("Net %s %s",
network_->pathName(net(parasitic)),
cap_unit->asString(capacitance(parasitic)));
report_->reportLine("Nodes:");
report_->report("Net {} {}", network_->pathName(net(parasitic)),
cap_unit->asString(capacitance(parasitic)));
report_->report("Nodes:");
for (ParasiticNode *node : nodes(parasitic))
report_->reportLine("%s%s %s",
name(node),
isExternal(node) ? " (ext)" : "",
cap_unit->asString(nodeGndCap(node)));
report_->reportLine("Resistors:");
report_->report("{}{} {}", name(node), isExternal(node) ? " (ext)" : "",
cap_unit->asString(nodeGndCap(node)));
report_->report("Resistors:");
for (ParasiticResistor *res : resistors(parasitic)) {
ParasiticNode *node1 = this->node1(res);
ParasiticNode *node2 = this->node2(res);
report_->reportLine("%zu %s%s %s%s %s",
id(res),
name(node1),
isExternal(node1) ? " (ext)" : "",
name(node2),
isExternal(node2) ? " (ext)" : "",
units_->resistanceUnit()->asString(value(res)));
report_->report("{} {}{} {}{} {}", id(res), name(node1),
isExternal(node1) ? " (ext)" : "", name(node2),
isExternal(node2) ? " (ext)" : "",
units_->resistanceUnit()->asString(value(res)));
}
report_->reportLine("Coupling Capacitors:");
report_->report("Coupling Capacitors:");
for (ParasiticCapacitor *cap : capacitors(parasitic)) {
ParasiticNode *node1 = this->node1(cap);
ParasiticNode *node2 = this->node2(cap);
report_->reportLine("%zu %s%s %s%s %s",
id(cap),
name(node1),
isExternal(node1) ? " (ext)" : "",
name(node2),
isExternal(node2) ? " (ext)" : "",
cap_unit->asString(value(cap)));
report_->report("{} {}{} {}{} {}", id(cap), name(node1),
isExternal(node1) ? " (ext)" : "", name(node2),
isExternal(node2) ? " (ext)" : "",
cap_unit->asString(value(cap)));
}
}
}
@@ -138,10 +129,10 @@ Parasitics::parasiticNodeResistorMap(const Parasitic *parasitic) const
return resistor_map;
}
ParasiticNodeCapacitorMap
ParasiticNodeCapacitorMap
Parasitics::parasiticNodeCapacitorMap(const Parasitic *parasitic) const
{
ParasiticNodeCapacitorMap capacitor_map;
ParasiticNodeCapacitorMap capacitor_map;
for (ParasiticCapacitor *capacitor : capacitors(parasitic)) {
ParasiticNode *n1 = node1(capacitor);
ParasiticNode *n2 = node2(capacitor);
@@ -186,9 +177,8 @@ Parasitics::reduceToPiElmore(const Parasitic *parasitic,
const Scene *scene,
const MinMax *min_max)
{
return sta::reduceToPiElmore(parasitic, drvr_pin, rf,
coupling_cap_factor_,
scene, min_max, this);
return sta::reduceToPiElmore(parasitic, drvr_pin, rf, coupling_cap_factor_, scene,
min_max, this);
}
Parasitic *
@@ -198,8 +188,7 @@ Parasitics::reduceToPiPoleResidue2(const Parasitic *parasitic,
const Scene *scene,
const MinMax *min_max)
{
return sta::reduceToPiPoleResidue2(parasitic, drvr_pin, rf,
coupling_cap_factor_,
return sta::reduceToPiPoleResidue2(parasitic, drvr_pin, rf, coupling_cap_factor_,
scene, min_max, this);
}
@@ -217,10 +206,9 @@ Parasitics::estimatePiElmore(const Pin *drvr_pin,
EstimateParasitics estimate(this);
float c2, rpi, c1, elmore_res, elmore_cap;
bool elmore_use_load_cap;
estimate.estimatePiElmore(drvr_pin, rf, wireload, fanout, net_pin_cap,
scene, min_max,
c2, rpi, c1,
elmore_res, elmore_cap, elmore_use_load_cap);
estimate.estimatePiElmore(drvr_pin, rf, wireload, fanout, net_pin_cap, scene,
min_max, c2, rpi, c1, elmore_res, elmore_cap,
elmore_use_load_cap);
if (c1 > 0.0 || c2 > 0.0) {
Parasitic *parasitic = makePiElmore(drvr_pin, rf, min_max, c2, rpi, c1);
@@ -265,19 +253,19 @@ Parasitics::makeWireloadNetwork(const Pin *drvr_pin,
if (op_cond)
tree = op_cond->wireloadTree();
switch (tree) {
case WireloadTree::worst_case:
makeWireloadNetworkWorst(parasitic, drvr_pin, net, wireload_cap,
wireload_res, fanout);
break;
case WireloadTree::balanced:
makeWireloadNetworkBalanced(parasitic, drvr_pin, wireload_cap,
wireload_res, fanout);
break;
case WireloadTree::best_case:
case WireloadTree::unknown:
makeWireloadNetworkBest(parasitic, drvr_pin, wireload_cap,
wireload_res, fanout);
break;
case WireloadTree::worst_case:
makeWireloadNetworkWorst(parasitic, drvr_pin, net, wireload_cap,
wireload_res, fanout);
break;
case WireloadTree::balanced:
makeWireloadNetworkBalanced(parasitic, drvr_pin, wireload_cap, wireload_res,
fanout);
break;
case WireloadTree::best_case:
case WireloadTree::unknown:
makeWireloadNetworkBest(parasitic, drvr_pin, wireload_cap, wireload_res,
fanout);
break;
}
}
return parasitic;
@@ -298,12 +286,10 @@ Parasitics::makeWireloadNetworkWorst(Parasitic *parasitic,
ParasiticNode *load_node = ensureParasiticNode(parasitic, net, 0, network_);
makeResistor(parasitic, resistor_index++, wireload_res, drvr_node, load_node);
incrCap(load_node, wireload_cap);
PinConnectedPinIterator *load_iter =
network_->connectedPinIterator(drvr_pin);
PinConnectedPinIterator *load_iter = network_->connectedPinIterator(drvr_pin);
while (load_iter->hasNext()) {
const Pin *load_pin = load_iter->next();
if (load_pin != drvr_pin
&& network_->isLoad(load_pin)) {
if (load_pin != drvr_pin && network_->isLoad(load_pin)) {
ParasiticNode *load_node1 = ensureParasiticNode(parasitic, load_pin, network_);
makeResistor(parasitic, resistor_index++, 0.0, load_node, load_node1);
}
@@ -320,13 +306,11 @@ Parasitics::makeWireloadNetworkBest(Parasitic *parasitic,
{
ParasiticNode *drvr_node = ensureParasiticNode(parasitic, drvr_pin, network_);
incrCap(drvr_node, wireload_cap);
PinConnectedPinIterator *load_iter =
network_->connectedPinIterator(drvr_pin);
PinConnectedPinIterator *load_iter = network_->connectedPinIterator(drvr_pin);
size_t resistor_index = 1;
while (load_iter->hasNext()) {
const Pin *load_pin = load_iter->next();
if (load_pin != drvr_pin
&& network_->isLoad(load_pin)) {
if (load_pin != drvr_pin && network_->isLoad(load_pin)) {
ParasiticNode *load_node1 = ensureParasiticNode(parasitic, load_pin, network_);
makeResistor(parasitic, resistor_index++, 0.0, drvr_node, load_node1);
}
@@ -345,15 +329,13 @@ Parasitics::makeWireloadNetworkBalanced(Parasitic *parasitic,
float fanout_cap = wireload_cap / fanout;
float fanout_res = wireload_res / fanout;
ParasiticNode *drvr_node = ensureParasiticNode(parasitic, drvr_pin, network_);
PinConnectedPinIterator *load_iter =
network_->connectedPinIterator(drvr_pin);
PinConnectedPinIterator *load_iter = network_->connectedPinIterator(drvr_pin);
size_t resistor_index = 1;
while (load_iter->hasNext()) {
const Pin *load_pin = load_iter->next();
if (load_pin != drvr_pin
&& network_->isLoad(load_pin)) {
if (load_pin != drvr_pin && network_->isLoad(load_pin)) {
ParasiticNode *load_node1 = ensureParasiticNode(parasitic, load_pin, network_);
makeResistor(parasitic, resistor_index++, fanout_res, drvr_node, load_node1);
makeResistor(parasitic, resistor_index++, fanout_res, drvr_node, load_node1);
incrCap(load_node1, fanout_cap);
}
}
@@ -391,12 +373,10 @@ ParasiticNodeLess::operator()(const ParasiticNode *node1,
unsigned id1 = parasitics_->netId(node1);
unsigned id2 = parasitics_->netId(node2);
return (pin1 == nullptr && pin2)
|| (pin1 && pin2
&& network_->id(pin1) < network_->id(pin2))
|| (pin1 == nullptr && pin2 == nullptr
&& (network_->id(net1) < network_->id(net2)
|| (net1 == net2
&& id1 < id2)));
|| (pin1 && pin2 && network_->id(pin1) < network_->id(pin2))
|| (pin1 == nullptr && pin2 == nullptr
&& (network_->id(net1) < network_->id(net2)
|| (net1 == net2 && id1 < id2)));
}
} // namespace
} // namespace sta

View File

@@ -147,7 +147,7 @@ ReduceToPi::reduceToPi(const Parasitic *parasitic_network,
rpi = -y3 * y3 / (y2 * y2 * y2);
}
debugPrint(debug_, "parasitic_reduce", 2,
" Pi model c2=%.3g rpi=%.3g c1=%.3g max_r=%.3g",
" Pi model c2={:.3g} rpi={:.3g} c1={:.3g} max_r={:.3g}",
c2, rpi, c1, max_resistance);
}
@@ -185,7 +185,7 @@ ReduceToPi::reducePiDfs(const Pin *drvr_pin,
&& resistor != from_res) {
if (isVisited(onode)) {
// Resistor loop.
debugPrint(debug_, "parasitic_reduce", 2, " loop detected thru resistor %zu",
debugPrint(debug_, "parasitic_reduce", 2, " loop detected thru resistor {}",
parasitics_->id(resistor));
markLoopResistor(resistor);
}
@@ -208,7 +208,7 @@ ReduceToPi::reducePiDfs(const Pin *drvr_pin,
setDownstreamCap(node, dwn_cap);
leave(node);
debugPrint(debug_, "parasitic_reduce", 3,
" node %s y1=%.3g y2=%.3g y3=%.3g cap=%.3g",
" node {} y1={:.3g} y2={:.3g} y3={:.3g} cap={:.3g}",
parasitics_->name(node), y1, y2, y3, dwn_cap);
}
@@ -309,10 +309,10 @@ reduceToPiElmore(const Parasitic *parasitic_network,
ParasiticNode *drvr_node =
parasitics->findParasiticNode(parasitic_network, drvr_pin);
if (drvr_node) {
debugPrint(sta->debug(), "parasitic_reduce", 1, "Reduce driver %s %s %s",
debugPrint(sta->debug(), "parasitic_reduce", 1, "Reduce driver {} {} {}",
sta->network()->pathName(drvr_pin),
rf->shortName(),
min_max->to_string().c_str());
min_max->to_string());
ReduceToPiElmore reducer(sta);
return reducer.makePiElmore(parasitic_network, drvr_pin, drvr_node,
coupling_cap_factor, rf, scene, min_max);
@@ -356,7 +356,7 @@ ReduceToPiElmore::reduceElmoreDfs(const Pin *drvr_pin,
const Pin *pin = parasitics_->pin(node);
if (from_res && pin) {
if (network_->isLoad(pin)) {
debugPrint(debug_, "parasitic_reduce", 2, " Load %s elmore=%.3g",
debugPrint(debug_, "parasitic_reduce", 2, " Load {} elmore={:.3g}",
network_->pathName(pin),
elmore);
parasitics_->setElmore(pi_elmore, pin, elmore);
@@ -456,7 +456,7 @@ reduceToPiPoleResidue2(const Parasitic *parasitic_network,
ParasiticNode *drvr_node =
parasitics->findParasiticNode(parasitic_network, drvr_pin);
if (drvr_node) {
debugPrint(sta->debug(), "parasitic_reduce", 1, "Reduce driver %s",
debugPrint(sta->debug(), "parasitic_reduce", 1, "Reduce driver {}",
sta->network()->pathName(drvr_pin));
ReduceToPiPoleResidue2 reducer(sta);
return reducer.makePiPoleResidue2(parasitic_network, drvr_pin, drvr_node,
@@ -564,7 +564,7 @@ ReduceToPiPoleResidue2::findBranchCurrents(const Pin *drvr_pin,
leave(node);
if (from_res) {
setCurrent(from_res, branch_i);
debugPrint(debug_, "parasitic_reduce", 3, " res i=%.3g", branch_i);
debugPrint(debug_, "parasitic_reduce", 3, " res i={:.3g}", branch_i);
}
return branch_i;
}
@@ -589,7 +589,7 @@ ReduceToPiPoleResidue2::findMoments(const Pin *drvr_pin,
double r_volt = r * current(resistor);
double onode_volt = from_volt - r_volt;
setMoment(onode, onode_volt, moment_index);
debugPrint(debug_, "parasitic_reduce", 3, " moment %s %d %.3g",
debugPrint(debug_, "parasitic_reduce", 3, " moment {} {} {:.3g}",
parasitics_->name(onode),
moment_index,
onode_volt);
@@ -655,7 +655,7 @@ ReduceToPiPoleResidue2::findPolesResidues(Parasitic *pi_pole_residue,
|| m1 / m2 == m2 / m3) {
double p1 = -1.0 / m1;
double k1 = 1.0;
debugPrint(debug_, "parasitic_reduce", 3, " load %s p1=%.3g k1=%.3g",
debugPrint(debug_, "parasitic_reduce", 3, " load {} p1={:.3g} k1={:.3g}",
network_->pathName(load_pin), p1, k1);
ComplexFloatSeq *poles = new ComplexFloatSeq(1);
ComplexFloatSeq *residues = new ComplexFloatSeq(1);
@@ -675,7 +675,7 @@ ReduceToPiPoleResidue2::findPolesResidues(Parasitic *pi_pole_residue,
k1 = k;
}
debugPrint(debug_, "parasitic_reduce", 3,
" load %s p1=%.3g p2=%.3g k1=%.3g k2=%.3g",
" load {} p1={:.3g} p2={:.3g} k1={:.3g} k2={:.3g}",
network_->pathName(load_pin), p1, p2, k1, k2);
ComplexFloatSeq *poles = new ComplexFloatSeq(2);

View File

@@ -1,25 +1,25 @@
// OpenSTA, Static Timing Analyzer
// Copyright (c) 2026, Parallax Software, Inc.
//
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
//
//
// The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software.
//
//
// Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
//
//
// This notice may not be removed or altered from any source distribution.
#include "ReportParasiticAnnotation.hh"
@@ -65,8 +65,8 @@ reportParasiticAnnotation(Parasitics *parasitics,
const Scene *scene,
StaState *sta)
{
ReportParasiticAnnotation report_annotation(parasitics, report_unannotated,
scene, sta);
ReportParasiticAnnotation report_annotation(parasitics, report_unannotated, scene,
sta);
report_annotation.report();
}
@@ -92,25 +92,26 @@ ReportParasiticAnnotation::report()
void
ReportParasiticAnnotation::reportAnnotationCounts()
{
report_->reportLine("Found %zu unannotated drivers.", unannotated_.size());
report_->report("Found {} unannotated drivers.", unannotated_.size());
if (report_unannotated_) {
sort(unannotated_, PinPathNameLess(network_));
for (const Pin *drvr_pin : unannotated_)
report_->reportLine(" %s", network_->pathName(drvr_pin));
report_->report(" {}", network_->pathName(drvr_pin));
}
report_->reportLine("Found %zu partially unannotated drivers.",
partially_annotated_.size());
report_->report("Found {} partially unannotated drivers.",
partially_annotated_.size());
if (report_unannotated_) {
sort(partially_annotated_, PinPathNameLess(network_));
for (const Pin *drvr_pin : partially_annotated_) {
report_->reportLine(" %s", network_->pathName(drvr_pin));
report_->report(" {}", network_->pathName(drvr_pin));
Parasitic *parasitic = parasitics_->findParasiticNetwork(drvr_pin);
if (parasitic) {
PinSet unannotated_loads = parasitics_->unannotatedLoads(parasitic, drvr_pin);
PinSet unannotated_loads =
parasitics_->unannotatedLoads(parasitic, drvr_pin);
for (const Pin *load_pin : unannotated_loads)
report_->reportLine(" %s", network_->pathName(load_pin));
report_->report(" {}", network_->pathName(load_pin));
}
}
}
@@ -124,21 +125,20 @@ ReportParasiticAnnotation::findCounts()
Vertex *vertex = vertex_iter.next();
Pin *pin = vertex->pin();
PortDirection *dir = network_->direction(pin);
if (vertex->isDriver(network_)
&& !dir->isInternal()) {
if (vertex->isDriver(network_) && !dir->isInternal()) {
Parasitic *parasitic = parasitics_->findParasiticNetwork(pin);
if (parasitic == nullptr)
parasitic = arc_delay_calc_->findParasitic(pin, RiseFall::rise(),
scene_, min_max_);
parasitic =
arc_delay_calc_->findParasitic(pin, RiseFall::rise(), scene_, min_max_);
if (parasitic) {
PinSet unannotated_loads = parasitics_->unannotatedLoads(parasitic, pin);
if (unannotated_loads.size() > 0)
partially_annotated_.push_back(pin);
}
else
else
unannotated_.push_back(pin);
}
}
}
} // namespace
} // namespace sta

View File

@@ -41,8 +41,7 @@ void
sta::SpefParse::error(const location_type &loc,
const std::string &msg)
{
reader->report()->fileError(164,reader->filename().c_str(),
loc.begin.line,"%s",msg.c_str());
reader->report()->fileError(1670,reader->filename(), loc.begin. line, "{}", msg);
}
%}
@@ -831,7 +830,7 @@ pos_integer:
INTEGER
{ int value = $1;
if (value < 0)
reader->warn(1525, "%d is not positive.", value);
reader->warn(1525, "{} is not positive.", value);
$$ = value;
}
;
@@ -840,13 +839,13 @@ pos_number:
INTEGER
{ float value = static_cast<float>($1);
if (value < 0)
reader->warn(1526, "%.4f is not positive.", value);
reader->warn(1526, "{:.4f} is not positive.", value);
$$ = value;
}
| FLOAT
{ float value = static_cast<float>($1);
if (value < 0)
reader->warn(1527, "%.4f is not positive.", value);
reader->warn(1527, "{:.4f} is not positive.", value);
$$ = value;
}
;

View File

@@ -1,25 +1,25 @@
// OpenSTA, Static Timing Analyzer
// Copyright (c) 2026, Parallax Software, Inc.
//
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
//
//
// The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software.
//
//
// Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
//
//
// This notice may not be removed or altered from any source distribution.
#include "SpefReader.hh"
@@ -55,9 +55,8 @@ readSpefFile(const std::string &filename,
Parasitics *parasitics,
StaState *sta)
{
SpefReader reader(filename, instance, pin_cap_included,
keep_coupling_caps, coupling_cap_factor,
reduce, scene, min_max, parasitics, sta);
SpefReader reader(filename, instance, pin_cap_included, keep_coupling_caps,
coupling_cap_factor, reduce, scene, min_max, parasitics, sta);
bool success = reader.read();
return success;
}
@@ -98,9 +97,7 @@ SpefReader::SpefReader(const std::string &filename,
parasitics->setCouplingCapFactor(coupling_cap_factor);
}
SpefReader::~SpefReader()
{
}
SpefReader::~SpefReader() {}
bool
SpefReader::read()
@@ -112,13 +109,13 @@ SpefReader::read()
SpefScanner scanner(&stream, filename_, this, report_);
scanner_ = &scanner;
SpefParse parser(&scanner, this);
//parser.set_debug_level(1);
// yyparse returns 0 on success.
// parser.set_debug_level(1);
// yyparse returns 0 on success.
success = (parser.parse() == 0);
stats.report("Read spef");
}
else
throw FileNotReadable(filename_.c_str());
throw FileNotReadable(filename_);
return success;
}
@@ -138,12 +135,9 @@ void
SpefReader::setBusBrackets(char left,
char right)
{
if (!((left == '[' && right == ']')
|| (left == '{' && right == '}')
|| (left == '(' && right == ')')
|| (left == '<' && right == '>')
|| (left == ':' && right == '\0')
|| (left == '.' && right == '\0')))
if (!((left == '[' && right == ']') || (left == '{' && right == '}')
|| (left == '(' && right == ')') || (left == '<' && right == '>')
|| (left == ':' && right == '\0') || (left == '.' && right == '\0')))
warn(1640, "illegal bus delimiters.");
bus_brkt_left_ = left;
bus_brkt_right_ = right;
@@ -181,19 +175,16 @@ SpefReader::findPortPinRelative(const char *name)
char *
SpefReader::translated(const char *token)
{
return spefToSta(token, divider_, network_->pathDivider(),
network_->pathEscape());
return spefToSta(token, divider_, network_->pathDivider(), network_->pathEscape());
}
void
SpefReader::warn(int id, const char *fmt, ...)
int
SpefReader::warnLine() const
{
va_list args;
va_start(args, fmt);
report_->vfileWarn(id, filename_.c_str(), scanner_->line(), fmt, args);
va_end(args);
return scanner_->line();
}
void
SpefReader::setTimeScale(float scale,
const char *units)
@@ -203,7 +194,7 @@ SpefReader::setTimeScale(float scale,
else if (stringEq(units, "PS"))
time_scale_ = scale * 1E-12F;
else
warn(1641, "unknown units %s.", units);
warn(1641, "unknown units {}.", units);
stringDelete(units);
}
@@ -216,7 +207,7 @@ SpefReader::setCapScale(float scale,
else if (stringEq(units, "FF"))
cap_scale_ = scale * 1E-15F;
else
warn(1642, "unknown units %s.", units);
warn(1642, "unknown units {}.", units);
stringDelete(units);
}
@@ -229,7 +220,7 @@ SpefReader::setResScale(float scale,
else if (stringEq(units, "KOHM"))
res_scale_ = scale * 1E+3F;
else
warn(1643, "unknown units %s.", units);
warn(1643, "unknown units {}.", units);
stringDelete(units);
}
@@ -244,7 +235,7 @@ SpefReader::setInductScale(float scale,
else if (stringEq(units, "UH"))
induct_scale_ = scale * 1E-6F;
else
warn(1644, "unknown units %s.", units);
warn(1644, "unknown units {}.", units);
stringDelete(units);
}
@@ -267,7 +258,7 @@ SpefReader::nameMapLookup(const char *name)
if (itr != name_map_.end())
return itr->second.c_str();
else {
warn(1645, "no name map entry for %d.", index);
warn(1645, "no name map entry for {}.", index);
return nullptr;
}
}
@@ -286,7 +277,7 @@ SpefReader::portDirection(char *spef_dir)
else if (stringEq(spef_dir, "B"))
direction = PortDirection::bidirect();
else
warn(1646, "unknown port direction %s.", spef_dir);
warn(1646, "unknown port direction {}.", spef_dir);
return direction;
}
@@ -314,16 +305,16 @@ SpefReader::findPin(char *name)
if (inst) {
pin = network_->findPin(inst, port_name);
if (pin == nullptr)
warn(1647, "pin %s not found.", name1);
warn(1647, "pin {} not found.", name1);
}
else
warn(1648, "instance %s not found.", name1);
warn(1648, "instance {} not found.", name1);
}
}
else {
pin = findPortPinRelative(name);
if (pin == nullptr)
warn(1649, "pin %s not found.", name);
warn(1649, "pin {} not found.", name);
}
}
return pin;
@@ -337,7 +328,7 @@ SpefReader::findNet(const char *name)
if (name1) {
net = findNetRelative(name1);
if (net == nullptr)
warn(1650, "net %s not found.", name1);
warn(1650, "net {} not found.", name1);
}
return net;
}
@@ -366,9 +357,7 @@ SpefReader::rspfDrvrBegin(Pin *drvr_pin,
float rpi = pi->r1()->value(triple_index_) * res_scale_;
float c1 = pi->c1()->value(triple_index_) * cap_scale_;
// Only one parasitic, save it under rise transition.
parasitic_ = parasitics_->makePiElmore(drvr_pin,
RiseFall::rise(),
MinMax::max(),
parasitic_ = parasitics_->makePiElmore(drvr_pin, RiseFall::rise(), MinMax::max(),
c2, rpi, c1);
}
delete pi;
@@ -412,8 +401,8 @@ SpefReader::dspfBegin(Net *net,
delete term_iter;
parasitic_ = parasitics_->findParasiticNetwork(parasitic_owner);
if (parasitic_ == nullptr)
parasitic_ = parasitics_->makeParasiticNetwork(parasitic_owner,
pin_cap_included_);
parasitic_ =
parasitics_->makeParasiticNetwork(parasitic_owner, pin_cap_included_);
}
net_ = net;
}
@@ -451,16 +440,15 @@ SpefReader::findParasiticNode(char *name,
// <instance>:<port>
Pin *pin = network_->findPin(inst, name2);
if (pin) {
if (local_only
&& !network_->isConnected(net_, pin))
warn(1651, "%s not connected to net %s.",
name1, sdc_network_->pathName(net_));
if (local_only && !network_->isConnected(net_, pin))
warn(1651, "{} not connected to net {}.", name1,
sdc_network_->pathName(net_));
return parasitics_->ensureParasiticNode(parasitic_, pin, network_);
}
else {
// Replace delimiter for error message.
*delim = delimiter_;
warn(1652, "pin %s not found.", name1);
warn(1652, "pin {} not found.", name1);
}
}
else {
@@ -472,15 +460,13 @@ SpefReader::findParasiticNode(char *name,
const char *id_str = delim + 1;
if (isDigits(id_str)) {
int id = atoi(id_str);
if (local_only
&& !network_->isConnected(net, net_))
warn(1653, "%s not connected to net %s.",
name1,
if (local_only && !network_->isConnected(net, net_))
warn(1653, "{} not connected to net {}.", name1,
network_->pathName(net_));
return parasitics_->ensureParasiticNode(parasitic_, net, id, network_);
}
else
warn(1654, "node %s not a pin or net:number", name1);
warn(1654, "node {} not a pin or net:number", name1);
}
}
}
@@ -491,23 +477,24 @@ SpefReader::findParasiticNode(char *name,
if (name1) {
Pin *pin = findPortPinRelative(name1);
if (pin) {
if (local_only
&& !network_->isConnected(net_, pin))
warn(1655, "%s not connected to net %s.", name1, network_->pathName(net_));
if (local_only && !network_->isConnected(net_, pin))
warn(1655, "{} not connected to net {}.", name1,
network_->pathName(net_));
return parasitics_->ensureParasiticNode(parasitic_, pin, network_);
}
else
warn(1656, "pin %s not found.", name1);
warn(1656, "pin {} not found.", name1);
}
else
warn(1657, "pin %s not found.", name);
warn(1657, "pin {} not found.", name);
}
}
return nullptr;
}
void
SpefReader::makeCapacitor(int, char *node_name,
SpefReader::makeCapacitor(int,
char *node_name,
SpefTriple *cap)
{
ParasiticNode *node = findParasiticNode(node_name, true);
@@ -622,7 +609,7 @@ SpefScanner::SpefScanner(std::istream *stream,
void
SpefScanner::error(const char *msg)
{
report_->fileError(1867, filename_.c_str(), lineno(), "%s", msg);
report_->fileError(1658, filename_.c_str(), lineno(), "{}", msg);
}
} // namespace
} // namespace sta

View File

@@ -25,6 +25,7 @@
#pragma once
#include <map>
#include <string_view>
#include "Zlib.hh"
#include "StringUtil.hh"
@@ -65,10 +66,6 @@ public:
const std::string &filename() const { return filename_; }
// Translate from spf/spef namespace to sta namespace.
char *translated(const char *token);
void warn(int id,
const char *fmt,
...)
__attribute__((format (printf, 3, 4)));
void setBusBrackets(char left,
char right);
void setTimeScale(float scale,
@@ -108,6 +105,15 @@ public:
char *node_name2,
SpefTriple *res);
PortDirection *portDirection(char *spef_dir);
int warnLine() const;
template <typename... Args>
void warn(int id,
std::string_view fmt,
Args &&...args)
{
report_->fileWarn(id, filename_, warnLine(), fmt,
std::forward<Args>(args)...);
}
private:
Pin *findPinRelative(const char *name);