1- #pragma once
2-
3- #include " geo.h"
4- #include " grt/GRoute.h"
5-
6- // STL libraries
7- #include < bitset>
8- #include < csignal>
9- #include < fstream>
10- #include < iostream>
11- #include < mutex>
12- #include < set>
13- #include < sstream>
14- #include < string>
15- #include < thread>
16- #include < tuple>
17- #include < vector>
18-
19- // Boost libraries
20- // #include <boost/functional/hash.hpp>
21- #include < boost/geometry.hpp>
22- #include < boost/geometry/geometries/box.hpp>
23- #include < boost/geometry/geometries/point.hpp>
24- #include < boost/geometry/index/rtree.hpp>
25-
26- #include " odb/geom.h"
27-
28- namespace odb {
29- class dbDatabase ;
30- } // namespace odb
31-
32- namespace stt {
33- class SteinerTreeBuilder ;
34- } // namespace stt
35-
36- namespace utl {
37- class Logger ;
38- } // namespace utl
39-
40- namespace grt {
41-
42- class Design ;
43- class GridGraph ;
44- class GRNet ;
45-
46- namespace bg = boost::geometry;
47- namespace bgi = boost::geometry::index;
48-
49- using boostPoint = bg::model::point<int , 2 , bg::cs::cartesian>;
50- using boostBox = bg::model::box<boostPoint>;
51- using RTree = bgi::rtree<std::pair<boostBox, int >, bgi::rstar<32 >>;
52-
53- struct Constants
54- {
55- double weight_wire_length;
56- double weight_via_number;
57- double weight_short_area;
58-
59- int min_routing_layer;
60-
61- double cost_logistic_slope;
62-
63- // allowed stem length increase to trunk length ratio
64- double max_detour_ratio;
65- int target_detour_count;
66-
67- double via_multiplier;
68-
69- double maze_logistic_slope;
70-
71- double pin_patch_threshold;
72- int pin_patch_padding;
73- double wire_patch_threshold;
74- double wire_patch_inflation_rate;
75-
76- bool write_heatmap;
77- };
78-
79- class CUGR
80- {
81- public:
82- CUGR (odb::dbDatabase* db,
83- utl::Logger* log,
84- stt::SteinerTreeBuilder* stt_builder);
85- void init (int min_routing_layer, int max_routing_layer);
86- void route ();
87- void write (const std::string& guide_file = " " );
88- NetRouteMap getRoutes ();
89-
90- private:
91- void sortNetIndices (std::vector<int >& netIndices) const ;
92- void getGuides (const GRNet* net,
93- std::vector<std::pair<int , grt::BoxT<int >>>& guides);
94- void printStatistics () const ;
95-
96- Design* design_;
97- GridGraph* grid_graph_;
98- std::vector<GRNet*> gr_nets_;
99-
100- odb::dbDatabase* db_;
101- utl::Logger* logger_;
102- stt::SteinerTreeBuilder* stt_builder_;
103-
104- Constants constants_;
105-
106- int area_of_pin_patches_;
107- int area_of_wire_patches_;
108- };
109-
1+ #pragma once
2+
3+ #include " geo.h"
4+ #include " grt/GRoute.h"
5+
6+ // STL libraries
7+ #include < bitset>
8+ #include < csignal>
9+ #include < fstream>
10+ #include < iostream>
11+ #include < mutex>
12+ #include < set>
13+ #include < sstream>
14+ #include < string>
15+ #include < thread>
16+ #include < tuple>
17+ #include < vector>
18+
19+ // Boost libraries
20+ // #include <boost/functional/hash.hpp>
21+ #include < boost/geometry.hpp>
22+ #include < boost/geometry/geometries/box.hpp>
23+ #include < boost/geometry/geometries/point.hpp>
24+ #include < boost/geometry/index/rtree.hpp>
25+
26+ #include " odb/geom.h"
27+
28+ namespace odb {
29+ class dbDatabase ;
30+ } // namespace odb
31+
32+ namespace stt {
33+ class SteinerTreeBuilder ;
34+ } // namespace stt
35+
36+ namespace utl {
37+ class Logger ;
38+ } // namespace utl
39+
40+ namespace grt {
41+
42+ class Design ;
43+ class GridGraph ;
44+ class GRNet ;
45+
46+ namespace bg = boost::geometry;
47+ namespace bgi = boost::geometry::index;
48+
49+ using boostPoint = bg::model::point<int , 2 , bg::cs::cartesian>;
50+ using boostBox = bg::model::box<boostPoint>;
51+ using RTree = bgi::rtree<std::pair<boostBox, int >, bgi::rstar<32 >>;
52+
53+ struct Constants
54+ {
55+ double weight_wire_length;
56+ double weight_via_number;
57+ double weight_short_area;
58+
59+ int min_routing_layer;
60+
61+ double cost_logistic_slope;
62+
63+ // allowed stem length increase to trunk length ratio
64+ double max_detour_ratio;
65+ int target_detour_count;
66+
67+ double via_multiplier;
68+
69+ double maze_logistic_slope;
70+
71+ double pin_patch_threshold;
72+ int pin_patch_padding;
73+ double wire_patch_threshold;
74+ double wire_patch_inflation_rate;
75+
76+ bool write_heatmap;
77+ };
78+
79+ class CUGR
80+ {
81+ public:
82+ CUGR (odb::dbDatabase* db,
83+ utl::Logger* log,
84+ stt::SteinerTreeBuilder* stt_builder);
85+ void init (int min_routing_layer, int max_routing_layer);
86+ void route ();
87+ void write (const std::string& guide_file = " " );
88+ NetRouteMap getRoutes ();
89+
90+ private:
91+ void sortNetIndices (std::vector<int >& netIndices) const ;
92+ void getGuides (const GRNet* net,
93+ std::vector<std::pair<int , grt::BoxT<int >>>& guides);
94+ void printStatistics () const ;
95+
96+ Design* design_;
97+ GridGraph* grid_graph_;
98+ std::vector<GRNet*> gr_nets_;
99+
100+ odb::dbDatabase* db_;
101+ utl::Logger* logger_;
102+ stt::SteinerTreeBuilder* stt_builder_;
103+
104+ Constants constants_;
105+
106+ int area_of_pin_patches_;
107+ int area_of_wire_patches_;
108+ };
109+
110110} // namespace grt
0 commit comments