29 float R_minW_nmos,
float R_minW_pmos,
36 float area, used_area;
42 vpr_printf(TIO_MESSAGE_INFO,
"Logic area (in minimum width transistor areas, excludes I/Os and empty grid tiles)...\n");
45 for (i = 1; i <=
nx; i++) {
46 for (j = 1; j <=
ny; j++) {
47 if (
grid[i][j].offset == 0) {
57 vpr_printf(TIO_MESSAGE_INFO,
"\tTotal logic block area (Warning, need to add pitch of routing to blocks with height > 3): %g\n", area);
69 vpr_printf(TIO_MESSAGE_INFO,
"\tTotal used logic block area: %g\n", used_area);
73 R_minW_nmos, R_minW_pmos);
76 if (timing_analysis_enabled) {
81 #ifdef HACK_LUT_PIN_SWAPPING
103 if (full_stats ==
TRUE)
112 int inet, bends, total_bends, max_bends;
113 int length, total_length, max_length;
114 int segments, total_segments, max_segments;
115 float av_bends, av_length, av_segments;
116 int num_global_nets, num_clb_opins_reserved;
125 num_clb_opins_reserved = 0;
127 for (inet = 0; inet <
num_nets; inet++) {
131 total_bends += bends;
132 max_bends =
std::max(bends, max_bends);
134 total_length += length;
135 max_length =
std::max(length, max_length);
137 total_segments += segments;
138 max_segments =
std::max(segments, max_segments);
142 num_clb_opins_reserved++;
146 av_bends = (float) total_bends / (
float) (num_nets - num_global_nets);
148 vpr_printf(TIO_MESSAGE_INFO,
"Average number of bends per net: %#g Maximum # of bends: %d\n", av_bends, max_bends);
151 av_length = (float) total_length / (
float) (num_nets - num_global_nets);
152 vpr_printf(TIO_MESSAGE_INFO,
"Number of routed nets (nonglobal): %d\n", num_nets - num_global_nets);
153 vpr_printf(TIO_MESSAGE_INFO,
"Wirelength results (in units of 1 clb segments)...\n");
154 vpr_printf(TIO_MESSAGE_INFO,
"\tTotal wirelength: %d, average net length: %#g\n", total_length, av_length);
155 vpr_printf(TIO_MESSAGE_INFO,
"\tMaximum net length: %d\n", max_length);
158 av_segments = (float) total_segments / (
float) (num_nets - num_global_nets);
159 vpr_printf(TIO_MESSAGE_INFO,
"Wirelength results in terms of physical segments...\n");
160 vpr_printf(TIO_MESSAGE_INFO,
"\tTotal wiring segments used: %d, average wire segments per net: %#g\n", total_segments, av_segments);
161 vpr_printf(TIO_MESSAGE_INFO,
"\tMaximum segments used by a net: %d\n", max_segments);
162 vpr_printf(TIO_MESSAGE_INFO,
"\tTotal local nets with reserved CLB opins: %d\n", num_clb_opins_reserved);
169 int i, j, max_occ, total_x, total_y;
179 vpr_printf(TIO_MESSAGE_INFO,
"X - Directed channels: j\tmax occ\tav_occ\t\tcapacity\n");
183 for (j = 0; j <=
ny; j++) {
188 for (i = 1; i <=
nx; i++) {
189 max_occ =
std::max(chanx_occ[i][j], max_occ);
190 av_occ += chanx_occ[i][j];
197 vpr_printf(TIO_MESSAGE_INFO,
"Y - Directed channels: i\tmax occ\tav_occ\t\tcapacity\n");
201 for (i = 0; i <=
nx; i++) {
206 for (j = 1; j <=
ny; j++) {
207 max_occ =
std::max(chany_occ[i][j], max_occ);
208 av_occ += chany_occ[i][j];
215 vpr_printf(TIO_MESSAGE_INFO,
"Total tracks in x-direction: %d, in y-direction: %d\n", total_x, total_y);
227 int i, j, inode, inet;
233 for (i = 1; i <=
nx; i++)
234 for (j = 0; j <=
ny; j++)
237 for (i = 0; i <=
nx; i++)
238 for (j = 1; j <=
ny; j++)
243 for (inet = 0; inet <
num_nets; inet++) {
249 while (tptr != NULL) {
253 if (rr_type ==
SINK) {
259 else if (rr_type ==
CHANX) {
265 else if (rr_type ==
CHANY) {
282 struct s_trace *tptr, *prevptr;
285 int bends, length, segments;
292 if (prevptr == NULL) {
293 vpr_printf(TIO_MESSAGE_ERROR,
"in get_num_bends_and_length: net #%d has no traceback.\n", inet);
296 inode = prevptr->
index;
299 tptr = prevptr->
next;
301 while (tptr != NULL) {
305 if (curr_type ==
SINK) {
313 else if (curr_type ==
CHANX || curr_type ==
CHANY) {
318 if (curr_type != prev_type
319 && (prev_type ==
CHANX || prev_type ==
CHANY))
323 prev_type = curr_type;
329 *segments_ptr = segments;
339 float norm_fac, two_point_length;
340 int inet, bends, length, segments,
index;
342 int prob_dist_size, i, incr;
344 prob_dist_size =
nx +
ny + 10;
345 prob_dist = (
float *)
my_calloc(prob_dist_size,
sizeof(
float));
348 for (inet = 0; inet <
num_nets; inet++) {
356 two_point_length = (float) length
358 index = (int) two_point_length;
359 if (index >= prob_dist_size) {
361 vpr_printf(TIO_MESSAGE_WARNING,
"index (%d) to prob_dist exceeds its allocated size (%d).\n",
362 index, prob_dist_size);
363 vpr_printf(TIO_MESSAGE_INFO,
"Realloc'ing to increase 2-pin wirelen prob distribution array.\n");
364 incr = index - prob_dist_size + 2;
365 prob_dist_size += incr;
367 prob_dist_size *
sizeof(
float));
368 for (i = prob_dist_size - incr; i < prob_dist_size; i++)
372 * (1 - two_point_length + index);
375 if (index >= prob_dist_size) {
377 vpr_printf(TIO_MESSAGE_WARNING,
"Warning: index (%d) to prob_dist exceeds its allocated size (%d).\n",
378 index, prob_dist_size);
379 vpr_printf(TIO_MESSAGE_INFO,
"Realloc'ing to increase 2-pin wirelen prob distribution array.\n");
380 incr = index - prob_dist_size + 2;
381 prob_dist_size += incr;
383 prob_dist_size *
sizeof(
float));
384 for (i = prob_dist_size - incr; i < prob_dist_size; i++)
388 * (1 - index + two_point_length);
397 vpr_printf(TIO_MESSAGE_INFO,
"Probability distribution of 2-pin net lengths:\n");
399 vpr_printf(TIO_MESSAGE_INFO,
"Length p(Lenth)\n");
403 for (index = 0; index < prob_dist_size; index++) {
404 prob_dist[
index] /= norm_fac;
405 vpr_printf(TIO_MESSAGE_INFO,
"%6d %10.6f\n", index, prob_dist[index]);
410 vpr_printf(TIO_MESSAGE_INFO,
"Number of 2-pin nets: ;%g;\n", norm_fac);
411 vpr_printf(TIO_MESSAGE_INFO,
"Expected value of 2-pin net length (R): ;%g;\n", av_length);
412 vpr_printf(TIO_MESSAGE_INFO,
"Total wire length: ;%g;\n", norm_fac * av_length);
424 int num_inputs_used = 0;
431 assert(type != NULL);
433 for (ipin = 0; ipin < type->
num_pins; ipin++) {
445 lambda = (float) num_inputs_used / (
float)
num_blocks;
446 vpr_printf(TIO_MESSAGE_INFO,
"Average lambda (input pins used per clb) is: %g\n", lambda);
457 char ** clock_names = NULL;
462 assert(clock_net !=
OPEN);
466 for (i = 0; !found && i < num_clocks; i++) {
467 if (strcmp(clock_names[i], name) == 0) {
473 clock_names = (
char **)
my_realloc (clock_names, ++num_clocks *
sizeof(
char *));
474 clock_names[num_clocks - 1] = name;
void print_timing_stats(void)
void load_net_delay_from_routing(float **net_delay, struct s_net *nets, int n_nets)
void ** alloc_matrix(int nrmin, int nrmax, int ncmin, int ncmax, size_t elsize)
struct s_class * class_inf
void free_matrix(void *vptr, int nrmin, int nrmax, int ncmin, size_t elsize)
static float ** net_delay
void get_segment_usage_stats(int num_segment, t_segment_inf *segment_inf)
void * my_calloc(size_t nelem, size_t size)
void print_wirelen_prob_dist(void)
void print_critical_path(const char *fname)
void do_timing_analysis(t_slack *slacks, boolean is_prepacked, boolean do_lut_input_balancing, boolean is_final_analysis)
static void load_channel_occupancies(int **chanx_occ, int **chany_occ)
boolean getEchoEnabled(void)
int count_netlist_clocks(void)
void get_num_bends_and_length(int inet, int *bends_ptr, int *len_ptr, int *segments_ptr)
void print_lut_remapping(const char *fname)
struct s_trace ** trace_head
boolean isEchoFileEnabled(enum e_echo_files echo_option)
static void get_channel_occupancy_stats(void)
struct s_grid_tile ** grid
void print_criticality(t_slack *slacks, boolean criticality_is_normalized, const char *fname)
static void get_length_and_bends_stats(void)
char * getOutputFileName(enum e_output_files ename)
static void * my_realloc(void *memblk, int ibytes)
void print_slack(float **slack, boolean slack_is_normalized, const char *fname)
void print_timing_graph(const char *fname)
float grid_logic_tile_area
char * getEchoFileName(enum e_echo_files echo_option)
void print_net_delay(float **net_delay, const char *fname)
void load_timing_graph_net_delays(float **net_delay)
void count_routing_transistors(enum e_directionality directionality, int num_switch, t_segment_inf *segment_inf, float R_minW_nmos, float R_minW_pmos)
struct s_logical_block * logical_block
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_delay, t_slack *slacks)