rm \n from print stmts

This commit is contained in:
James Cherry 2020-12-28 09:04:57 -08:00
parent 7337e6e099
commit 20f01e417b
41 changed files with 507 additions and 477 deletions

View File

@ -880,7 +880,7 @@ ArnoldiDelayCalc::pr_solve1(double s,
// ignoring a typical error at drive node, that comes // ignoring a typical error at drive node, that comes
// from slight inaccuracies in rr // from slight inaccuracies in rr
if (!(rr[order-1]>1.0 && p[order-1]>500.0 && va>v1-0.002)) if (!(rr[order-1]>1.0 && p[order-1]>500.0 && va>v1-0.002))
debugPrint0(debug_, "arnoldi", 1, "err, pr_solve1, va<v1\n"); debugPrint0(debug_, "arnoldi", 1, "err, pr_solve1, va<v1");
} }
tmin = ta; vmin = va; tmin = ta; vmin = va;
} else { } else {
@ -893,7 +893,7 @@ ArnoldiDelayCalc::pr_solve1(double s,
pr_get_v(ta,s,order,p,rr,&va); pr_get_v(ta,s,order,p,rr,&va);
} }
if (va>v1) if (va>v1)
debugPrint0(debug_, "arnoldi", 1, "err, pr_solve1, va>v1\n"); debugPrint0(debug_, "arnoldi", 1, "err, pr_solve1, va>v1");
tmax = ta; vmax = va; tmax = ta; vmax = va;
} }
} else { } else {
@ -1141,7 +1141,7 @@ ra_hinv(double y,
ex = exp(-x); ex = exp(-x);
f = x+ex-1.0-y; f = x+ex-1.0-y;
if (f<-1e-8 || f>1e-8) if (f<-1e-8 || f>1e-8)
debugPrint2(debug, "arnoldi", 1, "y f %g %g\n",y,f); debugPrint2(debug, "arnoldi", 1, "y f %g %g" ,y, f);
return x; return x;
} }
@ -1276,7 +1276,7 @@ ArnoldiDelayCalc::ra_solve_for_s(delay_work *D,
if (abs(f)>.5e-12) // .5ps if (abs(f)>.5e-12) // .5ps
debugPrint3(debug_, "arnoldi", 1, debugPrint3(debug_, "arnoldi", 1,
"ra_solve_for_s p %g tlohi %s err %s\n", "ra_solve_for_s p %g tlohi %s err %s",
p, p,
units_->timeUnit()->asString(tlohi), units_->timeUnit()->asString(tlohi),
units_->timeUnit()->asString(f)); units_->timeUnit()->asString(f));
@ -1396,7 +1396,7 @@ ArnoldiDelayCalc::ar1_ceff_delay(delay_work *D,
ArcDelay df; ArcDelay df;
Slew sf; Slew sf;
debugPrint1(debug_, "arnoldi", 1, "\nctot=%s\n", debugPrint1(debug_, "arnoldi", 1, "\nctot=%s",
units_->capacitanceUnit()->asString(ctot)); units_->capacitanceUnit()->asString(ctot));
rdelay = ra_rdelay_1(tab,ctot); rdelay = ra_rdelay_1(tab,ctot);
@ -1419,7 +1419,7 @@ ArnoldiDelayCalc::ar1_ceff_delay(delay_work *D,
double p = 1.0/(r*ctot); double p = 1.0/(r*ctot);
double thix,tlox; double thix,tlox;
if (bad) printf("bad\n"); if (bad) printf("bad\n");
debugPrint2(debug_, "arnoldi", 1, "at r=%s s=%s\n", debugPrint2(debug_, "arnoldi", 1, "at r=%s s=%s",
units_->resistanceUnit()->asString(r), units_->resistanceUnit()->asString(r),
units_->timeUnit()->asString(s)); units_->timeUnit()->asString(s));
thix = ra_solve_for_t(p,s,vhi); thix = ra_solve_for_t(p,s,vhi);
@ -1427,12 +1427,12 @@ ArnoldiDelayCalc::ar1_ceff_delay(delay_work *D,
tab->table->gateDelay(tab->cell, tab->pvt,tab->in_slew, tab->table->gateDelay(tab->cell, tab->pvt,tab->in_slew,
ctot, tab->relcap, pocv_enabled_, df, sf); ctot, tab->relcap, pocv_enabled_, df, sf);
debugPrint3(debug_, "arnoldi", 1, debugPrint3(debug_, "arnoldi", 1,
"table slew (in_slew %s ctot %s) = %s\n", "table slew (in_slew %s ctot %s) = %s",
units_->timeUnit()->asString(tab->in_slew), units_->timeUnit()->asString(tab->in_slew),
units_->capacitanceUnit()->asString(ctot), units_->capacitanceUnit()->asString(ctot),
delayAsString(sf, this)); delayAsString(sf, this));
tlohi = slew_derate*delayAsFloat(sf); tlohi = slew_derate*delayAsFloat(sf);
debugPrint2(debug_, "arnoldi", 1, "tlohi %s %s\n", debugPrint2(debug_, "arnoldi", 1, "tlohi %s %s",
units_->timeUnit()->asString(tlohi), units_->timeUnit()->asString(tlohi),
units_->timeUnit()->asString(tlox-thix)); units_->timeUnit()->asString(tlox-thix));
} }
@ -1463,17 +1463,17 @@ ArnoldiDelayCalc::ar1_ceff_delay(delay_work *D,
if((ceff-1e-20) < 0.0) { // 1e-8pf if((ceff-1e-20) < 0.0) { // 1e-8pf
debugPrint0(debug_, "arnoldi", 1, debugPrint0(debug_, "arnoldi", 1,
"Invalid effective capacitance, using total capacitance\n"); "Invalid effective capacitance, using total capacitance");
ceff = ctot; ceff = ctot;
} }
// new mvs at ceff // new mvs at ceff
s = ra_get_s(D,tab,r,ceff); s = ra_get_s(D,tab,r,ceff);
debugPrint1(debug_, "arnoldi", 1, "new mvs s = %s\n", debugPrint1(debug_, "arnoldi", 1, "new mvs s = %s",
units_->timeUnit()->asString(s)); units_->timeUnit()->asString(s));
} }
} }
debugPrint4(debug_, "arnoldi", 1, "r %s s %s ceff_time %s ceff %s\n", debugPrint4(debug_, "arnoldi", 1, "r %s s %s ceff_time %s ceff %s",
units_->resistanceUnit()->asString(r), units_->resistanceUnit()->asString(r),
units_->timeUnit()->asString(s), units_->timeUnit()->asString(s),
units_->timeUnit()->asString(ceff_time), units_->timeUnit()->asString(ceff_time),

View File

@ -404,8 +404,7 @@ ArnoldiReduce::makeRcmodelDfs(ts_point *pdrv)
} // while (stackN) } // while (stackN)
if (loop) if (loop)
debugPrint1(debug_, "arnoldi", 1, debugPrint1(debug_, "arnoldi", 1, "net %s loop",
"net %s loop\n",
network_->pathName(drvr_pin_)); network_->pathName(drvr_pin_));
} }
@ -433,7 +432,7 @@ ArnoldiReduce::getRC()
p->r = parasitics_->value(p->in_edge->resistor_, ap_); p->r = parasitics_->value(p->in_edge->resistor_, ap_);
if (!(p->r>=0.0 && p->r<100e+3)) { // 0 < r < 100kohm if (!(p->r>=0.0 && p->r<100e+3)) { // 0 < r < 100kohm
debugPrint2(debug_, "arnoldi", 1, debugPrint2(debug_, "arnoldi", 1,
"R value %g out of range, drvr pin %s\n", "R value %g out of range, drvr pin %s",
p->r, p->r,
network_->pathName(drvr_pin_)); network_->pathName(drvr_pin_));
} }
@ -499,7 +498,7 @@ ArnoldiReduce::makeRcmodelFromTs()
debug_->print("\n"); debug_->print("\n");
} }
for (i=0;i<nterms;i++) for (i=0;i<nterms;i++)
debugPrint2(debug_, "arnoldi", 1, "outV[%d] = T%d\n",i,outV[i]); debugPrint2(debug_, "arnoldi", 1, "outV[%d] = T%d", i, outV[i]);
} }
int max_order = 5; int max_order = 5;
@ -522,7 +521,7 @@ ArnoldiReduce::makeRcmodelFromTs()
sum = 0.0; sum = 0.0;
for (j=0;j<n;j++) sum += c[j]; for (j=0;j<n;j++) sum += c[j];
debugPrint1(debug_, "arnoldi", 1, "ctot = %s\n", debugPrint1(debug_, "arnoldi", 1, "ctot = %s",
units_->capacitanceUnit()->asString(sum)); units_->capacitanceUnit()->asString(sum));
ctot_ = sum; ctot_ = sum;
sqc_ = sqrt(sum); sqc_ = sqrt(sum);
@ -589,9 +588,9 @@ ArnoldiReduce::makeRcmodelFromTs()
if (debug_->check("arnoldi", 1)) { if (debug_->check("arnoldi", 1)) {
debugPrint1(debug_, "arnoldi", 1, debugPrint1(debug_, "arnoldi", 1,
"tridiagonal reduced matrix, drvr pin %s\n", "tridiagonal reduced matrix, drvr pin %s",
network_->pathName(drvr_pin_)); network_->pathName(drvr_pin_));
debugPrint2(debug_, "arnoldi", 1, "order %d n %d\n",order,n); debugPrint2(debug_, "arnoldi", 1, "order %d n %d",order,n);
for (h=0;h<order;h++) { for (h=0;h<order;h++) {
debug_->print("d[%d] %s", debug_->print("d[%d] %s",
h, h,

View File

@ -355,7 +355,7 @@ DmpAlg::findDriverParams(double ceff)
this, fvec_, fjac_, index_, p_, scale_); this, fvec_, fjac_, index_, p_, scale_);
t0_ = x_[DmpParam::t0]; t0_ = x_[DmpParam::t0];
dt_ = x_[DmpParam::dt]; dt_ = x_[DmpParam::dt];
debugPrint3(debug_, "dmp_ceff", 3, " t0 = %s dt = %s ceff = %s\n", debugPrint3(debug_, "dmp_ceff", 3, " t0 = %s dt = %s ceff = %s",
units_->timeUnit()->asString(t0_), units_->timeUnit()->asString(t0_),
units_->timeUnit()->asString(dt_), units_->timeUnit()->asString(dt_),
units_->capacitanceUnit()->asString(x_[DmpParam::ceff])); units_->capacitanceUnit()->asString(x_[DmpParam::ceff]));
@ -730,7 +730,7 @@ DmpCap::init(const LibertyLibrary *drvr_library,
double rpi, double rpi,
double c1) double c1)
{ {
debugPrint0(debug_, "dmp_ceff", 3, "Using DMP cap\n"); debugPrint0(debug_, "dmp_ceff", 3, "Using DMP cap");
DmpAlg::init(drvr_library, drvr_cell, pvt, gate_model, rf, DmpAlg::init(drvr_library, drvr_cell, pvt, gate_model, rf,
rd, in_slew, related_out_cap, c2, rpi, c1); rd, in_slew, related_out_cap, c2, rpi, c1);
ceff_ = c1 + c2; ceff_ = c1 + c2;
@ -740,7 +740,7 @@ void
DmpCap::gateDelaySlew(double &delay, DmpCap::gateDelaySlew(double &delay,
double &slew) double &slew)
{ {
debugPrint1(debug_, "dmp_ceff", 3, " ceff = %s\n", debugPrint1(debug_, "dmp_ceff", 3, " ceff = %s",
units_->capacitanceUnit()->asString(ceff_)); units_->capacitanceUnit()->asString(ceff_));
gateCapDelaySlew(ceff_, delay, slew); gateCapDelaySlew(ceff_, delay, slew);
gate_slew_ = slew; gate_slew_ = slew;
@ -871,7 +871,7 @@ DmpPi::init(const LibertyLibrary *drvr_library,
double rpi, double rpi,
double c1) double c1)
{ {
debugPrint0(debug_, "dmp_ceff", 3, "Using DMP Pi\n"); debugPrint0(debug_, "dmp_ceff", 3, "Using DMP Pi");
DmpAlg::init(drvr_library, drvr_cell, pvt, gate_model, rf, rd, DmpAlg::init(drvr_library, drvr_cell, pvt, gate_model, rf, rd,
in_slew, related_out_cap, c2, rpi, c1); in_slew, related_out_cap, c2, rpi, c1);
@ -1185,7 +1185,7 @@ DmpZeroC2::init(const LibertyLibrary *drvr_library,
double rpi, double rpi,
double c1) double c1)
{ {
debugPrint0(debug_, "dmp_ceff", 3, "Using DMP C2=0\n"); debugPrint0(debug_, "dmp_ceff", 3, "Using DMP C2=0");
DmpAlg::init(drvr_library, drvr_cell, pvt, gate_model, rf, rd, DmpAlg::init(drvr_library, drvr_cell, pvt, gate_model, rf, rd,
in_slew, related_out_cap, c2, rpi, c1); in_slew, related_out_cap, c2, rpi, c1);
ceff_ = c1; ceff_ = c1;
@ -1628,7 +1628,7 @@ DmpCeffDelayCalc::setCeffAlgorithm(const LibertyLibrary *drvr_library,
dmp_alg_->init(drvr_library, drvr_cell, pvt, gate_model, dmp_alg_->init(drvr_library, drvr_cell, pvt, gate_model,
drvr_rf_, rd, in_slew, related_out_cap, c2, rpi, c1); drvr_rf_, rd, in_slew, related_out_cap, c2, rpi, c1);
debugPrint6(debug_, "dmp_ceff", 3, debugPrint6(debug_, "dmp_ceff", 3,
" DMP in_slew = %s c2 = %s rpi = %s c1 = %s Rd = %s (%s alg)\n", " DMP in_slew = %s c2 = %s rpi = %s c1 = %s Rd = %s (%s alg)",
units_->timeUnit()->asString(in_slew), units_->timeUnit()->asString(in_slew),
units_->capacitanceUnit()->asString(c2), units_->capacitanceUnit()->asString(c2),
units_->resistanceUnit()->asString(rpi), units_->resistanceUnit()->asString(rpi),

View File

@ -287,7 +287,7 @@ GraphDelayCalc1::setObserver(DelayCalcObserver *observer)
void void
GraphDelayCalc1::delaysInvalid() GraphDelayCalc1::delaysInvalid()
{ {
debugPrint0(debug_, "delay_calc", 1, "delays invalid\n"); debugPrint0(debug_, "delay_calc", 1, "delays invalid");
delays_exist_ = false; delays_exist_ = false;
delays_seeded_ = false; delays_seeded_ = false;
incremental_ = false; incremental_ = false;
@ -323,7 +323,7 @@ GraphDelayCalc1::delayInvalid(const Pin *pin)
void void
GraphDelayCalc1::delayInvalid(Vertex *vertex) GraphDelayCalc1::delayInvalid(Vertex *vertex)
{ {
debugPrint1(debug_, "delay_calc", 2, "delays invalid %s\n", debugPrint1(debug_, "delay_calc", 2, "delays invalid %s",
vertex->name(sdc_network_)); vertex->name(sdc_network_));
if (graph_ && incremental_) { if (graph_ && incremental_) {
invalid_delays_.insert(vertex); invalid_delays_.insert(vertex);
@ -404,7 +404,7 @@ GraphDelayCalc1::findDelays(Level level)
if (arc_delay_calc_) { if (arc_delay_calc_) {
Stats stats(debug_); Stats stats(debug_);
int dcalc_count = 0; int dcalc_count = 0;
debugPrint1(debug_, "delay_calc", 1, "find delays to level %d\n", level); debugPrint1(debug_, "delay_calc", 1, "find delays to level %d", level);
if (!delays_seeded_) { if (!delays_seeded_) {
iter_->clear(); iter_->clear();
ensureMultiDrvrNetsFound(); ensureMultiDrvrNetsFound();
@ -427,7 +427,7 @@ GraphDelayCalc1::findDelays(Level level)
delays_exist_ = true; delays_exist_ = true;
incremental_ = true; incremental_ = true;
debugPrint1(debug_, "delay_calc", 1, "found %d delays\n", dcalc_count); debugPrint1(debug_, "delay_calc", 1, "found %d delays", dcalc_count);
stats.report("Delay calc"); stats.report("Delay calc");
} }
} }
@ -510,7 +510,7 @@ GraphDelayCalc1::ensureMultiDrvrNetsFound()
void void
GraphDelayCalc1::makeMultiDrvrNet(PinSet &drvr_pins) GraphDelayCalc1::makeMultiDrvrNet(PinSet &drvr_pins)
{ {
debugPrint0(debug_, "delay_calc", 3, "multi-driver net\n"); debugPrint0(debug_, "delay_calc", 3, "multi-driver net");
VertexSet *drvr_vertices = new VertexSet; VertexSet *drvr_vertices = new VertexSet;
MultiDrvrNet *multi_drvr = new MultiDrvrNet(drvr_vertices); MultiDrvrNet *multi_drvr = new MultiDrvrNet(drvr_vertices);
Level max_drvr_level = 0; Level max_drvr_level = 0;
@ -519,7 +519,7 @@ GraphDelayCalc1::makeMultiDrvrNet(PinSet &drvr_pins)
while (pin_iter.hasNext()) { while (pin_iter.hasNext()) {
Pin *pin = pin_iter.next(); Pin *pin = pin_iter.next();
Vertex *drvr_vertex = graph_->pinDrvrVertex(pin); Vertex *drvr_vertex = graph_->pinDrvrVertex(pin);
debugPrint1(debug_, "delay_calc", 3, " %s\n", debugPrint1(debug_, "delay_calc", 3, " %s",
network_->pathName(pin)); network_->pathName(pin));
multi_drvr_net_map_[drvr_vertex] = multi_drvr; multi_drvr_net_map_[drvr_vertex] = multi_drvr;
drvr_vertices->insert(drvr_vertex); drvr_vertices->insert(drvr_vertex);
@ -575,7 +575,7 @@ GraphDelayCalc1::seedDrvrSlew(Vertex *drvr_vertex,
ArcDelayCalc *arc_delay_calc) ArcDelayCalc *arc_delay_calc)
{ {
const Pin *drvr_pin = drvr_vertex->pin(); const Pin *drvr_pin = drvr_vertex->pin();
debugPrint1(debug_, "delay_calc", 2, "seed driver slew %s\n", debugPrint1(debug_, "delay_calc", 2, "seed driver slew %s",
drvr_vertex->name(sdc_network_)); drvr_vertex->name(sdc_network_));
InputDrive *drive = 0; InputDrive *drive = 0;
if (network_->isTopLevelPort(drvr_pin)) { if (network_->isTopLevelPort(drvr_pin)) {
@ -679,7 +679,7 @@ void
GraphDelayCalc1::seedLoadSlew(Vertex *vertex) GraphDelayCalc1::seedLoadSlew(Vertex *vertex)
{ {
const Pin *pin = vertex->pin(); const Pin *pin = vertex->pin();
debugPrint1(debug_, "delay_calc", 2, "seed load slew %s\n", debugPrint1(debug_, "delay_calc", 2, "seed load slew %s",
vertex->name(sdc_network_)); vertex->name(sdc_network_));
ClockSet *clks = sdc_->findLeafPinClocks(pin); ClockSet *clks = sdc_->findLeafPinClocks(pin);
initSlew(vertex); initSlew(vertex);
@ -757,7 +757,7 @@ GraphDelayCalc1::findInputDriverDelay(LibertyCell *drvr_cell,
LibertyPort *to_port, LibertyPort *to_port,
DcalcAnalysisPt *dcalc_ap) DcalcAnalysisPt *dcalc_ap)
{ {
debugPrint2(debug_, "delay_calc", 2, " driver cell %s %s\n", debugPrint2(debug_, "delay_calc", 2, " driver cell %s %s",
drvr_cell->name(), drvr_cell->name(),
rf->asString()); rf->asString());
LibertyCellTimingArcSetIterator set_iter(drvr_cell); LibertyCellTimingArcSetIterator set_iter(drvr_cell);
@ -789,7 +789,7 @@ GraphDelayCalc1::findInputArcDelay(LibertyCell *drvr_cell,
float from_slew, float from_slew,
DcalcAnalysisPt *dcalc_ap) DcalcAnalysisPt *dcalc_ap)
{ {
debugPrint5(debug_, "delay_calc", 3, " %s %s -> %s %s (%s)\n", debugPrint5(debug_, "delay_calc", 3, " %s %s -> %s %s (%s)",
arc->from()->name(), arc->from()->name(),
arc->fromTrans()->asString(), arc->fromTrans()->asString(),
arc->to()->name(), arc->to()->name(),
@ -818,7 +818,7 @@ GraphDelayCalc1::findInputArcDelay(LibertyCell *drvr_cell,
gate_delay, gate_slew); gate_delay, gate_slew);
ArcDelay load_delay = gate_delay - intrinsic_delay; ArcDelay load_delay = gate_delay - intrinsic_delay;
debugPrint3(debug_, "delay_calc", 3, debugPrint3(debug_, "delay_calc", 3,
" gate delay = %s intrinsic = %s slew = %s\n", " gate delay = %s intrinsic = %s slew = %s",
delayAsString(gate_delay, this), delayAsString(gate_delay, this),
delayAsString(intrinsic_delay, this), delayAsString(intrinsic_delay, this),
delayAsString(gate_slew, this)); delayAsString(gate_slew, this));
@ -842,7 +842,7 @@ GraphDelayCalc1::findVertexDelay(Vertex *vertex,
const Pin *pin = vertex->pin(); const Pin *pin = vertex->pin();
// Don't clobber root slews. // Don't clobber root slews.
if (!vertex->isRoot()) { if (!vertex->isRoot()) {
debugPrint2(debug_, "delay_calc", 2, "find delays %s (%s)\n", debugPrint2(debug_, "delay_calc", 2, "find delays %s (%s)",
vertex->name(sdc_network_), vertex->name(sdc_network_),
network_->cellName(network_->instance(pin))); network_->cellName(network_->instance(pin)));
if (network_->isLeaf(pin)) { if (network_->isLeaf(pin)) {
@ -1195,7 +1195,7 @@ GraphDelayCalc1::findArcDelay(LibertyCell *drvr_cell,
if (from_rf && drvr_rf) { if (from_rf && drvr_rf) {
DcalcAPIndex ap_index = dcalc_ap->index(); DcalcAPIndex ap_index = dcalc_ap->index();
debugPrint7(debug_, "delay_calc", 3, debugPrint7(debug_, "delay_calc", 3,
" %s %s -> %s %s (%s) corner:%s/%s\n", " %s %s -> %s %s (%s) corner:%s/%s",
arc->from()->name(), arc->from()->name(),
arc->fromTrans()->asString(), arc->fromTrans()->asString(),
arc->to()->name(), arc->to()->name(),
@ -1224,7 +1224,7 @@ GraphDelayCalc1::findArcDelay(LibertyCell *drvr_cell,
gate_delay, gate_slew); gate_delay, gate_slew);
} }
debugPrint2(debug_, "delay_calc", 3, debugPrint2(debug_, "delay_calc", 3,
" gate delay = %s slew = %s\n", " gate delay = %s slew = %s",
delayAsString(gate_delay, this), delayAsString(gate_delay, this),
delayAsString(gate_slew, this)); delayAsString(gate_slew, this));
// Merge slews. // Merge slews.
@ -1417,7 +1417,7 @@ GraphDelayCalc1::annotateLoadDelays(Vertex *drvr_vertex,
Slew load_slew; Slew load_slew;
arc_delay_calc->loadDelay(load_pin, wire_delay, load_slew); arc_delay_calc->loadDelay(load_pin, wire_delay, load_slew);
debugPrint3(debug_, "delay_calc", 3, debugPrint3(debug_, "delay_calc", 3,
" %s load delay = %s slew = %s\n", " %s load delay = %s slew = %s",
load_vertex->name(sdc_network_), load_vertex->name(sdc_network_),
delayAsString(wire_delay, this), delayAsString(wire_delay, this),
delayAsString(load_slew, this)); delayAsString(load_slew, this));
@ -1461,7 +1461,7 @@ void
GraphDelayCalc1::findCheckDelays(Vertex *vertex, GraphDelayCalc1::findCheckDelays(Vertex *vertex,
ArcDelayCalc *arc_delay_calc) ArcDelayCalc *arc_delay_calc)
{ {
debugPrint2(debug_, "delay_calc", 2, "find checks %s (%s)\n", debugPrint2(debug_, "delay_calc", 2, "find checks %s (%s)",
vertex->name(sdc_network_), vertex->name(sdc_network_),
network_->cellName(network_->instance(vertex->pin()))); network_->cellName(network_->instance(vertex->pin())));
if (vertex->hasChecks()) { if (vertex->hasChecks()) {
@ -1525,14 +1525,14 @@ GraphDelayCalc1::findCheckEdgeDelays(Edge *edge,
int slew_index = dcalc_ap->checkDataSlewIndex(); int slew_index = dcalc_ap->checkDataSlewIndex();
const Slew &to_slew = graph_->slew(to_vertex, to_rf, slew_index); const Slew &to_slew = graph_->slew(to_vertex, to_rf, slew_index);
debugPrint5(debug_, "delay_calc", 3, debugPrint5(debug_, "delay_calc", 3,
" %s %s -> %s %s (%s)\n", " %s %s -> %s %s (%s)",
arc_set->from()->name(), arc_set->from()->name(),
arc->fromTrans()->asString(), arc->fromTrans()->asString(),
arc_set->to()->name(), arc_set->to()->name(),
arc->toTrans()->asString(), arc->toTrans()->asString(),
arc_set->role()->asString()); arc_set->role()->asString());
debugPrint2(debug_, "delay_calc", 3, debugPrint2(debug_, "delay_calc", 3,
" from_slew = %s to_slew = %s\n", " from_slew = %s to_slew = %s",
delayAsString(from_slew, this), delayAsString(from_slew, this),
delayAsString(to_slew, this)); delayAsString(to_slew, this));
float related_out_cap = 0.0; float related_out_cap = 0.0;
@ -1550,7 +1550,7 @@ GraphDelayCalc1::findCheckEdgeDelays(Edge *edge,
pvt, dcalc_ap, pvt, dcalc_ap,
check_delay); check_delay);
debugPrint1(debug_, "delay_calc", 3, debugPrint1(debug_, "delay_calc", 3,
" check_delay = %s\n", " check_delay = %s",
delayAsString(check_delay, this)); delayAsString(check_delay, this));
graph_->setArcDelay(edge, arc, ap_index, check_delay); graph_->setArcDelay(edge, arc, ap_index, check_delay);
delay_changed = true; delay_changed = true;

View File

@ -155,7 +155,7 @@ LumpedCapDelayCalc::gateDelay(const LibertyCell *drvr_cell,
{ {
GateTimingModel *model = gateModel(arc, dcalc_ap); GateTimingModel *model = gateModel(arc, dcalc_ap);
debugPrint3(debug_, "delay_calc", 3, debugPrint3(debug_, "delay_calc", 3,
" in_slew = %s load_cap = %s related_load_cap = %s lumped\n", " in_slew = %s load_cap = %s related_load_cap = %s lumped",
delayAsString(in_slew, this), delayAsString(in_slew, this),
units()->capacitanceUnit()->asString(load_cap), units()->capacitanceUnit()->asString(load_cap),
units()->capacitanceUnit()->asString(related_out_cap)); units()->capacitanceUnit()->asString(related_out_cap));

View File

@ -48,6 +48,10 @@ public:
void print(const char *fmt, void print(const char *fmt,
...) const ...) const
__attribute__((format (printf, 2, 3))); __attribute__((format (printf, 2, 3)));
void reportLine(const char *what,
const char *fmt,
...) const
__attribute__((format (printf, 3, 4)));
protected: protected:
Report *&report_; Report *&report_;
@ -71,62 +75,53 @@ debugCheck(const Debug *debug,
// be expensive, so use macros. // be expensive, so use macros.
#define debugPrint0(debug, what, level, msg) \ #define debugPrint0(debug, what, level, msg) \
if (sta::debug_on && debug->check(what, level)) { \ if (debug_on && debug->check(what, level)) { \
debug->print("%s: %s", what, msg); \ debug->reportLine(what, "%s", msg); \
} }
#define debugPrint1(debug, what, level, fmt, arg1) \ #define debugPrint1(debug, what, level, fmt, arg1) \
if (sta::debug_on && debug->check(what, level)) { \ if (debug_on && debug->check(what, level)) { \
debug->print("%s: ", what); \ debug->reportLine(what, fmt, arg1); \
debug->print(fmt, arg1); \
} }
#define debugPrint2(debug, what, level, fmt, arg1, arg2) \ #define debugPrint2(debug, what, level, fmt, arg1, arg2) \
if (sta::debug_on && debug->check(what, level)) { \ if (debug_on && debug->check(what, level)) { \
debug->print("%s: ", what); \ debug->reportLine(what, fmt, arg1, arg2); \
debug->print(fmt, arg1, arg2); \
} }
#define debugPrint3(debug, what, level, fmt, arg1, arg2, arg3) \ #define debugPrint3(debug, what, level, fmt, arg1, arg2, arg3) \
if (sta::debug_on && debug->check(what, level)) { \ if (debug_on && debug->check(what, level)) { \
debug->print("%s: ", what); \ debug->reportLine(what, fmt, arg1, arg2, arg3); \
debug->print(fmt, arg1, arg2, arg3); \
} }
#define debugPrint4(debug, what, level, fmt, arg1, arg2, arg3, arg4) \ #define debugPrint4(debug, what, level, fmt, arg1, arg2, arg3, arg4) \
if (sta::debug_on && debug->check(what, level)) { \ if (debug_on && debug->check(what, level)) { \
debug->print("%s: ", what); \ debug->reportLine(what, fmt, arg1, arg2, arg3, arg4); \
debug->print(fmt, arg1, arg2, arg3, arg4); \
} }
#define debugPrint5(debug, what, level, fmt, arg1, arg2, arg3, arg4, arg5) \ #define debugPrint5(debug, what, level, fmt, arg1, arg2, arg3, arg4, arg5) \
if (sta::debug_on && debug->check(what, level)) { \ if (debug_on && debug->check(what, level)) { \
debug->print("%s: ", what); \ debug->reportLine(what, fmt, arg1, arg2, arg3, arg4, arg5); \
debug->print(fmt, arg1, arg2, arg3, arg4, arg5); \
} }
#define debugPrint6(debug,what,level,fmt,arg1,arg2,arg3,arg4,arg5,arg6) \ #define debugPrint6(debug,what,level,fmt,arg1,arg2,arg3,arg4,arg5,arg6) \
if (sta::debug_on && debug->check(what, level)) { \ if (debug_on && debug->check(what, level)) { \
debug->print("%s: ", what); \ debug->reportLine(what, fmt, arg1, arg2, arg3, arg4, arg5, arg6); \
debug->print(fmt, arg1, arg2, arg3, arg4, arg5, arg6); \
} }
#define debugPrint7(debug,what,level,fmt,arg1,arg2,arg3,arg4,arg5,arg6,arg7) \ #define debugPrint7(debug,what,level,fmt,arg1,arg2,arg3,arg4,arg5,arg6,arg7) \
if (sta::debug_on && debug->check(what, level)) { \ if (debug_on && debug->check(what, level)) { \
debug->print("%s: ", what); \ debug->reportLine(what, fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7); \
debug->print(fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7); \
} }
#define debugPrint8(debug,what,level,fmt,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8) \ #define debugPrint8(debug,what,level,fmt,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8) \
if (sta::debug_on && debug->check(what, level)) { \ if (debug_on && debug->check(what, level)) { \
debug->print("%s: ", what); \ debug->reportLine(what, fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8); \
debug->print(fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8); \
} }
#define debugPrint9(debug,what,level,fmt,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9) \ #define debugPrint9(debug,what,level,fmt,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9) \
if (sta::debug_on && debug->check(what, level)) { \ if (debug_on && debug->check(what, level)) { \
debug->print("%s: ", what); \ debug->reportLine(what, fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9); \
debug->print(fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9); \
} }
} // namespace } // namespace

View File

@ -42,13 +42,13 @@ public:
// Return the number of characters written. // Return the number of characters written.
virtual size_t printString(const char *buffer, virtual size_t printString(const char *buffer,
size_t length); size_t length);
virtual void print(const char *fmt, ...);
virtual void vprint(const char *fmt, virtual void vprint(const char *fmt,
va_list args); va_list args);
void print(const string *str); void print(const string *str);
void print(const string &str); void print(const string &str);
// Print line with return. // Print line with return.
virtual void printLine(const char *line); virtual void reportLine(const char *fmt, ...);
virtual void reportLineString(const char *line);
//////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////
@ -148,6 +148,8 @@ protected:
std::mutex buffer_lock_; std::mutex buffer_lock_;
static Report *default_; static Report *default_;
friend class Debug;
private: private:
DISALLOW_COPY_AND_ASSIGN(Report); DISALLOW_COPY_AND_ASSIGN(Report);
}; };

View File

@ -48,7 +48,8 @@ public:
virtual void setTclInterp(Tcl_Interp *interp); virtual void setTclInterp(Tcl_Interp *interp);
protected: protected:
virtual size_t printConsole(const char *buffer, size_t length); virtual size_t printConsole(const char *buffer,
size_t length);
void flush(); void flush();
private: private:
@ -56,7 +57,9 @@ private:
Tcl_ChannelType *makeEncapChannelType(Tcl_Channel channel, Tcl_ChannelType *makeEncapChannelType(Tcl_Channel channel,
char *channel_name, char *channel_name,
Tcl_DriverOutputProc output_proc); Tcl_DriverOutputProc output_proc);
size_t printTcl(Tcl_Channel channel, const char *buffer, size_t length); size_t printTcl(Tcl_Channel channel,
const char *buffer,
size_t length);
Tcl_Interp *interp_; Tcl_Interp *interp_;
// The original tcl channels. // The original tcl channels.

View File

@ -1713,7 +1713,7 @@ LibertyCell::makeLatchEnable(LibertyPort *d,
latch_d_to_q_map_[d_to_q] = latch_enable; latch_d_to_q_map_[d_to_q] = latch_enable;
latch_check_map_[setup_check] = latch_enable; latch_check_map_[setup_check] = latch_enable;
latch_data_ports_.insert(d); latch_data_ports_.insert(d);
debugPrint3(debug, "liberty", 2, "latch d=%s en=%s q=%s\n", debugPrint3(debug, "liberty", 2, "latch d=%s en=%s q=%s",
d->name(), en->name(), q->name()); d->name(), en->name(), q->name());
return latch_enable; return latch_enable;
} }

View File

@ -1782,7 +1782,7 @@ LibertyReader::beginCell(LibertyGroup *group)
{ {
const char *name = group->firstName(); const char *name = group->firstName();
if (name) { if (name) {
debugPrint1(debug_, "liberty", 1, "cell %s\n", name); debugPrint1(debug_, "liberty", 1, "cell %s", name);
cell_ = builder_->makeCell(library_, name, filename_); cell_ = builder_->makeCell(library_, name, filename_);
in_bus_ = false; in_bus_ = false;
in_bundle_ = false; in_bundle_ = false;
@ -2059,7 +2059,7 @@ LibertyReader::beginScaledCell(LibertyGroup *group)
if (op_cond_name) { if (op_cond_name) {
op_cond_ = library_->findOperatingConditions(op_cond_name); op_cond_ = library_->findOperatingConditions(op_cond_name);
if (op_cond_) { if (op_cond_) {
debugPrint2(debug_, "liberty", 1, "scaled cell %s %s\n", debugPrint2(debug_, "liberty", 1, "scaled cell %s %s",
name, op_cond_name); name, op_cond_name);
cell_ = library_->makeScaledCell(name, filename_); cell_ = library_->makeScaledCell(name, filename_);
} }
@ -2131,7 +2131,7 @@ LibertyReader::makeTimingArcs(LibertyPort *to_port,
const char *from_port_name = related_port_iter.next(); const char *from_port_name = related_port_iter.next();
PortNameBitIterator from_port_iter(cell_, from_port_name, this, line); PortNameBitIterator from_port_iter(cell_, from_port_name, this, line);
if (from_port_iter.hasNext()) { if (from_port_iter.hasNext()) {
debugPrint2(debug_, "liberty", 2, " timing %s -> %s\n", debugPrint2(debug_, "liberty", 2, " timing %s -> %s",
from_port_name, to_port->name()); from_port_name, to_port->name());
makeTimingArcs(from_port_name, from_port_iter, to_port, makeTimingArcs(from_port_name, from_port_iter, to_port,
related_out_port, timing); related_out_port, timing);
@ -2304,7 +2304,7 @@ LibertyReader::makeInternalPowers(LibertyPort *port,
const char *related_port_name = related_port_iter.next(); const char *related_port_name = related_port_iter.next();
PortNameBitIterator related_port_iter(cell_, related_port_name, this, line); PortNameBitIterator related_port_iter(cell_, related_port_name, this, line);
if (related_port_iter.hasNext()) { if (related_port_iter.hasNext()) {
debugPrint2(debug_, "liberty", 2, " power %s -> %s\n", debugPrint2(debug_, "liberty", 2, " power %s -> %s",
related_port_name, port->name()); related_port_name, port->name());
makeInternalPowers(port, related_port_name, related_port_iter, power_group); makeInternalPowers(port, related_port_name, related_port_iter, power_group);
} }
@ -2504,7 +2504,7 @@ LibertyReader::beginPin(LibertyGroup *group)
LibertyAttrValue *param = param_iter.next(); LibertyAttrValue *param = param_iter.next();
if (param->isString()) { if (param->isString()) {
const char *name = param->stringValue(); const char *name = param->stringValue();
debugPrint1(debug_, "liberty", 1, " port %s\n", name); debugPrint1(debug_, "liberty", 1, " port %s", name);
PortNameBitIterator port_iter(cell_, name, this, group->line()); PortNameBitIterator port_iter(cell_, name, this, group->line());
while (port_iter.hasNext()) { while (port_iter.hasNext()) {
LibertyPort *port = port_iter.next(); LibertyPort *port = port_iter.next();
@ -2524,7 +2524,7 @@ LibertyReader::beginPin(LibertyGroup *group)
LibertyAttrValue *param = param_iter.next(); LibertyAttrValue *param = param_iter.next();
if (param->isString()) { if (param->isString()) {
const char *name = param->stringValue(); const char *name = param->stringValue();
debugPrint1(debug_, "liberty", 1, " port %s\n", name); debugPrint1(debug_, "liberty", 1, " port %s", name);
LibertyPort *port = findPort(name); LibertyPort *port = findPort(name);
if (port == nullptr) if (port == nullptr)
port = builder_->makePort(cell_, name); port = builder_->makePort(cell_, name);
@ -2544,7 +2544,7 @@ LibertyReader::beginPin(LibertyGroup *group)
LibertyAttrValue *param = param_iter.next(); LibertyAttrValue *param = param_iter.next();
if (param->isString()) { if (param->isString()) {
const char *name = param->stringValue(); const char *name = param->stringValue();
debugPrint1(debug_, "liberty", 1, " port %s\n", name); debugPrint1(debug_, "liberty", 1, " port %s", name);
if (isBusName(name, brkt_left, brkt_right, escape_)) if (isBusName(name, brkt_left, brkt_right, escape_))
// Pins not inside a bus group with bus names are not really // Pins not inside a bus group with bus names are not really
// busses, so escape the brackets. // busses, so escape the brackets.
@ -2680,7 +2680,7 @@ LibertyReader::visitBusType(LibertyAttr *attr)
StringSeq::Iterator name_iter(bus_names_); StringSeq::Iterator name_iter(bus_names_);
while (name_iter.hasNext()) { while (name_iter.hasNext()) {
const char *name = name_iter.next(); const char *name = name_iter.next();
debugPrint1(debug_, "liberty", 1, " bus %s\n", name); debugPrint1(debug_, "liberty", 1, " bus %s", name);
LibertyPort *port = builder_->makeBusPort(cell_, name, LibertyPort *port = builder_->makeBusPort(cell_, name,
bus_dcl->from(), bus_dcl->from(),
bus_dcl->to()); bus_dcl->to());
@ -2723,7 +2723,7 @@ LibertyReader::visitMembers(LibertyAttr *attr)
StringSeq::Iterator name_iter(bus_names_); StringSeq::Iterator name_iter(bus_names_);
while (name_iter.hasNext()) { while (name_iter.hasNext()) {
const char *name = name_iter.next(); const char *name = name_iter.next();
debugPrint1(debug_, "liberty", 1, " bundle %s\n", name); debugPrint1(debug_, "liberty", 1, " bundle %s", name);
ConcretePortSeq *members = new ConcretePortSeq; ConcretePortSeq *members = new ConcretePortSeq;
LibertyAttrValueIterator value_iter(attr->values()); LibertyAttrValueIterator value_iter(attr->values());
while (value_iter.hasNext()) { while (value_iter.hasNext()) {

View File

@ -16,7 +16,8 @@
#include "TableModel.hh" #include "TableModel.hh"
#include "Report.hh" #include <string>
#include "Error.hh" #include "Error.hh"
#include "EnumNameMap.hh" #include "EnumNameMap.hh"
#include "Units.hh" #include "Units.hh"
@ -24,6 +25,8 @@
namespace sta { namespace sta {
using std::string;
static void static void
deleteSigmaModels(TableModel *models[EarlyLate::index_count]); deleteSigmaModels(TableModel *models[EarlyLate::index_count]);
static void static void
@ -732,7 +735,7 @@ Table0::report(const Units *units,
{ {
int digits = 4; int digits = 4;
const Unit *table_unit = units->timeUnit(); const Unit *table_unit = units->timeUnit();
report->print("%s\n", table_unit->asString(value_, digits)); report->reportLine("%s", table_unit->asString(value_, digits));
} }
//////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////
@ -835,15 +838,21 @@ Table1::report(const Units *units,
int digits = 4; int digits = 4;
const Unit *unit1 = tableVariableUnit(axis1_->variable(), units); const Unit *unit1 = tableVariableUnit(axis1_->variable(), units);
const Unit *table_unit = units->timeUnit(); const Unit *table_unit = units->timeUnit();
report->print("%s\n", tableVariableString(axis1_->variable())); report->reportLine("%s", tableVariableString(axis1_->variable()));
report->print("------------------------------\n"); report->reportLine("------------------------------");
for (size_t index1 = 0; index1 < axis1_->size(); index1++) string line;
report->print("%s ", unit1->asString(axis1_->axisValue(index1), digits)); for (size_t index1 = 0; index1 < axis1_->size(); index1++) {
report->print("\n"); line += unit1->asString(axis1_->axisValue(index1), digits);
line += " ";
}
report->reportLine(line.c_str());
for (size_t index1 = 0; index1 < axis1_->size(); index1++) line.clear();
report->print("%s ", table_unit->asString(tableValue(index1),digits)); for (size_t index1 = 0; index1 < axis1_->size(); index1++) {
report->print("\n"); line += table_unit->asString(tableValue(index1), digits);
line += " ";
}
report->reportLine(line.c_str());
} }
//////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////
@ -1020,19 +1029,23 @@ Table2::report(const Units *units,
const Unit *table_unit = units->timeUnit(); const Unit *table_unit = units->timeUnit();
const Unit *unit1 = tableVariableUnit(axis1_->variable(), units); const Unit *unit1 = tableVariableUnit(axis1_->variable(), units);
const Unit *unit2 = tableVariableUnit(axis2_->variable(), units); const Unit *unit2 = tableVariableUnit(axis2_->variable(), units);
report->print("%s\n", tableVariableString(axis2_->variable())); report->reportLine("%s", tableVariableString(axis2_->variable()));
report->print(" ------------------------------\n"); report->reportLine(" ------------------------------");
report->print(" "); string line = " ";
for (size_t index2 = 0; index2 < axis2_->size(); index2++) for (size_t index2 = 0; index2 < axis2_->size(); index2++) {
report->print("%s ", unit2->asString(axis2_->axisValue(index2), digits)); line += unit2->asString(axis2_->axisValue(index2), digits);
report->print("\n"); line += " ";
}
report->reportLine(line.c_str());
for (size_t index1 = 0; index1 < axis1_->size(); index1++) { for (size_t index1 = 0; index1 < axis1_->size(); index1++) {
report->print("%s |", unit1->asString(axis1_->axisValue(index1), digits)); line = unit1->asString(axis1_->axisValue(index1), digits);
for (size_t index2 = 0; index2 < axis2_->size(); index2++) line += " |";
report->print("%s ", table_unit->asString(tableValue(index1, index2), for (size_t index2 = 0; index2 < axis2_->size(); index2++) {
digits)); line += table_unit->asString(tableValue(index1, index2), digits);
report->print("\n"); line += " ";
}
report->reportLine(line.c_str());
} }
} }
@ -1277,23 +1290,26 @@ Table3::report(const Units *units,
const Unit *unit2 = tableVariableUnit(axis2_->variable(), units); const Unit *unit2 = tableVariableUnit(axis2_->variable(), units);
const Unit *unit3 = tableVariableUnit(axis3_->variable(), units); const Unit *unit3 = tableVariableUnit(axis3_->variable(), units);
for (size_t index1 = 0; index1 < axis1_->size(); index1++) { for (size_t index1 = 0; index1 < axis1_->size(); index1++) {
report->print("%s %s\n", tableVariableString(axis1_->variable()), report->reportLine("%s %s", tableVariableString(axis1_->variable()),
unit1->asString(axis1_->axisValue(index1), digits)); unit1->asString(axis1_->axisValue(index1), digits));
report->print("%s\n", tableVariableString(axis3_->variable())); report->reportLine("%s", tableVariableString(axis3_->variable()));
report->print(" ------------------------------\n"); report->reportLine(" ------------------------------");
report->print(" "); string line = " ";
for (size_t index3 = 0; index3 < axis3_->size(); index3++) for (size_t index3 = 0; index3 < axis3_->size(); index3++) {
report->print("%s ", unit3->asString(axis3_->axisValue(index3), digits)); line += unit3->asString(axis3_->axisValue(index3), digits);
report->print("\n"); line += " ";
}
report->reportLine(line.c_str());
for (size_t index2 = 0; index2 < axis2_->size(); index2++) { for (size_t index2 = 0; index2 < axis2_->size(); index2++) {
report->print("%s |", unit2->asString(axis2_->axisValue(index2),digits)); line = unit2->asString(axis2_->axisValue(index2),digits);
for (size_t index3 = 0; index3 < axis3_->size(); index3++) line += " |";
report->print("%s ", table_unit->asString(tableValue(index1, index2, for (size_t index3 = 0; index3 < axis3_->size(); index3++) {
index3), line += table_unit->asString(tableValue(index1, index2, index3), digits);
digits)); line += " ";
report->print("\n"); }
report->reportLine(line.c_str());
} }
} }
} }

View File

@ -316,3 +316,6 @@
604 Sdc.tcl:270 unknown $unit prefix '$prefix'. 604 Sdc.tcl:270 unknown $unit prefix '$prefix'.
605 Sdc.tcl:3066 wire load model '$model_name' not found. 605 Sdc.tcl:3066 wire load model '$model_name' not found.
606 Cmds.tcl:1875 get_property unsupported object type $object_type. 606 Cmds.tcl:1875 get_property unsupported object type $object_type.
607 StaTcl.i unknown report path field %s
608 StaTcl.i unknown report path field %s

View File

@ -1592,7 +1592,7 @@ ConcreteParasitics::reduceToPiElmore(Parasitic *parasitic,
const MinMax *cnst_min_max, const MinMax *cnst_min_max,
const ParasiticAnalysisPt *ap) const ParasiticAnalysisPt *ap)
{ {
debugPrint1(debug_, "parasitic_reduce", 1, "Reduce net %s\n", debugPrint1(debug_, "parasitic_reduce", 1, "Reduce net %s",
network_->pathName(net)); network_->pathName(net));
NetConnectedPinIterator *pin_iter = network_->connectedPinIterator(net); NetConnectedPinIterator *pin_iter = network_->connectedPinIterator(net);
while (pin_iter->hasNext()) { while (pin_iter->hasNext()) {
@ -1625,7 +1625,7 @@ ConcreteParasitics::reduceToPiPoleResidue2(Parasitic *parasitic,
const MinMax *cnst_min_max, const MinMax *cnst_min_max,
const ParasiticAnalysisPt *ap) const ParasiticAnalysisPt *ap)
{ {
debugPrint1(debug_, "parasitic_reduce", 1, "Reduce net %s\n", debugPrint1(debug_, "parasitic_reduce", 1, "Reduce net %s",
network_->pathName(net)); network_->pathName(net));
NetConnectedPinIterator *pin_iter = network_->connectedPinIterator(net); NetConnectedPinIterator *pin_iter = network_->connectedPinIterator(net);
while (pin_iter->hasNext()) { while (pin_iter->hasNext()) {

View File

@ -132,7 +132,7 @@ ReduceToPi::reduceToPi(const Pin *drvr_pin,
rpi = -y3 * y3 / (y2 * y2 * y2); rpi = -y3 * y3 / (y2 * y2 * y2);
} }
debugPrint3(debug_, "parasitic_reduce", 2, debugPrint3(debug_, "parasitic_reduce", 2,
" Pi model c2=%.3g rpi=%.3g c1=%.3g\n", " Pi model c2=%.3g rpi=%.3g c1=%.3g",
c2, rpi, c1); c2, rpi, c1);
} }
@ -173,8 +173,7 @@ ReduceToPi::reducePiDfs(const Pin *drvr_pin,
&& device != from_res) { && device != from_res) {
if (isVisited(onode)) { if (isVisited(onode)) {
// Resistor loop. // Resistor loop.
debugPrint1(debug_, "parasitic_reduce", 2, debugPrint1(debug_, "parasitic_reduce", 2, " loop detected thru resistor %s",
" loop detected thru resistor %s\n",
parasitics_->name(device)); parasitics_->name(device));
markLoopResistor(device); markLoopResistor(device);
} }
@ -197,7 +196,7 @@ ReduceToPi::reducePiDfs(const Pin *drvr_pin,
setDownstreamCap(node, dwn_cap); setDownstreamCap(node, dwn_cap);
leave(node); leave(node);
debugPrint5(debug_, "parasitic_reduce", 3, debugPrint5(debug_, "parasitic_reduce", 3,
" node %s y1=%.3g y2=%.3g y3=%.3g cap=%.3g\n", " node %s y1=%.3g y2=%.3g y3=%.3g cap=%.3g",
parasitics_->name(node), y1, y2, y3, dwn_cap); parasitics_->name(node), y1, y2, y3, dwn_cap);
} }
@ -302,8 +301,7 @@ reduceToPiElmore(Parasitic *parasitic_network,
ParasiticNode *drvr_node = parasitics->findNode(parasitic_network, ParasiticNode *drvr_node = parasitics->findNode(parasitic_network,
drvr_pin); drvr_pin);
if (drvr_node) { if (drvr_node) {
debugPrint1(sta->debug(), "parasitic_reduce", 1, debugPrint1(sta->debug(), "parasitic_reduce", 1, "Reduce driver %s",
"Reduce driver %s\n",
sta->network()->pathName(drvr_pin)); sta->network()->pathName(drvr_pin));
ReduceToPiElmore reducer(sta); ReduceToPiElmore reducer(sta);
reducer.makePiElmore(parasitic_network, drvr_pin, drvr_node, reducer.makePiElmore(parasitic_network, drvr_pin, drvr_node,
@ -357,8 +355,7 @@ ReduceToPiElmore::reduceElmoreDfs(const Pin *drvr_pin,
const Pin *pin = parasitics_->connectionPin(node); const Pin *pin = parasitics_->connectionPin(node);
if (from_res && pin) { if (from_res && pin) {
if (network_->isLoad(pin)) { if (network_->isLoad(pin)) {
debugPrint2(debug_, "parasitic_reduce", 2, debugPrint2(debug_, "parasitic_reduce", 2, " Load %s elmore=%.3g",
" Load %s elmore=%.3g\n",
network_->pathName(pin), network_->pathName(pin),
elmore); elmore);
parasitics_->setElmore(pi_elmore, pin, elmore); parasitics_->setElmore(pi_elmore, pin, elmore);
@ -469,8 +466,7 @@ reduceToPiPoleResidue2(Parasitic *parasitic_network,
Parasitics *parasitics = sta->parasitics(); Parasitics *parasitics = sta->parasitics();
ParasiticNode *drvr_node = parasitics->findNode(parasitic_network, drvr_pin); ParasiticNode *drvr_node = parasitics->findNode(parasitic_network, drvr_pin);
if (drvr_node) { if (drvr_node) {
debugPrint1(sta->debug(), "parasitic_reduce", 1, debugPrint1(sta->debug(), "parasitic_reduce", 1, "Reduce driver %s",
"Reduce driver %s\n",
sta->network()->pathName(drvr_pin)); sta->network()->pathName(drvr_pin));
ReduceToPiPoleResidue2 reducer(sta); ReduceToPiPoleResidue2 reducer(sta);
reducer.makePiPoleResidue2(parasitic_network, drvr_pin, drvr_node, reducer.makePiPoleResidue2(parasitic_network, drvr_pin, drvr_node,
@ -591,8 +587,7 @@ ReduceToPiPoleResidue2::findBranchCurrents(const Pin *drvr_pin,
leave(node); leave(node);
if (from_res) { if (from_res) {
setCurrent(from_res, branch_i); setCurrent(from_res, branch_i);
debugPrint1(debug_, "parasitic_reduce", 3, debugPrint1(debug_, "parasitic_reduce", 3, " res i=%.3g", branch_i);
" res i=%.3g\n", branch_i);
} }
return branch_i; return branch_i;
} }
@ -620,8 +615,7 @@ ReduceToPiPoleResidue2::findMoments(const Pin *drvr_pin,
double r_volt = r * current(device); double r_volt = r * current(device);
double onode_volt = from_volt - r_volt; double onode_volt = from_volt - r_volt;
setMoment(onode, onode_volt, moment_index); setMoment(onode, onode_volt, moment_index);
debugPrint3(debug_, "parasitic_reduce", 3, debugPrint3(debug_, "parasitic_reduce", 3, " moment %s %d %.3g",
" moment %s %d %.3g\n",
parasitics_->name(onode), parasitics_->name(onode),
moment_index, moment_index,
onode_volt); onode_volt);
@ -689,8 +683,7 @@ ReduceToPiPoleResidue2::findPolesResidues(Parasitic *pi_pole_residue,
|| m1 / m2 == m2 / m3) { || m1 / m2 == m2 / m3) {
double p1 = -1.0 / m1; double p1 = -1.0 / m1;
double k1 = 1.0; double k1 = 1.0;
debugPrint3(debug_, "parasitic_reduce", 3, debugPrint3(debug_, "parasitic_reduce", 3, " load %s p1=%.3g k1=%.3g",
" load %s p1=%.3g k1=%.3g\n",
network_->pathName(load_pin), p1, k1); network_->pathName(load_pin), p1, k1);
ComplexFloatSeq *poles = new ComplexFloatSeq(1); ComplexFloatSeq *poles = new ComplexFloatSeq(1);
ComplexFloatSeq *residues = new ComplexFloatSeq(1); ComplexFloatSeq *residues = new ComplexFloatSeq(1);
@ -710,7 +703,7 @@ ReduceToPiPoleResidue2::findPolesResidues(Parasitic *pi_pole_residue,
k1 = k; k1 = k;
} }
debugPrint5(debug_, "parasitic_reduce", 3, debugPrint5(debug_, "parasitic_reduce", 3,
" load %s p1=%.3g p2=%.3g k1=%.3g k2=%.3g\n", " load %s p1=%.3g p2=%.3g k1=%.3g k2=%.3g",
network_->pathName(load_pin), p1, p2, k1, k2); network_->pathName(load_pin), p1, p2, k1, k2);
ComplexFloatSeq *poles = new ComplexFloatSeq(2); ComplexFloatSeq *poles = new ComplexFloatSeq(2);

View File

@ -46,7 +46,7 @@ CycleAccting::findDelays(StaState *sta)
{ {
Debug *debug = sta->debug(); Debug *debug = sta->debug();
const Unit *time_unit = sta->units()->timeUnit(); const Unit *time_unit = sta->units()->timeUnit();
debugPrint2(debug, "cycle_acct", 1, "%s -> %s\n", debugPrint2(debug, "cycle_acct", 1, "%s -> %s",
src_->name(), src_->name(),
tgt_->name()); tgt_->name());
const int setup_index = TimingRole::setup()->index(); const int setup_index = TimingRole::setup()->index();
@ -88,14 +88,14 @@ CycleAccting::findDelays(StaState *sta)
if (tgt_past_src && src_past_tgt if (tgt_past_src && src_past_tgt
// Synchronicity achieved. // Synchronicity achieved.
&& fuzzyEqual(src_cycle_start, tgt_cycle_start)) { && fuzzyEqual(src_cycle_start, tgt_cycle_start)) {
debugPrint2(debug, "cycle_acct", 1, " setup = %s, required = %s\n", debugPrint2(debug, "cycle_acct", 1, " setup = %s, required = %s",
time_unit->asString(delay_[setup_index]), time_unit->asString(delay_[setup_index]),
time_unit->asString(required_[setup_index])); time_unit->asString(required_[setup_index]));
debugPrint2(debug, "cycle_acct", 1, " hold = %s, required = %s\n", debugPrint2(debug, "cycle_acct", 1, " hold = %s, required = %s",
time_unit->asString(delay_[hold_index]), time_unit->asString(delay_[hold_index]),
time_unit->asString(required_[hold_index])); time_unit->asString(required_[hold_index]));
debugPrint2(debug, "cycle_acct", 1, debugPrint2(debug, "cycle_acct", 1,
" converged at src cycles = %d tgt cycles = %d\n", " converged at src cycles = %d tgt cycles = %d",
src_cycle, tgt_cycle); src_cycle, tgt_cycle);
return; return;
} }
@ -103,13 +103,13 @@ CycleAccting::findDelays(StaState *sta)
if (fuzzyGreater(src_cycle_start, tgt_cycle_start + tgt_period) if (fuzzyGreater(src_cycle_start, tgt_cycle_start + tgt_period)
&& src_past_tgt) && src_past_tgt)
break; break;
debugPrint5(debug, "cycle_acct", 2, " %s src cycle %d %s + %s = %s\n", debugPrint5(debug, "cycle_acct", 2, " %s src cycle %d %s + %s = %s",
src_->name(), src_->name(),
src_cycle, src_cycle,
time_unit->asString(src_cycle_start), time_unit->asString(src_cycle_start),
time_unit->asString(src_->time()), time_unit->asString(src_->time()),
time_unit->asString(src_time)); time_unit->asString(src_time));
debugPrint5(debug, "cycle_acct", 2, " %s tgt cycle %d %s + %s = %s\n", debugPrint5(debug, "cycle_acct", 2, " %s tgt cycle %d %s + %s = %s",
tgt_->name(), tgt_->name(),
tgt_cycle, tgt_cycle,
time_unit->asString(tgt_cycle_start), time_unit->asString(tgt_cycle_start),
@ -124,7 +124,7 @@ CycleAccting::findDelays(StaState *sta)
double required = tgt_time - src_cycle_start; double required = tgt_time - src_cycle_start;
setSetupAccting(src_cycle, tgt_cycle, delay, required); setSetupAccting(src_cycle, tgt_cycle, delay, required);
debugPrint2(debug, "cycle_acct", 2, debugPrint2(debug, "cycle_acct", 2,
" setup min delay = %s, required = %s\n", " setup min delay = %s, required = %s",
time_unit->asString(delay_[setup_index]), time_unit->asString(delay_[setup_index]),
time_unit->asString(required_[setup_index])); time_unit->asString(required_[setup_index]));
} }
@ -160,7 +160,7 @@ CycleAccting::findDelays(StaState *sta)
setAccting(TimingRole::latchSetup(), setAccting(TimingRole::latchSetup(),
src_cycle, latch_tgt_cycle, delay, required); src_cycle, latch_tgt_cycle, delay, required);
debugPrint2(debug, "cycle_acct", 2, debugPrint2(debug, "cycle_acct", 2,
" latch setup min delay = %s, required = %s\n", " latch setup min delay = %s, required = %s",
time_unit->asString(delay_[latch_setup_index]), time_unit->asString(delay_[latch_setup_index]),
time_unit->asString(required_[latch_setup_index])); time_unit->asString(required_[latch_setup_index]));
} }
@ -174,7 +174,7 @@ CycleAccting::findDelays(StaState *sta)
double required = tgt_time - src_cycle_start; double required = tgt_time - src_cycle_start;
setHoldAccting(src_cycle, tgt_cycle, delay, required); setHoldAccting(src_cycle, tgt_cycle, delay, required);
debugPrint2(debug, "cycle_acct", 2, debugPrint2(debug, "cycle_acct", 2,
" hold min delay = %s, required = %s\n", " hold min delay = %s, required = %s",
time_unit->asString(delay_[hold_index]), time_unit->asString(delay_[hold_index]),
time_unit->asString(required_[hold_index])); time_unit->asString(required_[hold_index]));
} }
@ -189,7 +189,7 @@ CycleAccting::findDelays(StaState *sta)
setAccting(TimingRole::gatedClockHold(), setAccting(TimingRole::gatedClockHold(),
src_cycle, tgt_cycle, delay, required); src_cycle, tgt_cycle, delay, required);
debugPrint2(debug, "cycle_acct", 2, debugPrint2(debug, "cycle_acct", 2,
" gated clk hold min delay = %s, required = %s\n", " gated clk hold min delay = %s, required = %s",
time_unit->asString(delay_[gclk_hold_index]), time_unit->asString(delay_[gclk_hold_index]),
time_unit->asString(required_[gclk_hold_index])); time_unit->asString(required_[gclk_hold_index]));
} }
@ -198,7 +198,7 @@ CycleAccting::findDelays(StaState *sta)
} }
max_cycles_exceeded_ = true; max_cycles_exceeded_ = true;
debugPrint2(debug, "cycle_acct", 1, debugPrint2(debug, "cycle_acct", 1,
" max cycles exceeded after %d src cycles, %d tgt_cycles\n", " max cycles exceeded after %d src cycles, %d tgt_cycles",
src_cycle, tgt_cycle); src_cycle, tgt_cycle);
} }
else if (tgt_period > 0.0) else if (tgt_period > 0.0)

View File

@ -4243,7 +4243,7 @@ Sdc::makeLoopExceptions()
void void
Sdc::makeLoopExceptions(GraphLoop *loop) Sdc::makeLoopExceptions(GraphLoop *loop)
{ {
debugPrint0(debug_, "loop", 2, "Loop false path\n"); debugPrint0(debug_, "loop", 2, "Loop false path");
EdgeSeq::Iterator loop_edge_iter(loop->edges()); EdgeSeq::Iterator loop_edge_iter(loop->edges());
while (loop_edge_iter.hasNext()) { while (loop_edge_iter.hasNext()) {
Edge *edge = loop_edge_iter.next(); Edge *edge = loop_edge_iter.next();
@ -4289,7 +4289,7 @@ void
Sdc::makeLoopExceptionThru(Pin *pin, Sdc::makeLoopExceptionThru(Pin *pin,
ExceptionThruSeq *thrus) ExceptionThruSeq *thrus)
{ {
debugPrint1(debug_, "levelize", 2, " %s\n", network_->pathName(pin)); debugPrint1(debug_, "levelize", 2, " %s", network_->pathName(pin));
PinSet *pins = new PinSet; PinSet *pins = new PinSet;
pins->insert(pin); pins->insert(pin);
ExceptionThru *thru = makeExceptionThru(pins, nullptr, nullptr, ExceptionThru *thru = makeExceptionThru(pins, nullptr, nullptr,
@ -4313,7 +4313,7 @@ Sdc::deleteLoopExceptions()
void void
Sdc::addException(ExceptionPath *exception) Sdc::addException(ExceptionPath *exception)
{ {
debugPrint1(debug_, "exception_merge", 1, "add exception for %s\n", debugPrint1(debug_, "exception_merge", 1, "add exception for %s",
exception->asString(network_)); exception->asString(network_));
if (exception->isPathDelay()) { if (exception->isPathDelay()) {
@ -4339,7 +4339,7 @@ Sdc::addException(ExceptionPath *exception)
ExceptionTo *to = exception->to(); ExceptionTo *to = exception->to();
ExceptionTo *to1 = to ? to->clone() : nullptr; ExceptionTo *to1 = to ? to->clone() : nullptr;
ExceptionPath *exception1 = exception->clone(from1, thrus1, to1, true); ExceptionPath *exception1 = exception->clone(from1, thrus1, to1, true);
debugPrint1(debug_, "exception_merge", 1, " split exception for %s\n", debugPrint1(debug_, "exception_merge", 1, " split exception for %s",
exception1->asString(network_)); exception1->asString(network_));
addException1(exception1); addException1(exception1);
@ -4349,7 +4349,7 @@ Sdc::addException(ExceptionPath *exception)
ExceptionThruSeq *thrus2 = exceptionThrusClone(exception->thrus(), network_); ExceptionThruSeq *thrus2 = exceptionThrusClone(exception->thrus(), network_);
ExceptionTo *to2 = to ? to->clone() : nullptr; ExceptionTo *to2 = to ? to->clone() : nullptr;
ExceptionPath *exception2 = exception->clone(from2, thrus2, to2, true); ExceptionPath *exception2 = exception->clone(from2, thrus2, to2, true);
debugPrint1(debug_, "exception_merge", 1, " split exception for %s\n", debugPrint1(debug_, "exception_merge", 1, " split exception for %s",
exception2->asString(network_)); exception2->asString(network_));
addException1(exception2); addException1(exception2);
@ -4374,7 +4374,7 @@ Sdc::addException1(ExceptionPath *exception)
to->transition(), to->transition(),
to->endTransition(), true); to->endTransition(), true);
ExceptionPath *exception1 = exception->clone(from1, thrus1, to1, true); ExceptionPath *exception1 = exception->clone(from1, thrus1, to1, true);
debugPrint1(debug_, "exception_merge", 1, " split exception for %s\n", debugPrint1(debug_, "exception_merge", 1, " split exception for %s",
exception1->asString(network_)); exception1->asString(network_));
addException2(exception1); addException2(exception1);
@ -4384,7 +4384,7 @@ Sdc::addException1(ExceptionPath *exception)
ExceptionTo *to2 = new ExceptionTo(nullptr, clks2, nullptr, to->transition(), ExceptionTo *to2 = new ExceptionTo(nullptr, clks2, nullptr, to->transition(),
to->endTransition(), true); to->endTransition(), true);
ExceptionPath *exception2 = exception->clone(from2, thrus2, to2, true); ExceptionPath *exception2 = exception->clone(from2, thrus2, to2, true);
debugPrint1(debug_, "exception_merge", 1, " split exception for %s\n", debugPrint1(debug_, "exception_merge", 1, " split exception for %s",
exception2->asString(network_)); exception2->asString(network_));
addException2(exception2); addException2(exception2);
@ -4447,7 +4447,7 @@ Sdc::addException2(ExceptionPath *exception)
void void
Sdc::deleteMatchingExceptions(ExceptionPath *exception) Sdc::deleteMatchingExceptions(ExceptionPath *exception)
{ {
debugPrint1(debug_, "exception_merge", 1, "find matches for %s\n", debugPrint1(debug_, "exception_merge", 1, "find matches for %s",
exception->asString(network_)); exception->asString(network_));
ExceptionPathSet matches; ExceptionPathSet matches;
findMatchingExceptions(exception, matches); findMatchingExceptions(exception, matches);
@ -4751,7 +4751,7 @@ Sdc::recordMergeHash(ExceptionPath *exception,
{ {
size_t hash = exception->hash(missing_pt); size_t hash = exception->hash(missing_pt);
debugPrint3(debug_, "exception_merge", 3, debugPrint3(debug_, "exception_merge", 3,
"record merge hash %zu %s missing %s\n", "record merge hash %zu %s missing %s",
hash, hash,
exception->asString(network_), exception->asString(network_),
missing_pt->asString(network_)); missing_pt->asString(network_));
@ -4977,9 +4977,9 @@ Sdc::findMergeMatch(ExceptionPath *exception)
// search at the endpoint. // search at the endpoint.
&& exception->mergeable(match) && exception->mergeable(match)
&& match->mergeablePts(exception, missing_pt, match_missing_pt)) { && match->mergeablePts(exception, missing_pt, match_missing_pt)) {
debugPrint1(debug_, "exception_merge", 1, "merge %s\n", debugPrint1(debug_, "exception_merge", 1, "merge %s",
exception->asString(network_)); exception->asString(network_));
debugPrint1(debug_, "exception_merge", 1, " with %s\n", debugPrint1(debug_, "exception_merge", 1, " with %s",
match->asString(network_)); match->asString(network_));
// Unrecord the exception that is being merged away. // Unrecord the exception that is being merged away.
unrecordException(exception); unrecordException(exception);
@ -5158,7 +5158,7 @@ Sdc::deleteExceptionsReferencing(Clock *clk)
void void
Sdc::deleteException(ExceptionPath *exception) Sdc::deleteException(ExceptionPath *exception)
{ {
debugPrint1(debug_, "exception_merge", 2, "delete %s\n", debugPrint1(debug_, "exception_merge", 2, "delete %s",
exception->asString(network_)); exception->asString(network_));
unrecordException(exception); unrecordException(exception);
delete exception; delete exception;
@ -5188,7 +5188,7 @@ Sdc::unrecordMergeHash(ExceptionPath *exception,
{ {
size_t hash = exception->hash(missing_pt); size_t hash = exception->hash(missing_pt);
debugPrint3(debug_, "exception_merge", 3, debugPrint3(debug_, "exception_merge", 3,
"unrecord merge hash %zu %s missing %s\n", "unrecord merge hash %zu %s missing %s",
hash, hash,
exception->asString(network_), exception->asString(network_),
missing_pt->asString(network_)); missing_pt->asString(network_));
@ -5380,7 +5380,7 @@ Sdc::resetPath(ExceptionFrom *from,
while (except_iter.hasNext()) { while (except_iter.hasNext()) {
ExceptionPath *match = except_iter.next(); ExceptionPath *match = except_iter.next();
if (match->resetMatch(from, thrus, to, min_max)) { if (match->resetMatch(from, thrus, to, min_max)) {
debugPrint1(debug_, "exception_match", 3, "reset match %s\n", debugPrint1(debug_, "exception_match", 3, "reset match %s",
match->asString(network_)); match->asString(network_));
ExceptionPathSet expansions; ExceptionPathSet expansions;
expandException(match, expansions); expandException(match, expansions);

View File

@ -176,8 +176,8 @@ ReportAnnotated::reportDelayCounts()
total, annotated_total); total, annotated_total);
reportCount("net arcs to primary outputs", count_output_net, reportCount("net arcs to primary outputs", count_output_net,
total, annotated_total); total, annotated_total);
report_->print("----------------------------------------------------------------\n"); report_->reportLine("----------------------------------------------------------------");
report_->print("%-28s %10u %10u %10u\n", report_->reportLine("%-28s %10u %10u %10u",
" ", " ",
total, total,
annotated_total, annotated_total,
@ -267,8 +267,8 @@ ReportAnnotated::reportCheckCounts()
reportCheckCount(TimingRole::period(), total, annotated_total); reportCheckCount(TimingRole::period(), total, annotated_total);
reportCheckCount(TimingRole::skew(), total, annotated_total); reportCheckCount(TimingRole::skew(), total, annotated_total);
report_->print("----------------------------------------------------------------\n"); report_->reportLine("----------------------------------------------------------------");
report_->print("%-28s %10u %10u %10u\n", report_->reportLine("%-28s %10u %10u %10u",
" ", " ",
total, total,
annotated_total, annotated_total,
@ -433,7 +433,7 @@ ReportAnnotated::reportCount(const char *title,
if (report_role_[index]) { if (report_role_[index]) {
int count = edge_count_[index]; int count = edge_count_[index];
int annotated_count = edge_annotated_count_[index]; int annotated_count = edge_annotated_count_[index];
report_->print("%-28s %10u %10u %10u\n", report_->reportLine("%-28s %10u %10u %10u",
title, title,
count, count,
annotated_count, annotated_count,
@ -441,7 +441,7 @@ ReportAnnotated::reportCount(const char *title,
if (report_constant_arcs_) { if (report_constant_arcs_) {
int const_count = edge_constant_count_[index]; int const_count = edge_constant_count_[index];
int const_annotated_count = edge_constant_annotated_count_[index]; int const_annotated_count = edge_constant_annotated_count_[index];
report_->print("%-28s %10s %10u %10u\n", report_->reportLine("%-28s %10s %10u %10u",
"constant arcs", "constant arcs",
"", "",
const_annotated_count, const_annotated_count,
@ -512,14 +512,12 @@ ReportAnnotated::reportArcs(Vertex *vertex,
} }
else else
role_name = "delay"; role_name = "delay";
report_->print(" %-18s %s -> %s", const char *cond = edge->timingArcSet()->sdfCond();
report_->reportLine(" %-18s %s -> %s %s",
role_name, role_name,
network_->pathName(from_pin), network_->pathName(from_pin),
network_->pathName(to_pin)); network_->pathName(to_pin),
const char *cond = edge->timingArcSet()->sdfCond(); cond ? cond : "");
if (cond)
report_->print(" %s", cond);
report_->print("\n");
i++; i++;
} }
} }
@ -545,7 +543,7 @@ ReportAnnotated::reportWidthPeriodArcs(Pin *pin,
edge_count_[period_index]++; edge_count_[period_index]++;
graph_->periodCheckAnnotation(pin, ap_index, value, annotated); graph_->periodCheckAnnotation(pin, ap_index, value, annotated);
if (annotated == report_annotated) { if (annotated == report_annotated) {
report_->print(" %-18s %s\n", report_->reportLine(" %-18s %s",
"period", "period",
network_->pathName(pin)); network_->pathName(pin));
i++; i++;
@ -567,7 +565,7 @@ ReportAnnotated::reportWidthPeriodArcs(Pin *pin,
} }
} }
if (report) { if (report) {
report_->print(" %-18s %s\n", report_->reportLine(" %-18s %s",
"min width", "min width",
network_->pathName(pin)); network_->pathName(pin));
i++; i++;

View File

@ -232,7 +232,7 @@ BfsIterator::findNext(Level to_level)
void void
BfsIterator::enqueue(Vertex *vertex) BfsIterator::enqueue(Vertex *vertex)
{ {
debugPrint1(debug_, "bfs", 2, "enqueue %s\n", vertex->name(sdc_network_)); debugPrint1(debug_, "bfs", 2, "enqueue %s", vertex->name(sdc_network_));
if (!vertex->bfsInQueue(bfs_index_)) { if (!vertex->bfsInQueue(bfs_index_)) {
Level level = vertex->level(); Level level = vertex->level();
UniqueLock lock(queue_lock_); UniqueLock lock(queue_lock_);

View File

@ -253,7 +253,7 @@ visitMinPulseWidthChecks(MinPulseWidthCheckVisitor *visitor)
while (vertex_iter.hasNext()) { while (vertex_iter.hasNext()) {
Vertex *vertex = vertex_iter.next(); Vertex *vertex = vertex_iter.next();
if (isClkEnd(vertex, graph)) { if (isClkEnd(vertex, graph)) {
debugPrint1(debug, "mpw", 1, "check mpw %s\n", vertex->name(sdc_network)); debugPrint1(debug, "mpw", 1, "check mpw %s", vertex->name(sdc_network));
visitMinPulseWidthChecks(vertex, visitor); visitMinPulseWidthChecks(vertex, visitor);
} }
} }
@ -348,16 +348,16 @@ MinPulseWidthCheck::closePath(const StaState *sta,
open_tag->isSegmentStart(), open_tag->isSegmentStart(),
open_tag->states(), open_tag->states(),
false, sta); false, sta);
debugPrint1(sta->debug(), "mpw", 3, " open %s\n", debugPrint1(sta->debug(), "mpw", 3, " open %s",
open_tag->asString(sta)); open_tag->asString(sta));
debugPrint1(sta->debug(), "mpw", 3, " close %s\n", debugPrint1(sta->debug(), "mpw", 3, " close %s",
close_tag.asString(sta)); close_tag.asString(sta));
VertexPathIterator close_iter(open_path_.vertex(sta), close_rf, VertexPathIterator close_iter(open_path_.vertex(sta), close_rf,
close_ap, sta); close_ap, sta);
while (close_iter.hasNext()) { while (close_iter.hasNext()) {
PathVertex *close_path = close_iter.next(); PathVertex *close_path = close_iter.next();
if (tagMatchNoPathAp(close_path->tag(sta), &close_tag)) { if (tagMatchNoPathAp(close_path->tag(sta), &close_tag)) {
debugPrint1(sta->debug(), "mpw", 3, " match %s\n", debugPrint1(sta->debug(), "mpw", 3, " match %s",
close_path->tag(sta)->asString(sta)); close_path->tag(sta)->asString(sta));
close = close_path; close = close_path;
break; break;

View File

@ -51,7 +51,7 @@ ClkNetwork::clear()
void void
ClkNetwork::clkPinsInvalid() ClkNetwork::clkPinsInvalid()
{ {
debugPrint0(debug_, "clk_network", 1, "clk network invalid\n"); debugPrint0(debug_, "clk_network", 1, "clk network invalid");
clk_pins_valid_ = false; clk_pins_valid_ = false;
} }
@ -98,7 +98,7 @@ ClkSearchPred::searchTo(const Vertex *to)
void void
ClkNetwork::findClkPins() ClkNetwork::findClkPins()
{ {
debugPrint0(debug_, "clk_network", 1, "find clk network\n"); debugPrint0(debug_, "clk_network", 1, "find clk network");
clear(); clear();
findClkPins(false, pin_clks_map_); findClkPins(false, pin_clks_map_);
findClkPins(true, pin_ideal_clks_map_); findClkPins(true, pin_ideal_clks_map_);

View File

@ -140,28 +140,29 @@ ClkSkews::reportClkSkew(ClockSet *clks,
ClockSeq::Iterator clk_iter2(sorted_clks); ClockSeq::Iterator clk_iter2(sorted_clks);
while (clk_iter2.hasNext()) { while (clk_iter2.hasNext()) {
Clock *clk = clk_iter2.next(); Clock *clk = clk_iter2.next();
report_->print("Clock %s\n", clk->name()); report_->reportLine("Clock %s", clk->name());
ClkSkew *clk_skew = skews.findKey(clk); ClkSkew *clk_skew = skews.findKey(clk);
if (clk_skew) { if (clk_skew) {
report_->print("Latency CRPR Skew\n"); report_->reportLine("Latency CRPR Skew");
PathVertex *src_path = clk_skew->srcPath(); PathVertex *src_path = clk_skew->srcPath();
PathVertex *tgt_path = clk_skew->tgtPath(); PathVertex *tgt_path = clk_skew->tgtPath();
report_->print("%s %s\n", report_->reportLine("%s %s",
sdc_network_->pathName(src_path->pin(this)), sdc_network_->pathName(src_path->pin(this)),
src_path->transition(this)->asString()); src_path->transition(this)->asString());
report_->print("%7s\n", report_->reportLine("%7s",
time_unit->asString(clk_skew->srcLatency(this), digits)); time_unit->asString(clk_skew->srcLatency(this), digits));
report_->print("%s %s\n", report_->reportLine("%s %s",
sdc_network_->pathName(tgt_path->pin(this)), sdc_network_->pathName(tgt_path->pin(this)),
tgt_path->transition(this)->asString()); tgt_path->transition(this)->asString());
report_->print("%7s %7s %7s\n", report_->reportLine("%7s %7s %7s",
time_unit->asString(clk_skew->tgtLatency(this), digits), time_unit->asString(clk_skew->tgtLatency(this), digits),
time_unit->asString(delayAsFloat(-clk_skew->crpr(this)), digits), time_unit->asString(delayAsFloat(-clk_skew->crpr(this)),
digits),
time_unit->asString(clk_skew->skew(), digits)); time_unit->asString(clk_skew->skew(), digits));
} }
else else
report_->print("No launch/capture paths found.\n"); report_->reportLine("No launch/capture paths found.");
report_->print("\n"); report_->reportLine("");
} }
skews.deleteContents(); skews.deleteContents();
@ -276,7 +277,8 @@ ClkSkews::findClkSkew(Vertex *src_vertex,
&& tgt_path->pathAnalysisPt(this)->corner() == src_corner) { && tgt_path->pathAnalysisPt(this)->corner() == src_corner) {
ClkSkew probe(src_path, tgt_path, this); ClkSkew probe(src_path, tgt_path, this);
ClkSkew *clk_skew = skews.findKey(src_clk); ClkSkew *clk_skew = skews.findKey(src_clk);
debugPrint8(debug_, "clk_skew", 2, "%s %s %s -> %s %s %s crpr = %s skew = %s\n", debugPrint8(debug_, "clk_skew", 2,
"%s %s %s -> %s %s %s crpr = %s skew = %s",
network_->pathName(src_path->pin(this)), network_->pathName(src_path->pin(this)),
src_path->transition(this)->asString(), src_path->transition(this)->asString(),
time_unit->asString(probe.srcLatency(this)), time_unit->asString(probe.srcLatency(this)),
@ -325,7 +327,7 @@ ClkSkews::findFanout(Vertex *from,
// Return value. // Return value.
VertexSet &endpoints) VertexSet &endpoints)
{ {
debugPrint1(debug_, "fanout", 1, "%s\n", debugPrint1(debug_, "fanout", 1, "%s",
from->name(sdc_network_)); from->name(sdc_network_));
FanOutSrchPred pred(this); FanOutSrchPred pred(this);
BfsFwdIterator fanout_iter(BfsIndex::other, &pred, this); BfsFwdIterator fanout_iter(BfsIndex::other, &pred, this);
@ -333,7 +335,7 @@ ClkSkews::findFanout(Vertex *from,
while (fanout_iter.hasNext()) { while (fanout_iter.hasNext()) {
Vertex *fanout = fanout_iter.next(); Vertex *fanout = fanout_iter.next();
if (fanout->hasChecks()) { if (fanout->hasChecks()) {
debugPrint1(debug_, "fanout", 1, " endpoint %s\n", debugPrint1(debug_, "fanout", 1, " endpoint %s",
fanout->name(sdc_network_)); fanout->name(sdc_network_));
endpoints.insert(fanout); endpoints.insert(fanout);
} }

View File

@ -257,7 +257,7 @@ CheckCrpr::findCrpr(const PathVertex *src_clk_path,
if (src_clk_path2 && tgt_clk_path2 if (src_clk_path2 && tgt_clk_path2
&& (src_clk_path2->transition(this) == tgt_clk_path2->transition(this) && (src_clk_path2->transition(this) == tgt_clk_path2->transition(this)
|| same_pin)) { || same_pin)) {
debugPrint1(debug_, "crpr", 2, "crpr pin %s\n", debugPrint1(debug_, "crpr", 2, "crpr pin %s",
network_->pathName(src_clk_path2->pin(this))); network_->pathName(src_clk_path2->pin(this)));
crpr = findCrpr1(src_clk_path2, tgt_clk_path2); crpr = findCrpr1(src_clk_path2, tgt_clk_path2);
crpr_pin = src_clk_path2->pin(this); crpr_pin = src_clk_path2->pin(this);
@ -311,12 +311,12 @@ CheckCrpr::findCrpr1(const PathVertex *src_clk_path,
// is the min of the source and target max-min delay. // is the min of the source and target max-min delay.
float src_delta = crprArrivalDiff(src_clk_path); float src_delta = crprArrivalDiff(src_clk_path);
float tgt_delta = crprArrivalDiff(tgt_clk_path); float tgt_delta = crprArrivalDiff(tgt_clk_path);
debugPrint1(debug_, "crpr", 2, " src delta %s\n", debugPrint1(debug_, "crpr", 2, " src delta %s",
delayAsString(src_delta, this)); delayAsString(src_delta, this));
debugPrint1(debug_, "crpr", 2, " tgt delta %s\n", debugPrint1(debug_, "crpr", 2, " tgt delta %s",
delayAsString(tgt_delta, this)); delayAsString(tgt_delta, this));
float common_delay = min(src_delta, tgt_delta); float common_delay = min(src_delta, tgt_delta);
debugPrint2(debug_, "crpr", 2, " %s delta %s\n", debugPrint2(debug_, "crpr", 2, " %s delta %s",
network_->pathName(src_clk_path->pin(this)), network_->pathName(src_clk_path->pin(this)),
delayAsString(common_delay, this)); delayAsString(common_delay, this));
return common_delay; return common_delay;

View File

@ -195,7 +195,7 @@ Genclks::ensureInsertionDelays()
{ {
if (!found_insertion_delays_) { if (!found_insertion_delays_) {
Stats stats(debug_); Stats stats(debug_);
debugPrint0(debug_, "genclk", 1, "find generated clk insertion delays\n"); debugPrint0(debug_, "genclk", 1, "find generated clk insertion delays");
ClockSeq gclks; ClockSeq gclks;
for (auto clk : sdc_->clks()) { for (auto clk : sdc_->clks()) {
@ -314,7 +314,7 @@ Genclks::ensureMaster(Clock *gclk)
// Master source pin can actually be a clock source pin. // Master source pin can actually be a clock source pin.
if (master_clk != gclk) { if (master_clk != gclk) {
gclk->setInferedMasterClk(master_clk); gclk->setInferedMasterClk(master_clk);
debugPrint2(debug_, "genclk", 2, " %s master clk %s\n", debugPrint2(debug_, "genclk", 2, " %s master clk %s",
gclk->name(), gclk->name(),
master_clk->name()); master_clk->name());
found_master = true; found_master = true;
@ -341,7 +341,7 @@ Genclks::ensureMaster(Clock *gclk)
// Master source pin can actually be a clock source pin. // Master source pin can actually be a clock source pin.
if (master_clk != gclk) { if (master_clk != gclk) {
gclk->setInferedMasterClk(master_clk); gclk->setInferedMasterClk(master_clk);
debugPrint2(debug_, "genclk", 2, " %s master clk %s\n", debugPrint2(debug_, "genclk", 2, " %s master clk %s",
gclk->name(), gclk->name(),
master_clk->name()); master_clk->name());
found_master = true; found_master = true;
@ -366,7 +366,7 @@ Genclks::ensureMaster(Clock *gclk)
// Master source pin can actually be a clock source pin. // Master source pin can actually be a clock source pin.
if (master_clk != gclk) { if (master_clk != gclk) {
gclk->setInferedMasterClk(master_clk); gclk->setInferedMasterClk(master_clk);
debugPrint2(debug_, "genclk", 2, " %s master clk %s\n", debugPrint2(debug_, "genclk", 2, " %s master clk %s",
gclk->name(), gclk->name(),
master_clk->name()); master_clk->name());
master_clk_count++; master_clk_count++;
@ -463,7 +463,7 @@ Genclks::findFanin(Clock *gclk,
Vertex *vertex = iter.next(); Vertex *vertex = iter.next();
if (!fanins->hasKey(vertex)) { if (!fanins->hasKey(vertex)) {
fanins->insert(vertex); fanins->insert(vertex);
debugPrint2(debug_, "genclk", 2, "gen clk %s fanin %s\n", debugPrint2(debug_, "genclk", 2, "gen clk %s fanin %s",
gclk->name(), vertex->name(sdc_network_)); gclk->name(), vertex->name(sdc_network_));
iter.enqueueAdjacentVertices(vertex); iter.enqueueAdjacentVertices(vertex);
} }
@ -568,7 +568,7 @@ GenClkInsertionSearchPred::isNonGeneratedClkPin(const Pin *pin) const
void void
Genclks::findInsertionDelays(Clock *gclk) Genclks::findInsertionDelays(Clock *gclk)
{ {
debugPrint1(debug_, "genclk", 2, "find gen clk %s insertion\n", debugPrint1(debug_, "genclk", 2, "find gen clk %s insertion",
gclk->name()); gclk->name());
GenclkInfo *genclk_info = makeGenclkInfo(gclk); GenclkInfo *genclk_info = makeGenclkInfo(gclk);
FilterPath *src_filter = genclk_info->srcFilter(); FilterPath *src_filter = genclk_info->srcFilter();
@ -670,7 +670,7 @@ Genclks::findLatchFdbkEdges(Vertex *from_vertex,
Edge *edge = edge_iter.next(); Edge *edge = edge_iter.next();
Vertex *to_vertex = edge->to(graph_); Vertex *to_vertex = edge->to(graph_);
if (path_vertices.hasKey(to_vertex)) { if (path_vertices.hasKey(to_vertex)) {
debugPrint2(debug_, "genclk", 2, " found feedback edge %s -> %s\n", debugPrint2(debug_, "genclk", 2, " found feedback edge %s -> %s",
from_vertex->name(sdc_network_), from_vertex->name(sdc_network_),
to_vertex->name(sdc_network_)); to_vertex->name(sdc_network_));
if (fdbk_edges == nullptr) if (fdbk_edges == nullptr)
@ -716,7 +716,7 @@ Genclks::seedSrcPins(Clock *gclk,
Clock *master_clk = gclk->masterClk(); Clock *master_clk = gclk->masterClk();
for (Pin *master_pin : master_clk->leafPins()) { for (Pin *master_pin : master_clk->leafPins()) {
Vertex *vertex = graph_->pinDrvrVertex(master_pin); Vertex *vertex = graph_->pinDrvrVertex(master_pin);
debugPrint1(debug_, "genclk", 2, " seed src pin %s\n", debugPrint1(debug_, "genclk", 2, " seed src pin %s",
network_->pathName(master_pin)); network_->pathName(master_pin));
TagGroupBldr tag_bldr(true, this); TagGroupBldr tag_bldr(true, this);
tag_bldr.init(vertex); tag_bldr.init(vertex);
@ -868,7 +868,7 @@ GenclkSrcArrivalVisitor::visit(Vertex *vertex)
const Graph *graph = sta_->graph(); const Graph *graph = sta_->graph();
Search *search = sta_->search(); Search *search = sta_->search();
Genclks *genclks = search->genclks(); Genclks *genclks = search->genclks();
debugPrint1(debug, "genclk", 2, "find gen clk insert arrival %s\n", debugPrint1(debug, "genclk", 2, "find gen clk insert arrival %s",
vertex->name(sdc_network)); vertex->name(sdc_network));
tag_bldr_->init(vertex); tag_bldr_->init(vertex);
has_fanin_one_ = graph->hasFaninOne(vertex); has_fanin_one_ = graph->hasFaninOne(vertex);
@ -973,7 +973,7 @@ Genclks::recordSrcPaths(Clock *gclk)
src_path.arrival(this), src_path.arrival(this),
early_late, early_late,
this))) { this))) {
debugPrint4(debug_, "genclk", 2, " %s insertion %s %s %s\n", debugPrint4(debug_, "genclk", 2, " %s insertion %s %s %s",
network_->pathName(gclk_pin), network_->pathName(gclk_pin),
early_late->asString(), early_late->asString(),
rf->asString(), rf->asString(),
@ -1096,7 +1096,7 @@ Genclks::insertionDelay(const Clock *clk,
void void
Genclks::findPllDelays(Clock *gclk) Genclks::findPllDelays(Clock *gclk)
{ {
debugPrint1(debug_, "genclk", 2, "find gen clk %s pll delay\n", debugPrint1(debug_, "genclk", 2, "find gen clk %s pll delay",
gclk->name()); gclk->name());
FilterPath *pll_filter = makePllFilter(gclk); FilterPath *pll_filter = makePllFilter(gclk);
GenclkInfo *genclk_info = genclkInfo(gclk); GenclkInfo *genclk_info = genclkInfo(gclk);
@ -1131,7 +1131,7 @@ Genclks::seedPllPin(const Clock *gclk,
{ {
Pin *pll_out_pin = gclk->pllOut(); Pin *pll_out_pin = gclk->pllOut();
Vertex *vertex = graph_->pinDrvrVertex(pll_out_pin); Vertex *vertex = graph_->pinDrvrVertex(pll_out_pin);
debugPrint1(debug_, "genclk", 2, " seed pllout pin %s\n", debugPrint1(debug_, "genclk", 2, " seed pllout pin %s",
network_->pathName(pll_out_pin)); network_->pathName(pll_out_pin));
TagGroupBldr tag_bldr(true, this); TagGroupBldr tag_bldr(true, this);
tag_bldr.init(vertex); tag_bldr.init(vertex);
@ -1191,7 +1191,7 @@ PllArrivalVisitor::visit(Vertex *vertex)
Graph *graph = sta_->graph(); Graph *graph = sta_->graph();
Search *search = sta_->search(); Search *search = sta_->search();
Genclks *genclks = search->genclks(); Genclks *genclks = search->genclks();
debugPrint1(debug, "genclk", 2, "find gen clk pll arrival %s\n", debugPrint1(debug, "genclk", 2, "find gen clk pll arrival %s",
vertex->name(sdc_network)); vertex->name(sdc_network));
tag_bldr_->init(vertex); tag_bldr_->init(vertex);
genclks->copyGenClkSrcPaths(vertex, tag_bldr_); genclks->copyGenClkSrcPaths(vertex, tag_bldr_);

View File

@ -94,7 +94,7 @@ Latches::latchRequired(const Path *data_path,
+ PathEnd::checkSetupMcpAdjustment(data_clk_edge, enable_clk_edge, mcp, + PathEnd::checkSetupMcpAdjustment(data_clk_edge, enable_clk_edge, mcp,
1, sdc_) 1, sdc_)
+ open_crpr; + open_crpr;
debugPrint3(debug_, "latch", 1, "latch data %s %s enable %s\n", debugPrint3(debug_, "latch", 1, "latch data %s %s enable %s",
network_->pathName(data_path->pin(this)), network_->pathName(data_path->pin(this)),
delayAsString(data_arrival, this), delayAsString(data_arrival, this),
delayAsString(enable_arrival, this)); delayAsString(enable_arrival, this));

View File

@ -115,7 +115,7 @@ void
Levelize::levelize() Levelize::levelize()
{ {
Stats stats(debug_); Stats stats(debug_);
debugPrint0(debug_, "levelize", 1, "levelize\n"); debugPrint0(debug_, "levelize", 1, "levelize");
max_level_ = 0; max_level_ = 0;
clearLoopEdges(); clearLoopEdges();
deleteLoops(); deleteLoops();
@ -145,7 +145,7 @@ Levelize::findRoots()
Vertex *vertex = vertex_iter.next(); Vertex *vertex = vertex_iter.next();
setLevel(vertex, 0); setLevel(vertex, 0);
if (isRoot(vertex)) { if (isRoot(vertex)) {
debugPrint1(debug_, "levelize", 2, "root %s\n", vertex->name(sdc_network_)); debugPrint1(debug_, "levelize", 2, "root %s", vertex->name(sdc_network_));
roots_.insert(vertex); roots_.insert(vertex);
if (hasFanout(vertex, search_pred_, graph_)) if (hasFanout(vertex, search_pred_, graph_))
// Color roots with no fanout black so that they are // Color roots with no fanout black so that they are
@ -209,7 +209,7 @@ Levelize::visit(Vertex *vertex,
EdgeSeq &path) EdgeSeq &path)
{ {
Pin *from_pin = vertex->pin(); Pin *from_pin = vertex->pin();
debugPrint2(debug_, "levelize", 3, "level %d %s\n", debugPrint2(debug_, "levelize", 3, "level %d %s",
level, vertex->name(sdc_network_)); level, vertex->name(sdc_network_));
vertex->setColor(LevelColor::gray); vertex->setColor(LevelColor::gray);
setLevel(vertex, level); setLevel(vertex, level);
@ -254,7 +254,7 @@ void
Levelize::recordLoop(Edge *edge, Levelize::recordLoop(Edge *edge,
EdgeSeq &path) EdgeSeq &path)
{ {
debugPrint3(debug_, "levelize", 2, "Loop edge %s -> %s (%s)\n", debugPrint3(debug_, "levelize", 2, "Loop edge %s -> %s (%s)",
edge->from(graph_)->name(sdc_network_), edge->from(graph_)->name(sdc_network_),
edge->to(graph_)->name(sdc_network_), edge->to(graph_)->name(sdc_network_),
edge->role()->asString()); edge->role()->asString());
@ -276,7 +276,7 @@ EdgeSeq *
Levelize::loopEdges(EdgeSeq &path, Levelize::loopEdges(EdgeSeq &path,
Edge *closing_edge) Edge *closing_edge)
{ {
debugPrint0(debug_, "loop", 2, "Loop\n"); debugPrint0(debug_, "loop", 2, "Loop");
EdgeSeq *loop_edges = new EdgeSeq; EdgeSeq *loop_edges = new EdgeSeq;
// Skip the "head" of the path up to where closing_edge closes the loop. // Skip the "head" of the path up to where closing_edge closes the loop.
Pin *loop_pin = closing_edge->to(graph_)->pin(); Pin *loop_pin = closing_edge->to(graph_)->pin();
@ -288,14 +288,14 @@ Levelize::loopEdges(EdgeSeq &path,
if (from_pin == loop_pin) if (from_pin == loop_pin)
copy = true; copy = true;
if (copy) { if (copy) {
debugPrint2(debug_, "loop", 2, " %s -> %s\n", debugPrint2(debug_, "loop", 2, " %s -> %s",
edge->from(graph_)->name(sdc_network_), edge->from(graph_)->name(sdc_network_),
edge->to(graph_)->name(sdc_network_)); edge->to(graph_)->name(sdc_network_));
loop_edges->push_back(edge); loop_edges->push_back(edge);
loop_edges_.insert(edge); loop_edges_.insert(edge);
} }
} }
debugPrint2(debug_, "loop", 2, " %s -> %s\n", debugPrint2(debug_, "loop", 2, " %s -> %s",
closing_edge->from(graph_)->name(sdc_network_), closing_edge->from(graph_)->name(sdc_network_),
closing_edge->to(graph_)->name(sdc_network_)); closing_edge->to(graph_)->name(sdc_network_));
loop_edges->push_back(closing_edge); loop_edges->push_back(closing_edge);
@ -355,14 +355,14 @@ Levelize::levelizeCycles()
void void
Levelize::invalid() Levelize::invalid()
{ {
debugPrint0(debug_, "levelize", 1, "levels invalid\n"); debugPrint0(debug_, "levelize", 1, "levels invalid");
clear(); clear();
} }
void void
Levelize::invalidFrom(Vertex *vertex) Levelize::invalidFrom(Vertex *vertex)
{ {
debugPrint1(debug_, "levelize", 1, "level invalid from %s\n", debugPrint1(debug_, "levelize", 1, "level invalid from %s",
vertex->name(sdc_network_)); vertex->name(sdc_network_));
VertexInEdgeIterator edge_iter(vertex, graph_); VertexInEdgeIterator edge_iter(vertex, graph_);
while (edge_iter.hasNext()) { while (edge_iter.hasNext()) {
@ -384,7 +384,7 @@ Levelize::deleteVertexBefore(Vertex *vertex)
void void
Levelize::relevelizeFrom(Vertex *vertex) Levelize::relevelizeFrom(Vertex *vertex)
{ {
debugPrint1(debug_, "levelize", 1, "invalid relevelize from %s\n", debugPrint1(debug_, "levelize", 1, "invalid relevelize from %s",
vertex->name(sdc_network_)); vertex->name(sdc_network_));
relevelize_from_.insert(vertex); relevelize_from_.insert(vertex);
levels_valid_ = false; levels_valid_ = false;
@ -416,7 +416,7 @@ Levelize::relevelize()
VertexSet::Iterator vertex_iter(relevelize_from_); VertexSet::Iterator vertex_iter(relevelize_from_);
while (vertex_iter.hasNext()) { while (vertex_iter.hasNext()) {
Vertex *vertex = vertex_iter.next(); Vertex *vertex = vertex_iter.next();
debugPrint1(debug_, "levelize", 1, "relevelize from %s\n", debugPrint1(debug_, "levelize", 1, "relevelize from %s",
vertex->name(sdc_network_)); vertex->name(sdc_network_));
if (search_pred_->searchFrom(vertex)) { if (search_pred_->searchFrom(vertex)) {
if (isRoot(vertex)) { if (isRoot(vertex)) {
@ -487,8 +487,8 @@ GraphLoop::report(Report *report,
while (loop_edge_iter.hasNext()) { while (loop_edge_iter.hasNext()) {
Edge *edge = loop_edge_iter.next(); Edge *edge = loop_edge_iter.next();
if (first_edge) if (first_edge)
report->print(" %s\n", edge->from(graph)->name(network)); report->reportLine(" %s", edge->from(graph)->name(network));
report->print(" %s\n", edge->to(graph)->name(network)); report->reportLine(" %s", edge->to(graph)->name(network));
first_edge = false; first_edge = false;
} }
} }

View File

@ -119,9 +119,9 @@ PathEnum::PathEnum(int group_count,
void void
PathEnum::insert(PathEnd *path_end) PathEnum::insert(PathEnd *path_end)
{ {
debugPrint1(debug_, "path_enum", 1, "insert %s\n", debugPrint1(debug_, "path_enum", 1, "insert %s",
path_end->path()->name(this)); path_end->path()->name(this));
debugPrint3(debug_, "path_enum", 2, "diversion %s %s %s\n", debugPrint3(debug_, "path_enum", 2, "diversion %s %s %s",
path_end->path()->name(this), path_end->path()->name(this),
cmp_slack_ ? "slack" : "delay", cmp_slack_ ? "slack" : "delay",
delayAsString(cmp_slack_ ? path_end->slack(this) : delayAsString(cmp_slack_ ? path_end->slack(this) :
@ -195,7 +195,7 @@ PathEnum::findNext()
} }
else { else {
// We have endpoint_count paths for this endpoint, so we are done with it. // We have endpoint_count paths for this endpoint, so we are done with it.
debugPrint1(debug_, "path_enum", 1, "endpoint_count reached for %s\n", debugPrint1(debug_, "path_enum", 1, "endpoint_count reached for %s",
vertex->name(sdc_network_)); vertex->name(sdc_network_));
deleteDiversionPathEnd(div); deleteDiversionPathEnd(div);
} }
@ -330,7 +330,7 @@ PathEnumFaninVisitor::visitFromToPath(const Pin *,
const PathAnalysisPt *path_ap) const PathAnalysisPt *path_ap)
{ {
const Debug *debug = sta_->debug(); const Debug *debug = sta_->debug();
debugPrint4(debug, "path_enum", 3, "visit fanin %s -> %s %s %s\n", debugPrint4(debug, "path_enum", 3, "visit fanin %s -> %s %s %s",
from_path->name(sta_), from_path->name(sta_),
to_vertex->name(sta_->network()), to_vertex->name(sta_->network()),
to_rf->asString(), to_rf->asString(),
@ -433,7 +433,7 @@ PathEnum::makeDiversion(PathEnd *div_end,
void void
PathEnum::pruneDiversionQueue() PathEnum::pruneDiversionQueue()
{ {
debugPrint0(debug_, "path_enum", 2, "prune queue\n"); debugPrint0(debug_, "path_enum", 2, "prune queue");
VertexPathCountMap path_counts; VertexPathCountMap path_counts;
int end_count = 0; int end_count = 0;
// Collect endpoint_count diversions per vertex. // Collect endpoint_count diversions per vertex.
@ -589,7 +589,7 @@ PathEnum::updatePathHeadDelays(PathEnumedSeq &paths,
ArcDelay arc_delay = search_->deratedDelay(edge->from(graph_), ArcDelay arc_delay = search_->deratedDelay(edge->from(graph_),
arc, edge, false, path_ap); arc, edge, false, path_ap);
Arrival arrival = prev_arrival + arc_delay; Arrival arrival = prev_arrival + arc_delay;
debugPrint3(debug_, "path_enum", 3, "update arrival %s %s -> %s\n", debugPrint3(debug_, "path_enum", 3, "update arrival %s %s -> %s",
path->name(this), path->name(this),
delayAsString(path->arrival(this), this), delayAsString(path->arrival(this), this),
delayAsString(arrival, this)); delayAsString(arrival, this));

View File

@ -686,7 +686,7 @@ MakePathEndsAll::vertexEnd(Vertex *)
// Only save the worst path end for each crpr tag. // Only save the worst path end for each crpr tag.
// PathEnum will peel the others. // PathEnum will peel the others.
if (!unique_ends.hasKey(path_end)) { if (!unique_ends.hasKey(path_end)) {
debugPrint4(debug, "path_enum", 5, "insert %s %s %s %d\n", debugPrint4(debug, "path_enum", 5, "insert %s %s %s %d",
path_end->vertex(sta_)->name(network), path_end->vertex(sta_)->name(network),
path_end->typeName(), path_end->typeName(),
path_end->transition(sta_)->asString(), path_end->transition(sta_)->asString(),
@ -700,7 +700,7 @@ MakePathEndsAll::vertexEnd(Vertex *)
} }
} }
else else
debugPrint4(debug, "path_enum", 5, "prune %s %s %s %d\n", debugPrint4(debug, "path_enum", 5, "prune %s %s %s %d",
path_end->vertex(sta_)->name(network), path_end->vertex(sta_)->name(network),
path_end->typeName(), path_end->typeName(),
path_end->transition(sta_)->asString(), path_end->transition(sta_)->asString(),

View File

@ -344,7 +344,7 @@ void
PropActivityVisitor::visit(Vertex *vertex) PropActivityVisitor::visit(Vertex *vertex)
{ {
Pin *pin = vertex->pin(); Pin *pin = vertex->pin();
debugPrint1(debug_, "power_activity", 3, "visit %s\n", debugPrint1(debug_, "power_activity", 3, "visit %s",
vertex->name(network_)); vertex->name(network_));
if (power_->hasUserActivity(pin)) if (power_->hasUserActivity(pin))
power_->setActivity(pin, power_->userActivity(pin)); power_->setActivity(pin, power_->userActivity(pin));
@ -369,7 +369,7 @@ PropActivityVisitor::visit(Vertex *vertex)
Instance *inst = network_->instance(pin); Instance *inst = network_->instance(pin);
auto cell = network_->libertyCell(inst); auto cell = network_->libertyCell(inst);
if (cell && cell->hasSequentials()) { if (cell && cell->hasSequentials()) {
debugPrint1(debug_, "power_activity", 3, "pending reg %s\n", debugPrint1(debug_, "power_activity", 3, "pending reg %s",
network_->pathName(inst)); network_->pathName(inst));
visited_regs_->insert(inst); visited_regs_->insert(inst);
found_reg_without_activity_ = input_without_activity; found_reg_without_activity_ = input_without_activity;
@ -383,7 +383,7 @@ PropActivityVisitor::visit(Vertex *vertex)
Instance *inst = network_->instance(pin); Instance *inst = network_->instance(pin);
PwrActivity activity = power_->evalActivity(func, inst); PwrActivity activity = power_->evalActivity(func, inst);
power_->setActivity(pin, activity); power_->setActivity(pin, activity);
debugPrint3(debug_, "power_activity", 3, "set %s %.2e %.2f\n", debugPrint3(debug_, "power_activity", 3, "set %s %.2e %.2f",
vertex->name(network_), vertex->name(network_),
activity.activity(), activity.activity(),
activity.duty()); activity.duty());
@ -530,7 +530,7 @@ Power::seedActivities(BfsFwdIterator &bfs)
// Clock activities are baked in. // Clock activities are baked in.
if (!sdc_->isLeafPinClock(pin) if (!sdc_->isLeafPinClock(pin)
&& !network_->direction(pin)->isInternal()) { && !network_->direction(pin)->isInternal()) {
debugPrint1(debug_, "power_activity", 3, "seed %s\n", debugPrint1(debug_, "power_activity", 3, "seed %s",
vertex->name(network_)); vertex->name(network_));
if (hasUserActivity(pin)) if (hasUserActivity(pin))
setActivity(pin, userActivity(pin)); setActivity(pin, userActivity(pin));
@ -564,7 +564,7 @@ Power::seedRegOutputActivities(const Instance *inst,
Vertex *vertex = graph_->pinDrvrVertex(pin); Vertex *vertex = graph_->pinDrvrVertex(pin);
if (func->port() == seq->output() if (func->port() == seq->output()
|| func->port() == seq->outputInv()) { || func->port() == seq->outputInv()) {
debugPrint1(debug_, "power_activity", 3, "enqueue reg output %s\n", debugPrint1(debug_, "power_activity", 3, "enqueue reg output %s",
vertex->name(network_)); vertex->name(network_));
bfs.enqueue(vertex); bfs.enqueue(vertex);
} }
@ -652,16 +652,16 @@ Power::findInputInternalPower(const Pin *pin,
const LibertyPort *corner_port = port->cornerPort(lib_ap_index); const LibertyPort *corner_port = port->cornerPort(lib_ap_index);
auto internal_pwrs = corner_cell->internalPowers(corner_port); auto internal_pwrs = corner_cell->internalPowers(corner_port);
if (!internal_pwrs->empty()) { if (!internal_pwrs->empty()) {
debugPrint3(debug_, "power", 2, "internal input %s/%s (%s)\n", debugPrint3(debug_, "power", 2, "internal input %s/%s (%s)",
network_->pathName(inst), network_->pathName(inst),
port->name(), port->name(),
corner_cell->name()); corner_cell->name());
const DcalcAnalysisPt *dcalc_ap = corner->findDcalcAnalysisPt(MinMax::max()); const DcalcAnalysisPt *dcalc_ap = corner->findDcalcAnalysisPt(MinMax::max());
const Pvt *pvt = dcalc_ap->operatingConditions(); const Pvt *pvt = dcalc_ap->operatingConditions();
Vertex *vertex = graph_->pinLoadVertex(pin); Vertex *vertex = graph_->pinLoadVertex(pin);
debugPrint1(debug_, "power", 2, " cap = %s\n", debugPrint1(debug_, "power", 2, " cap = %s",
units_->capacitanceUnit()->asString(load_cap)); units_->capacitanceUnit()->asString(load_cap));
debugPrint0(debug_, "power", 2, " whena act/ns duty energy power\n"); debugPrint0(debug_, "power", 2, " whena act/ns duty energy power");
float internal = 0.0; float internal = 0.0;
for (InternalPower *pwr : *internal_pwrs) { for (InternalPower *pwr : *internal_pwrs) {
const char *related_pg_pin = pwr->relatedPgPin(); const char *related_pg_pin = pwr->relatedPgPin();
@ -694,7 +694,7 @@ Power::findInputInternalPower(const Pin *pin,
duty = evalActivity(when, inst).duty(); duty = evalActivity(when, inst).duty();
} }
float port_internal = energy * duty * activity.activity(); float port_internal = energy * duty * activity.activity();
debugPrint7(debug_, "power", 2, " %3s %6s %.2f %.2f %9.2e %9.2e %s\n", debugPrint7(debug_, "power", 2, " %3s %6s %.2f %.2f %9.2e %9.2e %s",
port->name(), port->name(),
when ? when->asString() : "", when ? when->asString() : "",
activity.activity() * 1e-9, activity.activity() * 1e-9,
@ -768,7 +768,7 @@ Power::findOutputInternalPower(const Pin *to_pin,
// Return values. // Return values.
PowerResult &result) PowerResult &result)
{ {
debugPrint3(debug_, "power", 2, "internal output %s/%s (%s)\n", debugPrint3(debug_, "power", 2, "internal output %s/%s (%s)",
network_->pathName(inst), network_->pathName(inst),
to_port->name(), to_port->name(),
cell->name()); cell->name());
@ -777,7 +777,7 @@ Power::findOutputInternalPower(const Pin *to_pin,
int lib_ap_index = corner->libertyIndex(MinMax::max()); int lib_ap_index = corner->libertyIndex(MinMax::max());
LibertyCell *corner_cell = cell->cornerCell(lib_ap_index); LibertyCell *corner_cell = cell->cornerCell(lib_ap_index);
const LibertyPort *to_corner_port = to_port->cornerPort(lib_ap_index); const LibertyPort *to_corner_port = to_port->cornerPort(lib_ap_index);
debugPrint1(debug_, "power", 2, " cap = %s\n", debugPrint1(debug_, "power", 2, " cap = %s",
units_->capacitanceUnit()->asString(load_cap)); units_->capacitanceUnit()->asString(load_cap));
FuncExpr *func = to_port->function(); FuncExpr *func = to_port->function();
@ -806,7 +806,7 @@ Power::findOutputInternalPower(const Pin *to_pin,
} }
float energy = 0.0; float energy = 0.0;
int tr_count = 0; int tr_count = 0;
debugPrint0(debug_, "power", 2, " when act/ns duty wgt energy power\n"); debugPrint0(debug_, "power", 2, " when act/ns duty wgt energy power");
for (auto to_rf : RiseFall::range()) { for (auto to_rf : RiseFall::range()) {
// Use unateness to find from_rf. // Use unateness to find from_rf.
RiseFall *from_rf = positive_unate ? to_rf : to_rf->opposite(); RiseFall *from_rf = positive_unate ? to_rf : to_rf->opposite();
@ -830,7 +830,7 @@ Power::findOutputInternalPower(const Pin *to_pin,
weight = duty / duty_sum; weight = duty / duty_sum;
} }
float port_internal = weight * energy * to_activity.activity(); float port_internal = weight * energy * to_activity.activity();
debugPrint9(debug_, "power", 2, "%3s -> %-3s %6s %.2f %.2f %.2f %9.2e %9.2e %s\n", debugPrint9(debug_, "power", 2, "%3s -> %-3s %6s %.2f %.2f %.2f %9.2e %9.2e %s",
from_corner_port->name(), from_corner_port->name(),
to_port->name(), to_port->name(),
when ? when->asString() : "", when ? when->asString() : "",
@ -942,7 +942,7 @@ Power::findLeakagePower(const Instance *,
if (port->direction()->isAnyInput()) if (port->direction()->isAnyInput())
duty *= port->isClock() ? 0.25 : 0.5; duty *= port->isClock() ? 0.25 : 0.5;
} }
debugPrint4(debug_, "power", 2, "leakage %s %s %.3e * %.2f\n", debugPrint4(debug_, "power", 2, "leakage %s %s %.3e * %.2f",
cell->name(), cell->name(),
when->asString(), when->asString(),
leak->power(), leak->power(),
@ -951,7 +951,7 @@ Power::findLeakagePower(const Instance *,
found_cond = true; found_cond = true;
} }
else { else {
debugPrint2(debug_, "power", 2, "leakage default %s %.3e\n", debugPrint2(debug_, "power", 2, "leakage default %s %.3e",
cell->name(), cell->name(),
leak->power()); leak->power());
default_leakage += leak->power(); default_leakage += leak->power();
@ -963,7 +963,7 @@ Power::findLeakagePower(const Instance *,
bool cell_leakage_exists; bool cell_leakage_exists;
cell->leakagePower(cell_leakage, cell_leakage_exists); cell->leakagePower(cell_leakage, cell_leakage_exists);
if (cell_leakage_exists) if (cell_leakage_exists)
debugPrint2(debug_, "power", 2, "leakage cell %s %.3e\n", debugPrint2(debug_, "power", 2, "leakage cell %s %.3e",
cell->name(), cell->name(),
cell_leakage); cell_leakage);
// Ignore default leakages unless there are no conditional leakage groups. // Ignore default leakages unless there are no conditional leakage groups.
@ -973,7 +973,7 @@ Power::findLeakagePower(const Instance *,
leakage = default_leakage; leakage = default_leakage;
else if (cell_leakage_exists) else if (cell_leakage_exists)
leakage = cell_leakage; leakage = cell_leakage;
debugPrint2(debug_, "power", 2, "leakage cell %s %.3e\n", debugPrint2(debug_, "power", 2, "leakage cell %s %.3e",
cell->name(), cell->name(),
leakage); leakage);
result.leakage() += leakage; result.leakage() += leakage;
@ -994,7 +994,7 @@ Power::findSwitchingPower(LibertyCell *cell,
LibertyCell *corner_cell = cell->cornerCell(lib_ap_index); LibertyCell *corner_cell = cell->cornerCell(lib_ap_index);
float volt = portVoltage(corner_cell, to_port, dcalc_ap); float volt = portVoltage(corner_cell, to_port, dcalc_ap);
float switching = .5 * load_cap * volt * volt * activity.activity(); float switching = .5 * load_cap * volt * volt * activity.activity();
debugPrint5(debug_, "power", 2, "switching %s/%s activity = %.2e volt = %.2f %.3e\n", debugPrint5(debug_, "power", 2, "switching %s/%s activity = %.2e volt = %.2f %.3e",
cell->name(), cell->name(),
to_port->name(), to_port->name(),
activity.activity(), activity.activity(),

View File

@ -388,9 +388,10 @@ ReportPath::reportEndpointHeader(PathEnd *end,
const char *setup_hold = (end->minMax(this) == MinMax::min()) const char *setup_hold = (end->minMax(this) == MinMax::min())
? "min_delay/hold" ? "min_delay/hold"
: "max_delay/setup"; : "max_delay/setup";
report_->print("%s group %s\n\n", report_->reportLine("%s group %s",
setup_hold, setup_hold,
group->name()); group->name());
report_->reportLine("");
string header; string header;
reportEndHeader(header); reportEndHeader(header);
report_->print(header); report_->print(header);

View File

@ -392,7 +392,7 @@ Search::copyState(const StaState *sta)
void void
Search::deletePaths() Search::deletePaths()
{ {
debugPrint0(debug_, "search", 1, "delete paths\n"); debugPrint0(debug_, "search", 1, "delete paths");
if (arrivals_exist_) { if (arrivals_exist_) {
VertexIterator vertex_iter(graph_); VertexIterator vertex_iter(graph_);
while (vertex_iter.hasNext()) { while (vertex_iter.hasNext()) {
@ -565,10 +565,10 @@ Search::findFilteredArrivals()
// Iterate until data arrivals at all latches stop changing. // Iterate until data arrivals at all latches stop changing.
for (int pass = 1; pass <= 2 || havePendingLatchOutputs() ; pass++) { for (int pass = 1; pass <= 2 || havePendingLatchOutputs() ; pass++) {
enqueuePendingLatchOutputs(); enqueuePendingLatchOutputs();
debugPrint1(debug_, "search", 1, "find arrivals pass %d\n", pass); debugPrint1(debug_, "search", 1, "find arrivals pass %d", pass);
int arrival_count = arrival_iter_->visitParallel(max_level, int arrival_count = arrival_iter_->visitParallel(max_level,
arrival_visitor_); arrival_visitor_);
debugPrint1(debug_, "search", 1, "found %d arrivals\n", arrival_count); debugPrint1(debug_, "search", 1, "found %d arrivals", arrival_count);
} }
arrivals_exist_ = true; arrivals_exist_ = true;
} }
@ -655,7 +655,7 @@ void
Search::arrivalsInvalid() Search::arrivalsInvalid()
{ {
if (arrivals_exist_) { if (arrivals_exist_) {
debugPrint0(debug_, "search", 1, "arrivals invalid\n"); debugPrint0(debug_, "search", 1, "arrivals invalid");
// Delete paths to make sure no state is left over. // Delete paths to make sure no state is left over.
// For example, set_disable_timing strands a vertex, which means // For example, set_disable_timing strands a vertex, which means
// the search won't revisit it to clear the previous arrival. // the search won't revisit it to clear the previous arrival.
@ -682,7 +682,7 @@ Search::arrivalsInvalid()
void void
Search::requiredsInvalid() Search::requiredsInvalid()
{ {
debugPrint0(debug_, "search", 1, "requireds invalid\n"); debugPrint0(debug_, "search", 1, "requireds invalid");
requireds_exist_ = false; requireds_exist_ = false;
requireds_seeded_ = false; requireds_seeded_ = false;
invalid_requireds_.clear(); invalid_requireds_.clear();
@ -695,7 +695,7 @@ void
Search::arrivalInvalid(Vertex *vertex) Search::arrivalInvalid(Vertex *vertex)
{ {
if (arrivals_exist_) { if (arrivals_exist_) {
debugPrint1(debug_, "search", 2, "arrival invalid %s\n", debugPrint1(debug_, "search", 2, "arrival invalid %s",
vertex->name(sdc_network_)); vertex->name(sdc_network_));
if (!arrival_iter_->inQueue(vertex)) { if (!arrival_iter_->inQueue(vertex)) {
// Lock for StaDelayCalcObserver called by delay calc threads. // Lock for StaDelayCalcObserver called by delay calc threads.
@ -765,7 +765,7 @@ void
Search::requiredInvalid(Vertex *vertex) Search::requiredInvalid(Vertex *vertex)
{ {
if (requireds_exist_) { if (requireds_exist_) {
debugPrint1(debug_, "search", 2, "required invalid %s\n", debugPrint1(debug_, "search", 2, "required invalid %s",
vertex->name(sdc_network_)); vertex->name(sdc_network_));
if (!required_iter_->inQueue(vertex)) { if (!required_iter_->inQueue(vertex)) {
// Lock for StaDelayCalcObserver called by delay calc threads. // Lock for StaDelayCalcObserver called by delay calc threads.
@ -784,7 +784,7 @@ Search::findClkArrivals()
if (!clk_arrivals_valid_) { if (!clk_arrivals_valid_) {
genclks_->ensureInsertionDelays(); genclks_->ensureInsertionDelays();
Stats stats(debug_); Stats stats(debug_);
debugPrint0(debug_, "search", 1, "find clk arrivals\n"); debugPrint0(debug_, "search", 1, "find clk arrivals");
arrival_iter_->clear(); arrival_iter_->clear();
seedClkVertexArrivals(); seedClkVertexArrivals();
ClkArrivalSearchPred search_clk(this); ClkArrivalSearchPred search_clk(this);
@ -916,7 +916,7 @@ Search::findAllArrivals(VertexVisitor *arrival_visitor)
// Iterate until data arrivals at all latches stop changing. // Iterate until data arrivals at all latches stop changing.
for (int pass = 1; pass == 1 || havePendingLatchOutputs(); pass++) { for (int pass = 1; pass == 1 || havePendingLatchOutputs(); pass++) {
enqueuePendingLatchOutputs(); enqueuePendingLatchOutputs();
debugPrint1(debug_, "search", 1, "find arrivals pass %d\n", pass); debugPrint1(debug_, "search", 1, "find arrivals pass %d", pass);
findArrivals(levelize_->maxLevel(), arrival_visitor); findArrivals(levelize_->maxLevel(), arrival_visitor);
} }
} }
@ -958,7 +958,7 @@ void
Search::findArrivals(Level level, Search::findArrivals(Level level,
VertexVisitor *arrival_visitor) VertexVisitor *arrival_visitor)
{ {
debugPrint1(debug_, "search", 1, "find arrivals to level %d\n", level); debugPrint1(debug_, "search", 1, "find arrivals to level %d", level);
findArrivals1(); findArrivals1();
Stats stats(debug_); Stats stats(debug_);
int arrival_count = arrival_iter_->visitParallel(level, arrival_visitor); int arrival_count = arrival_iter_->visitParallel(level, arrival_visitor);
@ -969,7 +969,7 @@ Search::findArrivals(Level level,
arrivals_at_endpoints_exist_ = true; arrivals_at_endpoints_exist_ = true;
} }
arrivals_exist_ = true; arrivals_exist_ = true;
debugPrint1(debug_, "search", 1, "found %u arrivals\n", arrival_count); debugPrint1(debug_, "search", 1, "found %u arrivals", arrival_count);
} }
void void
@ -1061,7 +1061,7 @@ ArrivalVisitor::visit(Vertex *vertex)
const Graph *graph = sta_->graph(); const Graph *graph = sta_->graph();
const Sdc *sdc = sta_->sdc(); const Sdc *sdc = sta_->sdc();
Search *search = sta_->search(); Search *search = sta_->search();
debugPrint1(debug, "search", 2, "find arrivals %s\n", debugPrint1(debug, "search", 2, "find arrivals %s",
vertex->name(sdc_network)); vertex->name(sdc_network));
Pin *pin = vertex->pin(); Pin *pin = vertex->pin();
// Don't clobber clock sources. // Don't clobber clock sources.
@ -1101,7 +1101,7 @@ ArrivalVisitor::visit(Vertex *vertex)
// For example, "set_max_delay -to" from an unclocked source register. // For example, "set_max_delay -to" from an unclocked source register.
bool is_clk = tag_bldr_->hasClkTag(); bool is_clk = tag_bldr_->hasClkTag();
if (vertex->isRegClk() && !is_clk) { if (vertex->isRegClk() && !is_clk) {
debugPrint1(debug, "search", 2, "arrival seed unclked reg clk %s\n", debugPrint1(debug, "search", 2, "arrival seed unclked reg clk %s",
network->pathName(pin)); network->pathName(pin));
search->makeUnclkedPaths(vertex, true, tag_bldr_); search->makeUnclkedPaths(vertex, true, tag_bldr_);
} }
@ -1122,7 +1122,7 @@ ArrivalVisitor::visit(Vertex *vertex)
|| !sdc->isPathDelayInternalEndpoint(pin))) || !sdc->isPathDelayInternalEndpoint(pin)))
search->arrivalIterator()->enqueueAdjacentVertices(vertex, adj_pred_); search->arrivalIterator()->enqueueAdjacentVertices(vertex, adj_pred_);
if (arrivals_changed) { if (arrivals_changed) {
debugPrint0(debug, "search", 4, "arrival changed\n"); debugPrint0(debug, "search", 4, "arrival changed");
// Only update arrivals when delays change by more than // Only update arrivals when delays change by more than
// fuzzyEqual can distinguish. // fuzzyEqual can distinguish.
search->setVertexArrivals(vertex, tag_bldr_); search->setVertexArrivals(vertex, tag_bldr_);
@ -1221,15 +1221,15 @@ ArrivalVisitor::visitFromToPath(const Pin *,
{ {
const Debug *debug = sta_->debug(); const Debug *debug = sta_->debug();
const Network *sdc_network = sta_->sdcNetwork(); const Network *sdc_network = sta_->sdcNetwork();
debugPrint1(debug, "search", 3, " %s\n", debugPrint1(debug, "search", 3, " %s",
from_vertex->name(sdc_network)); from_vertex->name(sdc_network));
debugPrint3(debug, "search", 3, " %s -> %s %s\n", debugPrint3(debug, "search", 3, " %s -> %s %s",
from_rf->asString(), from_rf->asString(),
to_rf->asString(), to_rf->asString(),
min_max->asString()); min_max->asString());
debugPrint1(debug, "search", 3, " from tag: %s\n", debugPrint1(debug, "search", 3, " from tag: %s",
from_tag->asString(sta_)); from_tag->asString(sta_));
debugPrint1(debug, "search", 3, " to tag : %s\n", debugPrint1(debug, "search", 3, " to tag : %s",
to_tag->asString(sta_)); to_tag->asString(sta_));
ClkInfo *to_clk_info = to_tag->clkInfo(); ClkInfo *to_clk_info = to_tag->clkInfo();
bool to_is_clk = to_tag->isClock(); bool to_is_clk = to_tag->isClock();
@ -1239,7 +1239,7 @@ ArrivalVisitor::visitFromToPath(const Pin *,
tag_bldr_->tagMatchArrival(to_tag, tag_match, arrival, arrival_index); tag_bldr_->tagMatchArrival(to_tag, tag_match, arrival, arrival_index);
if (tag_match == nullptr if (tag_match == nullptr
|| delayGreater(to_arrival, arrival, min_max, sta_)) { || delayGreater(to_arrival, arrival, min_max, sta_)) {
debugPrint5(debug, "search", 3, " %s + %s = %s %s %s\n", debugPrint5(debug, "search", 3, " %s + %s = %s %s %s",
delayAsString(from_path->arrival(sta_), sta_), delayAsString(from_path->arrival(sta_), sta_),
delayAsString(arc_delay, sta_), delayAsString(arc_delay, sta_),
delayAsString(to_arrival, sta_), delayAsString(to_arrival, sta_),
@ -1294,14 +1294,14 @@ ArrivalVisitor::pruneCrprArrivals()
Arrival max_arrival_max_crpr = (min_max == MinMax::max()) Arrival max_arrival_max_crpr = (min_max == MinMax::max())
? max_arrival - max_crpr ? max_arrival - max_crpr
: max_arrival + max_crpr; : max_arrival + max_crpr;
debugPrint4(debug, "search", 4, " cmp %s %s - %s = %s\n", debugPrint4(debug, "search", 4, " cmp %s %s - %s = %s",
tag->asString(sta_), tag->asString(sta_),
delayAsString(max_arrival, sta_), delayAsString(max_arrival, sta_),
delayAsString(max_crpr, sta_), delayAsString(max_crpr, sta_),
delayAsString(max_arrival_max_crpr, sta_)); delayAsString(max_arrival_max_crpr, sta_));
Arrival arrival = tag_bldr_->arrival(arrival_index); Arrival arrival = tag_bldr_->arrival(arrival_index);
if (delayGreater(max_arrival_max_crpr, arrival, min_max, sta_)) { if (delayGreater(max_arrival_max_crpr, arrival, min_max, sta_)) {
debugPrint1(debug, "search", 3, " pruned %s\n", debugPrint1(debug, "search", 3, " pruned %s",
tag->asString(sta_)); tag->asString(sta_));
tag_bldr_->deleteArrival(tag); tag_bldr_->deleteArrival(tag);
} }
@ -1423,7 +1423,7 @@ Search::seedArrival(Vertex *vertex)
// Internal roots isolated by disabled pins are seeded with no clock. // Internal roots isolated by disabled pins are seeded with no clock.
|| (unconstrained_paths_ || (unconstrained_paths_
&& !network_->isTopLevelPort(pin))) { && !network_->isTopLevelPort(pin))) {
debugPrint1(debug_, "search", 2, "arrival seed unclked root %s\n", debugPrint1(debug_, "search", 2, "arrival seed unclked root %s",
network_->pathName(pin)); network_->pathName(pin));
TagGroupBldr tag_bldr(true, this); TagGroupBldr tag_bldr(true, this);
tag_bldr.init(vertex); tag_bldr.init(vertex);
@ -1439,7 +1439,7 @@ Search::seedArrival(Vertex *vertex)
} }
} }
else { else {
debugPrint1(debug_, "search", 2, "arrival enqueue %s\n", debugPrint1(debug_, "search", 2, "arrival enqueue %s",
network_->pathName(pin)); network_->pathName(pin));
arrival_iter_->enqueue(vertex); arrival_iter_->enqueue(vertex);
} }
@ -1462,7 +1462,7 @@ Search::seedClkArrivals(const Pin *pin,
TagGroupBldr *tag_bldr) TagGroupBldr *tag_bldr)
{ {
for (Clock *clk : *sdc_->findLeafPinClocks(pin)) { for (Clock *clk : *sdc_->findLeafPinClocks(pin)) {
debugPrint2(debug_, "search", 2, "arrival seed clk %s pin %s\n", debugPrint2(debug_, "search", 2, "arrival seed clk %s pin %s",
clk->name(), network_->pathName(pin)); clk->name(), network_->pathName(pin));
for (PathAnalysisPt *path_ap : corners_->pathAnalysisPts()) { for (PathAnalysisPt *path_ap : corners_->pathAnalysisPts()) {
const MinMax *min_max = path_ap->pathMinMax(); const MinMax *min_max = path_ap->pathMinMax();
@ -1739,8 +1739,8 @@ Search::seedInputDelayArrival(const Pin *pin,
{ {
debugPrint1(debug_, "search", 2, debugPrint1(debug_, "search", 2,
input_delay input_delay
? "arrival seed input arrival %s\n" ? "arrival seed input arrival %s"
: "arrival seed input %s\n", : "arrival seed input %s",
vertex->name(sdc_network_)); vertex->name(sdc_network_));
ClockEdge *clk_edge = nullptr; ClockEdge *clk_edge = nullptr;
const Pin *ref_pin = nullptr; const Pin *ref_pin = nullptr;
@ -1990,7 +1990,7 @@ PathVisitor::visitFanoutPaths(Vertex *from_vertex)
if (pred_->searchTo(to_vertex) if (pred_->searchTo(to_vertex)
&& pred_->searchThru(edge)) { && pred_->searchThru(edge)) {
debugPrint1(sta_->debug(), "search", 3, debugPrint1(sta_->debug(), "search", 3,
" %s\n", to_vertex->name(sta_->network())); " %s", to_vertex->name(sta_->network()));
if (!visitEdge(from_pin, from_vertex, edge, to_pin, to_vertex)) if (!visitEdge(from_pin, from_vertex, edge, to_pin, to_vertex))
break; break;
} }
@ -2714,11 +2714,11 @@ Search::setVertexArrivals(Vertex *vertex,
void void
Search::reportArrivals(Vertex *vertex) const Search::reportArrivals(Vertex *vertex) const
{ {
report_->print("Vertex %s\n", vertex->name(sdc_network_)); report_->reportLine("Vertex %s", vertex->name(sdc_network_));
TagGroup *tag_group = tagGroup(vertex); TagGroup *tag_group = tagGroup(vertex);
Arrival *arrivals = graph_->arrivals(vertex); Arrival *arrivals = graph_->arrivals(vertex);
if (tag_group) { if (tag_group) {
report_->print("Group %u\n", tag_group->index()); report_->reportLine("Group %u", tag_group->index());
ArrivalMap::Iterator arrival_iter(tag_group->arrivalMap()); ArrivalMap::Iterator arrival_iter(tag_group->arrivalMap());
while (arrival_iter.hasNext()) { while (arrival_iter.hasNext()) {
Tag *tag; Tag *tag;
@ -2726,31 +2726,34 @@ Search::reportArrivals(Vertex *vertex) const
arrival_iter.next(tag, arrival_index); arrival_iter.next(tag, arrival_index);
PathAnalysisPt *path_ap = tag->pathAnalysisPt(this); PathAnalysisPt *path_ap = tag->pathAnalysisPt(this);
const RiseFall *rf = tag->transition(); const RiseFall *rf = tag->transition();
report_->print(" %d %s %s %s", const char *req = "?";
arrival_index,
rf->asString(),
path_ap->pathMinMax()->asString(),
delayAsString(arrivals[arrival_index], this));
if (vertex->hasRequireds()) { if (vertex->hasRequireds()) {
int req_index; int req_index;
bool exists; bool exists;
tag_group->requiredIndex(tag, req_index, exists); tag_group->requiredIndex(tag, req_index, exists);
if (exists) if (exists)
report_->print(" / %s", delayAsString(arrivals[req_index], this)); req = delayAsString(arrivals[req_index], this);
} }
report_->print(" %s", tag->asString(true, false, this));
bool report_clk_prev = false; bool report_clk_prev = false;
const char *clk_prev = "";
if (report_clk_prev if (report_clk_prev
&& tag_group->hasClkTag()) { && tag_group->hasClkTag()) {
PathVertex prev = check_crpr_->clkPathPrev(vertex, arrival_index); PathVertex prev = check_crpr_->clkPathPrev(vertex, arrival_index);
report_->print(" clk_prev=[%s]", if (!prev.isNull())
prev.isNull() ? "NULL" : prev.name(this)); clk_prev = prev.name(this);
} }
report_->print("\n"); report_->reportLine(" %d %s %s %s / %s %s %s",
arrival_index,
rf->asString(),
path_ap->pathMinMax()->asString(),
delayAsString(arrivals[arrival_index], this),
req,
tag->asString(true, false, this),
clk_prev);
} }
} }
else else
report_->print(" no arrivals\n"); report_->reportLine(" no arrivals");
} }
TagGroup * TagGroup *
@ -2781,7 +2784,7 @@ Search::reportTagGroups() const
for (TagGroupIndex i = 0; i < tag_group_next_; i++) { for (TagGroupIndex i = 0; i < tag_group_next_; i++) {
TagGroup *tag_group = tag_groups_[i]; TagGroup *tag_group = tag_groups_[i];
if (tag_group) { if (tag_group) {
report_->print("Group %4u hash = %4u (%4u)\n", report_->reportLine("Group %4u hash = %4u (%4u)",
i, i,
tag_group->hash(), tag_group->hash(),
tag_group->hash() % tag_group_set_->capacity()); tag_group->hash() % tag_group_set_->capacity());
@ -2789,7 +2792,7 @@ Search::reportTagGroups() const
} }
} }
size_t long_hash = tag_group_set_->longestBucketHash(); size_t long_hash = tag_group_set_->longestBucketHash();
report_->print("Longest hash bucket length %lu hash=%lu\n", report_->reportLine("Longest hash bucket length %lu hash=%lu",
tag_group_set_->bucketLength(long_hash), tag_group_set_->bucketLength(long_hash),
long_hash); long_hash);
} }
@ -2813,7 +2816,7 @@ Search::reportArrivalCountHistogram() const
for (size_t arrival_count = 0; arrival_count < vertex_counts.size(); arrival_count++) { for (size_t arrival_count = 0; arrival_count < vertex_counts.size(); arrival_count++) {
int vertex_count = vertex_counts[arrival_count]; int vertex_count = vertex_counts[arrival_count];
if (vertex_count > 0) if (vertex_count > 0)
report_->print("%6d %6d\n", arrival_count, vertex_count); report_->reportLine("%6d %6d", arrival_count, vertex_count);
} }
} }
@ -2896,10 +2899,10 @@ Search::reportTags() const
for (TagIndex i = 0; i < tag_next_; i++) { for (TagIndex i = 0; i < tag_next_; i++) {
Tag *tag = tags_[i]; Tag *tag = tags_[i];
if (tag) if (tag)
report_->print("%s\n", tag->asString(this)) ; report_->reportLine("%s", tag->asString(this)) ;
} }
size_t long_hash = tag_set_->longestBucketHash(); size_t long_hash = tag_set_->longestBucketHash();
printf("Longest hash bucket length %d hash=%zu\n", report_->reportLine("Longest hash bucket length %d hash=%zu",
tag_set_->bucketLength(long_hash), tag_set_->bucketLength(long_hash),
long_hash); long_hash);
} }
@ -2913,10 +2916,8 @@ Search::reportClkInfos() const
clk_infos.push_back(clk_info); clk_infos.push_back(clk_info);
sort(clk_infos, ClkInfoLess(this)); sort(clk_infos, ClkInfoLess(this));
for (ClkInfo *clk_info : clk_infos) for (ClkInfo *clk_info : clk_infos)
report_->print("ClkInfo %s\n", report_->reportLine("ClkInfo %s", clk_info->asString(this));
clk_info->asString(this)); report_->reportLine("%lu clk infos", clk_info_set_->size());
printf("%lu clk infos\n",
clk_info_set_->size());
} }
ClkInfo * ClkInfo *
@ -3070,14 +3071,14 @@ void
Search::findRequireds(Level level) Search::findRequireds(Level level)
{ {
Stats stats(debug_); Stats stats(debug_);
debugPrint1(debug_, "search", 1, "find requireds to level %d\n", level); debugPrint1(debug_, "search", 1, "find requireds to level %d", level);
RequiredVisitor req_visitor(this); RequiredVisitor req_visitor(this);
if (!requireds_seeded_) if (!requireds_seeded_)
seedRequireds(); seedRequireds();
seedInvalidRequireds(); seedInvalidRequireds();
int required_count = required_iter_->visitParallel(level, &req_visitor); int required_count = required_iter_->visitParallel(level, &req_visitor);
requireds_exist_ = true; requireds_exist_ = true;
debugPrint1(debug_, "search", 1, "found %d requireds\n", required_count); debugPrint1(debug_, "search", 1, "found %d requireds", required_count);
stats.report("Find requireds"); stats.report("Find requireds");
} }
@ -3101,7 +3102,7 @@ Search::endpoints()
while (vertex_iter.hasNext()) { while (vertex_iter.hasNext()) {
Vertex *vertex = vertex_iter.next(); Vertex *vertex = vertex_iter.next();
if (isEndpoint(vertex)) { if (isEndpoint(vertex)) {
debugPrint1(debug_, "endpoint", 2, "insert %s\n", debugPrint1(debug_, "endpoint", 2, "insert %s",
vertex->name(sdc_network_)); vertex->name(sdc_network_));
endpoints_->insert(vertex); endpoints_->insert(vertex);
} }
@ -3110,7 +3111,7 @@ Search::endpoints()
if (invalid_endpoints_) { if (invalid_endpoints_) {
for (Vertex *vertex : *invalid_endpoints_) { for (Vertex *vertex : *invalid_endpoints_) {
if (isEndpoint(vertex)) { if (isEndpoint(vertex)) {
debugPrint1(debug_, "endpoint", 2, "insert %s\n", debugPrint1(debug_, "endpoint", 2, "insert %s",
vertex->name(sdc_network_)); vertex->name(sdc_network_));
endpoints_->insert(vertex); endpoints_->insert(vertex);
} }
@ -3130,7 +3131,7 @@ void
Search::endpointInvalid(Vertex *vertex) Search::endpointInvalid(Vertex *vertex)
{ {
if (invalid_endpoints_) { if (invalid_endpoints_) {
debugPrint1(debug_, "endpoint", 2, "invalid %s\n", debugPrint1(debug_, "endpoint", 2, "invalid %s",
vertex->name(sdc_network_)); vertex->name(sdc_network_));
invalid_endpoints_->insert(vertex); invalid_endpoints_->insert(vertex);
} }
@ -3252,7 +3253,7 @@ FindEndRequiredVisitor::visit(PathEnd *path_end)
void void
Search::seedRequired(Vertex *vertex) Search::seedRequired(Vertex *vertex)
{ {
debugPrint1(debug_, "search", 2, "required seed %s\n", debugPrint1(debug_, "search", 2, "required seed %s",
vertex->name(sdc_network_)); vertex->name(sdc_network_));
RequiredCmp required_cmp; RequiredCmp required_cmp;
FindEndRequiredVisitor seeder(&required_cmp, this); FindEndRequiredVisitor seeder(&required_cmp, this);
@ -3339,7 +3340,7 @@ RequiredCmp::requiredsSave(Vertex *vertex,
if (prev_reqs) { if (prev_reqs) {
Required prev_req = path->required(sta); Required prev_req = path->required(sta);
if (!delayEqual(prev_req, req)) { if (!delayEqual(prev_req, req)) {
debugPrint2(debug, "search", 3, "required save %s -> %s\n", debugPrint2(debug, "search", 3, "required save %s -> %s",
delayAsString(prev_req, sta), delayAsString(prev_req, sta),
delayAsString(req, sta)); delayAsString(req, sta));
path->setRequired(req, sta); path->setRequired(req, sta);
@ -3347,7 +3348,7 @@ RequiredCmp::requiredsSave(Vertex *vertex,
} }
} }
else { else {
debugPrint1(debug, "search", 3, "required save MIA -> %s\n", debugPrint1(debug, "search", 3, "required save MIA -> %s",
delayAsString(req, sta)); delayAsString(req, sta));
path->setRequired(req, sta); path->setRequired(req, sta);
} }
@ -3392,7 +3393,7 @@ RequiredVisitor::visit(Vertex *vertex)
{ {
Search *search = sta_->search(); Search *search = sta_->search();
const Debug *debug = sta_->debug(); const Debug *debug = sta_->debug();
debugPrint1(debug, "search", 2, "find required %s\n", debugPrint1(debug, "search", 2, "find required %s",
vertex->name(sta_->network())); vertex->name(sta_->network()));
required_cmp_->requiredsInit(vertex, sta_); required_cmp_->requiredsInit(vertex, sta_);
vertex->setRequiredsPruned(false); vertex->setRequiredsPruned(false);
@ -3429,11 +3430,11 @@ RequiredVisitor::visitFromToPath(const Pin *,
// Don't propagate required times through latch D->Q edges. // Don't propagate required times through latch D->Q edges.
if (edge->role() != TimingRole::latchDtoQ()) { if (edge->role() != TimingRole::latchDtoQ()) {
const Debug *debug = sta_->debug(); const Debug *debug = sta_->debug();
debugPrint3(debug, "search", 3, " %s -> %s %s\n", debugPrint3(debug, "search", 3, " %s -> %s %s",
from_rf->asString(), from_rf->asString(),
to_rf->asString(), to_rf->asString(),
min_max->asString()); min_max->asString());
debugPrint2(debug, "search", 3, " from tag %2u: %s\n", debugPrint2(debug, "search", 3, " from tag %2u: %s",
from_tag->index(), from_tag->index(),
from_tag->asString(sta_)); from_tag->asString(sta_));
int arrival_index; int arrival_index;
@ -3446,10 +3447,10 @@ RequiredVisitor::visitFromToPath(const Pin *,
PathVertex to_path(to_vertex, to_tag, sta_); PathVertex to_path(to_vertex, to_tag, sta_);
Required to_required = to_path.required(sta_); Required to_required = to_path.required(sta_);
Required from_required = to_required - arc_delay; Required from_required = to_required - arc_delay;
debugPrint2(debug, "search", 3, " to tag %2u: %s\n", debugPrint2(debug, "search", 3, " to tag %2u: %s",
to_tag->index(), to_tag->index(),
to_tag->asString(sta_)); to_tag->asString(sta_));
debugPrint5(debug, "search", 3, " %s - %s = %s %s %s\n", debugPrint5(debug, "search", 3, " %s - %s = %s %s %s",
delayAsString(to_required, sta_), delayAsString(to_required, sta_),
delayAsString(arc_delay, sta_), delayAsString(arc_delay, sta_),
delayAsString(from_required, sta_), delayAsString(from_required, sta_),
@ -3469,10 +3470,10 @@ RequiredVisitor::visitFromToPath(const Pin *,
if (tagMatchNoCrpr(to_path_tag, to_tag)) { if (tagMatchNoCrpr(to_path_tag, to_tag)) {
Required to_required = to_path->required(sta_); Required to_required = to_path->required(sta_);
Required from_required = to_required - arc_delay; Required from_required = to_required - arc_delay;
debugPrint2(debug, "search", 3, " to tag %2u: %s\n", debugPrint2(debug, "search", 3, " to tag %2u: %s",
to_path_tag->index(), to_path_tag->index(),
to_path_tag->asString(sta_)); to_path_tag->asString(sta_));
debugPrint5(debug, "search", 3, " %s - %s = %s %s %s\n", debugPrint5(debug, "search", 3, " %s - %s = %s %s %s",
delayAsString(to_required, sta_), delayAsString(to_required, sta_),
delayAsString(arc_delay, sta_), delayAsString(arc_delay, sta_),
delayAsString(from_required, sta_), delayAsString(from_required, sta_),
@ -3667,7 +3668,7 @@ Search::tnsInvalid(Vertex *vertex)
{ {
if ((tns_exists_ || worst_slacks_) if ((tns_exists_ || worst_slacks_)
&& isEndpoint(vertex)) { && isEndpoint(vertex)) {
debugPrint1(debug_, "tns", 2, "tns invalid %s\n", debugPrint1(debug_, "tns", 2, "tns invalid %s",
vertex->name(sdc_network_)); vertex->name(sdc_network_));
UniqueLock lock(tns_lock_); UniqueLock lock(tns_lock_);
invalid_tns_.insert(vertex); invalid_tns_.insert(vertex);
@ -3681,7 +3682,7 @@ Search::updateInvalidTns()
for (Vertex *vertex : invalid_tns_) { for (Vertex *vertex : invalid_tns_) {
// Network edits can change endpointedness since tnsInvalid was called. // Network edits can change endpointedness since tnsInvalid was called.
if (isEndpoint(vertex)) { if (isEndpoint(vertex)) {
debugPrint1(debug_, "tns", 2, "update tns %s\n", debugPrint1(debug_, "tns", 2, "update tns %s",
vertex->name(sdc_network_)); vertex->name(sdc_network_));
SlackSeq slacks(path_ap_count); SlackSeq slacks(path_ap_count);
wnsSlacks(vertex, slacks); wnsSlacks(vertex, slacks);
@ -3730,7 +3731,7 @@ Search::tnsIncr(Vertex *vertex,
PathAPIndex path_ap_index) PathAPIndex path_ap_index)
{ {
if (delayLess(slack, 0.0, this)) { if (delayLess(slack, 0.0, this)) {
debugPrint2(debug_, "tns", 3, "tns+ %s %s\n", debugPrint2(debug_, "tns", 3, "tns+ %s %s",
delayAsString(slack, this), delayAsString(slack, this),
vertex->name(sdc_network_)); vertex->name(sdc_network_));
tns_[path_ap_index] += slack; tns_[path_ap_index] += slack;
@ -3749,7 +3750,7 @@ Search::tnsDecr(Vertex *vertex,
tns_slacks_[path_ap_index].findKey(vertex, slack, found); tns_slacks_[path_ap_index].findKey(vertex, slack, found);
if (found if (found
&& delayLess(slack, 0.0, this)) { && delayLess(slack, 0.0, this)) {
debugPrint2(debug_, "tns", 3, "tns- %s %s\n", debugPrint2(debug_, "tns", 3, "tns- %s %s",
delayAsString(slack, this), delayAsString(slack, this),
vertex->name(sdc_network_)); vertex->name(sdc_network_));
tns_[path_ap_index] -= slack; tns_[path_ap_index] -= slack;
@ -3810,7 +3811,7 @@ Search::wnsTnsPreamble()
// Required times are only needed at endpoints. // Required times are only needed at endpoints.
if (requireds_seeded_) { if (requireds_seeded_) {
for (Vertex *vertex : invalid_requireds_) { for (Vertex *vertex : invalid_requireds_) {
debugPrint1(debug_, "search", 2, "tns update required %s\n", debugPrint1(debug_, "search", 2, "tns update required %s",
vertex->name(sdc_network_)); vertex->name(sdc_network_));
if (isEndpoint(vertex)) { if (isEndpoint(vertex)) {
seedRequired(vertex); seedRequired(vertex);

View File

@ -66,7 +66,7 @@ Sim::functionSense(const FuncExpr *expr,
const Pin *input_pin, const Pin *input_pin,
const Instance *inst) const Instance *inst)
{ {
debugPrint2(debug_, "sim", 4, "find sense pin %s %s\n", debugPrint2(debug_, "sim", 4, "find sense pin %s %s",
network_->pathName(input_pin), network_->pathName(input_pin),
expr->asString()); expr->asString());
bool increasing, decreasing; bool increasing, decreasing;
@ -92,7 +92,7 @@ Sim::functionSense(const FuncExpr *expr,
sense = TimingSense::negative_unate; sense = TimingSense::negative_unate;
else else
sense = TimingSense::non_unate; sense = TimingSense::non_unate;
debugPrint1(debug_, "sim", 4, " %s\n", timingSenseString(sense)); debugPrint1(debug_, "sim", 4, " %s", timingSenseString(sense));
return sense; return sense;
} }
@ -755,7 +755,7 @@ Sim::setConstraintConstPins(LogicValueMap *value_map,
LogicValue value; LogicValue value;
const Pin *pin; const Pin *pin;
value_iter.next(pin, value); value_iter.next(pin, value);
debugPrint2(debug_, "sim", 2, "case pin %s = %c\n", debugPrint2(debug_, "sim", 2, "case pin %s = %c",
network_->pathName(pin), network_->pathName(pin),
logicValueString(value)); logicValueString(value));
if (network_->isHierarchical(pin)) { if (network_->isHierarchical(pin)) {
@ -789,12 +789,12 @@ Sim::setConstFuncPins(bool propagate)
if (port) { if (port) {
FuncExpr *expr = port->function(); FuncExpr *expr = port->function();
if (expr->op() == FuncExpr::op_zero) { if (expr->op() == FuncExpr::op_zero) {
debugPrint1(debug_, "sim", 2, "func pin %s = 0\n", debugPrint1(debug_, "sim", 2, "func pin %s = 0",
network_->pathName(pin)); network_->pathName(pin));
setPinValue(pin, LogicValue::zero, propagate); setPinValue(pin, LogicValue::zero, propagate);
} }
else if (expr->op() == FuncExpr::op_one) { else if (expr->op() == FuncExpr::op_one) {
debugPrint1(debug_, "sim", 2, "func pin %s = 1\n", debugPrint1(debug_, "sim", 2, "func pin %s = 1",
network_->pathName(pin)); network_->pathName(pin));
setPinValue(pin, LogicValue::one, propagate); setPinValue(pin, LogicValue::one, propagate);
} }
@ -810,7 +810,7 @@ Sim::enqueueConstantPinInputs(bool propagate)
LogicValue value; LogicValue value;
Pin *pin; Pin *pin;
const_iter->next(pin, value); const_iter->next(pin, value);
debugPrint2(debug_, "sim", 2, "network constant pin %s = %c\n", debugPrint2(debug_, "sim", 2, "network constant pin %s = %c",
network_->pathName(pin), network_->pathName(pin),
logicValueString(value)); logicValueString(value));
setPinValue(pin, value, propagate); setPinValue(pin, value, propagate);
@ -832,7 +832,7 @@ Sim::removePropagatedValue(const Pin *pin)
if (!exists) { if (!exists) {
sdc_->logicValue(pin, constraint_value, exists); sdc_->logicValue(pin, constraint_value, exists);
if (!exists) { if (!exists) {
debugPrint1(debug_, "sim", 2, "pin %s remove prop constant\n", debugPrint1(debug_, "sim", 2, "pin %s remove prop constant",
network_->pathName(pin)); network_->pathName(pin));
Vertex *vertex, *bidirect_drvr_vertex; Vertex *vertex, *bidirect_drvr_vertex;
graph_->pinVertices(pin, vertex, bidirect_drvr_vertex); graph_->pinVertices(pin, vertex, bidirect_drvr_vertex);
@ -864,7 +864,7 @@ Sim::setPinValue(const Pin *pin,
sdc_network_->pathName(pin)); sdc_network_->pathName(pin));
} }
else { else {
debugPrint2(debug_, "sim", 3, "pin %s = %c\n", debugPrint2(debug_, "sim", 3, "pin %s = %c",
network_->pathName(pin), network_->pathName(pin),
logicValueString(value)); logicValueString(value));
Vertex *vertex, *bidirect_drvr_vertex; Vertex *vertex, *bidirect_drvr_vertex;
@ -903,7 +903,7 @@ Sim::setPinValue(const Pin *pin,
void void
Sim::evalInstance(const Instance *inst) Sim::evalInstance(const Instance *inst)
{ {
debugPrint1(debug_, "sim", 2, "eval %s\n", network_->pathName(inst)); debugPrint1(debug_, "sim", 2, "eval %s", network_->pathName(inst));
InstancePinIterator *pin_iter = network_->pinIterator(inst); InstancePinIterator *pin_iter = network_->pinIterator(inst);
while (pin_iter->hasNext()) { while (pin_iter->hasNext()) {
Pin *pin = pin_iter->next(); Pin *pin = pin_iter->next();
@ -918,7 +918,7 @@ Sim::evalInstance(const Instance *inst)
if (tri_en_expr) { if (tri_en_expr) {
if (evalExpr(tri_en_expr, inst) == LogicValue::one) { if (evalExpr(tri_en_expr, inst) == LogicValue::one) {
value = evalExpr(expr, inst); value = evalExpr(expr, inst);
debugPrint3(debug_, "sim", 2, " %s tri_en=1 %s = %c\n", debugPrint3(debug_, "sim", 2, " %s tri_en=1 %s = %c",
port->name(), port->name(),
expr->asString(), expr->asString(),
logicValueString(value)); logicValueString(value));
@ -926,7 +926,7 @@ Sim::evalInstance(const Instance *inst)
} }
else { else {
value = evalExpr(expr, inst); value = evalExpr(expr, inst);
debugPrint3(debug_, "sim", 2, " %s %s = %c\n", debugPrint3(debug_, "sim", 2, " %s %s = %c",
port->name(), port->name(),
expr->asString(), expr->asString(),
logicValueString(value)); logicValueString(value));
@ -934,14 +934,14 @@ Sim::evalInstance(const Instance *inst)
} }
else if (port->isClockGateOutPin()) { else if (port->isClockGateOutPin()) {
value = clockGateOutValue(inst); value = clockGateOutValue(inst);
debugPrint2(debug_, "sim", 2, " %s gated_clk = %c\n", debugPrint2(debug_, "sim", 2, " %s gated_clk = %c",
port->name(), port->name(),
logicValueString(value)); logicValueString(value));
} }
FuncExpr *tri_en_expr = port->tristateEnable(); FuncExpr *tri_en_expr = port->tristateEnable();
if (tri_en_expr == nullptr if (tri_en_expr == nullptr
|| evalExpr(tri_en_expr, inst) == LogicValue::one) { || evalExpr(tri_en_expr, inst) == LogicValue::one) {
debugPrint3(debug_, "sim", 2, " %s %s = %c\n", debugPrint3(debug_, "sim", 2, " %s %s = %c",
port->name(), port->name(),
expr ? expr->asString() : "gated_clk", expr ? expr->asString() : "gated_clk",
logicValueString(value)); logicValueString(value));
@ -1093,7 +1093,7 @@ Sim::clearSimValues()
void void
Sim::clearInstSimValues(const Instance *inst) Sim::clearInstSimValues(const Instance *inst)
{ {
debugPrint1(debug_, "sim", 4, "clear %s\n", debugPrint1(debug_, "sim", 4, "clear %s",
network_->pathName(inst)); network_->pathName(inst));
InstancePinIterator *pin_iter = network_->pinIterator(inst); InstancePinIterator *pin_iter = network_->pinIterator(inst);
while (pin_iter->hasNext()) { while (pin_iter->hasNext()) {
@ -1123,7 +1123,7 @@ void
Sim::annotateVertexEdges(const Instance *inst, Sim::annotateVertexEdges(const Instance *inst,
bool annotate) bool annotate)
{ {
debugPrint2(debug_, "sim", 4, "annotate %s %s\n", debugPrint2(debug_, "sim", 4, "annotate %s %s",
network_->pathName(inst), network_->pathName(inst),
annotate ? "true" : "false"); annotate ? "true" : "false");
InstancePinIterator *pin_iter = network_->pinIterator(inst); InstancePinIterator *pin_iter = network_->pinIterator(inst);

View File

@ -3006,7 +3006,7 @@ Sta::findRequired(Vertex *vertex)
// path pruning on fanout vertices with DFS. // path pruning on fanout vertices with DFS.
int fanout = 0; int fanout = 0;
disableFanoutCrprPruning(vertex, fanout); disableFanoutCrprPruning(vertex, fanout);
debugPrint2(debug_, "search", 1, "resurrect pruned required %s fanout %d\n", debugPrint2(debug_, "search", 1, "resurrect pruned required %s fanout %d",
vertex->name(sdc_network_), vertex->name(sdc_network_),
fanout); fanout);
// Find fanout arrivals and requireds with pruning disabled. // Find fanout arrivals and requireds with pruning disabled.
@ -4613,7 +4613,7 @@ Sta::findFaninPins(Vertex *to,
int inst_level, int inst_level,
int pin_level) int pin_level)
{ {
debugPrint1(debug_, "fanin", 1, "%s\n", debugPrint1(debug_, "fanin", 1, "%s",
to->name(sdc_network_)); to->name(sdc_network_));
if (!visited.hasKey(to)) { if (!visited.hasKey(to)) {
visited.insert(to); visited.insert(to);
@ -4723,7 +4723,7 @@ Sta::findFanoutPins(Vertex *from,
int inst_level, int inst_level,
int pin_level) int pin_level)
{ {
debugPrint1(debug_, "fanout", 1, "%s\n", debugPrint1(debug_, "fanout", 1, "%s",
from->name(sdc_network_)); from->name(sdc_network_));
if (!visited.hasKey(from)) { if (!visited.hasKey(from)) {
visited.insert(from); visited.insert(from);

View File

@ -106,7 +106,7 @@ void
TagGroup::report(const StaState *sta) const TagGroup::report(const StaState *sta) const
{ {
Report *report = sta->report(); Report *report = sta->report();
report->print("Group %u hash = %u\n", index_, hash_); report->reportLine("Group %u hash = %u", index_, hash_);
arrivalMapReport(arrival_map_, sta); arrivalMapReport(arrival_map_, sta);
} }
@ -126,11 +126,11 @@ arrivalMapReport(const ArrivalMap *arrival_map,
Tag *tag; Tag *tag;
int arrival_index; int arrival_index;
arrival_iter.next(tag, arrival_index); arrival_iter.next(tag, arrival_index);
report->print(" %2u %s\n", report->reportLine(" %2u %s",
arrival_index, arrival_index,
tag->asString(sta)); tag->asString(sta));
} }
report->print("\n"); report->reportLine("");
} }
//////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////

View File

@ -56,7 +56,7 @@ VisitPathEnds::visitPathEnds(Vertex *vertex,
// Ignore slack on bidirect driver vertex. The load vertex gets the slack. // Ignore slack on bidirect driver vertex. The load vertex gets the slack.
if (!vertex->isBidirectDriver()) { if (!vertex->isBidirectDriver()) {
const Pin *pin = vertex->pin(); const Pin *pin = vertex->pin();
debugPrint1(debug_, "search", 2, "find end slack %s\n", debugPrint1(debug_, "search", 2, "find end slack %s",
vertex->name(sdc_network_)); vertex->name(sdc_network_));
visitor->vertexBegin(vertex); visitor->vertexBegin(vertex);
bool is_constrained = false; bool is_constrained = false;

View File

@ -247,7 +247,7 @@ PathGroupPathVisitor::visit(Vertex *vertex)
visitFanoutPaths(vertex); visitFanoutPaths(vertex);
if (vertex_matches_) { if (vertex_matches_) {
const Debug *debug = sta_->debug(); const Debug *debug = sta_->debug();
debugPrint1(debug, "visit_path_group", 1, "visit %s\n", debugPrint1(debug, "visit_path_group", 1, "visit %s",
vertex->name(sta_->network())); vertex->name(sta_->network()));
visitor_->visit(vertex); visitor_->visit(vertex);
bkwd_iter_->enqueueAdjacentVertices(vertex); bkwd_iter_->enqueueAdjacentVertices(vertex);
@ -279,7 +279,7 @@ PathGroupPathVisitor::visitFromToPath(const Pin *,
if (!to_path.isNull()) { if (!to_path.isNull()) {
if (matching_paths->hasKey(&to_path)) { if (matching_paths->hasKey(&to_path)) {
const Debug *debug = sta_->debug(); const Debug *debug = sta_->debug();
debugPrint4(debug, "visit_path_group", 2, "match %s %s -> %s %s\n", debugPrint4(debug, "visit_path_group", 2, "match %s %s -> %s %s",
from_vertex->name(sta_->network()), from_vertex->name(sta_->network()),
from_tag->asString(sta_), from_tag->asString(sta_),
to_vertex->name(sta_->network()), to_vertex->name(sta_->network()),
@ -295,7 +295,7 @@ PathGroupPathVisitor::visitFromToPath(const Pin *,
&& matching_paths->hasKey(to_path)) { && matching_paths->hasKey(to_path)) {
const Debug *debug = sta_->debug(); const Debug *debug = sta_->debug();
debugPrint4(debug, "visit_path_group", 2, debugPrint4(debug, "visit_path_group", 2,
"match crpr %s %s -> %s %s\n", "match crpr %s %s -> %s %s",
from_vertex->name(sta_->network()), from_vertex->name(sta_->network()),
from_tag->asString(sta_), from_tag->asString(sta_),
to_vertex->name(sta_->network()), to_vertex->name(sta_->network()),

View File

@ -149,7 +149,7 @@ WorstSlack::initQueue(PathAPIndex path_ap_index,
{ {
Search *search = sta->search(); Search *search = sta->search();
const Debug *debug = sta->debug(); const Debug *debug = sta->debug();
debugPrint0(debug, "wns", 3, "init queue\n"); debugPrint0(debug, "wns", 3, "init queue");
queue_.clear(); queue_.clear();
worst_vertex_ = nullptr; worst_vertex_ = nullptr;
@ -169,7 +169,7 @@ WorstSlack::initQueue(PathAPIndex path_ap_index,
sortQueue(path_ap_index, sta); sortQueue(path_ap_index, sta);
} }
} }
debugPrint1(debug, "wns", 3, "threshold %s\n", debugPrint1(debug, "wns", 3, "threshold %s",
delayAsString(slack_threshold_, sta)); delayAsString(slack_threshold_, sta));
// checkQueue(); // checkQueue();
} }
@ -181,7 +181,7 @@ WorstSlack::sortQueue(PathAPIndex path_ap_index,
if (queue_.size() > 0) { if (queue_.size() > 0) {
Search *search = sta->search(); Search *search = sta->search();
const Debug *debug = sta->debug(); const Debug *debug = sta->debug();
debugPrint0(debug, "wns", 3, "sort queue\n"); debugPrint0(debug, "wns", 3, "sort queue");
VertexSeq vertices; VertexSeq vertices;
vertices.reserve(queue_.size()); vertices.reserve(queue_.size());
@ -197,7 +197,7 @@ WorstSlack::sortQueue(PathAPIndex path_ap_index,
int threshold_index = min(min_queue_size_, vertex_count - 1); int threshold_index = min(min_queue_size_, vertex_count - 1);
Vertex *threshold_vertex = vertices[threshold_index]; Vertex *threshold_vertex = vertices[threshold_index];
slack_threshold_ = search->wnsSlack(threshold_vertex, path_ap_index); slack_threshold_ = search->wnsSlack(threshold_vertex, path_ap_index);
debugPrint1(debug, "wns", 3, "threshold %s\n", debugPrint1(debug, "wns", 3, "threshold %s",
delayAsString(slack_threshold_, sta)); delayAsString(slack_threshold_, sta));
// Reinsert vertices with slack < threshold. // Reinsert vertices with slack < threshold.
@ -223,7 +223,7 @@ WorstSlack::findWorstInQueue(PathAPIndex path_ap_index,
{ {
Search *search = sta->search(); Search *search = sta->search();
const Debug *debug = sta->debug(); const Debug *debug = sta->debug();
debugPrint0(debug, "wns", 3, "find worst in queue\n"); debugPrint0(debug, "wns", 3, "find worst in queue");
worst_vertex_ = nullptr; worst_vertex_ = nullptr;
worst_slack_ = slack_init_; worst_slack_ = slack_init_;
@ -263,7 +263,7 @@ WorstSlack::checkQueue(PathAPIndex path_ap_index,
if (!queue_.hasKey(end) if (!queue_.hasKey(end)
&& delayLessEqual(search->wnsSlack(end, path_ap_index), && delayLessEqual(search->wnsSlack(end, path_ap_index),
slack_threshold_, sta)) slack_threshold_, sta))
report->print("WorstSlack queue missing %s %s < %s\n", report->reportLine("WorstSlack queue missing %s %s < %s",
end->name(network), end->name(network),
delayAsString(search->wnsSlack(end, path_ap_index), sta), delayAsString(search->wnsSlack(end, path_ap_index), sta),
delayAsString(slack_threshold_, sta)); delayAsString(slack_threshold_, sta));
@ -273,7 +273,7 @@ WorstSlack::checkQueue(PathAPIndex path_ap_index,
while (queue_iter.hasNext()) { while (queue_iter.hasNext()) {
Vertex *end = queue_iter.next(); Vertex *end = queue_iter.next();
if (!end_set.hasKey(end)) if (!end_set.hasKey(end))
report->print("WorstSlack queue extra %s %s > %s\n", report->reportLine("WorstSlack queue extra %s %s > %s",
end->name(network), end->name(network),
delayAsString(search->wnsSlack(end, path_ap_index), sta), delayAsString(search->wnsSlack(end, path_ap_index), sta),
delayAsString(slack_threshold_, sta)); delayAsString(slack_threshold_, sta));
@ -302,13 +302,13 @@ WorstSlack::updateWorstSlack(Vertex *vertex,
if (!delayEqual(slack, slack_init_) if (!delayEqual(slack, slack_init_)
&& delayLessEqual(slack, slack_threshold_, sta)) { && delayLessEqual(slack, slack_threshold_, sta)) {
debugPrint2(debug, "wns", 3, "insert %s %s\n", debugPrint2(debug, "wns", 3, "insert %s %s",
vertex->name(network), vertex->name(network),
delayAsString(slack, sta)); delayAsString(slack, sta));
queue_.insert(vertex); queue_.insert(vertex);
} }
else { else {
debugPrint2(debug, "wns", 3, "delete %s %s\n", debugPrint2(debug, "wns", 3, "delete %s %s",
vertex->name(network), vertex->name(network),
delayAsString(slack, sta)); delayAsString(slack, sta));
queue_.erase(vertex); queue_.erase(vertex);
@ -321,7 +321,7 @@ WorstSlack::setWorstSlack(Vertex *vertex,
Slack slack, Slack slack,
const StaState *sta) const StaState *sta)
{ {
debugPrint2(sta->debug(), "wns", 3, "%s %s\n", debugPrint2(sta->debug(), "wns", 3, "%s %s",
vertex->name(sta->network()), vertex->name(sta->network()),
delayAsString(slack, sta)); delayAsString(slack, sta));
worst_vertex_ = vertex; worst_vertex_ = vertex;

View File

@ -859,11 +859,11 @@ WritePathSpice::writeSubcktInstVoltSrcs(Stage stage,
const char *drvr_port_name = drvr_port->name(); const char *drvr_port_name = drvr_port->name();
const char *inst_name = network_->pathName(inst); const char *inst_name = network_->pathName(inst);
debugPrint1(debug_, "write_spice", 2, "subckt %s\n", cell->name()); debugPrint1(debug_, "write_spice", 2, "subckt %s", cell->name());
for (string subckt_port_sname : *spice_port_names) { for (string subckt_port_sname : *spice_port_names) {
const char *subckt_port_name = subckt_port_sname.c_str(); const char *subckt_port_name = subckt_port_sname.c_str();
LibertyPgPort *pg_port = cell->findPgPort(subckt_port_name); LibertyPgPort *pg_port = cell->findPgPort(subckt_port_name);
debugPrint2(debug_, "write_spice", 2, " port %s%s\n", debugPrint2(debug_, "write_spice", 2, " port %s%s",
subckt_port_name, subckt_port_name,
pg_port ? " pwr/gnd" : ""); pg_port ? " pwr/gnd" : "");
if (pg_port) if (pg_port)
@ -1383,7 +1383,7 @@ WritePathSpice::writeSubckts()
report_->error(28, "The following subkcts are missing from %s", report_->error(28, "The following subkcts are missing from %s",
lib_subckt_filename_); lib_subckt_filename_);
for (const char *cell_name : path_cell_names) for (const char *cell_name : path_cell_names)
report_->print(" %s\n", cell_name); report_->reportLine(" %s", cell_name);
} }
} }
else { else {
@ -1404,7 +1404,7 @@ WritePathSpice::findPathCellnames(// Return values.
if (arc) { if (arc) {
LibertyCell *cell = arc->set()->libertyCell(); LibertyCell *cell = arc->set()->libertyCell();
if (cell) { if (cell) {
debugPrint1(debug_, "write_spice", 2, "cell %s\n", cell->name()); debugPrint1(debug_, "write_spice", 2, "cell %s", cell->name());
path_cell_names.insert(cell->name()); path_cell_names.insert(cell->name());
} }
// Include side receivers. // Include side receivers.

View File

@ -113,7 +113,7 @@ proc report_power_row { type row_result design_total field_width digits } {
} else { } else {
set percent [expr $total / $design_total * 100] set percent [expr $total / $design_total * 100]
} }
report_line "[format %-20s $type][power_col $internal $field_width $digits][power_col $switching $field_width $digits][power_col $leakage $field_width $digits][power_col $total $field_width $digits] [format %5.1f%% $percent]" report_line "[format %-20s $type][power_col $internal $field_width $digits][power_col $switching $field_width $digits][power_col $leakage $field_width $digits][power_col $total $field_width $digits] [format %5.1f $percent]%"
} }
proc is_nan { str } { proc is_nan { str } {

View File

@ -1983,7 +1983,7 @@ void
report_line(const char *msg) report_line(const char *msg)
{ {
Report *report = Sta::sta()->report(); Report *report = Sta::sta()->report();
report->printLine(msg); report->reportLineString(msg);
} }
void void
@ -4397,7 +4397,7 @@ set_report_path_field_properties(const char *field_name,
if (field) if (field)
field->setProperties(title, width, left_justify); field->setProperties(title, width, left_justify);
else else
sta->report()->print("Error: unknown report path field %s\n", field_name); sta->report()->error(607, "unknown report path field %s", field_name);
} }
void void
@ -4409,7 +4409,7 @@ set_report_path_field_width(const char *field_name,
if (field) if (field)
field->setWidth(width); field->setWidth(width);
else else
sta->report()->print("Error: unknown report path field %s\n", field_name); sta->report()->error(608, "unknown report path field %s", field_name);
} }
void void
@ -5187,7 +5187,7 @@ report_loops()
while (loop_iter.hasNext()) { while (loop_iter.hasNext()) {
GraphLoop *loop = loop_iter.next(); GraphLoop *loop = loop_iter.next();
loop->report(report, network, graph); loop->report(report, network, graph);
report->print("\n"); report->reportLine("");
} }
} }

View File

@ -112,4 +112,18 @@ Debug::print(const char *fmt,
va_end(args); va_end(args);
} }
void
Debug::reportLine(const char *what,
const char *fmt,
...) const
{
va_list args;
va_start(args, fmt);
report_->printToBuffer(what);
report_->printToBufferAppend(": ");
report_->printToBufferAppend(fmt, args);
report_->printToBufferAppend("\n");
report_->printBuffer();
}
} // namespace } // namespace

View File

@ -44,6 +44,64 @@ Report::~Report()
delete [] buffer_; delete [] buffer_;
} }
size_t
Report::printString(const char *buffer,
size_t length)
{
size_t ret = length;
if (redirect_to_string_)
redirectStringPrint(buffer, length);
else {
if (redirect_stream_)
ret = min(ret, fwrite(buffer, sizeof(char), length, redirect_stream_));
else
ret = min(ret, printConsole(buffer, length));
if (log_stream_)
ret = min(ret, fwrite(buffer, sizeof(char), length, log_stream_));
}
return ret;
}
void
Report::print(const string *str)
{
printString(str->c_str(), str->size());
}
void
Report::print(const string &str)
{
printString(str.c_str(), str.size());
}
void
Report::vprint(const char *fmt,
va_list args)
{
std::unique_lock<std::mutex> lock(buffer_lock_);
printToBuffer(fmt, args);
printString(buffer_, buffer_length_);
}
void
Report::reportLine(const char *fmt, ...)
{
va_list args;
va_start(args, fmt);
vprint(fmt, args);
printString("\n", 1);
va_end(args);
}
void
Report::reportLineString(const char *line)
{
printString(line, strlen(line));
printString("\n", 1);
}
////////////////////////////////////////////////////////////////
void void
Report::printToBuffer(const char *fmt, Report::printToBuffer(const char *fmt,
...) ...)
@ -96,61 +154,6 @@ Report::printBuffer()
printString(buffer_, buffer_length_); printString(buffer_, buffer_length_);
} }
size_t
Report::printString(const char *buffer,
size_t length)
{
size_t ret = length;
if (redirect_to_string_)
redirectStringPrint(buffer, length);
else {
if (redirect_stream_)
ret = min(ret, fwrite(buffer, sizeof(char), length, redirect_stream_));
else
ret = min(ret, printConsole(buffer, length));
if (log_stream_)
ret = min(ret, fwrite(buffer, sizeof(char), length, log_stream_));
}
return ret;
}
void
Report::print(const string *str)
{
printString(str->c_str(), str->size());
}
void
Report::print(const string &str)
{
printString(str.c_str(), str.size());
}
void
Report::vprint(const char *fmt,
va_list args)
{
std::unique_lock<std::mutex> lock(buffer_lock_);
printToBuffer(fmt, args);
printString(buffer_, buffer_length_);
}
void
Report::print(const char *fmt, ...)
{
va_list args;
va_start(args, fmt);
vprint(fmt, args);
va_end(args);
}
void
Report::printLine(const char *line)
{
printString(line, strlen(line));
printString("\n", 1);
}
//////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////
void void