48 OUTP boolean * ShowGraphics,
OUTP int *GraphPause,
52 len = strlen(Options->CircuitName) + 6;
53 if (Options->out_file_prefix != NULL ) {
54 len += strlen(Options->out_file_prefix);
57 if (Options->out_file_prefix == NULL ) {
61 Options->CircuitName);
65 if (Options->BlifFile == NULL ) {
66 len = strlen(Options->CircuitName) + 6;
67 if (Options->out_file_prefix != NULL ) {
68 len += strlen(Options->out_file_prefix);
70 Options->BlifFile = (
char*)
my_calloc(len,
sizeof(
char));
71 if (Options->out_file_prefix == NULL ) {
72 sprintf(Options->BlifFile,
"%s.blif", Options->CircuitName);
74 sprintf(Options->BlifFile,
"%s%s.blif", Options->out_file_prefix,
75 Options->CircuitName);
79 if (Options->NetFile == NULL ) {
80 len = strlen(Options->CircuitName) + 5;
81 if (Options->out_file_prefix != NULL ) {
82 len += strlen(Options->out_file_prefix);
84 Options->NetFile = (
char*)
my_calloc(len,
sizeof(
char));
85 if (Options->out_file_prefix == NULL ) {
86 sprintf(Options->NetFile,
"%s.net", Options->CircuitName);
88 sprintf(Options->NetFile,
"%s%s.net", Options->out_file_prefix,
89 Options->CircuitName);
93 if (Options->PlaceFile == NULL ) {
94 len = strlen(Options->CircuitName) + 7;
95 if (Options->out_file_prefix != NULL ) {
96 len += strlen(Options->out_file_prefix);
98 Options->PlaceFile = (
char*)
my_calloc(len,
sizeof(
char));
99 if (Options->out_file_prefix == NULL ) {
100 sprintf(Options->PlaceFile,
"%s.place", Options->CircuitName);
102 sprintf(Options->PlaceFile,
"%s%s.place", Options->out_file_prefix,
103 Options->CircuitName);
107 if (Options->RouteFile == NULL ) {
108 len = strlen(Options->CircuitName) + 7;
109 if (Options->out_file_prefix != NULL ) {
110 len += strlen(Options->out_file_prefix);
112 Options->RouteFile = (
char*)
my_calloc(len,
sizeof(
char));
113 if (Options->out_file_prefix == NULL ) {
114 sprintf(Options->RouteFile,
"%s.route", Options->CircuitName);
116 sprintf(Options->RouteFile,
"%s%s.route", Options->out_file_prefix,
117 Options->CircuitName);
120 if (Options->ActFile == NULL ) {
121 len = strlen(Options->CircuitName) + 7;
122 if (Options->out_file_prefix != NULL ) {
123 len += strlen(Options->out_file_prefix);
125 Options->ActFile = (
char*)
my_calloc(len,
sizeof(
char));
126 if (Options->out_file_prefix == NULL ) {
127 sprintf(Options->ActFile,
"%s.act", Options->CircuitName);
129 sprintf(Options->ActFile,
"%s%s.act", Options->out_file_prefix,
130 Options->CircuitName);
134 if (Options->PowerFile == NULL ) {
135 len = strlen(Options->CircuitName) + 7;
136 if (Options->out_file_prefix != NULL ) {
137 len += strlen(Options->out_file_prefix);
139 Options->PowerFile = (
char*)
my_calloc(len,
sizeof(
char));
140 if (Options->out_file_prefix == NULL ) {
141 sprintf(Options->PowerFile,
"%s.power", Options->CircuitName);
143 sprintf(Options->ActFile,
"%s%s.power", Options->out_file_prefix,
144 Options->CircuitName);
150 FileNameOpts->CircuitName = Options->CircuitName;
151 FileNameOpts->ArchFile = Options->ArchFile;
152 FileNameOpts->BlifFile = Options->BlifFile;
153 FileNameOpts->NetFile = Options->NetFile;
154 FileNameOpts->PlaceFile = Options->PlaceFile;
155 FileNameOpts->RouteFile = Options->RouteFile;
156 FileNameOpts->ActFile = Options->ActFile;
157 FileNameOpts->PowerFile = Options->PowerFile;
158 FileNameOpts->CmosTechFile = Options->CmosTechFile;
159 FileNameOpts->out_file_prefix = Options->out_file_prefix;
167 if (readArchFile ==
TRUE) {
172 *user_models = Arch->models;
173 *library_models = Arch->model_library;
195 *Segments = Arch->Segments;
196 RoutingArch->num_segment = Arch->num_segments;
198 SetupSwitches(*Arch, RoutingArch, Arch->Switches, Arch->num_switches);
200 SetupTiming(*Options, *Arch, TimingEnabled, *Operation, *PlacerOpts,
201 *RouterOpts, Timing);
211 PlacerOpts->seed = 1;
213 PlacerOpts->seed = Options->Seed;
217 vpr_printf(TIO_MESSAGE_INFO,
"Building complex block graph.\n");
226 *GraphPause = Options->GraphPause;
229 *ShowGraphics =
FALSE;
231 *ShowGraphics =
TRUE;
233 *ShowGraphics =
FALSE;
250 if (
FALSE == TimingEnabled) {
252 Timing->timing_analysis_enabled =
FALSE;
256 Timing->C_ipin_cblock = Arch.C_ipin_cblock;
257 Timing->T_ipin_cblock = Arch.T_ipin_cblock;
258 Timing->timing_analysis_enabled = TimingEnabled;
261 if (Options.SDCFile == NULL ) {
262 Timing->SDCFile = (
char*)
my_calloc(strlen(Options.CircuitName) + 5,
264 sprintf(Timing->SDCFile,
"%s.sdc", Options.CircuitName);
266 Timing->SDCFile = (
char*)
my_strdup(Options.SDCFile);
276 RoutingArch->num_switch = NumArchSwitches;
279 RoutingArch->wire_to_ipin_switch = RoutingArch->num_switch;
280 ++RoutingArch->num_switch;
283 RoutingArch->delayless_switch = RoutingArch->num_switch;
284 RoutingArch->global_route_switch = RoutingArch->delayless_switch;
285 ++RoutingArch->num_switch;
308 switch_inf[RoutingArch->wire_to_ipin_switch].
R = 0.;
309 switch_inf[RoutingArch->wire_to_ipin_switch].
Cin = Arch.C_ipin_cblock;
311 switch_inf[RoutingArch->wire_to_ipin_switch].
Tdel = Arch.T_ipin_cblock;
321 RoutingArch->switch_block_type = Arch.SBType;
322 RoutingArch->R_minW_nmos = Arch.R_minW_nmos;
323 RoutingArch->R_minW_pmos = Arch.R_minW_pmos;
324 RoutingArch->Fs = Arch.Fs;
327 RoutingArch->directionality = Arch.Segments[0].directionality;
332 RouterOpts->astar_fac = 1.2;
334 RouterOpts->astar_fac = Options.astar_fac;
337 RouterOpts->bb_factor = 3;
339 RouterOpts->bb_factor = 0;
342 RouterOpts->bb_factor = Options.bb_factor;
345 RouterOpts->criticality_exp = 1.0;
347 RouterOpts->criticality_exp = Options.criticality_exp;
350 RouterOpts->max_criticality = 0.99;
352 RouterOpts->max_criticality = Options.max_criticality;
355 RouterOpts->max_router_iterations = 50;
357 RouterOpts->max_router_iterations = 10;
360 RouterOpts->max_router_iterations = Options.max_router_iterations;
363 RouterOpts->pres_fac_mult = 1.3;
365 RouterOpts->pres_fac_mult = Options.pres_fac_mult;
370 RouterOpts->route_type = Options.RouteType;
373 RouterOpts->full_stats =
FALSE;
375 RouterOpts->full_stats =
TRUE;
378 RouterOpts->verify_binary_search =
FALSE;
380 RouterOpts->verify_binary_search =
TRUE;
384 RouterOpts->router_algorithm =
NO_TIMING;
388 if (
GLOBAL == RouterOpts->route_type) {
389 RouterOpts->router_algorithm =
NO_TIMING;
392 RouterOpts->router_algorithm = Options.RouterAlgorithm;
397 RouterOpts->fixed_channel_width = Options.RouteChanWidth;
401 RouterOpts->initial_pres_fac = 0.5;
403 RouterOpts->initial_pres_fac = 10000.0;
406 RouterOpts->initial_pres_fac = Options.initial_pres_fac;
414 if (
NO_TIMING == RouterOpts->router_algorithm) {
418 RouterOpts->base_cost_type = Options.base_cost_type;
422 RouterOpts->first_iter_pres_fac = 0.5;
424 RouterOpts->first_iter_pres_fac = 0.0;
427 RouterOpts->first_iter_pres_fac = 10000.0;
430 RouterOpts->first_iter_pres_fac = Options.first_iter_pres_fac;
434 RouterOpts->acc_fac = 1.0;
436 RouterOpts->acc_fac = 0.2;
439 RouterOpts->acc_fac = Options.acc_fac;
443 RouterOpts->bend_cost = 0.0;
444 if (
GLOBAL == RouterOpts->route_type) {
445 RouterOpts->bend_cost = 1.0;
448 RouterOpts->bend_cost = Options.bend_cost;
451 RouterOpts->doRouting =
FALSE;
453 RouterOpts->doRouting =
TRUE;
457 RouterOpts->doRouting =
TRUE;
464 AnnealSched->alpha_t = 0.8;
466 AnnealSched->alpha_t = Options.PlaceAlphaT;
468 if (AnnealSched->alpha_t >= 1 || AnnealSched->alpha_t <= 0) {
470 "alpha_t must be between 0 and 1 exclusive.\n");
473 AnnealSched->exit_t = 0.01;
475 AnnealSched->exit_t = Options.PlaceExitT;
477 if (AnnealSched->exit_t <= 0) {
478 vpr_printf(TIO_MESSAGE_ERROR,
"exit_t must be greater than 0.\n");
481 AnnealSched->init_t = 100.0;
483 AnnealSched->init_t = Options.PlaceInitT;
485 if (AnnealSched->init_t <= 0) {
486 vpr_printf(TIO_MESSAGE_ERROR,
"init_t must be greater than 0.\n");
489 if (AnnealSched->init_t < AnnealSched->exit_t) {
491 "init_t must be greater or equal to than exit_t.\n");
494 AnnealSched->inner_num = 1.0;
496 AnnealSched->inner_num = Options.PlaceInnerNum;
498 if (AnnealSched->inner_num <= 0) {
499 vpr_printf(TIO_MESSAGE_ERROR,
"init_t must be greater than 0.\n");
516 if (Arch.clb_grid.IsAuto) {
517 PackerOpts->aspect = Arch.clb_grid.Aspect;
519 PackerOpts->aspect = (float) Arch.clb_grid.H / (
float) Arch.clb_grid.W;
521 PackerOpts->output_file = net_file;
523 PackerOpts->blif_file_name = Options.BlifFile;
525 PackerOpts->doPacking =
FALSE;
527 PackerOpts->doPacking =
TRUE;
531 PackerOpts->doPacking =
TRUE;
534 PackerOpts->global_clocks =
TRUE;
536 PackerOpts->global_clocks = Options.global_clocks;
539 PackerOpts->hill_climbing_flag =
FALSE;
541 PackerOpts->hill_climbing_flag = Options.hill_climbing_flag;
544 PackerOpts->sweep_hanging_nets_and_inputs =
TRUE;
546 PackerOpts->sweep_hanging_nets_and_inputs =
547 Options.sweep_hanging_nets_and_inputs;
550 PackerOpts->skip_clustering =
FALSE;
552 PackerOpts->skip_clustering =
TRUE;
554 PackerOpts->allow_unrelated_clustering =
TRUE;
556 PackerOpts->allow_unrelated_clustering =
557 Options.allow_unrelated_clustering;
559 PackerOpts->allow_early_exit =
FALSE;
561 PackerOpts->allow_early_exit = Options.allow_early_exit;
563 PackerOpts->connection_driven =
TRUE;
565 PackerOpts->connection_driven = Options.connection_driven;
568 PackerOpts->timing_driven = TimingEnabled;
570 PackerOpts->timing_driven = Options.timing_driven;
572 PackerOpts->cluster_seed_type = (
575 PackerOpts->cluster_seed_type = Options.cluster_seed_type;
577 PackerOpts->alpha = 0.75;
579 PackerOpts->alpha = Options.alpha;
581 PackerOpts->beta = 0.9;
583 PackerOpts->beta = Options.beta;
587 PackerOpts->recompute_timing_after =
MAX_SHORT;
589 PackerOpts->recompute_timing_after = Options.recompute_timing_after;
591 PackerOpts->block_delay = 0;
593 PackerOpts->block_delay = Options.block_delay;
595 PackerOpts->intra_cluster_net_delay = 0;
597 PackerOpts->intra_cluster_net_delay = Options.intra_cluster_net_delay;
599 PackerOpts->inter_cluster_net_delay = 1.0;
600 PackerOpts->auto_compute_inter_cluster_net_delay =
TRUE;
602 PackerOpts->inter_cluster_net_delay = Options.inter_cluster_net_delay;
603 PackerOpts->auto_compute_inter_cluster_net_delay =
FALSE;
608 PackerOpts->packer_algorithm = Options.packer_algorithm;
616 PlacerOpts->block_dist = 1;
618 PlacerOpts->block_dist = Options.block_dist;
621 PlacerOpts->inner_loop_recompute_divider = 0;
623 PlacerOpts->inner_loop_recompute_divider =
624 Options.inner_loop_recompute_divider;
627 PlacerOpts->place_cost_exp = 1.;
629 PlacerOpts->place_cost_exp = Options.place_cost_exp;
632 PlacerOpts->td_place_exp_first = 1.;
634 PlacerOpts->td_place_exp_first = Options.place_exp_first;
637 PlacerOpts->td_place_exp_last = 8.;
639 PlacerOpts->td_place_exp_last = Options.place_exp_last;
647 PlacerOpts->place_algorithm = Options.PlaceAlgorithm;
650 PlacerOpts->pad_loc_file = NULL;
652 if (Options.PinFile) {
653 PlacerOpts->pad_loc_file =
my_strdup(Options.PinFile);
657 PlacerOpts->pad_loc_type =
FREE;
659 PlacerOpts->pad_loc_type = (Options.PinFile ?
USER :
RANDOM);
662 PlacerOpts->place_chan_width = 100;
664 PlacerOpts->place_chan_width = Options.PlaceChanWidth;
667 PlacerOpts->recompute_crit_iter = 1;
669 PlacerOpts->recompute_crit_iter = Options.RecomputeCritIter;
672 PlacerOpts->timing_tradeoff = 0.5;
674 PlacerOpts->timing_tradeoff = Options.PlaceTimingTradeoff;
678 PlacerOpts->enable_timing_computations =
FALSE;
681 PlacerOpts->enable_timing_computations =
TRUE;
684 PlacerOpts->enable_timing_computations = Options.ShowPlaceTiming;
693 PlacerOpts->doPlacement =
FALSE;
695 PlacerOpts->doPlacement =
TRUE;
699 PlacerOpts->doPlacement =
TRUE;
701 if (PlacerOpts->doPlacement ==
FALSE) {
static void SetupTiming(INP t_options Options, INP t_arch Arch, INP boolean TimingEnabled, INP enum e_operation Operation, INP struct s_placer_opts PlacerOpts, INP struct s_router_opts RouterOpts, OUTP t_timing_inf *Timing)
static void SetupRouterOpts(INP t_options Options, INP boolean TimingEnabled, OUTP struct s_router_opts *RouterOpts)
void EchoArch(INP const char *EchoFile, INP const t_type_descriptor *Types, INP int NumTypes, struct s_arch *arch)
int Count[OT_BASE_UNKNOWN]
void * my_calloc(size_t nelem, size_t size)
static void SetupSwitches(INP t_arch Arch, INOUTP struct s_det_routing_arch *RoutingArch, INP struct s_switch_inf *ArchSwitches, INP int NumArchSwitches)
t_clock_arch * g_clock_arch
void alloc_and_load_all_pb_graphs(boolean load_power_structures)
boolean getEchoEnabled(void)
void XmlReadArch(INP const char *ArchFile, INP boolean timing_enabled, OUTP struct s_arch *arch, OUTP t_type_descriptor **Types, OUTP int *NumTypes)
static void SetupAnnealSched(INP t_options Options, OUTP struct s_annealing_sched *AnnealSched)
void SetupVPR(INP t_options *Options, INP boolean TimingEnabled, INP boolean readArchFile, OUTP struct s_file_name_opts *FileNameOpts, INOUTP t_arch *Arch, OUTP enum e_operation *Operation, OUTP t_model **user_models, OUTP t_model **library_models, OUTP struct s_packer_opts *PackerOpts, OUTP struct s_placer_opts *PlacerOpts, OUTP struct s_annealing_sched *AnnealSched, OUTP struct s_router_opts *RouterOpts, OUTP struct s_det_routing_arch *RoutingArch, OUTP t_segment_inf **Segments, OUTP t_timing_inf *Timing, OUTP boolean *ShowGraphics, OUTP int *GraphPause, t_power_opts *PowerOpts)
static void SetupPlacerOpts(INP t_options Options, INP boolean TimingEnabled, OUTP struct s_placer_opts *PlacerOpts)
static void * my_malloc(int ibytes)
void echo_pb_graph(char *filename)
char * default_output_name
static void SetupOperation(INP t_options Options, OUTP enum e_operation *Operation)
struct s_switch_inf * switch_inf
boolean isEchoFileEnabled(enum e_echo_files echo_option)
static void SetupPackerOpts(INP t_options Options, INP boolean TimingEnabled, INP t_arch Arch, INP char *net_file, OUTP struct s_packer_opts *PackerOpts)
static void SetupPowerOpts(t_options Options, t_power_opts *power_opts, t_arch *Arch)
static void SetupRoutingArch(INP t_arch Arch, OUTP struct s_det_routing_arch *RoutingArch)
#define NO_FIXED_CHANNEL_WIDTH
float grid_logic_tile_area
struct s_type_descriptor * type_descriptors
char * getEchoFileName(enum e_echo_files echo_option)
e_power_buffer_type power_buffer_type
char * my_strdup(const char *str)
void alloc_and_load_output_file_names(const char *default_name)
float ipin_mux_trans_size
void my_srandom(int seed)