cleanup
This commit is contained in:
parent
d42f791da2
commit
9a0790d15e
|
|
@ -40,53 +40,82 @@ public:
|
|||
|
||||
// Primitives to print output.
|
||||
// Return the number of characters written.
|
||||
virtual size_t printString(const char *buffer, size_t length);
|
||||
virtual size_t printString(const char *buffer,
|
||||
size_t length);
|
||||
virtual void print(const char *fmt, ...);
|
||||
virtual void vprint(const char *fmt, va_list args);
|
||||
virtual void vprint(const char *fmt,
|
||||
va_list args);
|
||||
void print(const string *str);
|
||||
void print(const string &str);
|
||||
|
||||
// Print to debug stream (same as output stream).
|
||||
virtual void printDebug(const char *fmt, ...)
|
||||
__attribute__((format (printf, 2, 3)));
|
||||
virtual void vprintDebug(const char *fmt, va_list args);
|
||||
virtual void vprintDebug(const char *fmt,
|
||||
va_list args);
|
||||
|
||||
// Print to error stream.
|
||||
// Return the number of characters written.
|
||||
virtual size_t printError(const char *buffer, size_t length);
|
||||
virtual size_t printError(const char *buffer,
|
||||
size_t length);
|
||||
virtual void printError(const char *fmt, ...)
|
||||
__attribute__((format (printf, 2, 3)));
|
||||
virtual void vprintError(const char *fmt, va_list args);
|
||||
virtual void vprintError(const char *fmt,
|
||||
va_list args);
|
||||
|
||||
// Print to warning stream (same as error stream).
|
||||
virtual void printWarn(const char *fmt, ...)
|
||||
__attribute__((format (printf, 2, 3)));
|
||||
virtual void vprintWarn(const char *fmt, va_list args);
|
||||
virtual void vprintWarn(const char *fmt,
|
||||
va_list args);
|
||||
|
||||
////////////////////////////////////////////////////////////////
|
||||
|
||||
// Report warning.
|
||||
virtual void warn(int id, const char *fmt, ...)
|
||||
virtual void warn(int id,
|
||||
const char *fmt, ...)
|
||||
__attribute__((format (printf, 3, 4)));
|
||||
// Report warning in a file.
|
||||
virtual void fileWarn(int id, const char *filename, int line, const char *fmt, ...)
|
||||
virtual void fileWarn(int id,
|
||||
const char *filename,
|
||||
int line,
|
||||
const char *fmt, ...)
|
||||
__attribute__((format (printf, 5, 6)));
|
||||
virtual void vfileWarn(int id, const char *filename, int line, const char *fmt,
|
||||
virtual void vfileWarn(int id,
|
||||
const char *filename,
|
||||
int line,
|
||||
const char *fmt,
|
||||
va_list args);
|
||||
|
||||
virtual void error(int id,
|
||||
const char *fmt, ...)
|
||||
__attribute__((format (printf, 3, 4)));
|
||||
// Report error in a file.
|
||||
virtual void fileError(int id,
|
||||
const char *filename,
|
||||
int line,
|
||||
const char *fmt, ...)
|
||||
__attribute__((format (printf, 5, 6)));
|
||||
virtual void vfileError(int id,
|
||||
const char *filename,
|
||||
int line,
|
||||
const char *fmt,
|
||||
va_list args);
|
||||
|
||||
// Critical.
|
||||
// Report error condition that should not be possible or that prevents execution.
|
||||
// The default handler prints msg to stderr and exits.
|
||||
virtual void critical(int id, const char *fmt, ...)
|
||||
virtual void critical(int id,
|
||||
const char *fmt,
|
||||
...)
|
||||
__attribute__((format (printf, 3, 4)));
|
||||
virtual void fileCritical(int id, const char *filename, int line, const char *fmt, ...)
|
||||
virtual void fileCritical(int id,
|
||||
const char *filename,
|
||||
int line,
|
||||
const char *fmt,
|
||||
...)
|
||||
__attribute__((format (printf, 5, 6)));
|
||||
|
||||
virtual void error(int id, const char *fmt, ...)
|
||||
__attribute__((format (printf, 3, 4)));
|
||||
// Report error in a file.
|
||||
virtual void fileError(int id, const char *filename, int line, const char *fmt, ...)
|
||||
__attribute__((format (printf, 5, 6)));
|
||||
virtual void vfileError(int id, const char *filename, int line, const char *fmt,
|
||||
va_list args);
|
||||
|
||||
// Log output to filename until logEnd is called.
|
||||
virtual void logBegin(const char *filename);
|
||||
virtual void logEnd();
|
||||
|
|
@ -106,12 +135,16 @@ public:
|
|||
protected:
|
||||
// Primitive to print output on the console.
|
||||
// Return the number of characters written.
|
||||
virtual size_t printConsole(const char *buffer, size_t length) = 0;
|
||||
// Primitive to print error, warning and debug output.
|
||||
virtual size_t printConsole(const char *buffer,
|
||||
size_t length) = 0;
|
||||
// Primitive to print warning, error, critical and debug output.
|
||||
// Return the number of characters written.
|
||||
virtual size_t printErrorConsole(const char *buffer, size_t length) = 0;
|
||||
void printToBuffer(const char *fmt, va_list args);
|
||||
void redirectStringPrint(const char *buffer, size_t length);
|
||||
virtual size_t printErrorConsole(const char *buffer,
|
||||
size_t length) = 0;
|
||||
void printToBuffer(const char *fmt,
|
||||
va_list args);
|
||||
void redirectStringPrint(const char *buffer,
|
||||
size_t length);
|
||||
|
||||
FILE *log_stream_;
|
||||
FILE *redirect_stream_;
|
||||
|
|
|
|||
|
|
@ -192,29 +192,28 @@ CheckCapacitanceLimits::findLimit(const Pin *pin,
|
|||
|
||||
void
|
||||
CheckCapacitanceLimits::checkCapacitance(const Pin *pin,
|
||||
const Corner *corner,
|
||||
const Corner *corner1,
|
||||
const MinMax *min_max,
|
||||
const RiseFall *rf1,
|
||||
float limit1,
|
||||
// Return values.
|
||||
const Corner *&corner1,
|
||||
const Corner *&corner,
|
||||
const RiseFall *&rf,
|
||||
float &capacitance,
|
||||
float &slack,
|
||||
float &limit) const
|
||||
{
|
||||
const DcalcAnalysisPt *dcalc_ap = corner->findDcalcAnalysisPt(min_max);
|
||||
const DcalcAnalysisPt *dcalc_ap = corner1->findDcalcAnalysisPt(min_max);
|
||||
GraphDelayCalc *dcalc = sta_->graphDelayCalc();
|
||||
float cap = dcalc->loadCap(pin, dcalc_ap);
|
||||
|
||||
float slack1 = (min_max == MinMax::max())
|
||||
? limit1 - cap : cap - limit1;
|
||||
if (corner == nullptr
|
||||
|| (slack1 < slack
|
||||
// Break ties for the sake of regression stability.
|
||||
|| (fuzzyEqual(slack1, slack)
|
||||
&& rf1->index() < rf->index()))) {
|
||||
corner1 = corner;
|
||||
if (slack1 < slack
|
||||
// Break ties for the sake of regression stability.
|
||||
|| (fuzzyEqual(slack1, slack)
|
||||
&& rf1->index() < rf->index())) {
|
||||
corner = corner1;
|
||||
rf = rf1;
|
||||
capacitance = cap;
|
||||
slack = slack1;
|
||||
|
|
|
|||
|
|
@ -124,6 +124,7 @@ PathEnumed::required(const StaState *sta) const
|
|||
{
|
||||
// Required times are never needed for enumerated paths.
|
||||
sta->report()->critical(251, "enumerated path required time\n");
|
||||
return delay_zero;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
|
|
@ -5026,7 +5026,7 @@ Sta::checkCapacitanceLimitPreamble()
|
|||
|
||||
Pin *
|
||||
Sta::pinMinCapacitanceLimitSlack(const Corner *corner,
|
||||
const MinMax *min_max)
|
||||
const MinMax *min_max)
|
||||
{
|
||||
checkCapacitanceLimitPreamble();
|
||||
return check_capacitance_limits_->pinMinCapacitanceLimitSlack(corner, min_max);
|
||||
|
|
|
|||
|
|
@ -479,7 +479,7 @@ proc report_capacitance_limits { corner min_max all_violators verbose nosplit }
|
|||
puts "${min_max} capacitance"
|
||||
puts ""
|
||||
if { $verbose } {
|
||||
report_capacitance_limit_verbose $pin $corner $min_max
|
||||
report_capacitance_limit_verbose $pin $corner $min_max
|
||||
puts ""
|
||||
} else {
|
||||
report_capacitance_limit_short_header
|
||||
|
|
|
|||
|
|
@ -43,7 +43,8 @@ Report::~Report()
|
|||
}
|
||||
|
||||
void
|
||||
Report::printToBuffer(const char *fmt, va_list args)
|
||||
Report::printToBuffer(const char *fmt,
|
||||
va_list args)
|
||||
{
|
||||
// Copy args in case we need to grow the buffer.
|
||||
va_list args_copy;
|
||||
|
|
@ -59,7 +60,8 @@ Report::printToBuffer(const char *fmt, va_list args)
|
|||
}
|
||||
|
||||
size_t
|
||||
Report::printString(const char *buffer, size_t length)
|
||||
Report::printString(const char *buffer,
|
||||
size_t length)
|
||||
{
|
||||
size_t ret = length;
|
||||
if (redirect_to_string_)
|
||||
|
|
@ -88,7 +90,8 @@ Report::print(const string &str)
|
|||
}
|
||||
|
||||
void
|
||||
Report::vprint(const char *fmt, va_list args)
|
||||
Report::vprint(const char *fmt,
|
||||
va_list args)
|
||||
{
|
||||
std::unique_lock<std::mutex> lock(buffer_lock_);
|
||||
printToBuffer(fmt, args);
|
||||
|
|
@ -105,7 +108,8 @@ Report::print(const char *fmt, ...)
|
|||
}
|
||||
|
||||
size_t
|
||||
Report::printError(const char *buffer, size_t length)
|
||||
Report::printError(const char *buffer,
|
||||
size_t length)
|
||||
{
|
||||
size_t ret = length;
|
||||
if (redirect_to_string_)
|
||||
|
|
@ -122,7 +126,8 @@ Report::printError(const char *buffer, size_t length)
|
|||
}
|
||||
|
||||
void
|
||||
Report::vprintError(const char *fmt, va_list args)
|
||||
Report::vprintError(const char *fmt,
|
||||
va_list args)
|
||||
{
|
||||
std::unique_lock<std::mutex> lock(buffer_lock_);
|
||||
printToBuffer(fmt, args);
|
||||
|
|
@ -342,7 +347,8 @@ Report::redirectStringEnd()
|
|||
}
|
||||
|
||||
void
|
||||
Report::redirectStringPrint(const char *buffer, size_t length)
|
||||
Report::redirectStringPrint(const char *buffer,
|
||||
size_t length)
|
||||
{
|
||||
redirect_string_.append(buffer, length);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -312,19 +312,23 @@ ReportTcl::setTclInterp(Tcl_Interp *interp)
|
|||
}
|
||||
|
||||
size_t
|
||||
ReportTcl::printConsole(const char *buffer, size_t length)
|
||||
ReportTcl::printConsole(const char *buffer,
|
||||
size_t length)
|
||||
{
|
||||
return printTcl(tcl_stdout_, buffer, length);
|
||||
}
|
||||
|
||||
size_t
|
||||
ReportTcl::printErrorConsole(const char *buffer, size_t length)
|
||||
ReportTcl::printErrorConsole(const char *buffer,
|
||||
size_t length)
|
||||
{
|
||||
return printTcl(tcl_stderr_, buffer, length);
|
||||
}
|
||||
|
||||
size_t
|
||||
ReportTcl::printTcl(Tcl_Channel channel, const char *buffer, size_t length)
|
||||
ReportTcl::printTcl(Tcl_Channel channel,
|
||||
const char *buffer,
|
||||
size_t length)
|
||||
{
|
||||
const Tcl_ChannelType *ch_type = Tcl_GetChannelType(channel);
|
||||
Tcl_DriverOutputProc *output_proc = Tcl_ChannelOutputProc(ch_type);
|
||||
|
|
@ -405,7 +409,9 @@ ReportTcl::redirectStringEnd()
|
|||
////////////////////////////////////////////////////////////////
|
||||
|
||||
static int
|
||||
encapOutputProc(ClientData instanceData, CONST84 char *buf, int toWrite, int *)
|
||||
encapOutputProc(ClientData instanceData,
|
||||
CONST84 char *buf,
|
||||
int toWrite, int *)
|
||||
{
|
||||
ReportTcl *report = reinterpret_cast<ReportTcl *>(instanceData);
|
||||
return report->printString(buf, toWrite);
|
||||
|
|
@ -422,13 +428,17 @@ encapErrorOutputProc(ClientData instanceData,
|
|||
}
|
||||
|
||||
static int
|
||||
encapInputProc(ClientData, char *, int, int *)
|
||||
encapInputProc(ClientData,
|
||||
char *,
|
||||
int,
|
||||
int *)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
static int
|
||||
encapCloseProc(ClientData instanceData, Tcl_Interp *)
|
||||
encapCloseProc(ClientData instanceData,
|
||||
Tcl_Interp *)
|
||||
{
|
||||
ReportTcl *report = reinterpret_cast<ReportTcl *>(instanceData);
|
||||
report->logEnd();
|
||||
|
|
@ -438,19 +448,28 @@ encapCloseProc(ClientData instanceData, Tcl_Interp *)
|
|||
}
|
||||
|
||||
static int
|
||||
encapSetOptionProc(ClientData, Tcl_Interp *, CONST84 char *, CONST84 char *)
|
||||
encapSetOptionProc(ClientData,
|
||||
Tcl_Interp *,
|
||||
CONST84 char *,
|
||||
CONST84 char *)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
encapGetOptionProc(ClientData, Tcl_Interp *, CONST84 char *, Tcl_DString *)
|
||||
encapGetOptionProc(ClientData,
|
||||
Tcl_Interp *,
|
||||
CONST84 char *,
|
||||
Tcl_DString *)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
encapSeekProc(ClientData, long, int, int *)
|
||||
encapSeekProc(ClientData,
|
||||
long,
|
||||
int,
|
||||
int *)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
|
@ -461,13 +480,16 @@ encapWatchProc(ClientData, int)
|
|||
}
|
||||
|
||||
static int
|
||||
encapGetHandleProc(ClientData, int, ClientData *)
|
||||
encapGetHandleProc(ClientData,
|
||||
int,
|
||||
ClientData *)
|
||||
{
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
static int
|
||||
encapBlockModeProc(ClientData, int)
|
||||
encapBlockModeProc(ClientData,
|
||||
int)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue