Go to the source code of this file.
Functions | |
void | routing_stats (boolean full_stats, enum e_route_type route_type, int num_switch, t_segment_inf *segment_inf, int num_segment, float R_minW_nmos, float R_minW_pmos, enum e_directionality directionality, boolean timing_analysis_enabled, float **net_slack, float **net_delay, t_subblock_data subblock_data) |
void | print_wirelen_prob_dist (void) |
void | print_lambda (void) |
void print_lambda | ( | void | ) |
Definition at line 460 of file stats.c.
00461 { 00462 00463 /* Finds the average number of input pins used per fb. Does not * 00464 * count inputs which are hooked to global nets (i.e. the clock * 00465 * when it is marked global). */ 00466 00467 int bnum, ipin; 00468 int num_inputs_used = 0; 00469 int iclass, inet; 00470 float lambda; 00471 t_type_ptr type; 00472 00473 for(bnum = 0; bnum < num_blocks; bnum++) 00474 { 00475 type = block[bnum].type; 00476 assert(type != NULL); 00477 if(type != IO_TYPE) 00478 { 00479 for(ipin = 0; ipin < type->num_pins; ipin++) 00480 { 00481 iclass = type->pin_class[ipin]; 00482 if(type->class_inf[iclass].type == RECEIVER) 00483 { 00484 inet = block[bnum].nets[ipin]; 00485 if(inet != OPEN) /* Pin is connected? */ 00486 if(net[inet].is_global == FALSE) /* Not a global clock */ 00487 num_inputs_used++; 00488 } 00489 } 00490 } 00491 } 00492 00493 lambda = (float)num_inputs_used / (float)num_blocks; 00494 printf("Average lambda (input pins used per fb) is: %g\n", lambda); 00495 }
void print_wirelen_prob_dist | ( | void | ) |
Definition at line 360 of file stats.c.
00361 { 00362 00363 /* Prints out the probability distribution of the wirelength / number * 00364 * input pins on a net -- i.e. simulates 2-point net length probability * 00365 * distribution. */ 00366 00367 float *prob_dist; 00368 float norm_fac, two_point_length; 00369 int inet, bends, length, segments, index; 00370 float av_length; 00371 int prob_dist_size, i, incr; 00372 00373 prob_dist_size = nx + ny + 10; 00374 prob_dist = (float *)my_calloc(prob_dist_size, sizeof(float)); 00375 norm_fac = 0.; 00376 00377 for(inet = 0; inet < num_nets; inet++) 00378 { 00379 if(net[inet].is_global == FALSE) 00380 { 00381 get_num_bends_and_length(inet, &bends, &length, 00382 &segments); 00383 00384 /* Assign probability to two integer lengths proportionately -- i.e. * 00385 * if two_point_length = 1.9, add 0.9 of the pins to prob_dist[2] and * 00386 * only 0.1 to prob_dist[1]. */ 00387 00388 two_point_length = 00389 (float)length / (float)(net[inet].num_sinks); 00390 index = (int)two_point_length; 00391 if(index >= prob_dist_size) 00392 { 00393 00394 printf 00395 ("Warning: index (%d) to prob_dist exceeds its allocated size (%d)\n", 00396 index, prob_dist_size); 00397 printf 00398 ("Realloc'ing to increase 2-pin wirelen prob distribution array\n"); 00399 incr = index - prob_dist_size + 2; 00400 prob_dist_size += incr; 00401 prob_dist = 00402 my_realloc(prob_dist, 00403 prob_dist_size * sizeof(float)); 00404 for(i = prob_dist_size - incr; i < prob_dist_size; 00405 i++) 00406 prob_dist[i] = 0.0; 00407 } 00408 prob_dist[index] += 00409 (net[inet].num_sinks) * (1 - two_point_length + 00410 index); 00411 00412 index++; 00413 if(index >= prob_dist_size) 00414 { 00415 00416 printf 00417 ("Warning: index (%d) to prob_dist exceeds its allocated size (%d)\n", 00418 index, prob_dist_size); 00419 printf 00420 ("Realloc'ing to increase 2-pin wirelen prob distribution array\n"); 00421 incr = index - prob_dist_size + 2; 00422 prob_dist_size += incr; 00423 prob_dist = 00424 my_realloc(prob_dist, 00425 prob_dist_size * sizeof(float)); 00426 for(i = prob_dist_size - incr; i < prob_dist_size; 00427 i++) 00428 prob_dist[i] = 0.0; 00429 } 00430 prob_dist[index] += (net[inet].num_sinks) * (1 - index + 00431 two_point_length); 00432 00433 norm_fac += net[inet].num_sinks; 00434 } 00435 } 00436 00437 /* Normalize so total probability is 1 and print out. */ 00438 00439 printf("\nProbability distribution of 2-pin net lengths:\n\n"); 00440 printf("Length p(Lenth)\n"); 00441 00442 av_length = 0; 00443 00444 for(index = 0; index < prob_dist_size; index++) 00445 { 00446 prob_dist[index] /= norm_fac; 00447 printf("%6d %10.6f\n", index, prob_dist[index]); 00448 av_length += prob_dist[index] * index; 00449 } 00450 00451 printf("\nThe number of 2-pin nets is ;%g;\n", norm_fac); 00452 printf("\nExpected value of 2-pin net length (R) is ;%g;\n", av_length); 00453 printf("\nTotal wire length is ;%g;\n", norm_fac * av_length); 00454 00455 free(prob_dist); 00456 }
void routing_stats | ( | boolean | full_stats, | |
enum e_route_type | route_type, | |||
int | num_switch, | |||
t_segment_inf * | segment_inf, | |||
int | num_segment, | |||
float | R_minW_nmos, | |||
float | R_minW_pmos, | |||
enum e_directionality | directionality, | |||
boolean | timing_analysis_enabled, | |||
float ** | net_slack, | |||
float ** | net_delay, | |||
t_subblock_data | subblock_data | |||
) |
Definition at line 34 of file stats.c.
00046 { 00047 00048 /* Prints out various statistics about the current routing. Both a routing * 00049 * and an rr_graph must exist when you call this routine. */ 00050 00051 float T_crit; 00052 00053 00054 get_length_and_bends_stats(); 00055 get_channel_occupancy_stats(); 00056 00057 printf("Logic Area (in minimum width transistor areas):\n"); 00058 printf("Total Logic Area: %g Per 1x1 logic tile: %g\n", 00059 nx * ny * grid_logic_tile_area, grid_logic_tile_area); 00060 00061 if(route_type == DETAILED) 00062 { 00063 count_routing_transistors(directionality, num_switch, segment_inf, 00064 R_minW_nmos, R_minW_pmos); 00065 get_segment_usage_stats(num_segment, segment_inf); 00066 00067 if(timing_analysis_enabled) 00068 { 00069 load_net_delay_from_routing(net_delay); 00070 00071 #ifdef CREATE_ECHO_FILES 00072 print_net_delay(net_delay, "net_delay.echo"); 00073 #endif /* CREATE_ECHO_FILES */ 00074 00075 load_timing_graph_net_delays(net_delay); 00076 T_crit = load_net_slack(net_slack, 0); 00077 00078 #ifdef CREATE_ECHO_FILES 00079 print_timing_graph("timing_graph.echo"); 00080 print_net_slack("net_slack.echo", net_slack); 00081 print_critical_path("critical_path.echo", subblock_data); 00082 #endif /* CREATE_ECHO_FILES */ 00083 00084 printf("\n"); 00085 printf("Critical Path: %g (s)\n", T_crit); 00086 } 00087 } 00088 00089 if(full_stats == TRUE) 00090 print_wirelen_prob_dist(); 00091 }