2424
2525namespace rmp {
2626
27- std::vector<sta::Vertex*> GetNegativeEndpoints (sta::dbSta* sta)
27+ std::vector<sta::Vertex*> GetNegativeEndpoints (sta::dbSta* sta,
28+ rsz::Resizer* resizer)
2829{
2930 std::vector<sta::Vertex*> result;
3031
3132 sta::dbNetwork* network = sta->getDbNetwork ();
3233 for (sta::Vertex* vertex : *sta->endpoints ()) {
33- sta::PortDirection* direction = network->direction (vertex->pin ());
34+ sta::Pin* pin = vertex->pin ();
35+ sta::PortDirection* direction = network->direction (pin);
3436 if (!direction->isInput ()) {
3537 continue ;
3638 }
3739
40+ if (resizer != nullptr ) {
41+ if (resizer->dontTouch (pin) || resizer->dontTouch (network->net (pin))
42+ || resizer->dontTouch (network->instance (pin))) {
43+ continue ;
44+ }
45+ }
46+
3847 const sta::Slack slack = sta->vertexSlack (vertex, sta::MinMax::max ());
3948
4049 if (slack > 0.0 ) {
@@ -48,6 +57,7 @@ std::vector<sta::Vertex*> GetNegativeEndpoints(sta::dbSta* sta)
4857
4958void ZeroSlackStrategy::OptimizeDesign (sta::dbSta* sta,
5059 UniqueName& name_generator,
60+ rsz::Resizer* resizer,
5161 utl::Logger* logger)
5262{
5363 sta->ensureGraph ();
@@ -57,16 +67,19 @@ void ZeroSlackStrategy::OptimizeDesign(sta::dbSta* sta,
5767
5868 sta::dbNetwork* network = sta->getDbNetwork ();
5969
60- std::vector<sta::Vertex*> candidate_vertices = GetNegativeEndpoints (sta);
70+ std::vector<sta::Vertex*> candidate_vertices
71+ = GetNegativeEndpoints (sta, resizer);
6172
6273 if (candidate_vertices.empty ()) {
63- logger->info (
64- utl::RMP, 1030 , " All endpoints have positive slack, nothing to do." );
74+ logger->info (utl::RMP,
75+ 1030 ,
76+ " All candidate endpoints have positive slack, nothing to do." );
6577 return ;
6678 }
6779
6880 AbcLibraryFactory factory (logger);
6981 factory.AddDbSta (sta);
82+ factory.AddResizer (resizer);
7083 factory.SetCorner (corner_);
7184 AbcLibrary abc_library = factory.Build ();
7285
@@ -82,6 +95,12 @@ void ZeroSlackStrategy::OptimizeDesign(sta::dbSta* sta,
8295
8396 LogicCut cut = logic_extractor.BuildLogicCut (abc_library);
8497
98+ if (cut.IsEmpty ()) {
99+ logger->warn (
100+ utl::RMP, 1032 , " Logic cut is empty after extraction, nothing to do." );
101+ return ;
102+ }
103+
85104 utl::UniquePtrWithDeleter<abc::Abc_Ntk_t> mapped_abc_network
86105 = cut.BuildMappedAbcNetwork (abc_library, network, logger);
87106
0 commit comments