diff --git a/.clang-format b/.clang-format index cd7dc197..d50ce987 100644 --- a/.clang-format +++ b/.clang-format @@ -12,18 +12,20 @@ AllowShortLoopsOnASingleLine: false AlwaysBreakAfterReturnType: TopLevel BinPackArguments: false # fails -BinPackParameters: false +BinPackParameters: AlwaysOnePerLine BraceWrapping: AfterClass: true AfterStruct: true AfterFunction: true BeforeElse: true +BreakBeforeBinaryOperators: NonAssignment BreakBeforeBraces: Custom # fails if all initializers fit on one line BreakConstructorInitializers: AfterColon -ColumnLimit: 0 +ColumnLimit: 90 # fails -ConstructorInitializerAllOnOneLineOrOnePerLine: false ConstructorInitializerIndentWidth: 2 IncludeBlocks: Preserve +PackConstructorInitializers: Never PointerAlignment: Right +SortIncludes: Never diff --git a/liberty/LibertyReader.cc b/liberty/LibertyReader.cc index 686c0b2a..6b86742b 100644 --- a/liberty/LibertyReader.cc +++ b/liberty/LibertyReader.cc @@ -5706,7 +5706,7 @@ LibertyReader::visitPgType(LibertyAttr *attr) PwrGndType type = findPwrGndType(type_name); PortDirection *dir = PortDirection::unknown(); switch (type) { - case PwrGndType::primary_ground:; + case PwrGndType::primary_ground: case PwrGndType::backup_ground: case PwrGndType::internal_ground: dir = PortDirection::ground(); diff --git a/power/Power.cc b/power/Power.cc index 48692dea..f50fb67d 100644 --- a/power/Power.cc +++ b/power/Power.cc @@ -489,13 +489,16 @@ PropActivityVisitor::visit(Vertex *vertex) } if (network_->isDriver(pin)) { LibertyPort *port = network_->libertyPort(pin); - if (port) { - LibertyCell *test_cell = port->libertyCell()->testCell(); - if (test_cell) - port = test_cell->findLibertyPort(port->name()); - } if (port) { FuncExpr *func = port->function(); + if (func == nullptr) { + LibertyCell *test_cell = port->libertyCell()->testCell(); + if (test_cell) { + port = test_cell->findLibertyPort(port->name()); + if (port) + func = port->function(); + } + } if (func) { PwrActivity activity = power_->evalActivity(func, inst); changed = setActivityCheck(pin, activity); @@ -777,10 +780,24 @@ Power::seedRegOutputActivities(const Instance *inst, BfsFwdIterator &bfs) { LibertyCell *cell = network_->libertyCell(inst); - LibertyCell *test_cell = cell->testCell(); - const SequentialSeq &seqs = test_cell - ? test_cell->sequentials() - : cell->sequentials(); + const SequentialSeq &seqs = cell->sequentials(); + if (!seqs.empty()) + seedRegOutputActivities(inst, nullptr, seqs, bfs); + else { + LibertyCell *test_cell = cell->testCell(); + if (test_cell) { + const SequentialSeq &seqs = test_cell->sequentials(); + seedRegOutputActivities(inst, test_cell, seqs, bfs); + } + } +} + +void +Power::seedRegOutputActivities(const Instance *inst, + const LibertyCell *test_cell, + const SequentialSeq &seqs, + BfsFwdIterator &bfs) +{ for (Sequential *seq : seqs) { seedRegOutputActivities(inst, seq, seq->output(), false); seedRegOutputActivities(inst, seq, seq->outputInv(), true); @@ -791,7 +808,7 @@ Power::seedRegOutputActivities(const Instance *inst, Pin *pin = pin_iter->next(); LibertyPort *port = network_->libertyPort(pin); if (test_cell) - port = test_cell->findLibertyPort(port->name()); + port = test_cell->findLibertyPort(port->name()); if (port) { FuncExpr *func = port->function(); Vertex *vertex = graph_->pinDrvrVertex(pin); diff --git a/power/Power.hh b/power/Power.hh index 55f8a252..5c45fd60 100644 --- a/power/Power.hh +++ b/power/Power.hh @@ -191,6 +191,10 @@ protected: bool invert); void seedRegOutputActivities(const Instance *inst, BfsFwdIterator &bfs); + void seedRegOutputActivities(const Instance *inst, + const LibertyCell *test_cell, + const SequentialSeq &seqs, + BfsFwdIterator &bfs); PwrActivity evalActivity(FuncExpr *expr, const Instance *inst); PwrActivity evalActivity(FuncExpr *expr, diff --git a/search/PathEnum.cc b/search/PathEnum.cc index e3d6ac85..9650aff0 100644 --- a/search/PathEnum.cc +++ b/search/PathEnum.cc @@ -636,7 +636,8 @@ PathEnum::makeDivertedPath(Path *path, after_div_copy = copy; if (first) div_path = copy; - else if (network_->isLatchData(p->pin(this))) + else if (found_div + && network_->isLatchData(p->pin(this))) break; if (p == before_div) { // Replaced on next pass. diff --git a/tcl/TclTypeHelpers.cc b/tcl/TclTypeHelpers.cc index e3cabbb6..f5d73442 100644 --- a/tcl/TclTypeHelpers.cc +++ b/tcl/TclTypeHelpers.cc @@ -101,7 +101,7 @@ tclArgError(Tcl_Interp *interp, try { Sta::sta()->report()->error(id, msg, arg); } catch (const std::exception &e) { - Tcl_SetResult(interp, const_cast(e.what()), TCL_STATIC); + Tcl_SetResult(interp, const_cast(e.what()), TCL_VOLATILE); } }