From dae85f08e0c5a9a53e844767d758f53859da1b2e Mon Sep 17 00:00:00 2001 From: James Cherry Date: Sun, 3 Mar 2019 17:50:56 -0800 Subject: [PATCH] misspelled "Deescription", gcc warnings --- CMakeLists.txt | 3 +- graph/Delay.hh | 80 ------------------------------------- graph/DelayFloat.cc | 13 +++--- graph/DelayFloat.hh | 75 ++++++++++++++++++++++++++++++++++ graph/DelayNormal2.cc | 7 ++++ graph/DelayNormal2.hh | 75 ++++++++++++++++++++++++++++++++++ liberty/Liberty.cc | 26 ++++++------ liberty/Liberty.hh | 22 +++++++--- liberty/LibertyExprParse.yy | 1 + liberty/LibertyExprPvt.hh | 3 -- liberty/LibertyParse.yy | 1 - liberty/LibertyReader.cc | 64 +++++++++++++++++++++-------- liberty/LibertyReaderPvt.hh | 11 ++++- liberty/TimingArc.hh | 2 +- network/ConcreteLibrary.cc | 28 ++++++++----- search/Corner.cc | 2 +- search/ReportPath.cc | 18 ++++----- search/Sta.cc | 40 +++++++++---------- search/WritePathSpice.cc | 8 ++-- tcl/Cmds.tcl | 34 ++-------------- tcl/Sta.tcl | 8 ++-- 21 files changed, 311 insertions(+), 210 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a246d619..e9fa6bda 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -69,7 +69,6 @@ set(STA_SOURCE dcalc/SimpleRCDelayCalc.cc dcalc/UnitDelayCalc.cc - graph/Delay.cc graph/DelayFloat.cc graph/DelayNormal2.cc graph/Graph.cc @@ -700,7 +699,7 @@ endif() message(STATUS "STA executable: ${STA_HOME}/app/sta") -set(STA_COMPILE_OPTIONS -Wall -Wcast-qual -Wunused-parameter -Wno-deprecated-register) +set(STA_COMPILE_OPTIONS -Wall -Wcast-qual -Wunused-parameter -Wno-deprecated-register -Wredundant-decls) if (CMAKE_CXX_COMPILER_ID MATCHES AppleClang|Clang|GNU) target_compile_options(OpenSTA PUBLIC ${STA_COMPILE_OPTIONS}) diff --git a/graph/Delay.hh b/graph/Delay.hh index 8719394d..25284d45 100644 --- a/graph/Delay.hh +++ b/graph/Delay.hh @@ -30,91 +30,11 @@ // API common to DelayFloat and DelayNormal2. namespace sta { -class Units; -class StaState; - typedef Delay ArcDelay; typedef Delay Slew; typedef Delay Arrival; typedef Delay Required; typedef Delay Slack; -void -initDelayConstants(); -Delay -makeDelay(float delay, - float sigma_early, - float sigma_late); -// sigma^2 -Delay -makeDelay2(float delay, - float sigma2_early, - float sigma2_late); -float -delayAsFloat(const Delay &delay); -// mean late+/early- sigma -float -delayAsFloat(const Delay &delay, - const EarlyLate *early_late); -float -delaySigma(const Delay &delay, - const EarlyLate *early_late); -float -delaySigma2(const Delay &delay, - const EarlyLate *early_late); -const char * -delayAsString(const Delay &delay, - const StaState *sta); -const char * -delayAsString(const Delay &delay, - const StaState *sta, - int digits); -const char * -delayAsString(const Delay &delay, - const EarlyLate *early_late, - const StaState *sta, - int digits); -const Delay & -delayInitValue(const MinMax *min_max); -bool -delayIsInitValue(const Delay &delay, - const MinMax *min_max); -bool -delayFuzzyZero(const Delay &delay); -bool -delayFuzzyEqual(const Delay &delay1, - const Delay &delay2); -bool -delayFuzzyLess(const Delay &delay1, - const Delay &delay2); -bool -delayFuzzyLess(const Delay &delay1, - const Delay &delay2, - const MinMax *min_max); -bool -delayFuzzyLessEqual(const Delay &delay1, - const Delay &delay2); -bool -delayFuzzyLessEqual(const Delay &delay1, - const Delay &delay2, - const MinMax *min_max); -bool -delayFuzzyGreater(const Delay &delay1, - const Delay &delay2); -bool -delayFuzzyGreaterEqual(const Delay &delay1, - const Delay &delay2); -bool -delayFuzzyGreaterEqual(const Delay &delay1, - const Delay &delay2, - const MinMax *min_max); -bool -delayFuzzyGreater(const Delay &delay1, - const Delay &delay2, - const MinMax *min_max); -float -delayRatio(const Delay &delay1, - const Delay &delay2); - } // namespace #endif diff --git a/graph/DelayFloat.cc b/graph/DelayFloat.cc index 48ef42d4..7d29a84e 100644 --- a/graph/DelayFloat.cc +++ b/graph/DelayFloat.cc @@ -48,12 +48,6 @@ delayIsInitValue(const Delay &delay, return fuzzyEqual(delay, min_max->initValue()); } -float -delayAsFloat(const Delay &delay) -{ - return delay; -} - bool delayFuzzyZero(const Delay &delay) { @@ -146,6 +140,13 @@ delayRatio(const Delay &delay1, return delay1 / delay2; } +const char * +delayAsString(const Delay &delay, + const StaState *sta) +{ + return delayAsString(delay, sta, sta->units()->timeUnit()->digits()); +} + const char * delayAsString(const Delay &delay, const StaState *sta, diff --git a/graph/DelayFloat.hh b/graph/DelayFloat.hh index 306a1283..5d5df1d2 100644 --- a/graph/DelayFloat.hh +++ b/graph/DelayFloat.hh @@ -23,10 +23,15 @@ namespace sta { +class StaState; + typedef float Delay; const Delay delay_zero = 0.0; +void +initDelayConstants(); + inline Delay makeDelay(float delay, float, @@ -43,5 +48,75 @@ makeDelay2(float delay, return delay; } +inline float +delayAsFloat(const Delay &delay) +{ + return delay; +} + +// mean late+/early- sigma +float +delayAsFloat(const Delay &delay, + const EarlyLate *early_late); +float +delaySigma(const Delay &delay, + const EarlyLate *early_late); +float +delaySigma2(const Delay &delay, + const EarlyLate *early_late); +const char * +delayAsString(const Delay &delay, + const StaState *sta); +const char * +delayAsString(const Delay &delay, + const StaState *sta, + int digits); +const char * +delayAsString(const Delay &delay, + const EarlyLate *early_late, + const StaState *sta, + int digits); +const Delay & +delayInitValue(const MinMax *min_max); +bool +delayIsInitValue(const Delay &delay, + const MinMax *min_max); +bool +delayFuzzyZero(const Delay &delay); +bool +delayFuzzyEqual(const Delay &delay1, + const Delay &delay2); +bool +delayFuzzyLess(const Delay &delay1, + const Delay &delay2); +bool +delayFuzzyLess(const Delay &delay1, + const Delay &delay2, + const MinMax *min_max); +bool +delayFuzzyLessEqual(const Delay &delay1, + const Delay &delay2); +bool +delayFuzzyLessEqual(const Delay &delay1, + const Delay &delay2, + const MinMax *min_max); +bool +delayFuzzyGreater(const Delay &delay1, + const Delay &delay2); +bool +delayFuzzyGreaterEqual(const Delay &delay1, + const Delay &delay2); +bool +delayFuzzyGreaterEqual(const Delay &delay1, + const Delay &delay2, + const MinMax *min_max); +bool +delayFuzzyGreater(const Delay &delay1, + const Delay &delay2, + const MinMax *min_max); +float +delayRatio(const Delay &delay1, + const Delay &delay2); + } // namespace #endif diff --git a/graph/DelayNormal2.cc b/graph/DelayNormal2.cc index d48c2f21..b58309c3 100644 --- a/graph/DelayNormal2.cc +++ b/graph/DelayNormal2.cc @@ -416,6 +416,13 @@ delaySigma2(const Delay &delay, return delay.sigma2(early_late); } +const char * +delayAsString(const Delay &delay, + const StaState *sta) +{ + return delayAsString(delay, sta, sta->units()->timeUnit()->digits()); +} + const char * delayAsString(const Delay &delay, const StaState *sta, diff --git a/graph/DelayNormal2.hh b/graph/DelayNormal2.hh index d967706a..97ca6762 100644 --- a/graph/DelayNormal2.hh +++ b/graph/DelayNormal2.hh @@ -24,6 +24,7 @@ namespace sta { // Delay values defined as objects that hold a float value. class Delay; +class StaState; // Normal distribution with early(left)/late(right) std deviations. class Delay @@ -69,10 +70,20 @@ private: const Delay delay_zero(0.0); +void +initDelayConstants(); + Delay makeDelay(float delay, float sigma_early, float sigma_late); + +Delay +makeDelay2(float delay, + // sigma^2 + float sigma_early, + float sigma_late); + inline float delayAsFloat(const Delay &delay) { return delay.mean(); } @@ -89,5 +100,69 @@ Delay operator/(float delay1, Delay operator*(const Delay &delay1, float delay2); +// mean late+/early- sigma +float +delayAsFloat(const Delay &delay, + const EarlyLate *early_late); +float +delaySigma(const Delay &delay, + const EarlyLate *early_late); +float +delaySigma2(const Delay &delay, + const EarlyLate *early_late); +const char * +delayAsString(const Delay &delay, + const StaState *sta); +const char * +delayAsString(const Delay &delay, + const StaState *sta, + int digits); +const char * +delayAsString(const Delay &delay, + const EarlyLate *early_late, + const StaState *sta, + int digits); +const Delay & +delayInitValue(const MinMax *min_max); +bool +delayIsInitValue(const Delay &delay, + const MinMax *min_max); +bool +delayFuzzyZero(const Delay &delay); +bool +delayFuzzyEqual(const Delay &delay1, + const Delay &delay2); +bool +delayFuzzyLess(const Delay &delay1, + const Delay &delay2); +bool +delayFuzzyLess(const Delay &delay1, + const Delay &delay2, + const MinMax *min_max); +bool +delayFuzzyLessEqual(const Delay &delay1, + const Delay &delay2); +bool +delayFuzzyLessEqual(const Delay &delay1, + const Delay &delay2, + const MinMax *min_max); +bool +delayFuzzyGreater(const Delay &delay1, + const Delay &delay2); +bool +delayFuzzyGreaterEqual(const Delay &delay1, + const Delay &delay2); +bool +delayFuzzyGreaterEqual(const Delay &delay1, + const Delay &delay2, + const MinMax *min_max); +bool +delayFuzzyGreater(const Delay &delay1, + const Delay &delay2, + const MinMax *min_max); +float +delayRatio(const Delay &delay1, + const Delay &delay2); + } // namespace #endif diff --git a/liberty/Liberty.cc b/liberty/Liberty.cc index 74575ebb..8f9629ca 100644 --- a/liberty/Liberty.cc +++ b/liberty/Liberty.cc @@ -99,8 +99,11 @@ LibertyLibrary::LibertyLibrary(const char *name, default_ocv_derate_(NULL) { // Scalar templates are builtin. - TableTemplate *scalar_template = new TableTemplate("scalar", NULL, NULL, NULL); - addTableTemplate(scalar_template); + for (int i = 0; i != table_template_count; i++) { + TableTemplateType type = static_cast(i); + TableTemplate *scalar_template = new TableTemplate("scalar", NULL, NULL, NULL); + addTableTemplate(scalar_template, type); + } TransRiseFallIterator tr_iter; while (tr_iter.hasNext()) { @@ -117,7 +120,8 @@ LibertyLibrary::LibertyLibrary(const char *name, LibertyLibrary::~LibertyLibrary() { bus_dcls_.deleteContents(); - template_map_.deleteContents(); + for (int i = 0; i < table_template_count; i++) + template_maps_[i].deleteContents(); scale_factors_map_.deleteContents(); delete scale_factors_; @@ -182,21 +186,17 @@ LibertyLibrary::findBusDcl(const char *name) const } void -LibertyLibrary::addTableTemplate(TableTemplate *tbl_template) +LibertyLibrary::addTableTemplate(TableTemplate *tbl_template, + TableTemplateType type) { - template_map_[tbl_template->name()] = tbl_template; -} - -void -LibertyLibrary::deleteTableTemplate(TableTemplate *tbl_template) -{ - template_map_.eraseKey(tbl_template->name()); + template_maps_[type][tbl_template->name()] = tbl_template; } TableTemplate * -LibertyLibrary::findTableTemplate(const char *name) +LibertyLibrary::findTableTemplate(const char *name, + TableTemplateType type) { - return template_map_[name]; + return template_maps_[type][name]; } void diff --git a/liberty/Liberty.hh b/liberty/Liberty.hh index 16f24c19..41dcfe64 100644 --- a/liberty/Liberty.hh +++ b/liberty/Liberty.hh @@ -96,6 +96,14 @@ typedef enum { scale_factor_pvt_unknown } ScaleFactorPvt; +typedef enum { + table_template_delay, + table_template_power, + table_template_output_current, + table_template_ocv, + table_template_count +} TableTemplateType; + void initLiberty(); void @@ -138,8 +146,10 @@ public: void setDelayModelType(DelayModelType type); void addBusDcl(BusDcl *bus_dcl); BusDcl *findBusDcl(const char *name) const; - void addTableTemplate(TableTemplate *tbl_template); - TableTemplate *findTableTemplate(const char *name); + void addTableTemplate(TableTemplate *tbl_template, + TableTemplateType type); + TableTemplate *findTableTemplate(const char *name, + TableTemplateType type); float nominalProcess() { return nominal_process_; } void setNominalProcess(float process); float nominalVoltage() const { return nominal_voltage_; } @@ -289,12 +299,11 @@ protected: const TableModel *model, float in_slew, float wire_delay) const; - void deleteTableTemplate(TableTemplate *tbl_template); Units *units_; DelayModelType delay_model_type_; BusDclMap bus_dcls_; - TableTemplateMap template_map_; + TableTemplateMap template_maps_[table_template_count]; float nominal_process_; float nominal_voltage_; float nominal_temperature_; @@ -365,8 +374,9 @@ private: class TableTemplateIterator : public TableTemplateMap::ConstIterator { public: - TableTemplateIterator(const LibertyLibrary *library) : - TableTemplateMap::ConstIterator(library->template_map_) {} + TableTemplateIterator(const LibertyLibrary *library, + TableTemplateType type) : + TableTemplateMap::ConstIterator(library->template_maps_[type]) {} }; class OperatingConditionsIterator : public OperatingConditionsMap::ConstIterator diff --git a/liberty/LibertyExprParse.yy b/liberty/LibertyExprParse.yy index 45927901..b5217b68 100644 --- a/liberty/LibertyExprParse.yy +++ b/liberty/LibertyExprParse.yy @@ -23,6 +23,7 @@ #include "LibertyExpr.hh" #include "LibertyExprPvt.hh" +int LibertyExprLex_lex(); #define LibertyExprParse_lex LibertyExprLex_lex %} diff --git a/liberty/LibertyExprPvt.hh b/liberty/LibertyExprPvt.hh index a611cbd9..896e55b9 100644 --- a/liberty/LibertyExprPvt.hh +++ b/liberty/LibertyExprPvt.hh @@ -19,9 +19,6 @@ #include "DisallowCopyAssign.hh" -int -LibertyExprLex_lex(); - namespace sta { class Report; diff --git a/liberty/LibertyParse.yy b/liberty/LibertyParse.yy index 8047d84b..d7d1f7d8 100644 --- a/liberty/LibertyParse.yy +++ b/liberty/LibertyParse.yy @@ -22,7 +22,6 @@ #include "LibertyParser.hh" int LibertyLex_lex(); -int LibertyParse_error(const char *msg); #define LibertyParse_lex LibertyLex_lex // Use yacc generated parser errors. #define YYERROR_VERBOSE diff --git a/liberty/LibertyReader.cc b/liberty/LibertyReader.cc index 5ffb5d9b..16e9687d 100644 --- a/liberty/LibertyReader.cc +++ b/liberty/LibertyReader.cc @@ -234,12 +234,11 @@ LibertyReader::defineVisitors() defineAttrVisitor("slew_derate_from_library", &LibertyReader::visitSlewDerateFromLibrary); - defineGroupVisitor("lu_table_template", &LibertyReader::beginTableTemplate, + defineGroupVisitor("lu_table_template", + &LibertyReader::beginTableTemplateDelay, &LibertyReader::endTableTemplate); defineGroupVisitor("output_current_template", - &LibertyReader::beginTableTemplate, - &LibertyReader::endTableTemplate); - defineGroupVisitor("ocv_table_template", &LibertyReader::beginTableTemplate, + &LibertyReader::beginTableTemplateOutputCurrent, &LibertyReader::endTableTemplate); defineAttrVisitor("variable_1", &LibertyReader::visitVariable1); defineAttrVisitor("variable_2", &LibertyReader::visitVariable2); @@ -395,7 +394,8 @@ LibertyReader::defineVisitors() defineAttrVisitor("sdf_cond", &LibertyReader::visitSdfCond); // Power attributes. - defineGroupVisitor("power_lut_template", &LibertyReader::beginTableTemplate, + defineGroupVisitor("power_lut_template", + &LibertyReader::beginTableTemplatePower, &LibertyReader::endTableTemplate); defineGroupVisitor("leakage_power", &LibertyReader::beginLeakagePower, &LibertyReader::endLeakagePower); @@ -415,7 +415,7 @@ LibertyReader::defineVisitors() &LibertyReader::visitDefaultOcvDerateGroup); defineAttrVisitor("ocv_derate_group", &LibertyReader::visitOcvDerateGroup); defineGroupVisitor("ocv_table_template", - &LibertyReader::beginTableTemplate, + &LibertyReader::beginTableTemplateOcv, &LibertyReader::endTableTemplate); defineGroupVisitor("ocv_derate", &LibertyReader::beginOcvDerate, @@ -1211,13 +1211,26 @@ LibertyReader::visitSlewDerateFromLibrary(LibertyAttr *attr) //////////////////////////////////////////////////////////////// void -LibertyReader::beginTableTemplate(LibertyGroup *group) +LibertyReader::beginTableTemplateDelay(LibertyGroup *group) +{ + beginTableTemplate(group, table_template_delay); +} + +void +LibertyReader::beginTableTemplateOutputCurrent(LibertyGroup *group) +{ + beginTableTemplate(group, table_template_output_current); +} + +void +LibertyReader::beginTableTemplate(LibertyGroup *group, + TableTemplateType type) { if (library_) { const char *name = group->firstName(); if (name) { tbl_template_ = new TableTemplate(name); - library_->addTableTemplate(tbl_template_); + library_->addTableTemplate(tbl_template_, type); } else libWarn(group, "table template does not have a name.\n"); @@ -3732,7 +3745,8 @@ void LibertyReader::beginRiseTransitionDegredation(LibertyGroup *group) { if (library_) - beginTableModel(group, TransRiseFall::rise(), time_scale_, + beginTableModel(group, table_template_delay, + TransRiseFall::rise(), time_scale_, scale_factor_transition); } @@ -3740,7 +3754,8 @@ void LibertyReader::beginFallTransitionDegredation(LibertyGroup *group) { if (library_) - beginTableModel(group, TransRiseFall::fall(), time_scale_, + beginTableModel(group, table_template_delay, + TransRiseFall::fall(), time_scale_, scale_factor_transition); } @@ -3768,16 +3783,18 @@ LibertyReader::beginTimingTableModel(LibertyGroup *group, ScaleFactorType scale_factor_type) { if (timing_) - beginTableModel(group, tr, time_scale_, scale_factor_type); + beginTableModel(group, table_template_delay, tr, + time_scale_, scale_factor_type); } void LibertyReader::beginTableModel(LibertyGroup *group, + TableTemplateType type, TransRiseFall *tr, float scale, ScaleFactorType scale_factor_type) { - beginTable(group, scale); + beginTable(group, type, scale); tr_ = tr; scale_factor_type_ = scale_factor_type; sigma_type_ = EarlyLateAll::all(); @@ -3791,11 +3808,12 @@ LibertyReader::endTableModel() void LibertyReader::beginTable(LibertyGroup *group, + TableTemplateType type, float scale) { const char *template_name = group->firstName(); if (template_name) { - tbl_template_ = library_->findTableTemplate(template_name); + tbl_template_ = library_->findTableTemplate(template_name, type); if (tbl_template_) { axis_[0] = tbl_template_->axis1(); axis_[1] = tbl_template_->axis2(); @@ -4401,6 +4419,12 @@ LibertyReader::libError(LibertyStmt *stmt, //////////////////////////////////////////////////////////////// +void +LibertyReader::beginTableTemplatePower(LibertyGroup *group) +{ + beginTableTemplate(group, table_template_power); +} + void LibertyReader::beginLeakagePower(LibertyGroup *group) { @@ -4441,7 +4465,8 @@ void LibertyReader::beginFallPower(LibertyGroup *group) { if (internal_power_) - beginTableModel(group, TransRiseFall::fall(), energy_scale_, + beginTableModel(group, table_template_power, + TransRiseFall::fall(), energy_scale_, scale_factor_internal_power); } @@ -4449,7 +4474,8 @@ void LibertyReader::beginRisePower(LibertyGroup *group) { if (internal_power_) - beginTableModel(group, TransRiseFall::rise(), energy_scale_, + beginTableModel(group, table_template_power, + TransRiseFall::rise(), energy_scale_, scale_factor_internal_power); } @@ -4498,6 +4524,12 @@ LibertyReader::visitRelatedPgPin(LibertyAttr *attr) //////////////////////////////////////////////////////////////// +void +LibertyReader::beginTableTemplateOcv(LibertyGroup *group) +{ + beginTableTemplate(group, table_template_ocv); +} + void LibertyReader::visitOcvArcDepth(LibertyAttr *attr) { @@ -4558,7 +4590,7 @@ LibertyReader::beginOcvDerateFactors(LibertyGroup *group) rf_type_ = TransRiseFallBoth::riseFall(); derate_type_ = EarlyLateAll::all(); path_type_ = path_type_clk_and_data; - beginTable(group, 1.0); + beginTable(group, table_template_ocv, 1.0); } } diff --git a/liberty/LibertyReaderPvt.hh b/liberty/LibertyReaderPvt.hh index 6f9000d5..9a42a1a0 100644 --- a/liberty/LibertyReaderPvt.hh +++ b/liberty/LibertyReaderPvt.hh @@ -133,7 +133,10 @@ public: TransRiseFall *tr); virtual void visitSlewDerateFromLibrary(LibertyAttr *attr); - virtual void beginTableTemplate(LibertyGroup *group); + virtual void beginTableTemplateDelay(LibertyGroup *group); + virtual void beginTableTemplateOutputCurrent(LibertyGroup *group); + virtual void beginTableTemplate(LibertyGroup *group, + TableTemplateType type); virtual void endTableTemplate(LibertyGroup *group); virtual void visitVariable1(LibertyAttr *attr); virtual void visitVariable2(LibertyAttr *attr); @@ -320,6 +323,7 @@ public: virtual void endRiseFallTransitionDegredation(LibertyGroup *group); virtual void beginTableModel(LibertyGroup *group, + TableTemplateType type, TransRiseFall *tr, float scale, ScaleFactorType scale_factor_type); @@ -328,7 +332,8 @@ public: TransRiseFall *tr, ScaleFactorType scale_factor_type); virtual void beginTable(LibertyGroup *group, - float scale); + TableTemplateType type, + float scale); virtual void endTable(); virtual void makeTable(LibertyAttr *attr, float scale); @@ -351,6 +356,7 @@ public: virtual void visitSdfCond(LibertyAttr *attr); // Power attributes. + virtual void beginTableTemplatePower(LibertyGroup *group); virtual void beginLeakagePower(LibertyGroup *group); virtual void endLeakagePower(LibertyGroup *group); virtual void beginInternalPower(LibertyGroup *group); @@ -370,6 +376,7 @@ public: InternalPowerGroup *power_group); // AOCV attributes. + virtual void beginTableTemplateOcv(LibertyGroup *group); virtual void visitOcvArcDepth(LibertyAttr *attr); virtual void visitDefaultOcvDerateGroup(LibertyAttr *attr); virtual void visitOcvDerateGroup(LibertyAttr *attr); diff --git a/liberty/TimingArc.hh b/liberty/TimingArc.hh index 7a104363..16b70579 100644 --- a/liberty/TimingArc.hh +++ b/liberty/TimingArc.hh @@ -165,7 +165,7 @@ public: TimingArc *&arc2); const TimingArcSeq &arcs() const { return arcs_; } // Use the TimingArcSetArcIterator(arc_set) constructor instead. - TimingArcSetArcIterator *timingArcIterator(); + TimingArcSetArcIterator *timingArcIterator() __attribute__ ((deprecated)); TimingArcIndex addTimingArc(TimingArc *arc); void deleteTimingArc(TimingArc *arc); TimingArc *findTimingArc(unsigned arc_index); diff --git a/network/ConcreteLibrary.cc b/network/ConcreteLibrary.cc index 53606208..0c5355aa 100644 --- a/network/ConcreteLibrary.cc +++ b/network/ConcreteLibrary.cc @@ -562,7 +562,8 @@ ConcretePort::memberIterator() const ConcreteCellPortBitIterator::ConcreteCellPortBitIterator(const ConcreteCell* cell) : port_iter_(cell->ports_), - member_iter_(NULL) + member_iter_(NULL), + next_(NULL) { findNext(); } @@ -585,24 +586,29 @@ void ConcreteCellPortBitIterator::findNext() { if (member_iter_) { - if (member_iter_->hasNext()) + if (member_iter_->hasNext()) { next_ = member_iter_->next(); + return; + } else { delete member_iter_; member_iter_ = NULL; } } - if (member_iter_ == NULL) { - if (port_iter_.hasNext()) { - next_ = port_iter_.next(); - if (next_->isBus()) { - member_iter_ = next_->memberIterator(); - next_ = member_iter_->next(); - } + while (port_iter_.hasNext()) { + ConcretePort *next = port_iter_.next(); + if (next->isBus()) { + member_iter_ = next->memberIterator(); + next_ = member_iter_->next(); + return; } - else - next_ = NULL; + else if (!next->isBundle()) { + next_ = next; + return; + } + next_ = NULL; } + next_ = NULL; } } // namespace diff --git a/search/Corner.cc b/search/Corner.cc index 3681dc0c..12ce8416 100644 --- a/search/Corner.cc +++ b/search/Corner.cc @@ -445,7 +445,7 @@ Corner::libertyLibraries(const MinMax *min_max) int Corner::libertyIndex(const MinMax *min_max) const { - return index_ * 2 + min_max->index(); + return index_ * MinMax::index_count + min_max->index(); } //////////////////////////////////////////////////////////////// diff --git a/search/ReportPath.cc b/search/ReportPath.cc index d4ccf38d..e8daae0c 100644 --- a/search/ReportPath.cc +++ b/search/ReportPath.cc @@ -2891,9 +2891,8 @@ ReportPath::reportPathHeader(string &result) if (field->enabled()) { if (!first_field) result += ' '; - first_field = false; - reportField(field->title(), field, result); + first_field = false; } } trimRight(result); @@ -2988,11 +2987,11 @@ ReportPath::reportLine(const char *what, string &result) { ReportFieldSeq::Iterator field_iter(fields_); - int field_index = 0; + size_t field_index = 0; + bool first_field = true; while (field_iter.hasNext()) { ReportField *field = field_iter.next(); - bool first_field = field_index == 0; - bool last_field = field_index == fields_.size() - 1; + bool last_field = field_index == (fields_.size() - 1); if (field->enabled()) { if (!first_field) @@ -3021,19 +3020,16 @@ ReportPath::reportLine(const char *what, reportFieldDelay(total, early_late, field, result); } else if (field == field_edge_) { - if (tr) { - result += ' '; + if (tr) reportField(tr->shortName(), field, result); - } // Compatibility kludge; suppress trailing spaces. - else if (field_iter.hasNext()) { - result += ' '; + else if (field_iter.hasNext()) reportFieldBlank(field, result); - } } else if (field == field_case_ && line_case) result += line_case; + first_field = false; } field_index++; } diff --git a/search/Sta.cc b/search/Sta.cc index 53b03554..34337707 100644 --- a/search/Sta.cc +++ b/search/Sta.cc @@ -1068,11 +1068,11 @@ Sta::makeGeneratedClock(const char *name, char *comment) { sdc_->makeGeneratedClock(name, pins, add_to_pins, - src_pin, master_clk, - pll_out, pll_fdbk, - divide_by, multiply_by, duty_cycle, - invert, combinational, - edges, edge_shifts, comment); + src_pin, master_clk, + pll_out, pll_fdbk, + divide_by, multiply_by, duty_cycle, + invert, combinational, + edges, edge_shifts, comment); update_genclks_ = true; search_->arrivalsInvalid(); } @@ -1257,7 +1257,7 @@ Sta::setClockUncertainty(Clock *from_clk, float uncertainty) { sdc_->setClockUncertainty(from_clk, from_tr, to_clk, to_tr, - setup_hold, uncertainty); + setup_hold, uncertainty); search_->arrivalsInvalid(); } @@ -1282,11 +1282,11 @@ Sta::makeClockGroups(const char *name, const char *comment) { ClockGroups *groups = sdc_->makeClockGroups(name, - logically_exclusive, - physically_exclusive, - asynchronous, - allow_paths, - comment); + logically_exclusive, + physically_exclusive, + asynchronous, + allow_paths, + comment); search_->requiredsInvalid(); return groups; } @@ -1828,8 +1828,8 @@ Sta::setInputDelay(Pin *pin, float delay) { sdc_->setInputDelay(pin, tr, clk, clk_tr, ref_pin, - source_latency_included, network_latency_included, - min_max, add, delay); + source_latency_included, network_latency_included, + min_max, add, delay); search_->arrivalInvalid(pin); } @@ -1858,8 +1858,8 @@ Sta::setOutputDelay(Pin *pin, float delay) { sdc_->setOutputDelay(pin, tr, clk, clk_tr, ref_pin, - source_latency_included,network_latency_included, - min_max, add, delay); + source_latency_included,network_latency_included, + min_max, add, delay); search_->requiredInvalid(pin); } @@ -1895,8 +1895,8 @@ Sta::makeMulticyclePath(ExceptionFrom *from, const char *comment) { sdc_->makeMulticyclePath(from, thrus, to, min_max, - use_end_clk, path_multiplier, - comment); + use_end_clk, path_multiplier, + comment); search_->arrivalsInvalid(); } @@ -1910,8 +1910,8 @@ Sta::makePathDelay(ExceptionFrom *from, const char *comment) { sdc_->makePathDelay(from, thrus, to, min_max, - ignore_clk_latency, delay, - comment); + ignore_clk_latency, delay, + comment); search_->endpointsInvalid(); search_->arrivalsInvalid(); } @@ -1954,7 +1954,7 @@ Sta::makeExceptionFrom(PinSet *from_pins, const TransRiseFallBoth *from_tr) { return sdc_->makeExceptionFrom(from_pins, from_clks, from_insts, - from_tr); + from_tr); } void diff --git a/search/WritePathSpice.cc b/search/WritePathSpice.cc index 2f25d252..f440100c 100644 --- a/search/WritePathSpice.cc +++ b/search/WritePathSpice.cc @@ -171,7 +171,7 @@ private: // // stage // |---------------| - // |\ |\ + // |\ |\ . // -------| >---/\/\/----| >--- // gate |/ drvr load|/ // input @@ -1122,6 +1122,7 @@ WritePathSpice::onePort(FuncExpr *expr) return port; case FuncExpr::op_one: case FuncExpr::op_zero: + default: return NULL; } } @@ -1337,7 +1338,7 @@ WritePathSpice::recordSpicePortNames(const char *cell_name, auto cell = network_->findLibertyCell(cell_name); if (cell) { auto spice_port_names = new StringVector; - for (auto i = 2; i < tokens.size(); i++) { + for (size_t i = 2; i < tokens.size(); i++) { auto port_name = tokens[i].c_str(); auto port = cell->findLibertyPort(port_name); auto pg_port = cell->findPgPort(port_name); @@ -1526,7 +1527,8 @@ streamPrint(ofstream &stream, va_list args; va_start(args, fmt); char *result; - vasprintf(&result, fmt, args); + if (vasprintf(&result, fmt, args) == -1) + internalError("out of memory"); stream << result; free(result); va_end(args); diff --git a/tcl/Cmds.tcl b/tcl/Cmds.tcl index 433a86f0..9fa26f4b 100644 --- a/tcl/Cmds.tcl +++ b/tcl/Cmds.tcl @@ -1876,22 +1876,6 @@ proc get_object_type { obj } { } } -proc sort_by_full_name { objects } { - return [lsort -command full_name_cmp $objects] -} - -proc sort_by_name { objects } { - return [lsort -command name_cmp $objects] -} - -proc full_name_cmp { obj1 obj2 } { - return [string compare [get_full_name $obj1] [get_full_name $obj2]] -} - -proc name_cmp { obj1 obj2 } { - return [string compare [get_name $obj1] [get_name $obj2]] -} - proc get_name { object } { return [get_object_property $object "name"] } @@ -1900,22 +1884,12 @@ proc get_full_name { object } { return [get_object_property $object "full_name"] } -if {0} { -proc get_name { objects } { - set names {} - foreach object $objects { - lappend names [get_object_property $object "name"] - } - return $names +proc sort_by_full_name { objects } { + return [lsort -command full_name_cmp $objects] } -proc get_full_name { objects } { - set names {} - foreach object $objects { - lappend names [get_object_property $object "full_name"] - } - return $names -} +proc full_name_cmp { obj1 obj2 } { + return [string compare [get_full_name $obj1] [get_full_name $obj2]] } ################################################################ diff --git a/tcl/Sta.tcl b/tcl/Sta.tcl index 7c4a05b6..718b903b 100644 --- a/tcl/Sta.tcl +++ b/tcl/Sta.tcl @@ -40,15 +40,15 @@ proc define_report_path_fields {} { set_rise_fall_short_names "^" "v" set_report_path_field_order { fanout capacitance slew \ incr total edge case description } - set_report_path_field_properties "description" "Deescription" 36 1 + set_report_path_field_properties "description" "Description" 36 1 set width $report_path_field_width_extra set_report_path_field_properties "total" "Time" $width 0 set_report_path_field_properties "incr" "Delay" $width 0 set_report_path_field_properties "capacitance" "Cap" $width 0 set_report_path_field_properties "slew" "Slew" $width 0 set_report_path_field_properties "fanout" "Fanout" 5 0 - set_report_path_field_properties "edge" "" 1 0 - set_report_path_field_properties "case" "" 11 0 + set_report_path_field_properties "edge" " " 1 0 + set_report_path_field_properties "case" " " 11 0 } ################################################################ @@ -1002,7 +1002,7 @@ proc report_object_names { args } { if { [info exists flags(-verbose)] } { puts -nonewline "{" set first 1 - foreach obj [sort_name $objects] { + foreach obj [sort_by_full_name $objects] { if { !$first } { puts -nonewline ", " }