@@ -4805,6 +4805,12 @@ void GlobalRouter::removeNet(odb::dbNet* db_net)
48054805
48064806 if (use_cugr_) {
48074807 cugr_->removeNet (db_net);
4808+ auto it = db_net_map_.find (db_net);
4809+ if (it != db_net_map_.end ()) {
4810+ delete it->second ;
4811+ db_net_map_.erase (it);
4812+ }
4813+ routes_.erase (db_net);
48084814 } else {
48094815 auto it = db_net_map_.find (db_net);
48104816 if (it == db_net_map_.end () || it->second == nullptr ) {
@@ -6363,13 +6369,24 @@ std::vector<Net*> GlobalRouter::updateDirtyRoutes(bool save_guides)
63636369
63646370 if (use_cugr_) {
63656371 cugr_->setVerbose (false );
6366- for (odb::dbNet* net : dirty_nets_) {
6367- cugr_->updateNet (net);
6372+ std::vector<Net*> dirty_nets;
6373+ dirty_nets.reserve (dirty_nets_.size ());
6374+ for (odb::dbNet* db_net : dirty_nets_) {
6375+ // Rebuild the GlobalRouter pin set from the netlist (as updateDirtyNets
6376+ // does for FastRoute); updatePinAccessPoints below fixes the positions.
6377+ Net* net = getNet (db_net);
6378+ updateNetPins (net);
6379+ net->setDirtyNet (false );
6380+ net->clearLastPinPositions ();
6381+ cugr_->updateNet (db_net);
6382+ dirty_nets.push_back (net);
63686383 }
63696384 dirty_nets_.clear ();
63706385 cugr_->routeIncremental ();
63716386 routes_ = cugr_->getRoutes ();
6372- return {};
6387+ // Sync pin access points with CUGR's routing, as the full route does.
6388+ updatePinAccessPoints ();
6389+ return dirty_nets;
63736390 }
63746391
63756392 std::vector<Net*> dirty_nets;
0 commit comments