rewrite ReportPath to not use string result

This commit is contained in:
James Cherry 2020-12-28 19:51:34 -08:00
parent f32ddd728b
commit 72aaf962c6
6 changed files with 640 additions and 893 deletions

View File

@ -79,10 +79,8 @@ public:
const RiseFall *transition(const StaState *sta) const;
PathAnalysisPt *pathAnalysisPt(const StaState *sta) const;
PathAPIndex pathIndex(const StaState *sta) const;
virtual void reportShort(ReportPath *report,
string &result) const = 0;
virtual void reportFull(ReportPath *report,
string &result) const = 0;
virtual void reportShort(ReportPath *report) const = 0;
virtual void reportFull(ReportPath *report) const = 0;
// Predicates for PathEnd type.
// Default methods overridden by respective types.
@ -221,10 +219,8 @@ public:
virtual Type type() const;
virtual const char *typeName() const;
virtual PathEnd *copy();
virtual void reportShort(ReportPath *report,
string &result) const;
virtual void reportFull(ReportPath *report,
string &result) const;
virtual void reportShort(ReportPath *report) const;
virtual void reportFull(ReportPath *report) const;
virtual bool isUnconstrained() const;
virtual Required requiredTime(const StaState *sta) const;
virtual Required requiredTimeOffset(const StaState *sta) const;
@ -332,8 +328,8 @@ public:
virtual PathEnd *copy();
virtual Type type() const;
virtual const char *typeName() const;
virtual void reportShort(ReportPath *report, string &result) const;
virtual void reportFull(ReportPath *report, string &result) const;
virtual void reportShort(ReportPath *report) const;
virtual void reportFull(ReportPath *report) const;
virtual bool isCheck() const { return true; }
virtual ArcDelay margin(const StaState *sta) const;
virtual TimingRole *checkRole(const StaState *sta) const;
@ -377,10 +373,8 @@ public:
virtual PathEnd *copy();
PathVertex *latchDisable();
const PathVertex *latchDisable() const;
virtual void reportShort(ReportPath *report,
string &result) const;
virtual void reportFull(ReportPath *report,
string &result) const;
virtual void reportShort(ReportPath *report) const;
virtual void reportFull(ReportPath *report) const;
virtual TimingRole *checkRole(const StaState *sta) const;
virtual Required requiredTime(const StaState *sta) const;
virtual Arrival borrow(const StaState *sta) const;
@ -439,10 +433,8 @@ public:
virtual PathEnd *copy();
virtual Type type() const;
virtual const char *typeName() const;
virtual void reportShort(ReportPath *report,
string &result) const;
virtual void reportFull(ReportPath *report,
string &result) const;
virtual void reportShort(ReportPath *report) const;
virtual void reportFull(ReportPath *report) const;
virtual bool isOutputDelay() const { return true; }
virtual ArcDelay margin(const StaState *sta) const;
virtual TimingRole *checkRole(const StaState *sta) const;
@ -490,10 +482,8 @@ public:
virtual PathEnd *copy();
virtual Type type() const;
virtual const char *typeName() const;
virtual void reportShort(ReportPath *report,
string &result) const;
virtual void reportFull(ReportPath *report,
string &result) const;
virtual void reportShort(ReportPath *report) const;
virtual void reportFull(ReportPath *report) const;
virtual bool isGatedClock() const { return true; }
virtual ArcDelay margin(const StaState *) const { return margin_; }
virtual TimingRole *checkRole(const StaState *sta) const;
@ -527,10 +517,8 @@ public:
virtual PathEnd *copy();
virtual Type type() const;
virtual const char *typeName() const;
virtual void reportShort(ReportPath *report,
string &result) const;
virtual void reportFull(ReportPath *report,
string &result) const;
virtual void reportShort(ReportPath *report) const;
virtual void reportFull(ReportPath *report) const;
virtual bool isDataCheck() const { return true; }
virtual TimingRole *checkRole(const StaState *sta) const;
virtual ArcDelay margin(const StaState *sta) const;
@ -583,10 +571,8 @@ public:
virtual PathEnd *copy();
virtual Type type() const;
virtual const char *typeName() const;
virtual void reportShort(ReportPath *report,
string &result) const;
virtual void reportFull(ReportPath *report,
string &result) const;
virtual void reportShort(ReportPath *report) const;
virtual void reportFull(ReportPath *report) const;
virtual bool isPathDelay() const { return true; }
virtual TimingRole *checkRole(const StaState *sta) const;
virtual bool pathDelayMarginIsExternal() const;

View File

@ -44,7 +44,6 @@ public:
size_t length);
virtual void vprint(const char *fmt,
va_list args);
void print(const string &str);
// Print line with return.
virtual void reportLine(const char *fmt, ...);
virtual void reportLineString(const char *line);

View File

@ -451,10 +451,9 @@ PathEnd::checkInterClkUncertainty(const ClockEdge *src_clk_edge,
////////////////////////////////////////////////////////////////
void
PathEndUnconstrained::reportFull(ReportPath *report,
string &result) const
PathEndUnconstrained::reportFull(ReportPath *report) const
{
report->reportFull(this, result);
report->reportFull(this);
}
Slack
@ -464,10 +463,9 @@ PathEndUnconstrained::slackNoCrpr(const StaState *) const
}
void
PathEndUnconstrained::reportShort(ReportPath *report,
string &result) const
PathEndUnconstrained::reportShort(ReportPath *report) const
{
report->reportShort(this, result);
report->reportShort(this);
}
////////////////////////////////////////////////////////////////
@ -1009,17 +1007,15 @@ PathEndCheck::typeName() const
}
void
PathEndCheck::reportFull(ReportPath *report,
string &result) const
PathEndCheck::reportFull(ReportPath *report) const
{
report->reportFull(this, result);
report->reportFull(this);
}
void
PathEndCheck::reportShort(ReportPath *report,
string &result) const
PathEndCheck::reportShort(ReportPath *report) const
{
report->reportShort(this, result);
report->reportShort(this);
}
TimingRole *
@ -1137,17 +1133,15 @@ PathEndLatchCheck::latchDisable() const
}
void
PathEndLatchCheck::reportFull(ReportPath *report,
string &result) const
PathEndLatchCheck::reportFull(ReportPath *report) const
{
report->reportFull(this, result);
report->reportFull(this);
}
void
PathEndLatchCheck::reportShort(ReportPath *report,
string &result) const
PathEndLatchCheck::reportShort(ReportPath *report) const
{
report->reportShort(this, result);
report->reportShort(this);
}
float
@ -1321,17 +1315,15 @@ PathEndOutputDelay::typeName() const
}
void
PathEndOutputDelay::reportFull(ReportPath *report,
string &result) const
PathEndOutputDelay::reportFull(ReportPath *report) const
{
report->reportFull(this, result);
report->reportFull(this);
}
void
PathEndOutputDelay::reportShort(ReportPath *report,
string &result) const
PathEndOutputDelay::reportShort(ReportPath *report) const
{
report->reportShort(this, result);
report->reportShort(this);
}
ArcDelay
@ -1536,17 +1528,15 @@ PathEndGatedClock::checkRole(const StaState *) const
}
void
PathEndGatedClock::reportFull(ReportPath *report,
string &result) const
PathEndGatedClock::reportFull(ReportPath *report) const
{
report->reportFull(this, result);
report->reportFull(this);
}
void
PathEndGatedClock::reportShort(ReportPath *report,
string &result) const
PathEndGatedClock::reportShort(ReportPath *report) const
{
report->reportShort(this, result);
report->reportShort(this);
}
int
@ -1655,17 +1645,15 @@ PathEndDataCheck::checkRole(const StaState *sta) const
}
void
PathEndDataCheck::reportFull(ReportPath *report,
string &result) const
PathEndDataCheck::reportFull(ReportPath *report) const
{
report->reportFull(this, result);
report->reportFull(this);
}
void
PathEndDataCheck::reportShort(ReportPath *report,
string &result) const
PathEndDataCheck::reportShort(ReportPath *report) const
{
report->reportShort(this, result);
report->reportShort(this);
}
int
@ -1778,17 +1766,15 @@ PathEndPathDelay::findSrcClkArrival(const StaState *sta)
}
void
PathEndPathDelay::reportFull(ReportPath *report,
string &result) const
PathEndPathDelay::reportFull(ReportPath *report) const
{
report->reportFull(this, result);
report->reportFull(this);
}
void
PathEndPathDelay::reportShort(ReportPath *report,
string &result) const
PathEndPathDelay::reportShort(ReportPath *report) const
{
report->reportShort(this, result);
report->reportShort(this);
}
bool

File diff suppressed because it is too large Load Diff

View File

@ -63,42 +63,26 @@ public:
void reportPathEnd(PathEnd *end,
PathEnd *prev_end);
void reportPathEnds(PathEndSeq *ends);
// for debugging
void reportPath(const Path *path);
void reportShort(const PathEndUnconstrained *end,
string &result);
void reportShort(const PathEndCheck *end,
string &result);
void reportShort(const PathEndLatchCheck *end,
string &result);
void reportShort(const PathEndPathDelay *end,
string &result);
void reportShort(const PathEndOutputDelay *end,
string &result);
void reportShort(const PathEndGatedClock *end,
string &result);
void reportShort(const PathEndDataCheck *end,
string &result);
void reportShort(const PathEndUnconstrained *end);
void reportShort(const PathEndCheck *end);
void reportShort(const PathEndLatchCheck *end);
void reportShort(const PathEndPathDelay *end);
void reportShort(const PathEndOutputDelay *end);
void reportShort(const PathEndGatedClock *end);
void reportShort(const PathEndDataCheck *end);
void reportFull(const PathEndUnconstrained *end,
string &result);
void reportFull(const PathEndCheck *end,
string &result);
void reportFull(const PathEndLatchCheck *end,
string &result);
void reportFull(const PathEndPathDelay *end,
string &result);
void reportFull(const PathEndOutputDelay *end,
string &result);
void reportFull(const PathEndGatedClock *end,
string &result);
void reportFull(const PathEndDataCheck *end,
string &result);
void reportFull(const PathEndUnconstrained *end);
void reportFull(const PathEndCheck *end);
void reportFull(const PathEndLatchCheck *end);
void reportFull(const PathEndPathDelay *end);
void reportFull(const PathEndOutputDelay *end);
void reportFull(const PathEndGatedClock *end);
void reportFull(const PathEndDataCheck *end);
void reportEndHeader();
void reportEndLine(PathEnd *end,
string &result);
void reportEndLine(PathEnd *end);
void reportSummaryHeader();
void reportSummaryLine(PathEnd *end);
@ -158,84 +142,59 @@ protected:
void reportEndpointHeader(PathEnd *end,
PathEnd *prev_end);
void reportShort(const PathEndUnconstrained *end,
PathExpanded &expanded,
string &result);
PathExpanded &expanded);
void reportShort(const PathEndCheck *end,
PathExpanded &expanded,
string &result);
PathExpanded &expanded);
void reportShort(const PathEndLatchCheck *end,
PathExpanded &expanded,
string &result);
PathExpanded &expanded);
void reportShort(const PathEndPathDelay *end,
PathExpanded &expanded,
string &result);
PathExpanded &expanded);
void reportShort(const PathEndOutputDelay *end,
PathExpanded &expanded,
string &result);
PathExpanded &expanded);
void reportShort(const PathEndGatedClock *end,
PathExpanded &expanded,
string &result);
PathExpanded &expanded);
void reportShort(const PathEndDataCheck *end,
PathExpanded &expanded,
string &result);
void reportEndpoint(const PathEndOutputDelay *end,
string &result);
void reportEndpointOutputDelay(const PathEndClkConstrained *end,
string &result);
void reportEndpoint(const PathEndPathDelay *end,
string &result);
void reportEndpoint(const PathEndGatedClock *end,
string &result);
PathExpanded &expanded);
void reportEndpoint(const PathEndOutputDelay *end);
void reportEndpointOutputDelay(const PathEndClkConstrained *end);
void reportEndpoint(const PathEndPathDelay *end);
void reportEndpoint(const PathEndGatedClock *end);
string pathEndpoint(PathEnd *end);
string pathStartpoint(PathEnd *end,
PathExpanded &expanded);
void reportBorrowing(const PathEndLatchCheck *end,
Arrival &borrow,
Arrival &time_given_to_startpoint,
string &result);
void reportEndpoint(const PathEndDataCheck *end,
string &result);
Arrival &time_given_to_startpoint);
void reportEndpoint(const PathEndDataCheck *end);
const char *clkNetworkDelayIdealProp(bool is_ideal);
string checkRoleReason(const PathEnd *end);
string checkRoleString(const PathEnd *end);
virtual void reportGroup(const PathEnd *end,
string &result);
virtual void reportGroup(const PathEnd *end);
void reportStartpoint(const PathEnd *end,
PathExpanded &expanded,
string &result);
PathExpanded &expanded);
void reportUnclockedEndpoint(const PathEnd *end,
const char *default_reason,
string &result);
void reportEndpoint(const PathEndCheck *end,
string &result);
void reportEndpoint(const PathEndLatchCheck *end,
string &result);
const char *default_reason);
void reportEndpoint(const PathEndCheck *end);
void reportEndpoint(const PathEndLatchCheck *end);
const char *latchDesc(const PathEndLatchCheck *end);
void reportStartpoint(const char *start,
string reason,
string &result);
string reason);
void reportEndpoint(const char *end,
string reason,
string &result);
string reason);
void reportStartEndPoint(const char *pt,
string reason,
const char *key,
string &result);
const char *key);
string tgtClkName(const PathEnd *end);
const char *clkRegLatchDesc(const PathEnd *end);
void reportSrcPath(const PathEnd *end,
PathExpanded &expanded,
string &result);
PathExpanded &expanded);
void reportTgtClk(const PathEnd *end);
void reportTgtClk(const PathEnd *end,
string &result);
float prev_time);
void reportTgtClk(const PathEnd *end,
float prev_time,
string &result);
void reportTgtClk(const PathEnd *end,
float prev_time,
bool is_prop,
string &result);
bool is_prop);
bool pathFromGenPropClk(const Path *clk_path,
const EarlyLate *early_late);
bool isGenPropClk(const Clock *clk,
@ -247,8 +206,7 @@ protected:
float time_offset,
Arrival clk_insertion,
Arrival clk_latency,
bool is_path_delay,
string &result);
bool is_path_delay);
bool reportGenClkSrcPath(const Path *clk_path, Clock *clk,
const RiseFall *clk_rf,
const MinMax *min_max,
@ -260,8 +218,7 @@ protected:
const PathAnalysisPt *path_ap,
float time_offset,
float path_time_offset,
bool clk_used_as_data,
string &result);
bool clk_used_as_data);
bool reportGenClkSrcPath1(Clock *clk,
const Pin *clk_pin,
const RiseFall *clk_rf,
@ -269,86 +226,64 @@ protected:
const PathAnalysisPt *path_ap,
float gclk_time,
float time_offset,
bool clk_used_as_data,
string &result);
bool clk_used_as_data);
void reportClkSrcLatency(Arrival insertion,
float clk_time,
const EarlyLate *early_late,
string &result);
const EarlyLate *early_late);
void reportPathLine(const Path *path,
Delay incr,
Arrival time,
const char *line_case,
string &result);
const char *line_case);
void reportCommonClkPessimism(const PathEnd *end,
Arrival &clk_arrival,
string &result);
Arrival &clk_arrival);
void reportClkUncertainty(const PathEnd *end,
Arrival &clk_arrival,
string &result);
Arrival &clk_arrival);
void reportClkLine(const Clock *clk,
const char *clk_name,
const RiseFall *clk_rf,
Arrival clk_time,
const MinMax *min_max,
string &result);
const MinMax *min_max);
void reportClkLine(const Clock *clk,
const char *clk_name,
const RiseFall *clk_rf,
Arrival prev_time,
Arrival clk_time,
const MinMax *min_max,
string &result);
const MinMax *min_max);
void reportRequired(const PathEnd *end,
string margin_msg,
string &result);
void reportSlack(const PathEnd *end,
string &result);
void reportSlack(Slack slack,
string &result);
string margin_msg);
void reportSlack(const PathEnd *end);
void reportSlack(Slack slack);
void reportSpaceSlack(PathEnd *end,
string &result);
string &line);
void reportSpaceSlack(Slack slack,
string &result);
void reportSpaceSlack1(Slack slack,
string &result);
string &line);
void reportSrcPathArrival(const PathEnd *end,
PathExpanded &expanded,
string &result);
PathExpanded &expanded);
void reportPath(const PathEnd *end,
PathExpanded &expanded,
string &result);
void reportPath(const Path *path,
string &result);
void reportPathFull(const Path *path,
string &result);
void reportPathJson(const Path *path,
string &result);
void reportPathHeader(string &result);
PathExpanded &expanded);
void reportPathFull(const Path *path);
void reportPathJson(const Path *path);
void reportPathHeader();
void reportPath1(const Path *path,
PathExpanded &expanded,
bool clk_used_as_data,
float time_offset,
string &result);
float time_offset);
void reportPath2(const Path *path,
PathExpanded &expanded,
bool clk_used_as_data,
float time_offset,
string &result);
float time_offset);
void reportPath3(const Path *path,
PathExpanded &expanded,
bool clk_used_as_data,
bool report_clk_path,
Arrival prev_time,
float time_offset,
string &result);
float time_offset);
void reportPath4(const Path *path,
PathExpanded &expanded,
bool clk_used_as_data,
bool skip_first_path,
bool skip_last_path,
float time_offset,
string &result);
float time_offset);
void reportPath5(const Path *path,
PathExpanded &expanded,
size_t path_first_index,
@ -356,41 +291,33 @@ protected:
bool propagated_clk,
bool report_clk_path,
Arrival prev_time,
float time_offset,
string &result);
float time_offset);
void reportInputExternalDelay(const Path *path,
float time_offset,
string &result);
float time_offset);
void reportLine(const char *what,
Delay total,
const EarlyLate *early_late,
string &result);
const EarlyLate *early_late);
void reportLineNegative(const char *what,
Delay total,
const EarlyLate *early_late,
string &result);
const EarlyLate *early_late);
void reportLine(const char *what,
Delay total,
const EarlyLate *early_late,
const RiseFall *rf,
string &result);
const RiseFall *rf);
void reportLine(const char *what,
Delay incr,
Delay total,
const EarlyLate *early_late);
void reportLine(const char *what,
Delay incr,
Delay total,
const EarlyLate *early_late,
string &result);
void reportLine(const char *what,
Delay incr,
Delay total,
const EarlyLate *early_late,
const RiseFall *rf,
string &result);
const RiseFall *rf);
void reportLine(const char *what,
Slew slew,
Delay incr,
Delay total,
const EarlyLate *early_late,
string &result);
const EarlyLate *early_late);
void reportLine(const char *what,
float cap,
Slew slew,
@ -400,28 +327,24 @@ protected:
bool total_with_minus,
const EarlyLate *early_late,
const RiseFall *rf,
const char *line_case,
string &result);
const char *line_case);
void reportLineTotal(const char *what,
Delay incr,
const EarlyLate *early_late,
string &result);
const EarlyLate *early_late);
void reportLineTotalMinus(const char *what,
Delay decr,
const EarlyLate *early_late,
string &result);
const EarlyLate *early_late);
void reportLineTotal1(const char *what,
Delay incr,
bool incr_with_minus,
const EarlyLate *early_late,
string &result);
void reportDashLineTotal(string &result);
const EarlyLate *early_late);
void reportDashLineTotal();
void reportDescription(const char *what,
string &result);
string &result);
void reportDescription(const char *what,
bool first_field,
bool last_field,
string &result);
string &result);
void reportFieldTime(float value,
ReportField *field,
string &result);
@ -449,13 +372,9 @@ protected:
string &result);
void reportFieldBlank(const ReportField *field,
string &result);
void reportDashLine(string &result);
void reportDashLine(int line_width,
string &result);
void reportDashLine();
void reportDashLine(int line_width);
void makeDashLine(int line_width,
string &result);
void reportEndOfLine(string &result);
void reportBlankLine();
string descriptionField(Vertex *vertex);
bool reportClkPath() const;
string clkName(const Clock *clk,
@ -470,8 +389,7 @@ protected:
const MinMax *min_max);
const char *mpwCheckHiLow(MinPulseWidthCheck *check);
void reportSkewClkPath(const char *arrival_msg,
const PathVertex *clk_path,
string &result);
const PathVertex *clk_path);
const char *edgeRegLatchDesc(Edge *edge,
TimingArc *arc);
const char *checkRegLatchDesc(const TimingRole *role,

View File

@ -62,12 +62,6 @@ Report::printString(const char *buffer,
return ret;
}
void
Report::print(const string &str)
{
printString(str.c_str(), str.size());
}
void
Report::vprint(const char *fmt,
va_list args)