Skip to content

Commit

Permalink
Merge pull request #5438 from The-OpenROAD-Project-staging/buf-inv-split
Browse files Browse the repository at this point in the history
dbSta: split buffers from inverters in report_cell_usage
  • Loading branch information
maliberty authored Jul 24, 2024
2 parents f494e9e + 25c821b commit 6bac0a7
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 17 deletions.
9 changes: 6 additions & 3 deletions src/dbSta/include/db_sta/dbSta.hh
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,12 @@ class dbSta : public Sta, public ord::OpenRoadObserver
TIE,
LEF_OTHER,
STD_CELL,
STD_BUFINV,
STD_BUFINV_CLK_TREE,
STD_BUFINV_TIMING_REPAIR,
STD_BUF,
STD_BUF_CLK_TREE,
STD_BUF_TIMING_REPAIR,
STD_INV,
STD_INV_CLK_TREE,
STD_INV_TIMING_REPAIR,
STD_CLOCK_GATE,
STD_LEVEL_SHIFT,
STD_SEQUENTIAL,
Expand Down
27 changes: 17 additions & 10 deletions src/dbSta/src/dbSta.cc
Original file line number Diff line number Diff line change
Expand Up @@ -356,12 +356,18 @@ std::string dbSta::getInstanceTypeText(InstType type)
return "Other";
case STD_CELL:
return "Standard cell";
case STD_BUFINV:
return "Buffer/inverter";
case STD_BUFINV_CLK_TREE:
return "Clock buffer/inverter";
case STD_BUFINV_TIMING_REPAIR:
return "Timing Repair Buffer/inverter";
case STD_BUF:
return "Buffer";
case STD_BUF_CLK_TREE:
return "Clock buffer";
case STD_BUF_TIMING_REPAIR:
return "Timing Repair Buffer";
case STD_INV:
return "Inverter";
case STD_INV_CLK_TREE:
return "Clock inverter";
case STD_INV_TIMING_REPAIR:
return "Timing Repair inverter";
case STD_CLOCK_GATE:
return "Clock gate cell";
case STD_LEVEL_SHIFT:
Expand Down Expand Up @@ -449,7 +455,8 @@ dbSta::InstType dbSta::getInstanceType(odb::dbInst* inst)
return STD_OTHER;
}

if (lib_cell->isInverter() || lib_cell->isBuffer()) {
const bool is_inverter = lib_cell->isInverter();
if (is_inverter || lib_cell->isBuffer()) {
if (source_type == odb::dbSourceType::TIMING) {
for (auto* iterm : inst->getITerms()) {
// look through iterms and check for clock nets
Expand All @@ -458,12 +465,12 @@ dbSta::InstType dbSta::getInstanceType(odb::dbInst* inst)
continue;
}
if (net->getSigType() == odb::dbSigType::CLOCK) {
return STD_BUFINV_CLK_TREE;
return is_inverter ? STD_INV_CLK_TREE : STD_BUF_CLK_TREE;
}
}
return STD_BUFINV_TIMING_REPAIR;
return is_inverter ? STD_INV_TIMING_REPAIR : STD_BUF_TIMING_REPAIR;
}
return STD_BUFINV;
return is_inverter ? STD_INV : STD_BUF;
}
if (lib_cell->isClockGate()) {
return STD_CLOCK_GATE;
Expand Down
3 changes: 2 additions & 1 deletion src/dbSta/test/report_cell_usage.ok
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
[INFO ODB-0133] Created 579 nets and 1498 connections.
Cell usage report:
Fill cells: 168
Buffer/inverters: 232
Buffers: 202
Inverters: 30
Sequential cells: 35
Multi-Input combinational cells: 241
Total: 676
9 changes: 6 additions & 3 deletions src/gui/src/displayControls.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1532,11 +1532,14 @@ const DisplayControls::ModelRow* DisplayControls::getInstRow(
return &physical_instances_.other;
case sta::dbSta::InstType::STD_CELL:
return &instances_.stdcells;
case sta::dbSta::InstType::STD_BUFINV:
case sta::dbSta::InstType::STD_INV: /* fallthru */
case sta::dbSta::InstType::STD_BUF:
return &bufinv_instances_.other;
case sta::dbSta::InstType::STD_BUFINV_CLK_TREE:
case sta::dbSta::InstType::STD_BUF_CLK_TREE: /* fallthru */
case sta::dbSta::InstType::STD_INV_CLK_TREE:
return &clock_tree_instances_.bufinv;
case sta::dbSta::InstType::STD_BUFINV_TIMING_REPAIR:
case sta::dbSta::InstType::STD_BUF_TIMING_REPAIR: /* fallthru */
case sta::dbSta::InstType::STD_INV_TIMING_REPAIR:
return &bufinv_instances_.timing;
case sta::dbSta::InstType::STD_CLOCK_GATE:
return &clock_tree_instances_.clock_gates;
Expand Down

0 comments on commit 6bac0a7

Please sign in to comment.