00001 #include "util.h"
00002 #include "vpr_types.h"
00003 #include "globals.h"
00004 #include "OptionTokens.h"
00005 #include "ReadOptions.h"
00006 #include "xml_arch.h"
00007 #include "SetupVPR.h"
00008
00009
00010 void
00011 CheckSetup(IN enum e_operation Operation,
00012 IN struct s_placer_opts PlacerOpts,
00013 IN struct s_annealing_sched AnnealSched,
00014 IN struct s_router_opts RouterOpts,
00015 IN struct s_det_routing_arch RoutingArch,
00016 IN t_segment_inf * Segments,
00017 IN t_timing_inf Timing,
00018 IN t_subblock_data Subblocks,
00019 IN t_chan_width_dist Chans)
00020 {
00021 int i;
00022 int Tmp;
00023
00024 if((NONLINEAR_CONG == PlacerOpts.place_cost_type) &&
00025 (Operation != PLACE_AND_ROUTE) &&
00026 (PLACE_ALWAYS == PlacerOpts.place_freq))
00027 {
00028 printf(ERRTAG "Replacing using the nonlinear congestion option "
00029 "for each channel width makes sense only for full "
00030 "place and route.\n");
00031 exit(1);
00032 }
00033
00034 if((NONLINEAR_CONG == PlacerOpts.place_cost_type) &&
00035 (BOUNDING_BOX_PLACE != PlacerOpts.place_algorithm))
00036 {
00037
00038
00039 printf(ERRTAG
00040 "Cannot use non-linear placement only supported with "
00041 "bounding box placement\n");
00042 exit(1);
00043 }
00044
00045 if((GLOBAL == RouterOpts.route_type) &&
00046 (TIMING_DRIVEN == RouterOpts.router_algorithm))
00047 {
00048
00049 printf(ERRTAG "The global router does not support timing-drvien "
00050 "routing.\n");
00051 exit(1);
00052 }
00053
00054 if((GLOBAL == RouterOpts.route_type) &&
00055 (BOUNDING_BOX_PLACE != PlacerOpts.place_algorithm))
00056 {
00057
00058
00059
00060 printf(WARNTAG
00061 "Using global routing with timing-driven placement. "
00062 "This is allowed, but strange, and circuit speed will suffer.\n");
00063 }
00064
00065 if((FALSE == Timing.timing_analysis_enabled) &&
00066 ((PlacerOpts.place_algorithm == NET_TIMING_DRIVEN_PLACE) ||
00067 (PlacerOpts.place_algorithm == PATH_TIMING_DRIVEN_PLACE)))
00068 {
00069
00070
00071 printf(ERRTAG
00072 "Timing analysis must be enabled for timing-driven placement\n");
00073 exit(1);
00074 }
00075
00076 if((ROUTE_ONLY == Operation) && (USER == PlacerOpts.pad_loc_type))
00077 {
00078 printf(ERRTAG "You cannot specify both a full placement file and "
00079 "a pad location file.\n");
00080 exit(1);
00081 }
00082
00083 if((ROUTE_ONLY == Operation) || (PLACE_AND_ROUTE == Operation))
00084 {
00085 if((TIMING_DRIVEN == RouterOpts.router_algorithm) &&
00086 (FALSE == Timing.timing_analysis_enabled))
00087 {
00088 printf(ERRTAG
00089 "Cannot perform timing-driven routing when timing "
00090 "analysis is disabled.\n");
00091 exit(1);
00092 }
00093
00094 if((FALSE == Timing.timing_analysis_enabled) &&
00095 (DEMAND_ONLY != RouterOpts.base_cost_type))
00096 {
00097 printf(ERRTAG
00098 "base_cost_type must be demand_only when timing "
00099 "analysis is disabled.\n");
00100 exit(1);
00101 }
00102 }
00103
00104 if((TIMING_ANALYSIS_ONLY == Operation) &&
00105 (FALSE == Timing.timing_analysis_enabled))
00106 {
00107 printf(ERRTAG
00108 "-timing_analyze_only_with_net_delay option requires "
00109 "that timing analysis not be disabled.\n");
00110 exit(1);
00111 }
00112
00113 if((NONLINEAR_CONG == PlacerOpts.place_cost_type) &&
00114 ((PlacerOpts.num_regions > nx) || (PlacerOpts.num_regions > ny)))
00115 {
00116 printf(ERRTAG "Cannot use more regions than clbs in "
00117 "placement cost function.\n");
00118 exit(1);
00119 }
00120
00121 if(DETAILED == RouterOpts.route_type)
00122 {
00123 if((Chans.chan_x_dist.type != UNIFORM) ||
00124 (Chans.chan_y_dist.type != UNIFORM) ||
00125 (Chans.chan_x_dist.peak != Chans.chan_y_dist.peak) ||
00126 (Chans.chan_x_dist.peak != Chans.chan_width_io))
00127 {
00128 printf(ERRTAG "Detailed routing currently only supported "
00129 "on FPGAs with all channels of equal width.\n");
00130 exit(1);
00131 }
00132 }
00133
00134 for(i = 0; i < RoutingArch.num_segment; ++i)
00135 {
00136 Tmp = Segments[i].opin_switch;
00137 if(FALSE == switch_inf[Tmp].buffered)
00138 {
00139 printf(ERRTAG "opin_switch (#%d) of segment type #%d "
00140 "is not buffered.\n", Tmp, i);
00141 exit(1);
00142 }
00143 }
00144
00145 if(UNI_DIRECTIONAL == RoutingArch.directionality)
00146 {
00147 if((RouterOpts.fixed_channel_width != NO_FIXED_CHANNEL_WIDTH) &&
00148 (RouterOpts.fixed_channel_width % 2 > 0))
00149 {
00150 printf(ERRTAG
00151 "Routing channel width must be even for unidirectional\n");
00152 exit(1);
00153 }
00154 if((PlacerOpts.place_chan_width != NO_FIXED_CHANNEL_WIDTH) &&
00155 (PlacerOpts.place_chan_width % 2 > 0))
00156 {
00157 printf(ERRTAG
00158 "Place channel width must be even for unidirectional\n");
00159 exit(1);
00160 }
00161 }
00162 }