Go to the source code of this file.
Functions | |
boolean | IsTimingEnabled (IN t_options Options) |
void | SetupVPR (IN t_options Options, IN boolean TimingEnabled, OUT t_arch *Arch, OUT enum e_operation *Operation, OUT struct s_placer_opts *PlacerOpts, OUT struct s_annealing_sched *AnnealSched, OUT struct s_router_opts *RouterOpts, OUT struct s_det_routing_arch *RoutingArch, OUT t_segment_inf **Segments, OUT t_timing_inf *Timing, OUT t_subblock_data *Subblocks, OUT boolean *ShowGraphics, OUT int *GraphPause) |
void | CheckSetup (IN enum e_operation Operation, IN struct s_placer_opts PlacerOpts, IN struct s_annealing_sched AnnealSched, IN struct s_router_opts RouterOpts, IN struct s_det_routing_arch RoutingArch, IN t_segment_inf *Segments, IN t_timing_inf Timing, IN t_subblock_data Subblocks, IN t_chan_width_dist Chans) |
void | CheckArch (IN t_arch Arch, IN boolean TimingEnabled) |
void | CheckOptions (IN t_options Options, IN boolean TimingEnabled) |
void | ShowSetup (IN t_options Options, IN t_arch Arch, IN boolean TimingEnabled, IN enum e_operation Operation, IN struct s_placer_opts PlacerOpts, IN struct s_annealing_sched AnnealSched, IN struct s_router_opts RouterOpts, IN struct s_det_routing_arch RoutingArch, IN t_segment_inf *Segments, IN t_timing_inf Timing, IN t_subblock_data Subblocks) |
Definition at line 19 of file CheckArch.c.
00021 { 00022 CheckSwitches(Arch, TimingEnabled); 00023 CheckSegments(Arch); 00024 }
Definition at line 13 of file CheckOptions.c.
00015 { 00016 int i; 00017 boolean Placer; 00018 boolean TimingPlacer; 00019 boolean Router; 00020 boolean TimingRouter; 00021 const struct s_TokenPair *Cur; 00022 enum e_OptionBaseToken Yes; 00023 00024 /* Check that all filenames were given */ 00025 if((NULL == Options.NetFile) || 00026 (NULL == Options.ArchFile) || 00027 (NULL == Options.PlaceFile) || (NULL == Options.RouteFile)) 00028 { 00029 printf(ERRTAG "Not enough args. Need at least 'vpr " 00030 "<netfile> <archfile> <placefile> <routefile>'\n"); 00031 exit(1); 00032 } 00033 00034 /* Check that options aren't over specified */ 00035 Cur = OptionBaseTokenList; 00036 while(Cur->Str) 00037 { 00038 if(Options.Count[Cur->Enum] > 1) 00039 { 00040 printf(ERRTAG "Parameter '%s' was specified more than " 00041 "once on command line.\n", Cur->Str); 00042 exit(1); 00043 } 00044 ++Cur; 00045 } 00046 00047 /* Check for conflicting parameters and determine if placer and 00048 * router are on. */ 00049 i = 0; 00050 Placer = TRUE; /* On by default */ 00051 Router = TRUE; /* On by default */ 00052 if(Options.Count[OT_ROUTE_ONLY]) 00053 { 00054 ++i; 00055 Placer = FALSE; 00056 } 00057 if(Options.Count[OT_PLACE_ONLY]) 00058 { 00059 ++i; 00060 Router = FALSE; 00061 } 00062 if(Options.Count[OT_TIMING_ANALYZE_ONLY_WITH_NET_DELAY]) 00063 { 00064 ++i; 00065 Placer = FALSE; 00066 Router = FALSE; 00067 } 00068 if(i > 1) 00069 { 00070 printf(ERRTAG "'route_only', 'place_only', and " 00071 "'timing_analysis_only_with_net_delay' are mutually " 00072 "exclusive flags\n"); 00073 exit(1); 00074 } 00075 00076 /* If placing and timing is enabled, default to a timing placer */ 00077 TimingPlacer = (Placer && TimingEnabled); 00078 if(Options.Count[OT_PLACE_ALGORITHM] > 0) 00079 { 00080 if((PATH_TIMING_DRIVEN_PLACE != Options.PlaceAlgorithm) && 00081 (NET_TIMING_DRIVEN_PLACE != Options.PlaceAlgorithm)) 00082 { 00083 /* Turn off the timing placer if they request a different placer */ 00084 TimingPlacer = FALSE; 00085 } 00086 } 00087 00088 /* If routing and timing is enabled, default to a timing router */ 00089 TimingRouter = (Router && TimingEnabled); 00090 if(Options.Count[OT_ROUTER_ALGORITHM] > 0) 00091 { 00092 if(TIMING_DRIVEN != Options.RouterAlgorithm) 00093 { 00094 /* Turn off the timing router if they request a different router */ 00095 TimingRouter = FALSE; 00096 } 00097 } 00098 00099 Yes = OT_BASE_UNKNOWN; 00100 if(Options.Count[OT_SEED] > 0) 00101 { 00102 Yes = OT_SEED; 00103 } 00104 if(Options.Count[OT_INNER_NUM] > 0) 00105 { 00106 Yes = OT_INNER_NUM; 00107 } 00108 if(Options.Count[OT_INIT_T] > 0) 00109 { 00110 Yes = OT_INIT_T; 00111 } 00112 if(Options.Count[OT_ALPHA_T] > 0) 00113 { 00114 Yes = OT_ALPHA_T; 00115 } 00116 if(Options.Count[OT_EXIT_T] > 0) 00117 { 00118 Yes = OT_EXIT_T; 00119 } 00120 if(Options.Count[OT_FIX_PINS] > 0) 00121 { 00122 Yes = OT_FIX_PINS; 00123 } 00124 if(Options.Count[OT_PLACE_ALGORITHM] > 0) 00125 { 00126 Yes = OT_PLACE_ALGORITHM; 00127 } 00128 if(Options.Count[OT_PLACE_COST_TYPE] > 0) 00129 { 00130 Yes = OT_PLACE_COST_TYPE; 00131 } 00132 if(Options.Count[OT_PLACE_COST_EXP] > 0) 00133 { 00134 Yes = OT_PLACE_COST_EXP; 00135 } 00136 if(Options.Count[OT_PLACE_CHAN_WIDTH] > 0) 00137 { 00138 Yes = OT_PLACE_CHAN_WIDTH; 00139 } 00140 if(Options.Count[OT_NUM_REGIONS] > 0) 00141 { 00142 Yes = OT_NUM_REGIONS; 00143 } 00144 if(Options.Count[OT_ENABLE_TIMING_COMPUTATIONS] > 0) 00145 { 00146 Yes = OT_ENABLE_TIMING_COMPUTATIONS; 00147 } 00148 if(Options.Count[OT_BLOCK_DIST] > 0) 00149 { 00150 Yes = OT_BLOCK_DIST; 00151 } 00152 /* Make sure if place is off none of those options were given */ 00153 if((FALSE == Placer) && (Yes < OT_BASE_UNKNOWN)) 00154 { 00155 Cur = OptionBaseTokenList; 00156 while(Cur->Str) 00157 { 00158 if(Yes == Cur->Enum) 00159 { 00160 printf(ERRTAG 00161 "Option '%s' is not allowed when placement is " 00162 "not run.\n", Cur->Str); 00163 exit(1); 00164 } 00165 ++Cur; 00166 } 00167 } 00168 00169 Yes = OT_BASE_UNKNOWN; 00170 if(Options.Count[OT_TIMING_TRADEOFF] > 0) 00171 { 00172 Yes = OT_TIMING_TRADEOFF; 00173 } 00174 if(Options.Count[OT_RECOMPUTE_CRIT_ITER] > 0) 00175 { 00176 Yes = OT_RECOMPUTE_CRIT_ITER; 00177 } 00178 if(Options.Count[OT_INNER_LOOP_RECOMPUTE_DIVIDER] > 0) 00179 { 00180 Yes = OT_INNER_LOOP_RECOMPUTE_DIVIDER; 00181 } 00182 if(Options.Count[OT_TD_PLACE_EXP_FIRST] > 0) 00183 { 00184 Yes = OT_TD_PLACE_EXP_FIRST; 00185 } 00186 if(Options.Count[OT_TD_PLACE_EXP_LAST] > 0) 00187 { 00188 Yes = OT_TD_PLACE_EXP_LAST; 00189 } 00190 /* Make sure if place is off none of those options were given */ 00191 if((FALSE == TimingPlacer) && (Yes < OT_BASE_UNKNOWN)) 00192 { 00193 Cur = OptionBaseTokenList; 00194 while(Cur->Str) 00195 { 00196 if(Yes == Cur->Enum) 00197 { 00198 printf(ERRTAG 00199 "Option '%s' is not allowed when timing placement is " 00200 "not used.\n", Cur->Str); 00201 exit(1); 00202 } 00203 ++Cur; 00204 } 00205 } 00206 00207 Yes = OT_BASE_UNKNOWN; 00208 if(Options.Count[OT_ROUTE_TYPE] > 0) 00209 { 00210 Yes = OT_ROUTE_TYPE; 00211 } 00212 if(Options.Count[OT_ROUTE_CHAN_WIDTH] > 0) 00213 { 00214 Yes = OT_ROUTE_CHAN_WIDTH; 00215 } 00216 if(Options.Count[OT_ROUTER_ALGORITHM] > 0) 00217 { 00218 Yes = OT_ROUTER_ALGORITHM; 00219 } 00220 if(Options.Count[OT_MAX_ROUTER_ITERATIONS] > 0) 00221 { 00222 Yes = OT_MAX_ROUTER_ITERATIONS; 00223 } 00224 if(Options.Count[OT_INITIAL_PRES_FAC] > 0) 00225 { 00226 Yes = OT_INITIAL_PRES_FAC; 00227 } 00228 if(Options.Count[OT_FIRST_ITER_PRES_FAC] > 0) 00229 { 00230 Yes = OT_FIRST_ITER_PRES_FAC; 00231 } 00232 if(Options.Count[OT_PRES_FAC_MULT] > 0) 00233 { 00234 Yes = OT_PRES_FAC_MULT; 00235 } 00236 if(Options.Count[OT_ACC_FAC] > 0) 00237 { 00238 Yes = OT_ACC_FAC; 00239 } 00240 if(Options.Count[OT_BB_FACTOR] > 0) 00241 { 00242 Yes = OT_BB_FACTOR; 00243 } 00244 if(Options.Count[OT_BASE_COST_TYPE] > 0) 00245 { 00246 Yes = OT_BASE_COST_TYPE; 00247 } 00248 if(Options.Count[OT_BEND_COST] > 0) 00249 { 00250 Yes = OT_BEND_COST; 00251 } 00252 if(Options.Count[OT_BASE_COST_TYPE] > 0) 00253 { 00254 Yes = OT_BASE_COST_TYPE; 00255 } 00256 if(Options.Count[OT_ASTAR_FAC] > 0) 00257 { 00258 Yes = OT_ASTAR_FAC; 00259 } 00260 /* Make sure if router is off none of those options were given */ 00261 if((FALSE == Router) && (Yes < OT_BASE_UNKNOWN)) 00262 { 00263 Cur = OptionBaseTokenList; 00264 while(Cur->Str) 00265 { 00266 if(Yes == Cur->Enum) 00267 { 00268 printf(ERRTAG 00269 "Option '%s' is not allowed when router is " 00270 "not used.\n", Cur->Str); 00271 exit(1); 00272 } 00273 ++Cur; 00274 } 00275 } 00276 00277 Yes = OT_BASE_UNKNOWN; 00278 if(Options.Count[OT_MAX_CRITICALITY] > 0) 00279 { 00280 Yes = OT_MAX_CRITICALITY; 00281 } 00282 if(Options.Count[OT_CRITICALITY_EXP] > 0) 00283 { 00284 Yes = OT_CRITICALITY_EXP; 00285 } 00286 /* Make sure if timing router is off none of those options were given */ 00287 if((FALSE == TimingRouter) && (Yes < OT_BASE_UNKNOWN)) 00288 { 00289 Cur = OptionBaseTokenList; 00290 while(Cur->Str) 00291 { 00292 if(Yes == Cur->Enum) 00293 { 00294 printf(ERRTAG 00295 "Option '%s' is not allowed when timing router is " 00296 "not used.\n", Cur->Str); 00297 exit(1); 00298 } 00299 ++Cur; 00300 } 00301 } 00302 }
void CheckSetup | ( | IN enum e_operation | Operation, | |
IN struct s_placer_opts | PlacerOpts, | |||
IN struct s_annealing_sched | AnnealSched, | |||
IN struct s_router_opts | RouterOpts, | |||
IN struct s_det_routing_arch | RoutingArch, | |||
IN t_segment_inf * | Segments, | |||
IN t_timing_inf | Timing, | |||
IN t_subblock_data | Subblocks, | |||
IN t_chan_width_dist | Chans | |||
) |
Definition at line 11 of file CheckSetup.c.
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 /* Note that this may work together, but I have not tested it */ 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 /* Works, but very weird. Can't optimize timing well, since you're 00059 * not doing proper architecture delay modelling. */ 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 /* May work, not tested */ 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 }
Definition at line 1016 of file SetupVPR.c.
01017 { 01018 /* First priority to the '--timing_analysis' flag */ 01019 if(Options.Count[OT_TIMING_ANALYSIS]) 01020 { 01021 return Options.TimingAnalysis; 01022 } 01023 return TRUE; 01024 }
void SetupVPR | ( | IN t_options | Options, | |
IN boolean | TimingEnabled, | |||
OUT t_arch * | Arch, | |||
OUT enum e_operation * | Operation, | |||
OUT struct s_placer_opts * | PlacerOpts, | |||
OUT struct s_annealing_sched * | AnnealSched, | |||
OUT struct s_router_opts * | RouterOpts, | |||
OUT struct s_det_routing_arch * | RoutingArch, | |||
OUT t_segment_inf ** | Segments, | |||
OUT t_timing_inf * | Timing, | |||
OUT t_subblock_data * | Subblocks, | |||
OUT boolean * | ShowGraphics, | |||
OUT int * | GraphPause | |||
) |
Definition at line 49 of file SetupVPR.c.
00062 { 00063 00064 SetupOperation(Options, Operation); 00065 SetupPlacerOpts(Options, TimingEnabled, PlacerOpts); 00066 SetupAnnealSched(Options, AnnealSched); 00067 SetupRouterOpts(Options, TimingEnabled, RouterOpts); 00068 00069 XmlReadArch(Options.ArchFile, TimingEnabled, Arch, 00070 &type_descriptors, &num_types); 00071 00072 *Segments = Arch->Segments; 00073 RoutingArch->num_segment = Arch->num_segments; 00074 00075 SetupSwitches(*Arch, RoutingArch, Arch->Switches, Arch->num_switches); 00076 SetupRoutingArch(*Arch, RoutingArch); 00077 SetupTiming(Options, *Arch, TimingEnabled, *Operation, 00078 *PlacerOpts, *RouterOpts, Timing); 00079 00080 /* init global variables */ 00081 OutFilePrefix = Options.OutFilePrefix; 00082 grid_logic_tile_area = Arch->grid_logic_tile_area; 00083 ipin_mux_trans_size = Arch->ipin_mux_trans_size; 00084 00085 /* Set seed for pseudo-random placement, default seed to 1 */ 00086 PlacerOpts->seed = 1; 00087 if(Options.Count[OT_SEED]) 00088 { 00089 PlacerOpts->seed = Options.Seed; 00090 } 00091 my_srandom(PlacerOpts->seed); 00092 00093 *GraphPause = 1; /* DEFAULT */ 00094 if(Options.Count[OT_AUTO]) 00095 { 00096 *GraphPause = Options.GraphPause; 00097 } 00098 #ifdef NO_GRAPHICS 00099 *ShowGraphics = FALSE; /* DEFAULT */ 00100 #else /* NO_GRAPHICS */ 00101 *ShowGraphics = TRUE; /* DEFAULT */ 00102 if(Options.Count[OT_NODISP]) 00103 { 00104 *ShowGraphics = FALSE; 00105 } 00106 #endif /* NO_GRAPHICS */ 00107 00108 #ifdef CREATE_ECHO_FILES 00109 EchoArch("arch.echo", type_descriptors, num_types); 00110 #endif 00111 00112 if(Options.NetFile) 00113 { 00114 read_netlist(Options.NetFile, num_types, type_descriptors, 00115 IO_TYPE, 0, 1, Subblocks, &num_blocks, &block, 00116 &num_nets, &net); 00117 /* This is done so that all blocks have subblocks and can be treated the same */ 00118 load_subblock_info_to_type(Subblocks, IO_TYPE); 00119 check_netlist(Subblocks); 00120 } 00121 00122 InitArch(*Arch); 00123 }
void ShowSetup | ( | IN t_options | Options, | |
IN t_arch | Arch, | |||
IN boolean | TimingEnabled, | |||
IN enum e_operation | Operation, | |||
IN struct s_placer_opts | PlacerOpts, | |||
IN struct s_annealing_sched | AnnealSched, | |||
IN struct s_router_opts | RouterOpts, | |||
IN struct s_det_routing_arch | RoutingArch, | |||
IN t_segment_inf * | Segments, | |||
IN t_timing_inf | Timing, | |||
IN t_subblock_data | Subblocks | |||
) |
Definition at line 24 of file ShowSetup.c.
00035 { 00036 int i, j, num_p_inputs, num_p_outputs; 00037 00038 printf("Timing analysis: %s\n", (TimingEnabled ? "ON" : "OFF")); 00039 printf("\n"); 00040 00041 ShowOperation(Operation); 00042 ShowPlacerOpts(Options, PlacerOpts, AnnealSched); 00043 if((ROUTE_ONLY == Operation) || (PLACE_AND_ROUTE == Operation)) 00044 { 00045 ShowRouterOpts(RouterOpts); 00046 } 00047 else 00048 { 00049 printf("Router: DISABLED\n\n"); 00050 } 00051 00052 if(DETAILED == RouterOpts.route_type) 00053 ShowRoutingArch(RoutingArch); 00054 00055 printf("The circuit will be mapped into a %d x %d array of clbs.\n", 00056 nx, ny); 00057 printf("\n"); 00058 printf("Netlist num_nets: %d\n", num_nets); 00059 printf("Netlist num_blocks: %d\n", num_blocks); 00060 00061 /* Count I/O input and output pads */ 00062 num_p_inputs = 0; 00063 num_p_outputs = 0; 00064 for(i = 0; i < num_blocks; i++) 00065 { 00066 if(block[i].type == IO_TYPE) 00067 { 00068 for(j = 0; j < IO_TYPE->num_pins; j++) 00069 { 00070 if(block[i].nets[j] != OPEN) 00071 { 00072 if(IO_TYPE-> 00073 class_inf[IO_TYPE->pin_class[j]]. 00074 type == DRIVER) 00075 { 00076 num_p_inputs++; 00077 } 00078 else 00079 { 00080 assert(IO_TYPE-> 00081 class_inf[IO_TYPE-> 00082 pin_class[j]]. 00083 type == RECEIVER); 00084 num_p_outputs++; 00085 } 00086 } 00087 } 00088 } 00089 } 00090 00091 /* Print out each block separately instead */ 00092 printf("Netlist inputs pins: %d\n", num_p_inputs); 00093 printf("Netlist output pins: %d\n", num_p_outputs); 00094 printf("\n"); 00095 }