File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -288,6 +288,8 @@ class GlobalRouter
288288 FastRouteCore* fastroute () const { return fastroute_; }
289289 Rudy* getRudy ();
290290
291+ void writePinLocations (const char * file_name);
292+
291293 private:
292294 // Net functions
293295 Net* addNet (odb::dbNet* db_net);
Original file line number Diff line number Diff line change @@ -4782,6 +4782,29 @@ std::vector<PinGridLocation> GlobalRouter::getPinGridPositions(
47824782 return pin_locs;
47834783}
47844784
4785+ void GlobalRouter::writePinLocations (const char * file_name)
4786+ {
4787+ std::ofstream pin_loc_file;
4788+ pin_loc_file.open (file_name);
4789+ if (!pin_loc_file) {
4790+ logger_->error (
4791+ GRT, 271 , " Global route pin locations file could not be opened." );
4792+ }
4793+
4794+ for (const auto [db_net, net] : db_net_map_) {
4795+ if (!net->getPins ().empty ()) {
4796+ pin_loc_file << net->getName () << " " << net->getNumPins () << " \n " ;
4797+ for (const Pin& pin : net->getPins ()) {
4798+ const odb::Point& pin_pos = pin.getOnGridPosition ();
4799+ pin_loc_file << pin.getName () << " " << pin_pos.getX () << " "
4800+ << pin_pos.getY () << " \n " ;
4801+ }
4802+ pin_loc_file << " \n " ;
4803+ }
4804+ }
4805+ pin_loc_file.close ();
4806+ }
4807+
47854808// //////////////////////////////////////////////////////////////
47864809
47874810bool operator <(const RoutePt& p1, const RoutePt& p2)
Original file line number Diff line number Diff line change @@ -252,6 +252,11 @@ void read_segments(const char* file_name)
252252 getGlobalRouter ()->readSegments (file_name);
253253}
254254
255+ void write_pin_locations (const char * file_name)
256+ {
257+ getGlobalRouter ()->writePinLocations (file_name);
258+ }
259+
255260} // namespace
256261
257262%} // inline
You can’t perform that action at this time.
0 commit comments