示例#1
0
void
global_setup( int use_random, int hash_bits ) {
  FILE *log_file;
  time_t timer;

  /* Clear the log file. No error handling done. */

#if defined(ANDROID)
  sprintf(log_file_path, "%s/%s", android_files_dir, LOG_FILE_NAME);
#elif defined(__linux__)
  strcpy( log_file_path, LOG_FILE_NAME );
#else
  char directory_buffer[MAX_PATH_LENGTH];
  getcwd( directory_buffer, MAX_PATH_LENGTH );
  if ( directory_buffer[strlen( directory_buffer ) - 1] == '\\' )
    sprintf( log_file_path, "%s%s", directory_buffer, LOG_FILE_NAME );
  else
    sprintf( log_file_path, "%s\\%s", directory_buffer, LOG_FILE_NAME );
#endif

  if ( use_log_file ) {
    log_file = fopen( log_file_path, "w" );
    if ( log_file != NULL ) {
      time( &timer );
      fprintf( log_file, "%s %s\n", LOG_TEXT, ctime( &timer ) );
      fprintf( log_file, "%s %s %s\n", ENGINE_TEXT, __DATE__, __TIME__ );
      fclose( log_file );
    }
  }

  if ( use_random ) {
    time( &timer );
    my_srandom( timer );
  }
  else
    my_srandom( 1 );

  init_hash( hash_bits );
  init_bitboard();
  init_moves();
  init_patterns();
  init_coeffs();
  init_timer();
  init_probcut();
  init_stable();
  setup_search();
}
//_________________________________________________________________________
int parse_options(int &argc, char** &argv) {
  bool HELP = false;
  int argc0 = argc;
  argc = 1;
  for(int a=1; a<argc0; a++) {
    if(strcmp(argv[a],"-v")==0) SET_VERBOSE(VERBOSE_SOME);
    else if(strcmp(argv[a],"-vv")==0) SET_VERBOSE(VERBOSE_LOTS);
    else if(strcmp(argv[a],"-s")==0) my_srandom(0);
    else if(strcmp(argv[a],"-?")==0 || strcmp(argv[1],"--help")==0 || strcmp(argv[1],"/?")==0) HELP = true;
    else if(strcmp(argv[a],"-t")==0) MONITOR_TIME = true;
    else if(strcmp(argv[a],"-g")==0) SHUFFLE_TYPE = GKAN_HEURISTICS;
    else if(strcmp(argv[a],"-b")==0) SHUFFLE_TYPE = BRUTE_FORCE_HEURISTICS;
    else if(strcmp(argv[a],"-f")==0) SHUFFLE_TYPE = FAB_HEURISTICS;
    else if(strcmp(argv[a],"-o")==0) SHUFFLE_TYPE = OPTIMAL_HEURISTICS;
    else if(strcmp(argv[a],"-raw")==0) RAW_DEGREES=true;
    else // No option present
      argv[argc++] = argv[a];
  }
  if(!HELP && argc==2) {
    Fdeg = fopen(argv[1],"r");
    if(Fdeg==NULL) {
      fprintf(stderr,"Error : couldn't open file \"%s\" for reading\n",argv[1]);
      return -1;
    }
    argv[1]=argv[0];
    argv++;
    argc--;
  }
  if(HELP || argc!=1) {
    fprintf(stderr,"Usage : %s [options] [file containing degree distribution]\n",argv[0]);
    fprintf(stderr," -> %s returns a graph in its standard output\n",argv[0]);
    fprintf(stderr,"    If no file is given, %s reads its standard input\n",argv[0]);
    fprintf(stderr,"    [-v] and [-vv] options causes extra verbose.\n");
    fprintf(stderr,"    [-g] option uses the Gkantsidis heuristics.\n");
    fprintf(stderr,"    [-b] option uses the Brute Force heuristics.\n");
    fprintf(stderr,"    [-f] option uses the Modified Gkantsidis heuristics.\n");
    fprintf(stderr,"    [-o] option uses the Optimal Gkantsidis heuristics.\n");
    fprintf(stderr,"    [-t] option monitors computation time\n");
    fprintf(stderr,"    [-s] does a srandom(0) to get a constant random graph\n");
    fprintf(stderr,"    [-raw] is to take raw degree sequences as input\n");
    return -1;
  }
  return 0;
}
示例#3
0
JNIEXPORT void
JNIFn(zebra, ZebraEngine, zeGlobalInit)(JNIEnv *env, jobject thiz, jstring files_dir) {
    DROIDZEBRA_JNI_SETUP;

    char binbookpath[FILENAME_MAX], cmpbookpath[FILENAME_MAX];
    time_t timer;

    echo = TRUE;
    display_pv = DEFAULT_DISPLAY_PV;
    skill[BLACKSQ] = skill[WHITESQ] = -1;
    player_time[BLACKSQ] = player_time[WHITESQ] = INFINIT_TIME;
    player_increment[BLACKSQ] = player_increment[WHITESQ] = 0.0;

    const char *str;
    str = (*env)->GetStringUTFChars(env, files_dir, NULL);
    if (str == NULL) {
        DROIDZEBRA_JNI_CLEAN;
        return; /* OutOfMemoryError already thrown */
    }
    strncpy(android_files_dir, str, sizeof(android_files_dir) - 1);
    (*env)->ReleaseStringUTFChars(env, files_dir, str);

    toggle_status_log(USE_LOG);

    global_setup(DEFAULT_RANDOM, DEFAULT_HASH_BITS);
    init_thor_database();

    sprintf(cmpbookpath, "%s/book.cmp.z", android_files_dir);
    sprintf(binbookpath, "%s/book.bin", android_files_dir);
    if (access(cmpbookpath, R_OK) == 0) {
        init_osf(FALSE);
        unpack_compressed_database_gz(cmpbookpath, binbookpath);
        unlink(cmpbookpath);
    }

    init_learn(binbookpath, TRUE);

    time(&timer);
    my_srandom(timer);
    DROIDZEBRA_JNI_CLEAN;
}
示例#4
0
int main()
{
	time_t t;
	long int r;
	int i,j,poss_num,x,y,f;

	t = time(NULL);

	my_srandom(t);

	for(i=0; i<MAX; i++)
	{
		for(j=0; j<MAX; j++)
		{
			pros[i][j].chosed = 0;
			pros[i][j].possible = 1;
		}
	}
	r = random()%(MAX*MAX);
	chose(r,&x,&y);

	printf("%u%u ",x,y);

	for(i=0;i<(MAX*MAX);i++)
	{
		f = get_possible(x,y);

		poss_num = get_possible_num();
		if(poss_num == 0) break;
		r = my_random()%poss_num;

		chose(r,&x,&y);
		printf("%u%u ",x,y);
		
	}

	printf("\n");
}
示例#5
0
static void parse_command (int argc, char *argv[], char *net_file, char
    *arch_file, char *place_file, char *route_file, enum e_operation 
    *operation, float *aspect_ratio,  boolean *full_stats, boolean *user_sized,
    boolean *verify_binary_search, int *gr_automode, boolean *show_graphics,
    struct s_annealing_sched *annealing_sched, struct s_placer_opts
    *placer_opts, struct s_router_opts *router_opts, boolean 
    *timing_analysis_enabled, float *constant_net_delay) {

/* Parse the command line to get the input and output files and options. */

   int i;
   int seed;
   boolean do_one_nonlinear_place, bend_cost_set, base_cost_type_set;

/* Set the defaults.  If the user specified an option on the command *
 * line, the corresponding default is overwritten.                   */

   seed = 1;

/* Flag to check if place_chan_width has been specified. */

   do_one_nonlinear_place = FALSE;
   bend_cost_set = FALSE;
   base_cost_type_set = FALSE;

/* Allows me to see if nx and or ny have been set. */

   nx = 0;
   ny = 0;

   *operation = PLACE_AND_ROUTE;
   annealing_sched->type = AUTO_SCHED;
   annealing_sched->inner_num = 10.;
   annealing_sched->init_t = 100.;
   annealing_sched->alpha_t = 0.8;
   annealing_sched->exit_t = 0.01;

   placer_opts->place_cost_exp = 1.;
   placer_opts->place_cost_type = LINEAR_CONG;
   placer_opts->num_regions = 4;        /* Really 4 x 4 array */
   placer_opts->place_freq = PLACE_ONCE;
   placer_opts->place_chan_width = 100;   /* Reduces roundoff for lin. cong. */
   placer_opts->pad_loc_type = FREE;
   placer_opts->pad_loc_file[0] = '\0';

/* Old values for breadth first router: first_iter_pres_fac = 0, *
 * pres_fac_mult = 2, acc_fac = 0.2.                             */

   router_opts->router_algorithm = TIMING_DRIVEN;
   router_opts->first_iter_pres_fac = 0.5;
   router_opts->initial_pres_fac = 0.5;
   router_opts->pres_fac_mult = 2;
   router_opts->acc_fac = 1;
   router_opts->base_cost_type = DEMAND_ONLY;
   router_opts->bend_cost = 1.;
   router_opts->max_router_iterations = 30;
   router_opts->bb_factor = 3;
   router_opts->route_type = DETAILED;
   router_opts->fixed_channel_width = NO_FIXED_CHANNEL_WIDTH;
   router_opts->astar_fac = 1.2;
   router_opts->max_criticality = 0.99;
   router_opts->criticality_exp = 1.;

   *timing_analysis_enabled = TRUE;
   *aspect_ratio = 1.;
   *full_stats = FALSE;
   *user_sized = FALSE;
   *verify_binary_search = FALSE;  
   *show_graphics = TRUE;
   *gr_automode = 1;     /* Wait for user input only after MAJOR updates. */
   *constant_net_delay = -1;

/* Start parsing the command line.  First four arguments are not   *
 * optional.                                                       */

   if (argc < 5) {
     printf("Usage:  vpr circuit.net fpga.arch placed.out routed.out "
             "[Options ...]\n\n");
     printf("General Options:  [-nodisp] [-auto <int>] [-route_only]\n");
     printf("\t[-place_only] [-timing_analyze_only_with_net_delay <float>]\n");
     printf("\t[-aspect_ratio <float>] [-nx <int>] [-ny <int>] [-fast]\n");
     printf("\t[-full_stats] [-timing_analysis on | off]\n");

     printf("\nPlacer Options:  [-init_t <float>] [-exit_t <float>]\n");
     printf("\t[-alpha_t <float>] [-inner_num <float>] [-seed <int>]\n");
     printf("\t[-place_cost_exp <float>] [-place_cost_type linear | "
                 "nonlinear]\n");
     printf("\t[-place_chan_width <int>] [-num_regions <int>] \n");
     printf("\t[-fix_pins random | <file.pads>]\n");

     printf("\nRouter Options:  [-max_router_iterations <int>] "
                 "[-bb_factor <int>]\n");
     printf("\t[-initial_pres_fac <float>] [-pres_fac_mult <float>]\n"
            "\t[-acc_fac <float>] [-first_iter_pres_fac <float>]\n"
            "\t[-bend_cost <float>] [-route_type global | detailed]\n"
            "\t[-verify_binary_search] [-route_chan_width <int>]\n"
            "\t[-router_algorithm breadth_first | timing_driven]\n"
            "\t[-base_cost_type intrinsic_delay | delay_normalized | "
            "demand_only]\n");

     printf ("\nRouting options valid only for timing-driven routing:\n"
             "\t[-astar_fac <float>] [-max_criticality <float>]\n"
             "\t[-criticality_exp <float>]\n\n");
     exit(1);
   }

   strncpy(net_file,argv[1],BUFSIZE);
   strncpy(arch_file,argv[2],BUFSIZE);
   strncpy(place_file,argv[3],BUFSIZE);
   strncpy(route_file,argv[4],BUFSIZE);
   i = 5;

/* Now get any optional arguments.      */

   while (i < argc) {

      if (strcmp(argv[i],"-aspect_ratio") == 0) {
 
         *aspect_ratio = read_float_option (argc, argv, i);
 
         if (*aspect_ratio <= 0.) {
           printf("Error:  Aspect ratio must be > 0.\n");
           exit(1);
         }
 
         i += 2;
         continue;
      }  

      if (strcmp(argv[i],"-nodisp") == 0) {
         *show_graphics = FALSE;
         i++;
         continue;
      }

      if (strcmp(argv[i],"-auto") == 0) {

         *gr_automode = read_int_option (argc, argv, i);

         if ((*gr_automode > 2) || (*gr_automode < 0)) {
           printf("Error:  -auto value must be between 0 and 2.\n");
           exit(1);
         }

         i += 2;
         continue;
      }

      if (strcmp(argv[i],"-fix_pins") == 0) {
 
        if (argc <= i+1) {
            printf("Error:  -fix_pins option requires a string parameter.\n");
            exit (1);
         }
 
         if (strcmp(argv[i+1], "random") == 0) {
            placer_opts->pad_loc_type = RANDOM;
         }
         else {
            placer_opts->pad_loc_type = USER;
            strncpy (placer_opts->pad_loc_file, argv[i+1], BUFSIZE);
         }
 
         i += 2;
         continue;
      }  

      if (strcmp(argv[i],"-full_stats") == 0) {
         *full_stats = TRUE;
 
         i += 1;
         continue;
      }

      if (strcmp(argv[i],"-nx") == 0) {
 
         nx = read_int_option (argc, argv, i);
         *user_sized = TRUE;
 
         if (nx <= 0) {
           printf("Error:  -nx value must be greater than 0.\n");
           exit(1);
         }
 
         i += 2;
         continue;
      }  

      if (strcmp(argv[i],"-ny") == 0) { 
 
         ny = read_int_option (argc, argv, i); 
         *user_sized = TRUE;
 
         if (ny <= 0) { 
           printf("Error:  -ny value must be greater than 0.\n");
           exit(1); 
         } 
  
         i += 2; 
         continue;
      }   


      if (strcmp(argv[i],"-fast") == 0) {
 
/* Set all parameters for fast compile. */
 
         annealing_sched->inner_num = 1;
         router_opts->first_iter_pres_fac = 10000;
         router_opts->initial_pres_fac = 10000;
         router_opts->bb_factor = 0;
         router_opts->max_router_iterations = 10;
 
         i++;
         continue;
      }

      if (strcmp (argv[i],"-timing_analysis") == 0) {
         if (argc <= i+1) {
            printf ("Error:  -timing_analysis option requires a string "
                    "parameter.\n");
            exit (1);
         } 
         if (strcmp(argv[i+1], "on") == 0) {
            *timing_analysis_enabled = TRUE;
         } 
         else if (strcmp(argv[i+1], "off") == 0) {
            *timing_analysis_enabled = FALSE;
         } 
         else {
            printf("Error:  -timing_analysis must be on or off.\n");
            exit (1);
         } 
 
         i += 2;
         continue;
      }

      
      if (strcmp(argv[i],"-timing_analyze_only_with_net_delay") == 0) {

         *operation = TIMING_ANALYSIS_ONLY;
         *constant_net_delay = read_float_option (argc, argv, i);

         if (*constant_net_delay < 0.) {
            printf("Error:  -timing_analyze_only_with_net_delay value must "
                   "be > 0.\n");
            exit(1);
         }

         i += 2;
         continue;
      }  


      if (strcmp(argv[i],"-init_t") == 0) {

         annealing_sched->init_t = read_float_option (argc, argv, i);

         if (annealing_sched->init_t < 0) {
           printf("Error:  -init_t value must be nonnegative 0.\n");
           exit(1);
         }

         annealing_sched->type = USER_SCHED;
         i += 2;
         continue;
      }

      if (strcmp(argv[i],"-alpha_t") == 0) {

         annealing_sched->alpha_t = read_float_option (argc, argv, i);

         if ((annealing_sched->alpha_t <= 0) || 
                    (annealing_sched->alpha_t >= 1.)) {
           printf("Error:  -alpha_t value must be between 0. and 1.\n");
           exit(1);
         }

         annealing_sched->type = USER_SCHED;
         i += 2;
         continue;
      }

      if (strcmp(argv[i],"-exit_t") == 0) {

         annealing_sched->exit_t = read_float_option (argc, argv, i);

         if (annealing_sched->exit_t <= 0.) {
           printf("Error:  -exit_t value must be greater than 0.\n");
           exit(1);
         }

         annealing_sched->type = USER_SCHED;
         i += 2;
         continue;
      }

      if (strcmp(argv[i],"-inner_num") == 0) {

         annealing_sched->inner_num = read_float_option (argc, argv, i);

         if (annealing_sched->inner_num <= 0.) {
           printf("Error:  -inner_num value must be greater than 0.\n");
           exit(1);
         }

         i += 2;
         continue;
      }

      if (strcmp(argv[i],"-seed") == 0) {

         seed = read_int_option (argc, argv, i);

         i += 2;
         continue;
      }

      if (strcmp(argv[i],"-place_cost_exp") == 0) {
 
         placer_opts->place_cost_exp = read_float_option (argc, argv, i);
 
         if (placer_opts->place_cost_exp < 0.) {
           printf("Error:  -place_cost_exp value must be nonnegative.\n");
           exit(1);
         }
 
         i += 2;
         continue;
      }

      if (strcmp(argv[i],"-place_cost_type") == 0) {

        if (argc <= i+1) {
            printf("Error:  -place_cost_type option requires a "
               "string parameter.\n");
            exit (1);
         }
           
         if (strcmp(argv[i+1], "linear") == 0) {
            placer_opts->place_cost_type = LINEAR_CONG;
         }
         else if (strcmp(argv[i+1], "nonlinear") == 0) {
            placer_opts->place_cost_type = NONLINEAR_CONG;
         }
         else {
            printf("Error:  -place_cost_type must be linear or nonlinear.\n");
            exit (1);
         }

         i += 2;
         continue;

      }  

      if (strcmp(argv[i],"-num_regions") == 0) {

         placer_opts->num_regions = read_int_option (argc, argv, i);

         if (placer_opts->num_regions <= 0.) {
           printf("Error:  -num_regions value must be greater than 0.\n");
           exit(1);
         }

         i += 2;
         continue;
      }  


      if (strcmp(argv[i],"-place_chan_width") == 0) {

         placer_opts->place_chan_width = read_int_option (argc, argv, i);

         if (placer_opts->place_chan_width <= 0.) {
           printf("Error:  -place_chan_width value must be greater than 0.\n");
           exit(1);
         }

         i += 2;
         do_one_nonlinear_place = TRUE;
         continue;
      }  

      if (strcmp(argv[i],"-max_router_iterations") == 0) { 

         router_opts->max_router_iterations = read_int_option (argc, argv, i);

         if (router_opts->max_router_iterations < 0) {
            printf("Error:  -max_router_iterations value is less than 0.\n");
            exit(1);
         }

         i += 2;
         continue;
      }    

      if (strcmp(argv[i],"-bb_factor") == 0) {

         router_opts->bb_factor = read_int_option (argc, argv, i);

         if (router_opts->bb_factor < 0) {
            printf("Error:  -bb_factor is less than 0.\n");
            exit (1);
         }

         i += 2;
         continue;
      }


      if (strcmp(argv[i],"-router_algorithm") == 0) {

        if (argc <= i+1) {
            printf("Error:  -router_algorithm option requires a string "
                   "parameter.\n");
            exit (1);
         }
           
         if (strcmp(argv[i+1], "breadth_first") == 0) {
            router_opts->router_algorithm = BREADTH_FIRST;
         }
         else if (strcmp(argv[i+1], "timing_driven") == 0) {
            router_opts->router_algorithm = TIMING_DRIVEN;
         }
         else {
            printf("Error:  -router_algorithm must be breadth_first or "
                   "timing_driven.\n");
            exit (1);
         }

         i += 2;
         continue;
      }


      if (strcmp(argv[i],"-first_iter_pres_fac") == 0) {

         router_opts->first_iter_pres_fac = read_float_option (argc, argv, i);

         if (router_opts->first_iter_pres_fac < 0.) {
            printf("Error:  -first_iter_pres_fac must be nonnegative.\n");
            exit (1);
         }

         i += 2;
         continue;
      }  


      if (strcmp(argv[i],"-initial_pres_fac") == 0) { 

         router_opts->initial_pres_fac = read_float_option (argc, argv, i);

         if (router_opts->initial_pres_fac <= 0.) { 
            printf("Error:  -initial_pres_fac must be greater than 0.\n");
            exit (1); 
         } 

         i += 2; 
         continue; 
      }   


      if (strcmp(argv[i],"-pres_fac_mult") == 0) {

         router_opts->pres_fac_mult = read_float_option (argc, argv, i);

         if (router_opts->pres_fac_mult <= 0.) {
            printf("Error:  -pres_fac_mult must be greater than "
               "0.\n");
            exit (1);
         }  

         i += 2; 
         continue;
      }


      if (strcmp(argv[i],"-acc_fac") == 0) { 

         router_opts->acc_fac = read_float_option (argc, argv, i);

         if (router_opts->acc_fac < 0.) { 
            printf("Error:  -acc_fac must be nonnegative.\n");
            exit (1); 
         }    

         i += 2;  
         continue; 
      }   


      if (strcmp(argv[i],"-astar_fac") == 0) { 

         router_opts->astar_fac = read_float_option (argc, argv, i);

         if (router_opts->astar_fac < 0.) { 
            printf("Error:  -astar_fac must be nonnegative.\n");
            exit (1); 
         }    

         i += 2;  
         continue; 
      }   


      if (strcmp(argv[i],"-max_criticality") == 0) {

         router_opts->max_criticality = read_float_option (argc, argv, i);

         if (router_opts->max_criticality < 0. || router_opts->max_criticality
                        >= 1.) {
            printf("Error:  -max_criticality must be greater than or equal\n"
                   "to 0 and less than 1.\n");
            exit (1);
         }

         i += 2;
         continue;
      }  


      if (strcmp(argv[i],"-criticality_exp") == 0) {

         router_opts->criticality_exp = read_float_option (argc, argv, i);

         if (router_opts->criticality_exp < 0.) {
            printf("Error:  -criticality_exp must be non-negative.\n");
            exit (1);
         }

         i += 2;
         continue;
      }  


      if (strcmp(argv[i],"-base_cost_type") == 0) {

        if (argc <= i+1) {
            printf("Error:  -base_cost_type option requires a string "
                   "parameter.\n");
            exit (1);
         }
           
         if (strcmp(argv[i+1], "intrinsic_delay") == 0) {
            router_opts->base_cost_type = INTRINSIC_DELAY;
         }
         else if (strcmp(argv[i+1], "delay_normalized") == 0) {
            router_opts->base_cost_type = DELAY_NORMALIZED;
         }
         else if (strcmp(argv[i+1], "demand_only") == 0) {
            router_opts->base_cost_type = DEMAND_ONLY;
         }
         else {
            printf("Error:  -base_cost_type must be intrinsic_delay, "
                   "delay_normalized or demand_only.\n");
            exit (1);
         }

         base_cost_type_set = TRUE;
         i += 2;
         continue;
      }


      if (strcmp(argv[i],"-bend_cost") == 0) {
 
         router_opts->bend_cost = read_float_option (argc, argv, i);
 
         if (router_opts->bend_cost < 0.) {
            printf("Error:  -bend_cost cannot be less than 0.\n");
            exit (1);
         }
 
         bend_cost_set = TRUE;
         i += 2;
         continue;
      }  


      if (strcmp(argv[i],"-route_type") == 0) {

        if (argc <= i+1) {
            printf("Error:  -route_type option requires a "
               "string parameter.\n");
            exit (1);
         }

         if (strcmp(argv[i+1], "global") == 0) {
            router_opts->route_type = GLOBAL;
         }
         else if (strcmp(argv[i+1], "detailed") == 0) {
            router_opts->route_type = DETAILED;
         }
         else {
            printf("Error:  -route_type must be global or detailed.\n");
            exit (1);
         }

         i += 2;
         continue;
 
      }  


      if (strcmp(argv[i],"-route_chan_width") == 0) {

         router_opts->fixed_channel_width = read_int_option (argc, argv, i);

         if (router_opts->fixed_channel_width <= 0) {
           printf("Error:  -route_chan_width value must be greater than 0.\n");
           exit(1);
         }
 
         if (router_opts->fixed_channel_width >= MAX_CHANNEL_WIDTH) {
            printf ("Error:  -router_chan_width value must be less than %d."
                    "\n", MAX_CHANNEL_WIDTH);
            exit (1);
         }
 
         i += 2;
         continue;
      }  


      if (strcmp(argv[i],"-route_only") == 0) {
         if (*operation == PLACE_ONLY) {
            printf("Error:  Both -route_only and -place_only specified.\n");
            exit (1);
         }
         *operation = ROUTE_ONLY;
         placer_opts->place_freq = PLACE_NEVER;
         i++;
         continue;
      }


      if (strcmp(argv[i],"-place_only") == 0) {
         if (*operation == ROUTE_ONLY) {
            printf("Error:  Both -route_only and -place_only specified.\n");
            exit (1);
         }
         *operation = PLACE_ONLY;
         i++;
         continue;
      }


      if (strcmp(argv[i],"-verify_binary_search") == 0) {
         *verify_binary_search = TRUE;
         i++;
         continue;
      }

      printf("Error:  Unrecognized flag: %s.  Aborting.\n",argv[i]);
      exit(1);

   }   /* End of giant while loop. */


/* Check for illegal options combinations. */

   if (placer_opts->place_cost_type == NONLINEAR_CONG && *operation !=
        PLACE_AND_ROUTE && do_one_nonlinear_place == FALSE) {
      printf("Error:  Replacing using the nonlinear congestion option\n");
      printf("        for each channel width makes sense only for full "
                      "place and route.\n");
      exit (1);
   }

   if (*operation == ROUTE_ONLY && placer_opts->pad_loc_type == USER) {
      printf ("Error:  You cannot specify both a full placement file and \n");
      printf ("        a pad location file.\n");
      exit (1);
   }

   if (router_opts->fixed_channel_width != NO_FIXED_CHANNEL_WIDTH &&
           *verify_binary_search) {
      printf ("Error:  Routing on a fixed channel width (%d tracks) "
              "specified.\n", router_opts->fixed_channel_width);
      printf ("        There is no binary search to verify, so you \n"
              "        cannot specify -verify_binary_search option.\n");
      exit (1);
   }

   if (*operation == ROUTE_ONLY || *operation == PLACE_AND_ROUTE) {
      if (router_opts->router_algorithm == TIMING_DRIVEN && 
                   *timing_analysis_enabled == FALSE) {
         printf ("Error:  Cannot perform timing-driven routing when timing "
                 "analysis is disabled.\n");
         exit (1);
      }

      if (*timing_analysis_enabled == FALSE && router_opts->base_cost_type 
            != DEMAND_ONLY) {
         printf ("Error:  base_cost_type must be demand_only when timing "
                 "analysis is disabled.\n");
         exit (1);
      }
   }

   if (*operation == TIMING_ANALYSIS_ONLY && *timing_analysis_enabled == 
      FALSE) {
      printf ("Error:  -timing_analyze_only_with_net_delay option requires\n"
              "\tthat timing analysis not be disabled.\n");
      exit (1);
   }


/* Now echo back the options the user has selected. */

   printf("\nGeneral Options:\n");

   if (*aspect_ratio != 1.) {
      printf("\tFPGA will have a width/length ratio of %g.\n", 
          *aspect_ratio);
   }

   if (*user_sized == TRUE) {
      printf("\tThe FPGA size has been specified by the user.\n");

   /* If one of nx or ny was unspecified, compute it from the other and  *
    * the aspect ratio.  If both are unspecified, wait till the netlist  *
    * is read and compute the smallest possible nx and ny in read_arch.  */

      if (ny == 0) {   
         ny = (float) nx / (float) *aspect_ratio;
      }
      else if (nx == 0) {
         nx = ny *  *aspect_ratio;
      }
      else if (*aspect_ratio != 1 && *aspect_ratio != nx / ny) {
            printf("\nError:  User-specified size and aspect ratio do\n");
            printf("not match.  Note that aspect ratio does not have to\n");
            printf("be specified if both nx and ny are specified.\n");
            exit (1);
      }
   }

   if (*full_stats == TRUE) {
      printf("\tA full statistical report will be printed.\n");
   }

   if (*operation == ROUTE_ONLY) {
      printf ("\tRouting will be performed on an existing placement.\n");
   } else if (*operation == PLACE_ONLY) {
      printf ("\tThe circuit will be placed but not routed.\n");
   } else if (*operation == PLACE_AND_ROUTE) {
      printf ("\tThe circuit will be placed and routed.\n");
   } else if (*operation == TIMING_ANALYSIS_ONLY) {
      printf ("\tOnly timing analysis (assuming a constant net delay) will "
              "be performed.\n");
   }

   if (*operation == PLACE_ONLY || *operation == PLACE_AND_ROUTE) {
      printf("\nPlacer Options:\n");
      if (annealing_sched->type == AUTO_SCHED) {
         printf("\tAutomatic annealing schedule selected.\n");
         printf("\tNumber of moves in the inner loop is (num_blocks)^4/3 "
            "* %g\n", annealing_sched->inner_num);
      }
      else {
         printf("\tUser annealing schedule selected with:\n");
         printf("\tInitial Temperature: %g\n",annealing_sched->init_t);
         printf("\tExit (Final) Temperature: %g\n",annealing_sched->exit_t);
         printf("\tTemperature Reduction factor (alpha_t): %g\n",
                annealing_sched->alpha_t);
         printf("\tNumber of moves in the inner loop is (num_blocks)^4/3 * "
            "%g\n", annealing_sched->inner_num);
      }
      
      if (placer_opts->place_cost_type == NONLINEAR_CONG) {
         printf("\tPlacement cost type is nonlinear congestion.\n");
         printf("\tCongestion will be determined on a %d x %d array.\n",
               placer_opts->num_regions, placer_opts->num_regions);
         if (do_one_nonlinear_place == TRUE) {
            placer_opts->place_freq = PLACE_ONCE;
            printf("\tPlacement will be performed once.\n");
            printf("\tPlacement channel width factor = %d.\n",
                 placer_opts->place_chan_width);
         }
         else {
            placer_opts->place_freq = PLACE_ALWAYS;
            printf("\tCircuit will be replaced for each channel width "
                  "attempted.\n");
         }
      }

      else if (placer_opts->place_cost_type == LINEAR_CONG) {
         placer_opts->place_freq = PLACE_ONCE;
         printf("\tPlacement cost type is linear congestion.\n");
         printf("\tPlacement will be performed once.\n");
         printf("\tPlacement channel width factor = %d.\n",
                placer_opts->place_chan_width);
         printf("\tExponent used in placement cost: %g\n",
                placer_opts->place_cost_exp);
      }
   
      if (placer_opts->pad_loc_type == RANDOM) {
         printf("\tPlacer will fix the IO pins in a random configuration.\n");
      }
      else if (placer_opts->pad_loc_type == USER) {
         printf ("\tPlacer will fix the IO pins as specified by file %s.\n",
                  placer_opts->pad_loc_file);
      }

      printf("\tInitial random seed: %d\n", seed);
      my_srandom(seed);

   }   /* End of echo placement options. */


   if (*operation == ROUTE_ONLY || *operation == PLACE_AND_ROUTE) {
      printf("\nRouting Options:\n");

      if (router_opts->route_type == GLOBAL) 
         printf("\tOnly GLOBAL routing will be performed.\n");
      else 
         printf("\tCombined GLOBAL + DETAILED routing will be performed.\n");

      if (router_opts->router_algorithm == BREADTH_FIRST) 
         printf ("\tRouter algorithm:  breadth first.\n");
      else
         printf ("\tRouter algorithm:  timing driven.\n");

      printf("\tThe router will try at most %d iterations.\n",
            router_opts->max_router_iterations);
      printf("\tRoutings can go at most %d channels outside their "
            "bounding box.\n", router_opts->bb_factor);

/* The default bend_cost for DETAILED routing is 0, while the default for *
 * GLOBAL routing is 1.                                                   */

      if (bend_cost_set == FALSE && router_opts->route_type == DETAILED) 
         router_opts->bend_cost = 0.;

      printf("\tCost of a bend (bend_cost) is %g.\n", router_opts->bend_cost);

      printf("\tFirst iteration sharing penalty factor (first_iter_pres_fac):"
                " %g\n", router_opts->first_iter_pres_fac);
      printf("\tInitial (2nd iter.) sharing penalty factor (initial_pres_fac):"
            " %g\n", router_opts->initial_pres_fac);
      printf("\tSharing penalty growth factor (pres_fac_mult): %g\n",
            router_opts->pres_fac_mult);
      printf("\tAccumulated sharing penalty factor (acc_fac): %g\n", 
            router_opts->acc_fac);

/* Default base_cost_type is DELAY_NORMALIZED for timing_driven routing */

      if (!base_cost_type_set && router_opts->router_algorithm == TIMING_DRIVEN)
         router_opts->base_cost_type = DELAY_NORMALIZED;

      printf ("\tBase_cost_type:  ");
      if (router_opts->base_cost_type == INTRINSIC_DELAY) 
         printf ("intrinsic delay.\n");
      else if (router_opts->base_cost_type == DELAY_NORMALIZED) 
         printf ("delay normalized.\n");
      else if (router_opts->base_cost_type == DEMAND_ONLY) 
         printf ("demand only.\n");
      
      if (router_opts->router_algorithm == TIMING_DRIVEN) {
         printf ("\tSearch aggressiveness factor (astar_fac): %g\n", 
                  router_opts->astar_fac);
         printf ("\tMaximum sink criticality (max_criticality): %g\n",
                  router_opts->max_criticality);
         printf ("\tExponent for criticality computation (criticality_exp): "
                 "%g\n", router_opts->criticality_exp);
      }
       
      if (router_opts->fixed_channel_width == NO_FIXED_CHANNEL_WIDTH) {
         printf ("\tRouter will find the minimum number of tracks "
                 "required to route.\n");
      }  
      else {
         printf ("\tRouter will attempt routing only with a channel width"
                 " factor of %d.\n", router_opts->fixed_channel_width);
      }  

      if (*verify_binary_search) {

/* Router will ensure routings with 1, 2, and 3 tracks fewer than the *
 * best found by the binary search will not succeed.  Normally only   *
 * verify that best - 1 tracks does not succeed.                      */

         printf("\tRouter will verify that binary search yields min. "
                  "channel width.\n");
      }
   }  /* End of echo router options. */

   
   if (*operation == TIMING_ANALYSIS_ONLY) {
      printf ("\tNet delay value for timing analysis: %g (s)\n", 
              *constant_net_delay);
   }

   printf("\n");

}