5
5
#include " draw_global.h"
6
6
#include " place_and_route.h"
7
7
#include " route_common.h"
8
+ #include " route_export.h"
8
9
#include " rr_graph.h"
9
10
10
11
/* The numbering relation between the channels and clbs is: *
36
37
* chan_width_y[0] chan_width_y[1] *
37
38
* */
38
39
39
- /* ******************* Subroutines local to route_common.c *******************/
40
+ /* ******************* Subroutines local to route_common.cpp *******************/
40
41
static vtr::vector<ParentNetId, std::vector<RRNodeId>> load_net_rr_terminals (const RRGraphView& rr_graph,
41
42
const Netlist<>& net_list,
42
43
bool is_flat);
@@ -74,7 +75,7 @@ void save_routing(vtr::vector<ParentNetId, vtr::optional<RouteTree>>& best_routi
74
75
saved_clb_opins_used_locally = clb_opins_used_locally;
75
76
}
76
77
77
- /* Empties route_ctx.current_rt and copies over best_routing onto it.
78
+ /* Empties route_ctx.route_trees and copies over best_routing onto it.
78
79
* Also restores the locally used opin data. */
79
80
void restore_routing (vtr::vector<ParentNetId, vtr::optional<RouteTree>>& best_routing,
80
81
t_clb_opins_used& clb_opins_used_locally,
@@ -117,46 +118,6 @@ void get_serial_num(const Netlist<>& net_list) {
117
118
VTR_LOG (" Serial number (magic cookie) for the routing is: %d\n " , serial_num);
118
119
}
119
120
120
- void try_graph (int width_fac,
121
- const t_router_opts& router_opts,
122
- t_det_routing_arch* det_routing_arch,
123
- std::vector<t_segment_inf>& segment_inf,
124
- t_chan_width_dist chan_width_dist,
125
- t_direct_inf* directs,
126
- int num_directs,
127
- bool is_flat) {
128
- auto & device_ctx = g_vpr_ctx.mutable_device ();
129
-
130
- t_graph_type graph_type;
131
- t_graph_type graph_directionality;
132
- if (router_opts.route_type == GLOBAL) {
133
- graph_type = GRAPH_GLOBAL;
134
- graph_directionality = GRAPH_BIDIR;
135
- } else {
136
- graph_type = (det_routing_arch->directionality == BI_DIRECTIONAL ? GRAPH_BIDIR : GRAPH_UNIDIR);
137
- graph_directionality = (det_routing_arch->directionality == BI_DIRECTIONAL ? GRAPH_BIDIR : GRAPH_UNIDIR);
138
- }
139
-
140
- /* Set the channel widths */
141
- t_chan_width chan_width = init_chan (width_fac, chan_width_dist, graph_directionality);
142
-
143
- /* Free any old routing graph, if one exists. */
144
- free_rr_graph ();
145
-
146
- /* Set up the routing resource graph defined by this FPGA architecture. */
147
- int warning_count;
148
- create_rr_graph (graph_type,
149
- device_ctx.physical_tile_types ,
150
- device_ctx.grid ,
151
- chan_width,
152
- det_routing_arch,
153
- segment_inf,
154
- router_opts,
155
- directs, num_directs,
156
- &warning_count,
157
- is_flat);
158
- }
159
-
160
121
/* * This routine checks to see if this is a resource-feasible routing.
161
122
* That is, are all rr_node capacity limitations respected? It assumes
162
123
* that the occupancy arrays are up to date when it is called. */
@@ -211,10 +172,9 @@ vtr::vector<RRNodeId, std::set<ClusterNetId>> collect_rr_node_nets() {
211
172
return rr_node_nets;
212
173
}
213
174
175
+ /* * Updates pathfinder's occupancy by either adding or removing the
176
+ * usage of a resource node. */
214
177
void pathfinder_update_single_node_occupancy (RRNodeId inode, int add_or_sub) {
215
- /* Updates pathfinder's occupancy by either adding or removing the
216
- * usage of a resource node. */
217
-
218
178
auto & route_ctx = g_vpr_ctx.mutable_routing ();
219
179
220
180
int occ = route_ctx.rr_node_route_inf [inode].occ () + add_or_sub;
@@ -223,14 +183,13 @@ void pathfinder_update_single_node_occupancy(RRNodeId inode, int add_or_sub) {
223
183
VTR_ASSERT (occ >= 0 );
224
184
}
225
185
186
+ /* * This routine recomputes the acc_cost (accumulated congestion cost) of each
187
+ * routing resource for the pathfinder algorithm after all nets have been routed.
188
+ * It updates the accumulated cost to by adding in the number of extra signals
189
+ * sharing a resource right now (i.e. after each complete iteration) times acc_fac.
190
+ * THIS ROUTINE ASSUMES THE OCCUPANCY VALUES IN RR_NODE ARE UP TO DATE.
191
+ * This routine also creates a new overuse info for the current routing iteration. */
226
192
void pathfinder_update_acc_cost_and_overuse_info (float acc_fac, OveruseInfo& overuse_info) {
227
- /* This routine recomputes the acc_cost (accumulated congestion cost) of each *
228
- * routing resource for the pathfinder algorithm after all nets have been routed. *
229
- * It updates the accumulated cost to by adding in the number of extra signals *
230
- * sharing a resource right now (i.e. after each complete iteration) times acc_fac. *
231
- * THIS ROUTINE ASSUMES THE OCCUPANCY VALUES IN RR_NODE ARE UP TO DATE. *
232
- * This routine also creates a new overuse info for the current routing iteration. */
233
-
234
193
auto & device_ctx = g_vpr_ctx.device ();
235
194
const auto & rr_graph = device_ctx.rr_graph ;
236
195
auto & route_ctx = g_vpr_ctx.mutable_routing ();
@@ -264,20 +223,6 @@ void pathfinder_update_cost_from_route_tree(const RouteTreeNode& root, int add_o
264
223
}
265
224
}
266
225
267
- float update_pres_fac (float new_pres_fac) {
268
- /* This routine should take the new value of the present congestion factor *
269
- * and propagate it to all the relevant data fields in the vpr flow. *
270
- * Currently, it only updates the pres_fac used by the drawing functions */
271
- #ifndef NO_GRAPHICS
272
-
273
- // Only updates the drawing pres_fac if graphics is enabled
274
- get_draw_state_vars ()->pres_fac = new_pres_fac;
275
-
276
- #endif // NO_GRAPHICS
277
-
278
- return new_pres_fac;
279
- }
280
-
281
226
/* Call this before you route any nets. It frees any old route trees and
282
227
* sets the list of rr_nodes touched to empty. */
283
228
void init_route_structs (const Netlist<>& net_list,
@@ -442,12 +387,9 @@ static t_clb_opins_used alloc_and_load_clb_opins_used_locally() {
442
387
return (clb_opins_used_locally);
443
388
}
444
389
445
- /* the trace lists are only freed after use by the timing-driven placer */
446
- /* Do not free them after use by the router, since stats, and draw */
447
- /* routines use the trace values */
390
+ /* Frees the temporary storage needed only during the routing. The
391
+ * final routing result is not freed. */
448
392
void free_route_structs () {
449
- /* Frees the temporary storage needed only during the routing. The *
450
- * final routing result is not freed. */
451
393
auto & route_ctx = g_vpr_ctx.mutable_routing ();
452
394
453
395
if (route_ctx.route_bb .size () != 0 ) {
0 commit comments