@@ -38,35 +38,34 @@ using namespace std;
38
38
/* ****************** Subroutines local to this module ************************/
39
39
40
40
static int binary_search_place_and_route (struct s_placer_opts placer_opts,
41
- char *place_file, char *net_file, char *arch_file, char *route_file,
41
+ struct s_file_name_opts filename_opts,
42
+ const t_arch* arch,
42
43
bool verify_binary_search, int min_chan_width_hint,
43
44
struct s_annealing_sched annealing_sched,
44
45
struct s_router_opts router_opts,
45
46
struct s_det_routing_arch *det_routing_arch, t_segment_inf * segment_inf,
46
- t_timing_inf timing_inf, t_chan_width_dist chan_width_dist,
47
- t_direct_inf *directs, int num_directs);
47
+ t_timing_inf timing_inf);
48
48
49
49
static float comp_width (t_chan * chan, float x, float separation);
50
50
51
51
void post_place_sync (const int L_num_blocks);
52
52
53
53
/* ************************ Subroutine Definitions ****************************/
54
54
55
- bool place_and_route (struct s_placer_opts placer_opts, char *place_file, char *net_file,
56
- char *arch_file, char *route_file,
55
+ bool place_and_route (struct s_placer_opts placer_opts,
56
+ struct s_file_name_opts filename_opts,
57
+ const t_arch* arch,
57
58
struct s_annealing_sched annealing_sched,
58
59
struct s_router_opts router_opts,
59
60
struct s_det_routing_arch *det_routing_arch, t_segment_inf * segment_inf,
60
- t_timing_inf timing_inf, t_chan_width_dist chan_width_dist,
61
- t_direct_inf *directs, int num_directs) {
61
+ t_timing_inf timing_inf) {
62
62
63
63
/* This routine controls the overall placement and routing of a circuit. */
64
64
char msg[vtr::BUFSIZE];
65
65
66
66
bool success = false ;
67
67
vtr::t_chunk net_delay_ch = {NULL , 0 , NULL };
68
68
69
- /* struct s_linked_vptr *net_delay_chunk_list_head;*/
70
69
vtr::t_ivec **clb_opins_used_locally = NULL ; /* [0..num_blocks-1][0..num_class-1] */
71
70
clock_t begin, end;
72
71
@@ -79,18 +78,22 @@ bool place_and_route(struct s_placer_opts placer_opts, char *place_file, char *n
79
78
80
79
if (!placer_opts.doPlacement || placer_opts.place_freq == PLACE_NEVER) {
81
80
/* Read the placement from a file */
81
+ <<<<<<< HEAD
82
82
read_place (place_file, arch_file, net_file, nx, ny, num_blocks, block);
83
+ =======
84
+ read_place (filename_opts.ArchFile , filename_opts.NetFile , filename_opts.PlaceFile , arch, nx, ny, num_blocks, block);
85
+ >>>>>>> Add netlist and architecture SHA256 ID consistency checks when reading placement file
83
86
sync_grid_to_blocks (num_blocks, nx, ny, grid);
84
87
} else {
85
88
VTR_ASSERT ((PLACE_ONCE == placer_opts.place_freq ) || (PLACE_ALWAYS == placer_opts.place_freq ));
86
89
begin = clock ();
87
- try_place (placer_opts, annealing_sched, chan_width_dist , router_opts,
90
+ try_place (placer_opts, annealing_sched, arch-> Chans , router_opts,
88
91
det_routing_arch, segment_inf,
89
92
#ifdef ENABLE_CLASSIC_VPR_STA
90
93
timing_inf,
91
94
#endif
92
- directs, num_directs);
93
- print_place (place_file, net_file, arch_file );
95
+ arch-> Directs , arch-> num_directs );
96
+ print_place (filename_opts. ArchFile , arch-> architecture_id , filename_opts. NetFile , g_clbs_nlist. netlist_id . c_str (), filename_opts. PlaceFile );
94
97
end = clock ();
95
98
96
99
vtr::printf_info (" Placement took %g seconds.\n " , (float )(end - begin) / CLOCKS_PER_SEC);
@@ -108,21 +111,21 @@ bool place_and_route(struct s_placer_opts placer_opts, char *place_file, char *n
108
111
if (width_fac != NO_FIXED_CHANNEL_WIDTH) {
109
112
// Only try if a fixed channel width is specified
110
113
try_graph (width_fac, router_opts, det_routing_arch,
111
- segment_inf, chan_width_dist ,
112
- directs, num_directs);
114
+ segment_inf, arch-> Chans ,
115
+ arch-> Directs , arch-> num_directs );
113
116
}
114
117
return (true );
115
118
}
116
119
117
120
/* If channel width not fixed, use binary search to find min W */
118
121
if (NO_FIXED_CHANNEL_WIDTH == width_fac) {
119
122
// Binary search for the min channel width
120
- g_solution_inf.channel_width = binary_search_place_and_route (placer_opts, place_file, net_file,
121
- arch_file, route_file,
123
+ g_solution_inf.channel_width = binary_search_place_and_route (placer_opts,
124
+ filename_opts,
125
+ arch,
122
126
router_opts.verify_binary_search , router_opts.min_channel_width_hint ,
123
127
annealing_sched, router_opts,
124
- det_routing_arch, segment_inf, timing_inf, chan_width_dist,
125
- directs, num_directs);
128
+ det_routing_arch, segment_inf, timing_inf);
126
129
success = (g_solution_inf.channel_width > 0 ? true : false );
127
130
} else {
128
131
// Route at the specified channel width
@@ -150,8 +153,8 @@ bool place_and_route(struct s_placer_opts placer_opts, char *place_file, char *n
150
153
#ifdef ENABLE_CLASSIC_VPR_STA
151
154
slacks,
152
155
#endif
153
- chan_width_dist ,
154
- clb_opins_used_locally, directs, num_directs);
156
+ arch-> Chans ,
157
+ clb_opins_used_locally, arch-> Directs , arch-> num_directs );
155
158
156
159
if (success == false ) {
157
160
@@ -163,7 +166,7 @@ bool place_and_route(struct s_placer_opts placer_opts, char *place_file, char *n
163
166
164
167
vtr::printf_info (" Circuit successfully routed with a channel width factor of %d.\n " , width_fac);
165
168
166
- print_route (route_file );
169
+ print_route (filename_opts. RouteFile );
167
170
168
171
if (getEchoEnabled () && isEchoFileEnabled (E_ECHO_ROUTING_SINK_DELAYS)) {
169
172
print_sink_delays (getEchoFileName (E_ECHO_ROUTING_SINK_DELAYS));
@@ -209,26 +212,17 @@ bool place_and_route(struct s_placer_opts placer_opts, char *place_file, char *n
209
212
delete [] g_switch_fanin_remap;
210
213
g_switch_fanin_remap = NULL ;
211
214
212
- /* WMF: cleaning up memory usage */
213
-
214
- /* if (g_heap_free_head)
215
- free(g_heap_free_head);
216
- if (g_trace_free_head)
217
- free(g_trace_free_head);
218
- if (g_linked_f_pointer_free_head)
219
- free(g_linked_f_pointer_free_head);*/
220
-
221
215
return (success);
222
216
}
223
217
224
218
static int binary_search_place_and_route (struct s_placer_opts placer_opts,
225
- char *place_file, char *net_file, char *arch_file, char *route_file,
219
+ struct s_file_name_opts filename_opts,
220
+ const t_arch* arch,
226
221
bool verify_binary_search, int min_chan_width_hint,
227
222
struct s_annealing_sched annealing_sched,
228
223
struct s_router_opts router_opts,
229
224
struct s_det_routing_arch *det_routing_arch, t_segment_inf * segment_inf,
230
- t_timing_inf timing_inf, t_chan_width_dist chan_width_dist,
231
- t_direct_inf *directs, int num_directs) {
225
+ t_timing_inf timing_inf) {
232
226
233
227
/* This routine performs a binary search to find the minimum number of *
234
228
* tracks per channel required to successfully route a circuit, and returns *
@@ -356,20 +350,20 @@ static int binary_search_place_and_route(struct s_placer_opts placer_opts,
356
350
357
351
if (placer_opts.place_freq == PLACE_ALWAYS) {
358
352
placer_opts.place_chan_width = current;
359
- try_place (placer_opts, annealing_sched, chan_width_dist ,
353
+ try_place (placer_opts, annealing_sched, arch-> Chans ,
360
354
router_opts, det_routing_arch, segment_inf,
361
355
#ifdef ENABLE_CLASSIC_VPR_STA
362
356
timing_inf,
363
357
#endif
364
- directs, num_directs);
358
+ arch-> Directs , arch-> num_directs );
365
359
}
366
360
success = try_route (current, router_opts, det_routing_arch, segment_inf,
367
361
timing_inf, net_delay,
368
362
#ifdef ENABLE_CLASSIC_VPR_STA
369
363
slacks,
370
364
#endif
371
- chan_width_dist ,
372
- clb_opins_used_locally, directs, num_directs);
365
+ arch-> Chans ,
366
+ clb_opins_used_locally, arch-> Directs , arch-> num_directs );
373
367
attempt_count++;
374
368
fflush (stdout);
375
369
@@ -471,27 +465,29 @@ static int binary_search_place_and_route(struct s_placer_opts placer_opts,
471
465
break ;
472
466
if (placer_opts.place_freq == PLACE_ALWAYS) {
473
467
placer_opts.place_chan_width = current;
474
- try_place (placer_opts, annealing_sched, chan_width_dist ,
468
+ try_place (placer_opts, annealing_sched, arch-> Chans ,
475
469
router_opts, det_routing_arch, segment_inf,
476
470
#ifdef ENABLE_CLASSIC_VPR_STA
477
471
timing_inf,
478
472
#endif
479
- directs, num_directs);
473
+ arch-> Directs , arch-> num_directs );
480
474
}
481
475
success = try_route (current, router_opts, det_routing_arch,
482
476
segment_inf, timing_inf, net_delay,
483
477
#ifdef ENABLE_CLASSIC_VPR_STA
484
478
slacks,
485
479
#endif
486
- chan_width_dist , clb_opins_used_locally, directs, num_directs);
480
+ arch-> Chans , clb_opins_used_locally, arch-> Directs , arch-> num_directs );
487
481
488
482
if (success && Fc_clipped == false ) {
489
483
final = current;
490
484
save_routing (best_routing, clb_opins_used_locally,
491
485
saved_clb_opins_used_locally);
492
486
493
487
if (placer_opts.place_freq == PLACE_ALWAYS) {
494
- print_place (place_file, net_file, arch_file);
488
+ print_place (filename_opts.ArchFile , arch->architecture_id ,
489
+ filename_opts.NetFile , g_clbs_nlist.netlist_id .c_str (),
490
+ filename_opts.PlaceFile );
495
491
}
496
492
}
497
493
@@ -507,18 +503,8 @@ static int binary_search_place_and_route(struct s_placer_opts placer_opts,
507
503
/* End binary search verification. */
508
504
/* Restore the best placement (if necessary), the best routing, and *
509
505
* * the best channel widths for final drawing and statistics output. */
510
- init_chan (final , chan_width_dist);
511
-
512
- #if 0
513
- if (placer_opts.place_freq == PLACE_ALWAYS)
514
- {
515
- vtr::printf_info("Reading best placement back in.\n");
516
- placer_opts.place_chan_width = final;
517
- read_place(place_file, net_file, arch_file, placer_opts,
518
- router_opts, chan_width_dist, det_routing_arch,
519
- segment_inf, timing_inf);
520
- }
521
- #endif
506
+ init_chan (final , arch->Chans );
507
+
522
508
free_rr_graph ();
523
509
524
510
build_rr_graph (graph_type, num_types, type_descriptors, nx, ny, grid,
@@ -532,7 +518,7 @@ static int binary_search_place_and_route(struct s_placer_opts placer_opts,
532
518
router_opts.base_cost_type ,
533
519
router_opts.trim_empty_channels ,
534
520
router_opts.trim_obs_channels ,
535
- directs, num_directs, false ,
521
+ arch-> Directs , arch-> num_directs , false ,
536
522
det_routing_arch->dump_rr_structs_file ,
537
523
&det_routing_arch->wire_to_rr_ipin_switch ,
538
524
&g_num_rr_switches,
@@ -550,7 +536,7 @@ static int binary_search_place_and_route(struct s_placer_opts placer_opts,
550
536
}
551
537
vtr::printf_info (" Best routing used a channel width factor of %d.\n " , final );
552
538
553
- print_route (route_file );
539
+ print_route (filename_opts. RouteFile );
554
540
555
541
if (getEchoEnabled () && isEchoFileEnabled (E_ECHO_ROUTING_SINK_DELAYS)) {
556
542
print_sink_delays (getEchoFileName (E_ECHO_ROUTING_SINK_DELAYS));
0 commit comments