Skip to content

Commit 3a59a57

Browse files
authored
Merge branch 'The-OpenROAD-Project:master' into master
2 parents 16e57a7 + 1f974c3 commit 3a59a57

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+264
-174
lines changed

BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ cc_binary(
142142
deps = [
143143
":openroad_lib",
144144
":openroad_version",
145-
"//:ord",
145+
":ord",
146146
"//src/cut",
147147
"//src/gui",
148148
"//src/sta:opensta_lib",

src/cgt/include/cgt/ClockGating.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,8 @@ class ClockGating
143143
// Helper for inserting new instances/nets into a network.
144144
NetworkBuilder network_builder_;
145145

146-
Logger* logger_;
147-
sta::dbSta* sta_;
146+
Logger* logger_ = nullptr;
147+
sta::dbSta* sta_ = nullptr;
148148
std::unique_ptr<cut::AbcLibraryFactory> abc_factory_;
149149
std::unique_ptr<cut::AbcLibrary> abc_library_;
150150
};

src/cgt/src/ClockGating.cpp

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -375,13 +375,6 @@ void ClockGating::run()
375375
abc_factory_->AddDbSta(sta_);
376376
abc_library_ = std::make_unique<cut::AbcLibrary>(abc_factory_->Build());
377377

378-
abc::Abc_SclInstallGenlib(abc_library_->abc_library(),
379-
/*Slew=*/0,
380-
/*Gain=*/0,
381-
/*fUseAll=*/0,
382-
/*nGatesMin=*/0);
383-
abc::Mio_LibraryTransferCellIds();
384-
385378
dump("pre");
386379

387380
std::vector<sta::Instance*> instances;
@@ -519,7 +512,7 @@ void ClockGating::run()
519512
continue;
520513
}
521514

522-
correct_conds = gate_cond_cover;
515+
correct_conds = std::move(gate_cond_cover);
523516
searchClockGates(instance,
524517
correct_conds,
525518
correct_conds.begin(),
@@ -664,10 +657,11 @@ void ClockGating::searchClockGates(sta::Instance* const instance,
664657
abc::Abc_Ntk_t& abc_network,
665658
const bool clk_enable)
666659
{
667-
if (end - begin < 2) {
660+
size_t half_len = (end - begin) / 2;
661+
if (half_len == 0) {
668662
return;
669663
}
670-
auto mid = begin + (end - begin) / 2;
664+
auto mid = begin + half_len;
671665
auto combined_candidate_names
672666
= combinedGatingCondNames(sta_->getDbNetwork(), mid, end, clk_enable);
673667
debugPrint(
@@ -691,6 +685,7 @@ void ClockGating::searchClockGates(sta::Instance* const instance,
691685
"Clock gating signals: '{}' can be dropped",
692686
combined_candidate_names);
693687
good_gate_conds.erase(mid, end);
688+
mid = begin + half_len;
694689
} else if (end - mid > 1) {
695690
debugPrint(logger_,
696691
CGT,
@@ -832,6 +827,8 @@ static abc::Abc_Obj_t* regDataFunctionToAbc(sta::dbNetwork* const network,
832827
case sta::FuncExpr::op_or:
833828
case sta::FuncExpr::op_xor:
834829
expr_stack.push_back(expr->right());
830+
expr_stack.push_back(expr->left());
831+
break;
835832
case sta::FuncExpr::op_not:
836833
expr_stack.push_back(expr->left());
837834
break;

src/cgt/test/aes_nangate45.ok

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
[WARNING CUT-0021] Leakage power doesn't exist for cell LOGIC0_X1
44
[WARNING CUT-0021] Leakage power doesn't exist for cell LOGIC1_X1
55
Derived GENLIB library "NangateOpenCellLibrary" with 92 gates.
6-
Warning: Detected 2 multi-output gates (for example, "FA_X1").
7-
SC library cannot be found.
86
[INFO CGT-0003] Clock gating instance 0/562
97
[INFO CGT-0004] Accepted clock enable '_13148_ | _04712_ | _04712_ | _00499_ | _05106_ | _05208_' for instance dcnt\[0\]$_SDFFE_PN0P_
108
[INFO CGT-0004] Accepted clock enable '_13151_ | _11055_ | _07150_ | _09231_ | _11144_ | _05152_ | _07152_ | _04670_' for instance ld_r$_DFF_P_

src/cgt/test/countdown_asap7.ok

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
[INFO ODB-0227] LEF file: asap7/asap7_tech_1x_201209.lef, created 30 layers, 9 vias
1212
[INFO ODB-0227] LEF file: asap7/asap7sc7p5t_28_R_1x_220121a.lef, created 212 library cells
1313
Derived GENLIB library "asap7sc7p5t_AO_RVT_FF_nldm_211120" with 169 gates.
14-
Warning: Detected 2 multi-output gates (for example, "FAx1_ASAP7_75t_R").
15-
SC library cannot be found.
1614
[INFO CGT-0003] Clock gating instance 0/3
1715
[INFO CGT-0004] Accepted clock enable '_05_ | _02_ | _01_ | _10_ | _03_' for instance val\[0\]$_DFF_PP1_
1816
No differences found.

src/cgt/test/ibex_sky130hd.ok

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
[INFO ODB-0227] LEF file: sky130hd/sky130hd.tlef, created 13 layers, 25 vias
22
[INFO ODB-0227] LEF file: sky130hd/sky130hd_std_cell.lef, created 437 library cells
33
Derived GENLIB library "sky130_fd_sc_hd__ss_n40C_1v40" with 317 gates.
4-
Warning: Detected 9 multi-output gates (for example, "sky130_fd_sc_hd__fa_1").
5-
SC library cannot be found.
64
[INFO CGT-0003] Clock gating instance 0/946
75
[INFO CGT-0004] Accepted clock enable 'ex_block_i.gen_multdiv_fast.multdiv_i.md_state_q\[5\] | _03749_ | _03000_ | _04094_ | _03636_ | _04093_' for instance _20290_
86
[INFO CGT-0004] Accepted clock enable 'cs_registers_i.mcountinhibit_q\[0\] | _05037_ | _04531_ | _04533_ | _04495_ | _04405_ | _05854_ | _04404_' for instance cs_registers_i.mcountinhibit_q\[0\]$_DFFE_PN0P_

src/cut/include/cut/logic_cut.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
#include <utility>
77
#include <vector>
88

9-
#include "abc_library_factory.h"
109
#include "base/abc/abc.h"
10+
#include "cut/abc_library_factory.h"
1111
#include "db_sta/dbNetwork.hh"
1212
#include "sta/NetworkClass.hh"
1313
#include "utl/Logger.h"
@@ -18,9 +18,9 @@ namespace cut {
1818
class LogicCut
1919
{
2020
public:
21-
LogicCut(std::vector<sta::Net*>& primary_inputs,
22-
std::vector<sta::Net*>& primary_outputs,
23-
sta::InstanceSet& cut_instances)
21+
LogicCut(std::vector<sta::Net*>&& primary_inputs,
22+
std::vector<sta::Net*>&& primary_outputs,
23+
sta::InstanceSet&& cut_instances)
2424
: primary_inputs_(std::move(primary_inputs)),
2525
primary_outputs_(std::move(primary_outputs)),
2626
cut_instances_(std::move(cut_instances))

src/cut/include/cut/logic_extractor.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
#include <unordered_set>
77
#include <vector>
88

9-
#include "abc_library_factory.h"
9+
#include "cut/abc_library_factory.h"
10+
#include "cut/logic_cut.h"
1011
#include "db_sta/dbSta.hh"
11-
#include "logic_cut.h"
1212
#include "sta/Graph.hh"
1313
#include "sta/NetworkClass.hh"
1414
#include "sta/SearchPred.hh"

src/cut/src/blif.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,7 @@ bool Blif::readBlif(const char* file_name, odb::dbBlock* block)
534534
auto port_ = network_->libertyPort(pin_);
535535
if (port_->isClock()) {
536536
mtermName = mTerm->getName();
537-
netName = connection;
537+
netName = std::move(connection);
538538
break;
539539
}
540540
}

src/cut/src/logic_extractor.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,9 @@ LogicCut LogicExtractorFactory::BuildLogicCut(AbcLibrary& abc_network)
385385
std::vector<sta::Net*> primary_output_nets
386386
= ConvertIoPinsToNets(filtered_primary_outputs);
387387

388-
return LogicCut(primary_input_nets, primary_output_nets, cut_instances);
388+
return LogicCut(std::move(primary_input_nets),
389+
std::move(primary_output_nets),
390+
std::move(cut_instances));
389391
}
390392

391393
} // namespace cut

0 commit comments

Comments
 (0)