1- #include " vtr_log.h"
21
2+ #include " CheckSetup.h"
3+
4+ #include " vtr_log.h"
35#include " vpr_types.h"
46#include " vpr_error.h"
57#include " globals.h"
6- #include " echo_files.h"
78#include " read_xml_arch_file.h"
8- # include " CheckSetup.h "
9+
910
1011static constexpr int DYMANIC_PORT_RANGE_MIN = 49152 ;
1112static constexpr int DYNAMIC_PORT_RANGE_MAX = 65535 ;
1213
13- void CheckSetup (const t_packer_opts& PackerOpts ,
14- const t_placer_opts& PlacerOpts ,
15- const t_ap_opts& APOpts ,
16- const t_router_opts& RouterOpts ,
17- const t_server_opts& ServerOpts ,
18- const t_det_routing_arch& RoutingArch ,
19- const std::vector<t_segment_inf>& Segments ,
20- const t_timing_inf& Timing ,
21- const t_chan_width_dist& Chans ) {
22- if (!Timing .timing_analysis_enabled && PackerOpts .timing_driven ) {
14+ void CheckSetup (const t_packer_opts& packer_opts ,
15+ const t_placer_opts& placer_opts ,
16+ const t_ap_opts& ap_opts ,
17+ const t_router_opts& router_opts ,
18+ const t_server_opts& server_opts ,
19+ const t_det_routing_arch& routing_arch ,
20+ const std::vector<t_segment_inf>& segments ,
21+ const t_timing_inf& timing ,
22+ const t_chan_width_dist& chans ) {
23+ if (!timing .timing_analysis_enabled && packer_opts .timing_driven ) {
2324 VPR_FATAL_ERROR (VPR_ERROR_OTHER,
2425 " Packing cannot be timing driven without timing analysis enabled\n " );
2526 }
2627
27- if (PackerOpts .load_flat_placement ) {
28- if (PackerOpts .device_layout == " auto" ) {
28+ if (packer_opts .load_flat_placement ) {
29+ if (packer_opts .device_layout == " auto" ) {
2930 VPR_FATAL_ERROR (VPR_ERROR_OTHER,
3031 " Legalization requires a fixed device layout.\n " );
3132 }
32- if (!PlacerOpts .constraints_file .empty ()) {
33+ if (!placer_opts .constraints_file .empty ()) {
3334 VPR_FATAL_ERROR (VPR_ERROR_OTHER,
3435 " Cannot specify a fixed clusters file when running legalization.\n " );
3536 }
3637 }
3738
3839
39- if ((GLOBAL == RouterOpts .route_type )
40- && (PlacerOpts .place_algorithm .is_timing_driven ())) {
40+ if ((GLOBAL == router_opts .route_type )
41+ && (placer_opts .place_algorithm .is_timing_driven ())) {
4142 /* Works, but very weird. Can't optimize timing well, since you're
4243 * not doing proper architecture delay modelling. */
4344 VTR_LOG_WARN (
4445 " Using global routing with timing-driven placement. "
4546 " This is allowed, but strange, and circuit speed will suffer.\n " );
4647 }
4748
48- if (!Timing .timing_analysis_enabled
49- && (PlacerOpts .place_algorithm .is_timing_driven ())) {
49+ if (!timing .timing_analysis_enabled
50+ && (placer_opts .place_algorithm .is_timing_driven ())) {
5051 /* May work, not tested */
5152 VPR_FATAL_ERROR (VPR_ERROR_OTHER,
5253 " Timing analysis must be enabled for timing-driven placement.\n " );
5354 }
5455
55- if (!PlacerOpts .doPlacement && (!PlacerOpts .constraints_file .empty ())) {
56+ if (!placer_opts .doPlacement && (!placer_opts .constraints_file .empty ())) {
5657 VPR_FATAL_ERROR (VPR_ERROR_OTHER,
5758 " A block location file requires that placement is enabled.\n " );
5859 }
5960
60- if (PlacerOpts .place_algorithm .is_timing_driven () &&
61- PlacerOpts .place_static_move_prob .size () > NUM_PL_MOVE_TYPES) {
61+ if (placer_opts .place_algorithm .is_timing_driven () &&
62+ placer_opts .place_static_move_prob .size () > NUM_PL_MOVE_TYPES) {
6263 VPR_FATAL_ERROR (VPR_ERROR_OTHER,
6364 " The number of provided placer move probabilities (%d) should equal or less than the total number of supported moves (%d).\n " ,
64- PlacerOpts .place_static_move_prob .size (),
65+ placer_opts .place_static_move_prob .size (),
6566 NUM_PL_MOVE_TYPES);
6667 }
6768
68- if (!PlacerOpts .place_algorithm .is_timing_driven () &&
69- PlacerOpts .place_static_move_prob .size () > NUM_PL_NONTIMING_MOVE_TYPES) {
69+ if (!placer_opts .place_algorithm .is_timing_driven () &&
70+ placer_opts .place_static_move_prob .size () > NUM_PL_NONTIMING_MOVE_TYPES) {
7071 VPR_FATAL_ERROR (VPR_ERROR_OTHER,
7172 " The number of placer non timing move probabilities (%d) should equal to or less than the total number of supported moves (%d).\n " ,
72- PlacerOpts .place_static_move_prob .size (),
73+ placer_opts .place_static_move_prob .size (),
7374 NUM_PL_MOVE_TYPES);
7475 }
7576
7677 // Rules for doing Analytical Placement
77- if (APOpts .doAP ) {
78+ if (ap_opts .doAP ) {
7879 // Make sure that the --place option was not set.
79- if (PlacerOpts .doPlacement ) {
80+ if (placer_opts .doPlacement ) {
8081 VPR_FATAL_ERROR (VPR_ERROR_OTHER,
8182 " Cannot perform both analytical and non-analytical placement.\n " );
8283 }
8384 // Make sure that the --pack option was not set.
84- if (PackerOpts .doPacking ) {
85+ if (packer_opts .doPacking ) {
8586 VPR_FATAL_ERROR (VPR_ERROR_OTHER,
8687 " Analytical placement should skip packing.\n " );
8788 }
@@ -95,58 +96,58 @@ void CheckSetup(const t_packer_opts& PackerOpts,
9596 // goes with ensuring that some blocks are fixed.
9697 }
9798
98- if (RouterOpts .doRouting ) {
99- if (!Timing .timing_analysis_enabled
100- && (DEMAND_ONLY != RouterOpts .base_cost_type && DEMAND_ONLY_NORMALIZED_LENGTH != RouterOpts .base_cost_type )) {
99+ if (router_opts .doRouting ) {
100+ if (!timing .timing_analysis_enabled
101+ && (DEMAND_ONLY != router_opts .base_cost_type && DEMAND_ONLY_NORMALIZED_LENGTH != router_opts .base_cost_type )) {
101102 VPR_FATAL_ERROR (VPR_ERROR_OTHER,
102103 " base_cost_type must be demand_only or demand_only_normalized_length when timing analysis is disabled.\n " );
103104 }
104105 }
105106
106- if (DETAILED == RouterOpts .route_type ) {
107- if ((Chans .chan_x_dist .type != UNIFORM)
108- || (Chans .chan_y_dist .type != UNIFORM)) {
107+ if (DETAILED == router_opts .route_type ) {
108+ if ((chans .chan_x_dist .type != UNIFORM)
109+ || (chans .chan_y_dist .type != UNIFORM)) {
109110 VPR_FATAL_ERROR (VPR_ERROR_OTHER,
110111 " Detailed routing currently only supported on FPGAs with uniform channel distributions.\n " );
111112 }
112113 }
113114
114- for (int i = 0 ; i < (int )Segments .size (); ++i) {
115- int Tmp = Segments [i].arch_opin_switch ;
115+ for (int i = 0 ; i < (int )segments .size (); ++i) {
116+ int opin_switch_idx = segments [i].arch_opin_switch ;
116117 auto & device_ctx = g_vpr_ctx.device ();
117- if (!device_ctx.arch_switch_inf [Tmp ].buffered ()) {
118+ if (!device_ctx.arch_switch_inf [opin_switch_idx ].buffered ()) {
118119 VPR_FATAL_ERROR (VPR_ERROR_OTHER,
119- " arch_opin_switch (#%d) of segment type #%d is not buffered.\n " , Tmp , i);
120+ " arch_opin_switch (#%d) of segment type #%d is not buffered.\n " , opin_switch_idx , i);
120121 }
121122 }
122123
123- if ((PlacerOpts .place_chan_width != NO_FIXED_CHANNEL_WIDTH) && PlacerOpts .place_chan_width < 0 ) {
124+ if ((placer_opts .place_chan_width != NO_FIXED_CHANNEL_WIDTH) && placer_opts .place_chan_width < 0 ) {
124125 VPR_FATAL_ERROR (VPR_ERROR_OTHER,
125126 " Place channel width must be positive.\n " );
126127 }
127- if ((RouterOpts .fixed_channel_width != NO_FIXED_CHANNEL_WIDTH) && RouterOpts .fixed_channel_width < 0 ) {
128+ if ((router_opts .fixed_channel_width != NO_FIXED_CHANNEL_WIDTH) && router_opts .fixed_channel_width < 0 ) {
128129 VPR_FATAL_ERROR (VPR_ERROR_OTHER,
129130 " Routing channel width must be positive.\n " );
130131 }
131132
132- if (UNI_DIRECTIONAL == RoutingArch .directionality ) {
133- if ((RouterOpts .fixed_channel_width != NO_FIXED_CHANNEL_WIDTH)
134- && (RouterOpts .fixed_channel_width % 2 > 0 )) {
133+ if (UNI_DIRECTIONAL == routing_arch .directionality ) {
134+ if ((router_opts .fixed_channel_width != NO_FIXED_CHANNEL_WIDTH)
135+ && (router_opts .fixed_channel_width % 2 > 0 )) {
135136 VPR_FATAL_ERROR (VPR_ERROR_OTHER,
136137 " Routing channel width must be even for unidirectional.\n " );
137138 }
138- if ((PlacerOpts .place_chan_width != NO_FIXED_CHANNEL_WIDTH)
139- && (PlacerOpts .place_chan_width % 2 > 0 )) {
139+ if ((placer_opts .place_chan_width != NO_FIXED_CHANNEL_WIDTH)
140+ && (placer_opts .place_chan_width % 2 > 0 )) {
140141 VPR_FATAL_ERROR (VPR_ERROR_OTHER,
141142 " Place channel width must be even for unidirectional.\n " );
142143 }
143144 }
144145
145- if (ServerOpts .is_server_mode_enabled ) {
146- if (ServerOpts .port_num < DYMANIC_PORT_RANGE_MIN || ServerOpts .port_num > DYNAMIC_PORT_RANGE_MAX) {
146+ if (server_opts .is_server_mode_enabled ) {
147+ if (server_opts .port_num < DYMANIC_PORT_RANGE_MIN || server_opts .port_num > DYNAMIC_PORT_RANGE_MAX) {
147148 VPR_FATAL_ERROR (VPR_ERROR_OTHER,
148149 " Specified server port number `--port %d` is out of range [%d-%d]. Please specify a port number within that range.\n " ,
149- ServerOpts .port_num , DYMANIC_PORT_RANGE_MIN, DYNAMIC_PORT_RANGE_MAX);
150+ server_opts .port_num , DYMANIC_PORT_RANGE_MIN, DYNAMIC_PORT_RANGE_MAX);
150151 }
151152 }
152153}
0 commit comments