rm \n from print stmts

This commit is contained in:
James Cherry 2020-12-28 18:04:49 -08:00
parent 20f01e417b
commit f32ddd728b
6 changed files with 330 additions and 380 deletions

View File

@ -44,11 +44,11 @@ public:
size_t length); size_t length);
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);
// Print line with return. // Print line with return.
virtual void reportLine(const char *fmt, ...); virtual void reportLine(const char *fmt, ...);
virtual void reportLineString(const char *line); virtual void reportLineString(const char *line);
void reportLine(const string &line);
//////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////

View File

@ -164,9 +164,9 @@ ReportAnnotated::reportDelayAnnotation()
void void
ReportAnnotated::reportDelayCounts() ReportAnnotated::reportDelayCounts()
{ {
report_->print(" Not \n"); report_->reportLine(" Not ");
report_->print("Delay type Total Annotated Annotated\n"); report_->reportLine("Delay type Total Annotated Annotated");
report_->print("----------------------------------------------------------------\n"); report_->reportLine("----------------------------------------------------------------");
int total = 0; int total = 0;
int annotated_total = 0; int annotated_total = 0;
@ -252,9 +252,9 @@ ReportAnnotated::reportCheckAnnotation()
void void
ReportAnnotated::reportCheckCounts() ReportAnnotated::reportCheckCounts()
{ {
report_->print(" Not \n"); report_->reportLine(" Not ");
report_->print("Check type Total Annotated Annotated\n"); report_->reportLine("Check type Total Annotated Annotated");
report_->print("----------------------------------------------------------------\n"); report_->reportLine("----------------------------------------------------------------");
int total = 0; int total = 0;
int annotated_total = 0; int annotated_total = 0;
@ -466,9 +466,8 @@ ReportAnnotated::reportArcs(const char *header,
bool report_annotated, bool report_annotated,
PinSet &pins) PinSet &pins)
{ {
report_->print("\n"); report_->reportLine("");
report_->print(header); report_->reportLine(header);
report_->print("\n");
PinSeq sorted_pins; PinSeq sorted_pins;
sortPinSet(&pins, network_, sorted_pins); sortPinSet(&pins, network_, sorted_pins);
int i = 0; int i = 0;

View File

@ -270,7 +270,6 @@ ReportPath::setReportSigmas(bool report)
void void
ReportPath::reportPathEndHeader() ReportPath::reportPathEndHeader()
{ {
string header;
switch (format_) { switch (format_) {
case ReportPathFormat::full: case ReportPathFormat::full:
case ReportPathFormat::full_clock: case ReportPathFormat::full_clock:
@ -279,12 +278,10 @@ ReportPath::reportPathEndHeader()
case ReportPathFormat::endpoint: case ReportPathFormat::endpoint:
break; break;
case ReportPathFormat::summary: case ReportPathFormat::summary:
reportSummaryHeader(header); reportSummaryHeader();
report_->print(header);
break; break;
case ReportPathFormat::slack_only: case ReportPathFormat::slack_only:
reportSlackOnlyHeader(header); reportSlackOnlyHeader();
report_->print(header);
break; break;
default: default:
report_->critical(255, "unsupported path type"); report_->critical(255, "unsupported path type");
@ -305,7 +302,7 @@ ReportPath::reportPathEndFooter()
case ReportPathFormat::endpoint: case ReportPathFormat::endpoint:
case ReportPathFormat::summary: case ReportPathFormat::summary:
case ReportPathFormat::slack_only: case ReportPathFormat::slack_only:
report_->print("\n"); report_->reportLine("");
break; break;
default: default:
report_->critical(256, "unsupported path type"); report_->critical(256, "unsupported path type");
@ -329,13 +326,13 @@ ReportPath::reportPathEnd(PathEnd *end,
case ReportPathFormat::full_clock: case ReportPathFormat::full_clock:
case ReportPathFormat::full_clock_expanded: case ReportPathFormat::full_clock_expanded:
end->reportFull(this, result); end->reportFull(this, result);
report_->print(result); report_->reportLine(result);
report_->print("\n\n"); report_->reportLine("");
break; break;
case ReportPathFormat::shorter: case ReportPathFormat::shorter:
end->reportShort(this, result); end->reportShort(this, result);
report_->print(result); report_->reportLine(result);
report_->print("\n\n"); report_->reportLine("");
break; break;
case ReportPathFormat::endpoint: case ReportPathFormat::endpoint:
reportEndpointHeader(end, prev_end); reportEndpointHeader(end, prev_end);
@ -343,12 +340,10 @@ ReportPath::reportPathEnd(PathEnd *end,
report_->print(result); report_->print(result);
break; break;
case ReportPathFormat::summary: case ReportPathFormat::summary:
reportSummaryLine(end, result); reportSummaryLine(end);
report_->print(result);
break; break;
case ReportPathFormat::slack_only: case ReportPathFormat::slack_only:
reportSlackOnly(end, result); reportSlackOnly(end);
report_->print(result);
break; break;
default: default:
report_->critical(257, "unsupported path type"); report_->critical(257, "unsupported path type");
@ -367,8 +362,8 @@ ReportPath::reportPathEnds(PathEndSeq *ends)
reportEndpointHeader(end, prev_end); reportEndpointHeader(end, prev_end);
string result; string result;
end->reportFull(this, result); end->reportFull(this, result);
report_->print(result); report_->reportLine(result);
report_->print("\n\n"); report_->reportLine("");
prev_end = end; prev_end = end;
} }
reportPathEndFooter(); reportPathEndFooter();
@ -384,7 +379,7 @@ ReportPath::reportEndpointHeader(PathEnd *end,
PathGroup *group = search_->pathGroup(end); PathGroup *group = search_->pathGroup(end);
if (group != prev_group) { if (group != prev_group) {
if (prev_group) if (prev_group)
report_->print("\n"); report_->reportLine("");
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";
@ -392,9 +387,7 @@ ReportPath::reportEndpointHeader(PathEnd *end,
setup_hold, setup_hold,
group->name()); group->name());
report_->reportLine(""); report_->reportLine("");
string header; reportEndHeader();
reportEndHeader(header);
report_->print(header);
} }
} }
@ -992,28 +985,29 @@ ReportPath::reportEndpoint(const PathEndDataCheck *end,
//////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////
void void
ReportPath::reportEndHeader(string &result) ReportPath::reportEndHeader()
{ {
string line;
// Line one. // Line one.
reportDescription("", result); reportDescription("", line);
result += ' '; line += ' ';
reportField("Required", field_total_, result); reportField("Required", field_total_, line);
result += ' '; line += ' ';
reportField("Actual", field_total_, result); reportField("Actual", field_total_, line);
reportEndOfLine(result); report_->reportLine(line);
// Line two. // Line two.
reportDescription("Endpoint", result); line.clear();
result += ' '; reportDescription("Endpoint", line);
reportField("Delay", field_total_, result); line += ' ';
result += ' '; reportField("Delay", field_total_, line);
reportField("Delay", field_total_, result); line += ' ';
result += ' '; reportField("Delay", field_total_, line);
reportField("Slack", field_total_, result); line += ' ';
reportEndOfLine(result); reportField("Slack", field_total_, line);
report_->reportLine(line);
reportDashLine(field_description_->width() + field_total_->width() * 3 + 3, reportDashLine(field_description_->width() + field_total_->width() * 3 + 3);
result);
} }
void void
@ -1031,35 +1025,35 @@ ReportPath::reportEndLine(PathEnd *end,
//////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////
void void
ReportPath::reportSummaryHeader(string &result) ReportPath::reportSummaryHeader()
{ {
reportDescription("Startpoint", result); string line;
result += ' '; reportDescription("Startpoint", line);
reportDescription("Endpoint", result); line += ' ';
result += ' '; reportDescription("Endpoint", line);
reportField("Slack", field_total_, result); line += ' ';
reportEndOfLine(result); reportField("Slack", field_total_, line);
reportDashLine(field_description_->width() * 2 + field_total_->width() + 1, report_->reportLine(line);
result);
reportEndOfLine(result); reportDashLine(field_description_->width() * 2 + field_total_->width() + 1);
} }
void void
ReportPath::reportSummaryLine(PathEnd *end, ReportPath::reportSummaryLine(PathEnd *end)
string &result)
{ {
string line;
PathExpanded expanded(end->path(), this); PathExpanded expanded(end->path(), this);
const EarlyLate *early_late = end->pathEarlyLate(this); const EarlyLate *early_late = end->pathEarlyLate(this);
auto startpoint = pathStartpoint(end, expanded); auto startpoint = pathStartpoint(end, expanded);
reportDescription(startpoint.c_str(), result); reportDescription(startpoint.c_str(), line);
result += ' '; line += ' ';
auto endpoint = pathEndpoint(end); auto endpoint = pathEndpoint(end);
reportDescription(endpoint.c_str(), result); reportDescription(endpoint.c_str(), line);
if (end->isUnconstrained()) if (end->isUnconstrained())
reportSpaceFieldDelay(end->dataArrivalTimeOffset(this), early_late, result); reportSpaceFieldDelay(end->dataArrivalTimeOffset(this), early_late, line);
else else
reportSpaceFieldDelay(end->slack(this), early_late, result); reportSpaceFieldDelay(end->slack(this), early_late, line);
reportEndOfLine(result); report_->reportLine(line);
} }
string string
@ -1099,27 +1093,28 @@ ReportPath::pathEndpoint(PathEnd *end)
//////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////
void void
ReportPath::reportSlackOnlyHeader(string &result) ReportPath::reportSlackOnlyHeader()
{ {
reportDescription("Group", result); string line;
result += ' '; reportDescription("Group", line);
reportField("Slack", field_total_, result); line += ' ';
reportEndOfLine(result); reportField("Slack", field_total_, line);
reportDashLine(field_description_->width() + field_total_->width() + 1, report_->reportLine(line);
result);
reportDashLine(field_description_->width() + field_total_->width() + 1);
} }
void void
ReportPath::reportSlackOnly(PathEnd *end, ReportPath::reportSlackOnly(PathEnd *end)
string &result)
{ {
string line;
const EarlyLate *early_late = end->pathEarlyLate(this); const EarlyLate *early_late = end->pathEarlyLate(this);
reportDescription(search_->pathGroup(end)->name(), result); reportDescription(search_->pathGroup(end)->name(), line);
if (end->isUnconstrained()) if (end->isUnconstrained())
reportSpaceFieldDelay(end->dataArrivalTimeOffset(this), early_late, result); reportSpaceFieldDelay(end->dataArrivalTimeOffset(this), early_late, line);
else else
reportSpaceFieldDelay(end->slack(this), early_late, result); reportSpaceFieldDelay(end->slack(this), early_late, line);
reportEndOfLine(result); report_->reportLine(line);
} }
//////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////
@ -1129,20 +1124,14 @@ ReportPath::reportMpwCheck(MinPulseWidthCheck *check,
bool verbose) bool verbose)
{ {
if (verbose) { if (verbose) {
string result; reportVerbose(check);
reportVerbose(check, result); report_->reportLine("");
report_->print(result);
report_->print("\n");
} }
else { else {
string header; reportMpwHeaderShort();
reportMpwHeaderShort(header); reportShort(check);
report_->print(header);
string result;
reportShort(check, result);
report_->print(result);
} }
report_->print("\n"); report_->reportLine("");
} }
void void
@ -1154,76 +1143,75 @@ ReportPath::reportMpwChecks(MinPulseWidthCheckSeq *checks,
MinPulseWidthCheckSeq::Iterator check_iter(checks); MinPulseWidthCheckSeq::Iterator check_iter(checks);
while (check_iter.hasNext()) { while (check_iter.hasNext()) {
MinPulseWidthCheck *check = check_iter.next(); MinPulseWidthCheck *check = check_iter.next();
string result; reportVerbose(check);
reportVerbose(check, result); report_->reportLine("");
report_->print(result);
report_->print("\n");
} }
} }
else { else {
string header; reportMpwHeaderShort();
reportMpwHeaderShort(header);
report_->print(header);
MinPulseWidthCheckSeq::Iterator check_iter(checks); MinPulseWidthCheckSeq::Iterator check_iter(checks);
while (check_iter.hasNext()) { while (check_iter.hasNext()) {
MinPulseWidthCheck *check = check_iter.next(); MinPulseWidthCheck *check = check_iter.next();
string result; reportShort(check);
reportShort(check, result);
report_->print(result);
} }
} }
report_->print("\n"); report_->reportLine("");
} }
} }
void void
ReportPath::reportMpwHeaderShort(string &result) ReportPath::reportMpwHeaderShort()
{ {
reportDescription("", result); string line;
result += ' '; reportDescription("", line);
reportField("Required", field_total_, result); line += ' ';
result += ' '; reportField("Required", field_total_, line);
reportField("Actual", field_total_, result); line += ' ';
reportEndOfLine(result); reportField("Actual", field_total_, line);
report_->reportLine(line);
reportDescription("Pin", result); line.clear();
result += ' '; reportDescription("Pin", line);
reportField("Width", field_total_, result); line += ' ';
result += ' '; reportField("Width", field_total_, line);
reportField("Width", field_total_, result); line += ' ';
result += ' '; reportField("Width", field_total_, line);
reportField("Slack", field_total_, result); line += ' ';
reportEndOfLine(result); reportField("Slack", field_total_, line);
reportDashLine(field_description_->width() + field_total_->width() * 3 + 3, report_->reportLine(line);
result);
reportDashLine(field_description_->width() + field_total_->width() * 3 + 3);
} }
void void
ReportPath::reportShort(MinPulseWidthCheck *check, ReportPath::reportShort(MinPulseWidthCheck *check)
string &result)
{ {
string line;
const char *pin_name = cmd_network_->pathName(check->pin(this)); const char *pin_name = cmd_network_->pathName(check->pin(this));
const char *hi_low = mpwCheckHiLow(check); const char *hi_low = mpwCheckHiLow(check);
auto what = stdstrPrint("%s (%s)", pin_name, hi_low); auto what = stdstrPrint("%s (%s)", pin_name, hi_low);
reportDescription(what.c_str(), result); reportDescription(what.c_str(), line);
reportSpaceFieldTime(check->minWidth(this), result); reportSpaceFieldTime(check->minWidth(this), line);
reportSpaceFieldDelay(check->width(this), EarlyLate::late(), result); reportSpaceFieldDelay(check->width(this), EarlyLate::late(), line);
reportSpaceSlack(check->slack(this), result); reportSpaceSlack1(check->slack(this), line);
report_->reportLine(line);
} }
void void
ReportPath::reportVerbose(MinPulseWidthCheck *check, ReportPath::reportVerbose(MinPulseWidthCheck *check)
string &result)
{ {
string line;
const char *pin_name = cmd_network_->pathName(check->pin(this)); const char *pin_name = cmd_network_->pathName(check->pin(this));
result += "Pin: "; line += "Pin: ";
result += pin_name; line += pin_name;
reportEndOfLine(result); report_->reportLine(line);
result += "Check: sequential_clock_pulse_width\n"; line = "Check: sequential_clock_pulse_width\n";
reportEndOfLine(result); report_->reportLine(line);
line.clear();
reportPathHeader(line);
reportPathHeader(result);
const EarlyLate *open_el = EarlyLate::late(); const EarlyLate *open_el = EarlyLate::late();
ClockEdge *open_clk_edge = check->openClkEdge(this); ClockEdge *open_clk_edge = check->openClkEdge(this);
Clock *open_clk = open_clk_edge->clock(); Clock *open_clk = open_clk_edge->clock();
@ -1232,15 +1220,16 @@ ReportPath::reportVerbose(MinPulseWidthCheck *check,
float open_clk_time = open_clk_edge->time(); float open_clk_time = open_clk_edge->time();
auto open_clk_msg = stdstrPrint("clock %s (%s edge)", open_clk_name, open_rise_fall); auto open_clk_msg = stdstrPrint("clock %s (%s edge)", open_clk_name, open_rise_fall);
reportLine(open_clk_msg.c_str(), open_clk_time, open_clk_time, reportLine(open_clk_msg.c_str(), open_clk_time, open_clk_time,
open_el, result); open_el, line);
Arrival open_arrival = check->openArrival(this); Arrival open_arrival = check->openArrival(this);
bool is_prop = isPropagated(check->openPath()); bool is_prop = isPropagated(check->openPath());
const char *clk_ideal_prop = clkNetworkDelayIdealProp(is_prop); const char *clk_ideal_prop = clkNetworkDelayIdealProp(is_prop);
reportLine(clk_ideal_prop, check->openDelay(this), open_arrival, reportLine(clk_ideal_prop, check->openDelay(this), open_arrival,
open_el, result); open_el, line);
reportLine(pin_name, delay_zero, open_arrival, open_el, result); reportLine(pin_name, delay_zero, open_arrival, open_el, line);
reportLine("open edge arrival time", open_arrival, open_el, result); reportLine("open edge arrival time", open_arrival, open_el, line);
reportEndOfLine(result); reportEndOfLine(line);
const EarlyLate *close_el = EarlyLate::late(); const EarlyLate *close_el = EarlyLate::late();
ClockEdge *close_clk_edge = check->closeClkEdge(this); ClockEdge *close_clk_edge = check->closeClkEdge(this);
@ -1250,28 +1239,29 @@ ReportPath::reportVerbose(MinPulseWidthCheck *check,
float close_offset = check->closeOffset(this); float close_offset = check->closeOffset(this);
float close_clk_time = close_clk_edge->time() + close_offset; float close_clk_time = close_clk_edge->time() + close_offset;
auto close_clk_msg = stdstrPrint("clock %s (%s edge)", close_clk_name, close_rise_fall); auto close_clk_msg = stdstrPrint("clock %s (%s edge)", close_clk_name, close_rise_fall);
reportLine(close_clk_msg.c_str(), close_clk_time, close_clk_time, close_el, result); reportLine(close_clk_msg.c_str(), close_clk_time, close_clk_time, close_el, line);
Arrival close_arrival = check->closeArrival(this) + close_offset; Arrival close_arrival = check->closeArrival(this) + close_offset;
reportLine(clk_ideal_prop, check->closeDelay(this), close_arrival, reportLine(clk_ideal_prop, check->closeDelay(this), close_arrival,
close_el, result); close_el, line);
reportLine(pin_name, delay_zero, close_arrival, close_el, result); reportLine(pin_name, delay_zero, close_arrival, close_el, line);
if (sdc_->crprEnabled()) { if (sdc_->crprEnabled()) {
Crpr pessimism = check->commonClkPessimism(this); Crpr pessimism = check->commonClkPessimism(this);
close_arrival += pessimism; close_arrival += pessimism;
reportLine("clock reconvergence pessimism", pessimism, close_arrival, reportLine("clock reconvergence pessimism", pessimism, close_arrival,
close_el, result); close_el, line);
} }
reportLine("close edge arrival time", close_arrival, close_el, result); reportLine("close edge arrival time", close_arrival, close_el, line);
reportDashLine(result); reportDashLine(line);
float min_width = check->minWidth(this); float min_width = check->minWidth(this);
const char *hi_low = mpwCheckHiLow(check); const char *hi_low = mpwCheckHiLow(check);
auto rpw_msg = stdstrPrint("required pulse width (%s)", hi_low); auto rpw_msg = stdstrPrint("required pulse width (%s)", hi_low);
reportLine(rpw_msg.c_str(), min_width, EarlyLate::early(), result); reportLine(rpw_msg.c_str(), min_width, EarlyLate::early(), line);
reportLine("actual pulse width", check->width(this), EarlyLate::early(), result); reportLine("actual pulse width", check->width(this), EarlyLate::early(), line);
reportDashLine(result); reportDashLine(line);
reportSlack(check->slack(this), result); reportSlack(check->slack(this), line);
report_->print(line);
} }
const char * const char *
@ -1290,20 +1280,14 @@ ReportPath::reportCheck(MinPeriodCheck *check,
bool verbose) bool verbose)
{ {
if (verbose) { if (verbose) {
string result; reportVerbose(check);
reportVerbose(check, result); report_->reportLine("");
report_->print(result);
report_->print("\n");
} }
else { else {
string header; reportPeriodHeaderShort();
reportPeriodHeaderShort(header); reportShort(check);
report_->print(header);
string result;
reportShort(check, result);
report_->print(result);
} }
report_->print("\n"); report_->reportLine("");
} }
void void
@ -1315,76 +1299,77 @@ ReportPath::reportChecks(MinPeriodCheckSeq *checks,
MinPeriodCheckSeq::Iterator check_iter(checks); MinPeriodCheckSeq::Iterator check_iter(checks);
while (check_iter.hasNext()) { while (check_iter.hasNext()) {
MinPeriodCheck *check = check_iter.next(); MinPeriodCheck *check = check_iter.next();
string result; reportVerbose(check);
reportVerbose(check, result); report_->reportLine("");
report_->print(result);
report_->print("\n");
} }
} }
else { else {
string header; reportPeriodHeaderShort();
reportPeriodHeaderShort(header);
report_->print(header);
MinPeriodCheckSeq::Iterator check_iter(checks); MinPeriodCheckSeq::Iterator check_iter(checks);
while (check_iter.hasNext()) { while (check_iter.hasNext()) {
MinPeriodCheck *check = check_iter.next(); MinPeriodCheck *check = check_iter.next();
reportShort(check);
}
}
report_->reportLine("");
}
}
void
ReportPath::reportPeriodHeaderShort()
{
string line;
reportDescription("", line);
line += ' ';
reportField("", field_total_, line);
line += ' ';
reportField("Min", field_total_, line);
line += ' ';
reportField("", field_total_, line);
report_->reportLine(line);
line.clear();
reportDescription("Pin", line);
line += ' ';
reportField("Period", field_total_, line);
line += ' ';
reportField("Period", field_total_, line);
line += ' ';
reportField("Slack", field_total_, line);
report_->reportLine(line);
reportDashLine(field_description_->width() + field_total_->width() * 3 + 3);
}
void
ReportPath::reportShort(MinPeriodCheck *check)
{
string line;
const char *pin_name = cmd_network_->pathName(check->pin());
reportDescription(pin_name, line);
reportSpaceFieldDelay(check->period(), EarlyLate::early(), line);
reportSpaceFieldDelay(check->minPeriod(this), EarlyLate::early(), line);
reportSpaceSlack1(check->slack(this), line);
report_->reportLine(line);
}
void
ReportPath::reportVerbose(MinPeriodCheck *check)
{
string line;
const char *pin_name = cmd_network_->pathName(check->pin());
line += "Pin: ";
line += pin_name;
report_->reportLine(line);
string result; string result;
reportShort(check, result);
report_->print(result);
}
}
report_->print("\n");
}
}
void
ReportPath::reportPeriodHeaderShort(string &result)
{
reportDescription("", result);
result += ' ';
reportField("", field_total_, result);
result += ' ';
reportField("Min", field_total_, result);
result += ' ';
reportField("", field_total_, result);
reportEndOfLine(result);
reportDescription("Pin", result);
result += ' ';
reportField("Period", field_total_, result);
result += ' ';
reportField("Period", field_total_, result);
result += ' ';
reportField("Slack", field_total_, result);
reportEndOfLine(result);
reportDashLine(field_description_->width() + field_total_->width() * 3 + 3,
result);
}
void
ReportPath::reportShort(MinPeriodCheck *check,
string &result)
{
const char *pin_name = cmd_network_->pathName(check->pin());
reportDescription(pin_name, result);
reportSpaceFieldDelay(check->period(), EarlyLate::early(), result);
reportSpaceFieldDelay(check->minPeriod(this), EarlyLate::early(), result);
reportSpaceSlack(check->slack(this), result);
}
void
ReportPath::reportVerbose(MinPeriodCheck *check, string &result)
{
const char *pin_name = cmd_network_->pathName(check->pin());
result += "Pin: ";
result += pin_name;
reportEndOfLine(result);
reportLine("period", check->period(), EarlyLate::early(), result); reportLine("period", check->period(), EarlyLate::early(), result);
reportLine("min period", -check->minPeriod(this), reportLine("min period", -check->minPeriod(this),
EarlyLate::early(), result); EarlyLate::early(), result);
reportDashLine(result); reportDashLine(result);
reportSlack(check->slack(this), result); reportSlack(check->slack(this), result);
report_->print(result);
} }
//////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////
@ -1394,20 +1379,14 @@ ReportPath::reportCheck(MaxSkewCheck *check,
bool verbose) bool verbose)
{ {
if (verbose) { if (verbose) {
string result; reportVerbose(check);
reportVerbose(check, result); report_->reportLine("");
report_->print(result);
report_->print("\n");
} }
else { else {
string header; reportMaxSkewHeaderShort();
reportMaxSkewHeaderShort(header); reportShort(check);
report_->print(header);
string result;
reportShort(check, result);
report_->print(result);
} }
report_->print("\n"); report_->reportLine("");
} }
void void
@ -1419,56 +1398,51 @@ ReportPath::reportChecks(MaxSkewCheckSeq *checks,
MaxSkewCheckSeq::Iterator check_iter(checks); MaxSkewCheckSeq::Iterator check_iter(checks);
while (check_iter.hasNext()) { while (check_iter.hasNext()) {
MaxSkewCheck *check = check_iter.next(); MaxSkewCheck *check = check_iter.next();
string result; reportVerbose(check);
reportVerbose(check, result);
report_->print(result);
report_->print("\n");
} }
} }
else { else {
string header; reportMaxSkewHeaderShort();
reportMaxSkewHeaderShort(header);
report_->print(header);
MaxSkewCheckSeq::Iterator check_iter(checks); MaxSkewCheckSeq::Iterator check_iter(checks);
while (check_iter.hasNext()) { while (check_iter.hasNext()) {
MaxSkewCheck *check = check_iter.next(); MaxSkewCheck *check = check_iter.next();
string result; reportShort(check);
reportShort(check, result);
report_->print(result);
} }
} }
report_->print("\n"); report_->reportLine("");
} }
} }
void void
ReportPath::reportMaxSkewHeaderShort(string &result) ReportPath::reportMaxSkewHeaderShort()
{ {
reportDescription("", result); string line;
result += ' '; reportDescription("", line);
reportField("Required", field_total_, result); line += ' ';
result += ' '; reportField("Required", field_total_, line);
reportField("Actual", field_total_, result); line += ' ';
result += ' '; reportField("Actual", field_total_, line);
reportField("", field_total_, result); line += ' ';
reportEndOfLine(result); reportField("", field_total_, line);
report_->reportLine(line);
reportDescription("Pin", result); line.clear();
result += ' '; reportDescription("Pin", line);
reportField("Skew", field_total_, result); line += ' ';
result += ' '; reportField("Skew", field_total_, line);
reportField("Skew", field_total_, result); line += ' ';
result += ' '; reportField("Skew", field_total_, line);
reportField("Slack", field_total_, result); line += ' ';
reportEndOfLine(result); reportField("Slack", field_total_, line);
reportDashLine(field_description_->width() + field_total_->width() * 3 + 3, report_->reportLine(line);
result);
reportDashLine(field_description_->width() + field_total_->width() * 3 + 3);
} }
void void
ReportPath::reportShort(MaxSkewCheck *check, ReportPath::reportShort(MaxSkewCheck *check)
string &result)
{ {
string line;
Pin *clk_pin = check->clkPin(this); Pin *clk_pin = check->clkPin(this);
const char *clk_pin_name = network_->pathName(clk_pin); const char *clk_pin_name = network_->pathName(clk_pin);
TimingArc *check_arc = check->checkArc(); TimingArc *check_arc = check->checkArc();
@ -1476,41 +1450,43 @@ ReportPath::reportShort(MaxSkewCheck *check,
clk_pin_name, clk_pin_name,
check_arc->fromTrans()->asString(), check_arc->fromTrans()->asString(),
check_arc->toTrans()->asString()); check_arc->toTrans()->asString());
reportDescription(what.c_str(), result); reportDescription(what.c_str(), line);
const EarlyLate *early_late = EarlyLate::early(); const EarlyLate *early_late = EarlyLate::early();
reportSpaceFieldDelay(check->maxSkew(this), early_late, result); reportSpaceFieldDelay(check->maxSkew(this), early_late, line);
reportSpaceFieldDelay(check->skew(this), early_late, result); reportSpaceFieldDelay(check->skew(this), early_late, line);
reportSpaceSlack(check->slack(this), result); reportSpaceSlack1(check->slack(this), line);
report_->reportLine(line);
} }
void void
ReportPath::reportVerbose(MaxSkewCheck *check, ReportPath::reportVerbose(MaxSkewCheck *check)
string &result)
{ {
string line;
const char *clk_pin_name = cmd_network_->pathName(check->clkPin(this)); const char *clk_pin_name = cmd_network_->pathName(check->clkPin(this));
result += "Constrained Pin: "; line += "Constrained Pin: ";
result += clk_pin_name; line += clk_pin_name;
reportEndOfLine(result); report_->reportLine(line);
const char *ref_pin_name = cmd_network_->pathName(check->refPin(this)); const char *ref_pin_name = cmd_network_->pathName(check->refPin(this));
result += "Reference Pin: "; line = "Reference Pin: ";
result += ref_pin_name; line += ref_pin_name;
reportEndOfLine(result); report_->reportLine(line);
result += "Check: max_skew"; line = "Check: max_skew";
reportEndOfLine(result); report_->reportLine(line);
reportEndOfLine(result); report_->reportLine("");
string result;
reportPathHeader(result); reportPathHeader(result);
reportSkewClkPath("reference pin arrival time", check->refPath(), result); reportSkewClkPath("reference pin arrival time", check->refPath(), result);
reportSkewClkPath("constrained pin arrival time", check->clkPath(), result); reportSkewClkPath("constrained pin arrival time", check->clkPath(), result);
reportDashLine(result); reportDashLine(result);
reportLine("allowable skew", check->maxSkew(this), reportLine("allowable skew", check->maxSkew(this), EarlyLate::early(), result);
EarlyLate::early(), result);
reportLine("actual skew", check->skew(this), EarlyLate::late(), result); reportLine("actual skew", check->skew(this), EarlyLate::late(), result);
reportDashLine(result); reportDashLine(result);
reportSlack(check->slack(this), result); reportSlack(check->slack(this), result);
report_->print(result);
} }
// Based on reportTgtClk. // Based on reportTgtClk.
@ -1564,25 +1540,17 @@ ReportPath::reportSkewClkPath(const char *arrival_msg,
void void
ReportPath::reportLimitShortHeader(const ReportField *field) ReportPath::reportLimitShortHeader(const ReportField *field)
{ {
string result; string line;
reportLimitShortHeader(field, result); reportDescription("Pin", line);
report_->print(result); line += ' ';
} reportField("Limit", field, line);
line += ' ';
reportField(field->title(), field, line);
line += ' ';
reportField("Slack", field, line);
report_->reportLine(line);
void reportDashLine(field_description_->width() + field->width() * 3 + 3);
ReportPath::reportLimitShortHeader(const ReportField *field,
string &result)
{
reportDescription("Pin", result);
result += ' ';
reportField("Limit", field, result);
result += ' ';
reportField(field->title(), field, result);
result += ' ';
reportField("Slack", field, result);
reportEndOfLine(result);
reportDashLine(field_description_->width() + field->width() * 3 + 3,
result);
} }
void void
@ -1592,31 +1560,19 @@ ReportPath::reportLimitShort(const ReportField *field,
float limit, float limit,
float slack) float slack)
{ {
string result; string line;
reportLimitShort(field, pin, value, limit, slack, result);
report_->print(result);
}
void
ReportPath::reportLimitShort(const ReportField *field,
Pin *pin,
float value,
float limit,
float slack,
string &result)
{
const char *pin_name = cmd_network_->pathName(pin); const char *pin_name = cmd_network_->pathName(pin);
reportDescription(pin_name, result); reportDescription(pin_name, line);
result += ' '; line += ' ';
reportField(limit, field, result); reportField(limit, field, line);
result += ' '; line += ' ';
reportField(value, field, result); reportField(value, field, line);
result += ' '; line += ' ';
reportField(slack, field, result); reportField(slack, field, line);
result += (slack >= 0.0) line += (slack >= 0.0)
? " (MET)" ? " (MET)"
: " (VIOLATED)"; : " (VIOLATED)";
reportEndOfLine(result); report_->reportLine(line);
} }
void void
@ -1628,52 +1584,39 @@ ReportPath::reportLimitVerbose(const ReportField *field,
float slack, float slack,
const MinMax *min_max) const MinMax *min_max)
{ {
string result; string line;
reportLimitVerbose(field, pin, rf, value, limit, slack, min_max, result); line += "Pin ";
report_->print(result); line += cmd_network_->pathName(pin);
} line += ' ';
void
ReportPath::reportLimitVerbose(const ReportField *field,
Pin *pin,
const RiseFall *rf,
float value,
float limit,
float slack,
const MinMax *min_max,
string &result)
{
result += "Pin ";
result += cmd_network_->pathName(pin);
result += ' ';
if (rf) if (rf)
result += rf->shortName(); line += rf->shortName();
else else
result += ' '; line += ' ';
reportEndOfLine(result); report_->reportLine(line);
result += min_max->asString(); line = min_max->asString();
result += ' '; line += ' ';
result += field->name(); line += field->name();
result += ' '; line += ' ';
reportField(limit, field, result); reportField(limit, field, line);
reportEndOfLine(result); report_->reportLine(line);
line = field->name();
line += " ";
reportField(value, field, line);
report_->reportLine(line);
result += field->name();
result += " ";
reportField(value, field, result);
reportEndOfLine(result);
int name_width = strlen(field->name()) + 5; int name_width = strlen(field->name()) + 5;
reportDashLine(name_width + field->width(), result); reportDashLine(name_width + field->width());
result += "Slack"; line = "Slack";
for (int i = strlen("Slack"); i < name_width; i++) for (int i = strlen("Slack"); i < name_width; i++)
result += ' '; line += ' ';
reportField(slack, field, result); reportField(slack, field, line);
result += (slack >= 0.0) line += (slack >= 0.0)
? " (MET)" ? " (MET)"
: " (VIOLATED)"; : " (VIOLATED)";
reportEndOfLine(result); report_->reportLine(line);
} }
//////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////
@ -2469,6 +2412,17 @@ ReportPath::reportSpaceSlack(Slack slack,
reportEndOfLine(result); reportEndOfLine(result);
} }
void
ReportPath::reportSpaceSlack1(Slack slack,
string &result)
{
const EarlyLate *early_late = EarlyLate::early();
reportSpaceFieldDelay(slack, early_late, result);
result += (delayAsFloat(slack, early_late, this) >= 0.0)
? " (MET)"
: " (VIOLATED)";
}
void void
ReportPath::reportCommonClkPessimism(const PathEnd *end, ReportPath::reportCommonClkPessimism(const PathEnd *end,
Arrival &clk_arrival, Arrival &clk_arrival,
@ -3378,13 +3332,28 @@ ReportPath::reportDashLine(string &result)
reportEndOfLine(result); reportEndOfLine(result);
} }
void
ReportPath::reportDashLine(int line_width)
{
string line;
makeDashLine(line_width, line);
report_->reportLine(line);
}
void void
ReportPath::reportDashLine(int line_width, ReportPath::reportDashLine(int line_width,
string &result) string &result)
{
makeDashLine(line_width, result);
reportEndOfLine(result);
}
void
ReportPath::makeDashLine(int line_width,
string &result)
{ {
for (int i = 0; i < line_width; i++) for (int i = 0; i < line_width; i++)
result += '-'; result += '-';
reportEndOfLine(result);
} }
void void

View File

@ -96,62 +96,46 @@ public:
void reportFull(const PathEndDataCheck *end, void reportFull(const PathEndDataCheck *end,
string &result); string &result);
void reportEndHeader(string &result); void reportEndHeader();
void reportEndLine(PathEnd *end, void reportEndLine(PathEnd *end,
string &result); string &result);
void reportSummaryHeader(string &result); void reportSummaryHeader();
void reportSummaryLine(PathEnd *end, void reportSummaryLine(PathEnd *end);
string &result);
void reportSlackOnlyHeader(string &result); void reportSlackOnlyHeader();
void reportSlackOnly(PathEnd *end, void reportSlackOnly(PathEnd *end);
string &result);
void reportMpwCheck(MinPulseWidthCheck *check, void reportMpwCheck(MinPulseWidthCheck *check,
bool verbose); bool verbose);
void reportMpwChecks(MinPulseWidthCheckSeq *checks, void reportMpwChecks(MinPulseWidthCheckSeq *checks,
bool verbose); bool verbose);
void reportMpwHeaderShort(string &result); void reportMpwHeaderShort();
void reportShort(MinPulseWidthCheck *check, void reportShort(MinPulseWidthCheck *check);
string &result); void reportVerbose(MinPulseWidthCheck *check);
void reportVerbose(MinPulseWidthCheck *check,
string &result);
void reportCheck(MinPeriodCheck *check, void reportCheck(MinPeriodCheck *check,
bool verbose); bool verbose);
void reportChecks(MinPeriodCheckSeq *checks, void reportChecks(MinPeriodCheckSeq *checks,
bool verbose); bool verbose);
void reportPeriodHeaderShort(string &result); void reportPeriodHeaderShort();
void reportShort(MinPeriodCheck *check, void reportShort(MinPeriodCheck *check);
string &result); void reportVerbose(MinPeriodCheck *check);
void reportVerbose(MinPeriodCheck *check,
string &result);
void reportCheck(MaxSkewCheck *check, void reportCheck(MaxSkewCheck *check,
bool verbose); bool verbose);
void reportChecks(MaxSkewCheckSeq *checks, void reportChecks(MaxSkewCheckSeq *checks,
bool verbose); bool verbose);
void reportMaxSkewHeaderShort(string &result); void reportMaxSkewHeaderShort();
void reportShort(MaxSkewCheck *check, void reportShort(MaxSkewCheck *check);
string &result); void reportVerbose(MaxSkewCheck *check);
void reportVerbose(MaxSkewCheck *check,
string &result);
void reportLimitShortHeader(const ReportField *field); void reportLimitShortHeader(const ReportField *field);
void reportLimitShortHeader(const ReportField *field,
string &result);
void reportLimitShort(const ReportField *field, void reportLimitShort(const ReportField *field,
Pin *pin, Pin *pin,
float value, float value,
float limit, float limit,
float slack); float slack);
void reportLimitShort(const ReportField *field,
Pin *pin,
float value,
float limit,
float slack,
string &result);
void reportLimitVerbose(const ReportField *field, void reportLimitVerbose(const ReportField *field,
Pin *pin, Pin *pin,
const RiseFall *rf, const RiseFall *rf,
@ -159,14 +143,6 @@ public:
float limit, float limit,
float slack, float slack,
const MinMax *min_max); const MinMax *min_max);
void reportLimitVerbose(const ReportField *field,
Pin *pin,
const RiseFall *rf,
float value,
float limit,
float slack,
const MinMax *min_max,
string &result);
ReportField *fieldSlew() const { return field_slew_; } ReportField *fieldSlew() const { return field_slew_; }
ReportField *fieldFanout() const { return field_fanout_; } ReportField *fieldFanout() const { return field_fanout_; }
ReportField *fieldCapacitance() const { return field_capacitance_; } ReportField *fieldCapacitance() const { return field_capacitance_; }
@ -334,6 +310,8 @@ protected:
string &result); string &result);
void reportSpaceSlack(Slack slack, void reportSpaceSlack(Slack slack,
string &result); string &result);
void reportSpaceSlack1(Slack slack,
string &result);
void reportSrcPathArrival(const PathEnd *end, void reportSrcPathArrival(const PathEnd *end,
PathExpanded &expanded, PathExpanded &expanded,
string &result); string &result);
@ -474,6 +452,9 @@ protected:
void reportDashLine(string &result); void reportDashLine(string &result);
void reportDashLine(int line_width, void reportDashLine(int line_width,
string &result); string &result);
void reportDashLine(int line_width);
void makeDashLine(int line_width,
string &result);
void reportEndOfLine(string &result); void reportEndOfLine(string &result);
string descriptionField(Vertex *vertex); string descriptionField(Vertex *vertex);
bool reportClkPath() const; bool reportClkPath() const;

View File

@ -62,12 +62,6 @@ Report::printString(const char *buffer,
return ret; return ret;
} }
void
Report::print(const string *str)
{
printString(str->c_str(), str->size());
}
void void
Report::print(const string &str) Report::print(const string &str)
{ {
@ -100,6 +94,13 @@ Report::reportLineString(const char *line)
printString("\n", 1); printString("\n", 1);
} }
void
Report::reportLine(const string &line)
{
printString(line.c_str(), line.length());
printString("\n", 1);
}
//////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////
void void