@@ -37,16 +37,16 @@ struct RouteIterResults {
37
37
38
38
/* * Route a given netlist. Takes a big context and passes it around to net & sink routing fns. */
39
39
class NetlistRouter {
40
- public:
40
+ public:
41
41
virtual ~NetlistRouter () {}
42
42
virtual RouteIterResults route_netlist (int itry, float pres_fac, float worst_neg_slack) = 0;
43
43
virtual void set_rcv_enabled (bool x) = 0;
44
44
virtual void set_timing_info (std::shared_ptr<SetupHoldTimingInfo> timing_info) = 0;
45
45
};
46
46
47
47
template <typename HeapType>
48
- class SerialNetlistRouter : public NetlistRouter {
49
- public:
48
+ class SerialNetlistRouter : public NetlistRouter {
49
+ public:
50
50
SerialNetlistRouter (
51
51
const Netlist<>& net_list,
52
52
const RouterLookahead* router_lookahead,
@@ -59,27 +59,27 @@ class SerialNetlistRouter: public NetlistRouter {
59
59
route_budgets& budgeting_inf,
60
60
const RoutingPredictor& routing_predictor,
61
61
const vtr::vector<ParentNetId, std::vector<std::unordered_map<RRNodeId, int >>>& choking_spots,
62
- bool is_flat
63
- ):
64
- _router (_make_router(router_lookahead, is_flat)),
65
- _net_list (net_list),
66
- _router_opts (router_opts),
67
- _connections_inf (connections_inf),
68
- _net_delay (net_delay),
69
- _netlist_pin_lookup (netlist_pin_lookup),
70
- _timing_info (timing_info),
71
- _pin_timing_invalidator (pin_timing_invalidator),
72
- _budgeting_inf (budgeting_inf),
73
- _routing_predictor (routing_predictor),
74
- _choking_spots (choking_spots),
75
- _is_flat (is_flat){}
62
+ bool is_flat)
63
+ : _router(_make_router(router_lookahead, is_flat))
64
+ , _net_list(net_list)
65
+ , _router_opts(router_opts)
66
+ , _connections_inf(connections_inf)
67
+ , _net_delay(net_delay)
68
+ , _netlist_pin_lookup(netlist_pin_lookup)
69
+ , _timing_info(timing_info)
70
+ , _pin_timing_invalidator(pin_timing_invalidator)
71
+ , _budgeting_inf(budgeting_inf)
72
+ , _routing_predictor(routing_predictor)
73
+ , _choking_spots(choking_spots)
74
+ , _is_flat(is_flat) {}
76
75
~SerialNetlistRouter () {}
77
76
78
77
RouteIterResults route_netlist (int itry, float pres_fac, float worst_neg_slack);
79
78
void set_rcv_enabled (bool x);
80
79
void set_timing_info (std::shared_ptr<SetupHoldTimingInfo> timing_info);
81
- private:
82
- ConnectionRouter<HeapType> _make_router (const RouterLookahead* router_lookahead, bool is_flat){
80
+
81
+ private:
82
+ ConnectionRouter<HeapType> _make_router (const RouterLookahead* router_lookahead, bool is_flat) {
83
83
auto & device_ctx = g_vpr_ctx.device ();
84
84
auto & route_ctx = g_vpr_ctx.mutable_routing ();
85
85
@@ -109,8 +109,8 @@ class SerialNetlistRouter: public NetlistRouter {
109
109
};
110
110
111
111
template <typename HeapType>
112
- class ParallelNetlistRouter : public NetlistRouter {
113
- public:
112
+ class ParallelNetlistRouter : public NetlistRouter {
113
+ public:
114
114
ParallelNetlistRouter (
115
115
const Netlist<>& net_list,
116
116
const RouterLookahead* router_lookahead,
@@ -123,28 +123,28 @@ class ParallelNetlistRouter: public NetlistRouter {
123
123
route_budgets& budgeting_inf,
124
124
const RoutingPredictor& routing_predictor,
125
125
const vtr::vector<ParentNetId, std::vector<std::unordered_map<RRNodeId, int >>>& choking_spots,
126
- bool is_flat
127
- ):
128
- _routers_th (_make_router(router_lookahead, is_flat)),
129
- _net_list (net_list),
130
- _router_opts (router_opts),
131
- _connections_inf (connections_inf),
132
- _net_delay (net_delay),
133
- _netlist_pin_lookup (netlist_pin_lookup),
134
- _timing_info (timing_info),
135
- _pin_timing_invalidator (pin_timing_invalidator),
136
- _budgeting_inf (budgeting_inf),
137
- _routing_predictor (routing_predictor),
138
- _choking_spots (choking_spots),
139
- _is_flat (is_flat){}
126
+ bool is_flat)
127
+ : _routers_th(_make_router(router_lookahead, is_flat))
128
+ , _net_list(net_list)
129
+ , _router_opts(router_opts)
130
+ , _connections_inf(connections_inf)
131
+ , _net_delay(net_delay)
132
+ , _netlist_pin_lookup(netlist_pin_lookup)
133
+ , _timing_info(timing_info)
134
+ , _pin_timing_invalidator(pin_timing_invalidator)
135
+ , _budgeting_inf(budgeting_inf)
136
+ , _routing_predictor(routing_predictor)
137
+ , _choking_spots(choking_spots)
138
+ , _is_flat(is_flat) {}
140
139
~ParallelNetlistRouter () {}
141
140
142
141
RouteIterResults route_netlist (int itry, float pres_fac, float worst_neg_slack);
143
142
void set_rcv_enabled (bool x);
144
143
void set_timing_info (std::shared_ptr<SetupHoldTimingInfo> timing_info);
145
- private:
144
+
145
+ private:
146
146
void route_partition_tree_node (tbb::task_group& g, PartitionTreeNode& node, int itry, float pres_fac, float worst_neg_slack);
147
- ConnectionRouter<HeapType> _make_router (const RouterLookahead* router_lookahead, bool is_flat){
147
+ ConnectionRouter<HeapType> _make_router (const RouterLookahead* router_lookahead, bool is_flat) {
148
148
auto & device_ctx = g_vpr_ctx.device ();
149
149
auto & route_ctx = g_vpr_ctx.mutable_routing ();
150
150
@@ -187,8 +187,8 @@ inline std::unique_ptr<NetlistRouter> make_netlist_router_with_heap(
187
187
route_budgets& budgeting_inf,
188
188
const RoutingPredictor& routing_predictor,
189
189
const vtr::vector<ParentNetId, std::vector<std::unordered_map<RRNodeId, int >>>& choking_spots,
190
- bool is_flat){
191
- if (router_opts.router_algorithm == e_router_algorithm::TIMING_DRIVEN){
190
+ bool is_flat) {
191
+ if (router_opts.router_algorithm == e_router_algorithm::TIMING_DRIVEN) {
192
192
return std::make_unique<SerialNetlistRouter<HeapType>>(
193
193
net_list,
194
194
router_lookahead,
@@ -202,7 +202,7 @@ inline std::unique_ptr<NetlistRouter> make_netlist_router_with_heap(
202
202
routing_predictor,
203
203
choking_spots,
204
204
is_flat);
205
- }else if (router_opts.router_algorithm == e_router_algorithm::PARALLEL){
205
+ } else if (router_opts.router_algorithm == e_router_algorithm::PARALLEL) {
206
206
#ifdef VPR_USE_TBB
207
207
return std::make_unique<ParallelNetlistRouter<HeapType>>(
208
208
net_list,
@@ -220,7 +220,7 @@ inline std::unique_ptr<NetlistRouter> make_netlist_router_with_heap(
220
220
#else
221
221
VPR_FATAL_ERROR (VPR_ERROR_ROUTE, " VPR isn't compiled with TBB support required for parallel routing" );
222
222
#endif
223
- }else {
223
+ } else {
224
224
VPR_FATAL_ERROR (VPR_ERROR_ROUTE, " Unknown router algorithm %d" , router_opts.router_algorithm );
225
225
}
226
226
}
@@ -239,7 +239,7 @@ inline std::unique_ptr<NetlistRouter> make_netlist_router(
239
239
const RoutingPredictor& routing_predictor,
240
240
const vtr::vector<ParentNetId, std::vector<std::unordered_map<RRNodeId, int >>>& choking_spots,
241
241
bool is_flat) {
242
- if (router_opts.router_heap == e_heap_type::BINARY_HEAP){
242
+ if (router_opts.router_heap == e_heap_type::BINARY_HEAP) {
243
243
return make_netlist_router_with_heap<BinaryHeap>(
244
244
net_list,
245
245
router_lookahead,
@@ -252,9 +252,8 @@ inline std::unique_ptr<NetlistRouter> make_netlist_router(
252
252
budgeting_inf,
253
253
routing_predictor,
254
254
choking_spots,
255
- is_flat
256
- );
257
- }else if (router_opts.router_heap == e_heap_type::BUCKET_HEAP_APPROXIMATION){
255
+ is_flat);
256
+ } else if (router_opts.router_heap == e_heap_type::BUCKET_HEAP_APPROXIMATION) {
258
257
return make_netlist_router_with_heap<Bucket>(
259
258
net_list,
260
259
router_lookahead,
@@ -267,10 +266,8 @@ inline std::unique_ptr<NetlistRouter> make_netlist_router(
267
266
budgeting_inf,
268
267
routing_predictor,
269
268
choking_spots,
270
- is_flat
271
- );
272
- }else {
269
+ is_flat);
270
+ } else {
273
271
VPR_FATAL_ERROR (VPR_ERROR_ROUTE, " Unknown heap type %d" , router_opts.router_heap );
274
272
}
275
273
}
276
-
0 commit comments