Skip to content

Commit 58ed574

Browse files
committed
reorganize router code, add NetlistRouter
1 parent 18cc251 commit 58ed574

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+2886
-3984
lines changed

utils/route_diag/src/main.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
#include "router_delay_profiling.h"
3434
#include "route_tree.h"
3535
#include "route_common.h"
36-
#include "route_timing.h"
36+
#include "route_net.h"
3737
#include "route_export.h"
3838
#include "rr_graph.h"
3939
#include "rr_graph2.h"
@@ -122,8 +122,7 @@ static void do_one_route(const Netlist<>& net_list,
122122
cost_params,
123123
bounding_box,
124124
router_stats,
125-
conn_params,
126-
true);
125+
conn_params);
127126

128127
if (found_path) {
129128
VTR_ASSERT(cheapest.index == sink_node);

vpr/src/base/SetupVPR.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -481,6 +481,7 @@ static void SetupRouterOpts(const t_options& Options, t_router_opts* RouterOpts)
481481
RouterOpts->generate_rr_node_overuse_report = Options.generate_rr_node_overuse_report;
482482
RouterOpts->flat_routing = Options.flat_routing;
483483
RouterOpts->has_choking_spot = Options.has_choking_spot;
484+
RouterOpts->with_timing_analysis = Options.timing_analysis;
484485
}
485486

486487
static void SetupAnnealSched(const t_options& Options,

vpr/src/base/place_and_route.cpp

Lines changed: 28 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include "place.h"
2121
#include "read_place.h"
2222
#include "read_route.h"
23+
#include "route.h"
2324
#include "route_export.h"
2425
#include "draw.h"
2526
#include "stats.h"
@@ -191,19 +192,19 @@ int binary_search_place_and_route(const Netlist<>& placement_net_list,
191192
arch->num_directs,
192193
false);
193194
}
194-
success = try_route(router_net_list,
195-
current,
196-
router_opts,
197-
analysis_opts,
198-
det_routing_arch, segment_inf,
199-
net_delay,
200-
timing_info,
201-
delay_calc,
202-
arch->Chans,
203-
arch->Directs,
204-
arch->num_directs,
205-
(attempt_count == 0) ? ScreenUpdatePriority::MAJOR : ScreenUpdatePriority::MINOR,
206-
is_flat);
195+
success = route(router_net_list,
196+
current,
197+
router_opts,
198+
analysis_opts,
199+
det_routing_arch, segment_inf,
200+
net_delay,
201+
timing_info,
202+
delay_calc,
203+
arch->Chans,
204+
arch->Directs,
205+
arch->num_directs,
206+
(attempt_count == 0) ? ScreenUpdatePriority::MAJOR : ScreenUpdatePriority::MINOR,
207+
is_flat);
207208

208209
attempt_count++;
209210
fflush(stdout);
@@ -331,19 +332,20 @@ int binary_search_place_and_route(const Netlist<>& placement_net_list,
331332
false);
332333
}
333334

334-
success = try_route(router_net_list,
335-
current,
336-
router_opts,
337-
analysis_opts,
338-
det_routing_arch, segment_inf,
339-
net_delay,
340-
timing_info,
341-
delay_calc,
342-
arch->Chans,
343-
arch->Directs,
344-
arch->num_directs,
345-
ScreenUpdatePriority::MINOR,
346-
is_flat);
335+
success = route(router_net_list,
336+
current,
337+
router_opts,
338+
analysis_opts,
339+
det_routing_arch,
340+
segment_inf,
341+
net_delay,
342+
timing_info,
343+
delay_calc,
344+
arch->Chans,
345+
arch->Directs,
346+
arch->num_directs,
347+
ScreenUpdatePriority::MINOR,
348+
is_flat);
347349

348350
if (success && Fc_clipped == false) {
349351
final = current;

vpr/src/base/read_options.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2932,8 +2932,6 @@ void set_conditional_defaults(t_options& args) {
29322932
*/
29332933
//Base cost type
29342934
if (args.base_cost_type.provenance() != Provenance::SPECIFIED) {
2935-
VTR_ASSERT(args.RouterAlgorithm == TIMING_DRIVEN || args.RouterAlgorithm == PARALLEL);
2936-
29372935
if (args.RouteType == DETAILED) {
29382936
if (args.timing_analysis) {
29392937
args.base_cost_type.set(DELAY_NORMALIZED_LENGTH, Provenance::INFERRED);

vpr/src/base/vpr_api.cpp

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
#include "pb_type_graph.h"
5454
#include "route_common.h"
5555
#include "timing_place_lookup.h"
56+
#include "route.h"
5657
#include "route_export.h"
5758
#include "vpr_api.h"
5859
#include "read_sdc.h"
@@ -61,9 +62,9 @@
6162
#include "lb_type_rr_graph.h"
6263
#include "read_activity.h"
6364
#include "net_delay.h"
64-
#include "AnalysisDelayCalculator.h"
6565
#include "concrete_timing_info.h"
6666
#include "netlist_writer.h"
67+
#include "AnalysisDelayCalculator.h"
6768
#include "RoutingDelayCalculator.h"
6869
#include "check_route.h"
6970
#include "constant_nets.h"
@@ -367,7 +368,6 @@ bool vpr_flow(t_vpr_setup& vpr_setup, t_arch& arch) {
367368
}
368369

369370
#ifdef VPR_USE_TBB
370-
371371
/* Set this here, because tbb::global_control doesn't control anything once it's out of scope
372372
* (contrary to the name). */
373373
tbb::global_control c(tbb::global_control::max_allowed_parallelism, vpr_setup.num_workers);
@@ -803,10 +803,11 @@ RouteStatus vpr_route_flow(const Netlist<>& net_list,
803803
std::shared_ptr<RoutingDelayCalculator> routing_delay_calc = nullptr;
804804
if (vpr_setup.Timing.timing_analysis_enabled) {
805805
auto& atom_ctx = g_vpr_ctx.atom();
806-
807806
routing_delay_calc = std::make_shared<RoutingDelayCalculator>(atom_ctx.nlist, atom_ctx.lookup, net_delay, is_flat);
808-
809807
timing_info = make_setup_hold_timing_info(routing_delay_calc, router_opts.timing_update_type);
808+
} else {
809+
/* No delay calculator (segfault if the code calls into it) and wirelength driven routing */
810+
timing_info = make_constant_timing_info(0);
810811
}
811812

812813
if (router_opts.doRouting == STAGE_DO) {
@@ -920,20 +921,20 @@ RouteStatus vpr_route_fixed_W(const Netlist<>& net_list,
920921
VPR_FATAL_ERROR(VPR_ERROR_ROUTE, "Fixed channel width must be specified when routing at fixed channel width (was %d)", fixed_channel_width);
921922
}
922923
bool status = false;
923-
status = try_route(net_list,
924-
fixed_channel_width,
925-
vpr_setup.RouterOpts,
926-
vpr_setup.AnalysisOpts,
927-
&vpr_setup.RoutingArch,
928-
vpr_setup.Segments,
929-
net_delay,
930-
timing_info,
931-
delay_calc,
932-
arch.Chans,
933-
arch.Directs,
934-
arch.num_directs,
935-
ScreenUpdatePriority::MAJOR,
936-
is_flat);
924+
status = route(net_list,
925+
fixed_channel_width,
926+
vpr_setup.RouterOpts,
927+
vpr_setup.AnalysisOpts,
928+
&vpr_setup.RoutingArch,
929+
vpr_setup.Segments,
930+
net_delay,
931+
timing_info,
932+
delay_calc,
933+
arch.Chans,
934+
arch.Directs,
935+
arch.num_directs,
936+
ScreenUpdatePriority::MAJOR,
937+
is_flat);
937938

938939
return RouteStatus(status, fixed_channel_width);
939940
}

vpr/src/base/vpr_types.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1393,6 +1393,8 @@ struct t_router_opts {
13931393
bool flat_routing;
13941394
bool has_choking_spot;
13951395

1396+
bool with_timing_analysis;
1397+
13961398
// Options related to rr_node reordering, for testing and possible cache optimization
13971399
e_rr_node_reorder_algorithm reorder_rr_graph_nodes_algorithm = DONT_REORDER;
13981400
int reorder_rr_graph_nodes_threshold = 0;

vpr/src/draw/draw.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@
8686
# endif
8787

8888
# include "rr_graph.h"
89-
# include "route_util.h"
89+
# include "route_utilization.h"
9090
# include "place_macro.h"
9191
# include "buttons.h"
9292
# include "draw_rr.h"

vpr/src/draw/draw_basic.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
# endif
6161

6262
# include "rr_graph.h"
63-
# include "route_util.h"
63+
# include "route_utilization.h"
6464
# include "place_macro.h"
6565
# include "buttons.h"
6666

vpr/src/draw/draw_rr.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
# include "manual_moves.h"
4444

4545
# include "rr_graph.h"
46-
# include "route_util.h"
46+
# include "route_utilization.h"
4747
# include "place_macro.h"
4848
# include "buttons.h"
4949

vpr/src/draw/draw_rr_edges.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
# include "manual_moves.h"
4444

4545
# include "rr_graph.h"
46-
# include "route_util.h"
46+
# include "route_utilization.h"
4747
# include "place_macro.h"
4848
# include "buttons.h"
4949

vpr/src/draw/draw_searchbar.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
# include "manual_moves.h"
4545

4646
# include "rr_graph.h"
47-
# include "route_util.h"
47+
# include "route_utilization.h"
4848
# include "place_macro.h"
4949
# include "buttons.h"
5050

vpr/src/draw/draw_toggle_functions.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
# include "manual_moves.h"
5050

5151
# include "rr_graph.h"
52-
# include "route_util.h"
52+
# include "route_utilization.h"
5353
# include "place_macro.h"
5454
# include "buttons.h"
5555

vpr/src/draw/draw_triangle.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
# include "manual_moves.h"
4545

4646
# include "rr_graph.h"
47-
# include "route_util.h"
47+
# include "route_utilization.h"
4848
# include "place_macro.h"
4949
# include "buttons.h"
5050

vpr/src/draw/search_bar.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
# endif
6060

6161
# include "rr_graph.h"
62-
# include "route_util.h"
62+
# include "route_utilization.h"
6363
# include "place_macro.h"
6464

6565
extern std::string rr_highlight_message;

vpr/src/place/place_timing_update.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
#include "timing_place.h"
88
#include "place_util.h"
99

10+
#include "NetPinTimingInvalidator.h"
11+
1012
///@brief Initialize the timing information and structures in the placer.
1113
void initialize_timing_info(const PlaceCritParams& crit_params,
1214
const PlaceDelayModel* delay_model,

vpr/src/place/timing_place_lookup.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
#include "globals.h"
2121
#include "place_and_route.h"
2222
#include "route_common.h"
23-
#include "route_timing.h"
23+
#include "route_net.h"
2424
#include "route_export.h"
2525
#include "rr_graph.h"
2626
#include "timing_place_lookup.h"

vpr/src/route/channel_stats.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#include "channel_stats.h"
2-
#include "route_util.h"
2+
#include "route_utilization.h"
33
#include "histogram.h"
44
#include "globals.h"
55

vpr/src/route/connection_based_routing.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#include "connection_based_routing.h"
22

3-
#include "route_timing.h"
43
#include "route_profiling.h"
54

65
// incremental rerouting resources class definitions

0 commit comments

Comments
 (0)