@@ -82,7 +82,7 @@ GlobalRouter::GlobalRouter(utl::Logger* logger,
8282 grid_origin_(0 , 0 ),
8383 groute_renderer_(nullptr ),
8484 grid_(new Grid),
85- is_incremental_ (false ),
85+ infinite_capacity_ (false ),
8686 adjustment_(0.0 ),
8787 congestion_report_iter_step_(0 ),
8888 allow_congestion_(false ),
@@ -101,7 +101,8 @@ GlobalRouter::GlobalRouter(utl::Logger* logger,
101101 heatmap_(nullptr ),
102102 heatmap_rudy_(nullptr ),
103103 congestion_file_name_(nullptr ),
104- grouter_cbk_(nullptr )
104+ grouter_cbk_(nullptr ),
105+ is_incremental_(false )
105106{
106107 fastroute_
107108 = new FastRouteCore (db_, logger_, callback_handler_, stt_builder_, sta_);
@@ -734,6 +735,8 @@ void GlobalRouter::setCapacities(int min_routing_layer, int max_routing_layer)
734735 fastroute_->initEdges ();
735736 int x_grids = grid_->getXGrids ();
736737 int y_grids = grid_->getYGrids ();
738+ const int kBigInt = std::numeric_limits<int >::max ();
739+ const int16_t kBigCap = std::numeric_limits<int16_t >::max () / 10 ;
737740
738741 for (int layer = 1 ; layer <= grid_->getNumLayers (); layer++) {
739742 odb::dbTechLayer* tech_layer = db_->getTech ()->findRoutingLayer (layer);
@@ -748,44 +751,49 @@ void GlobalRouter::setCapacities(int min_routing_layer, int max_routing_layer)
748751 = tech_layer->getDirection () == odb::dbTechLayerDir::HORIZONTAL;
749752
750753 if (tech_layer->getDirection () == odb::dbTechLayerDir::HORIZONTAL) {
751- int min_cap = std::numeric_limits< int >:: max () ;
754+ int min_cap = kBigInt ;
752755 for (int y = 1 ; y <= y_grids; y++) {
753756 for (int x = 1 ; x < x_grids; x++) {
754- const int cap = inside_layer_range ? computeGCellCapacity (x - 1 ,
755- y - 1 ,
756- track_init,
757- track_pitch,
758- track_count,
759- horizontal)
760- : 0 ;
757+ int cap = 0 ;
758+ if (infinite_capacity_) {
759+ cap = kBigCap ;
760+ } else if (inside_layer_range) {
761+ cap = computeGCellCapacity (
762+ x - 1 , y - 1 , track_init, track_pitch, track_count, horizontal);
763+ }
761764 min_cap = std::min (min_cap, cap);
762765 fastroute_->setEdgeCapacity (x - 1 , y - 1 , x, y - 1 , layer, cap);
763766 }
764767 }
765- min_cap = min_cap == std::numeric_limits< int >:: max () ? 0 : min_cap;
768+ min_cap = min_cap == kBigInt ? 0 : min_cap;
766769 fastroute_->addHCapacity (min_cap, layer);
767770 } else {
768- int min_cap = std::numeric_limits< int >:: max () ;
771+ int min_cap = kBigInt ;
769772 for (int x = 1 ; x <= x_grids; x++) {
770773 for (int y = 1 ; y < y_grids; y++) {
771- const int cap = inside_layer_range ? computeGCellCapacity (x - 1 ,
772- y - 1 ,
773- track_init,
774- track_pitch,
775- track_count,
776- horizontal)
777- : 0 ;
774+ int cap = 0 ;
775+ if (infinite_capacity_) {
776+ cap = kBigCap ;
777+ } else if (inside_layer_range) {
778+ cap = computeGCellCapacity (
779+ x - 1 , y - 1 , track_init, track_pitch, track_count, horizontal);
780+ }
778781 min_cap = std::min (min_cap, cap);
779782 fastroute_->setEdgeCapacity (x - 1 , y - 1 , x - 1 , y, layer, cap);
780783 }
781784 }
782- min_cap = min_cap == std::numeric_limits< int >:: max () ? 0 : min_cap;
785+ min_cap = min_cap == kBigInt ? 0 : min_cap;
783786 fastroute_->addVCapacity (min_cap, layer);
784787 }
785788 }
786789 fastroute_->initLowerBoundCapacities ();
787790}
788791
792+ void GlobalRouter::setInfiniteCapacity (bool infinite_capacity)
793+ {
794+ infinite_capacity_ = infinite_capacity;
795+ }
796+
789797int GlobalRouter::computeGCellCapacity (const int x,
790798 const int y,
791799 const int track_init,
0 commit comments