#include <stdio.h>
#include <math.h>
#include "util.h"
#include "vpr_types.h"
#include "globals.h"
#include "path_delay.h"
#include "path_delay2.h"
#include "net_delay.h"
#include "timing_place_lookup.h"
#include "timing_place.h"
Go to the source code of this file.
Functions | |
static float ** | alloc_crit (struct s_linked_vptr **chunk_list_head_ptr) |
static void | free_crit (struct s_linked_vptr **chunk_list_head_ptr) |
void | print_sink_delays (char *fname) |
void | load_criticalities (struct s_placer_opts placer_opts, float **net_slack, float d_max, float crit_exponent) |
void | alloc_lookups_and_criticalities (t_chan_width_dist chan_width_dist, struct s_router_opts router_opts, struct s_det_routing_arch det_routing_arch, t_segment_inf *segment_inf, t_timing_inf timing_inf, t_subblock_data subblock_data, float ***net_delay, float ***net_slack) |
void | free_lookups_and_criticalities (float ***net_delay, float ***net_slack) |
Variables | |
float ** | timing_place_crit |
static struct s_linked_vptr * | timing_place_crit_chunk_list_head |
static struct s_linked_vptr * | net_delay_chunk_list_head |
static float ** alloc_crit | ( | struct s_linked_vptr ** | chunk_list_head_ptr | ) | [static] |
Definition at line 27 of file timing_place.c.
00028 { 00029 00030 /* Allocates space for the timing_place_crit data structure * 00031 * [0..num_nets-1][1..num_pins-1]. I chunk the data to save space on large * 00032 * problems. */ 00033 00034 float **local_crit; /* [0..num_nets-1][1..num_pins-1] */ 00035 float *tmp_ptr; 00036 int inet; 00037 int chunk_bytes_avail; 00038 char *chunk_next_avail_mem; 00039 00040 *chunk_list_head_ptr = NULL; 00041 chunk_bytes_avail = 0; 00042 chunk_next_avail_mem = NULL; 00043 00044 local_crit = (float **)my_malloc(num_nets * sizeof(float *)); 00045 00046 for(inet = 0; inet < num_nets; inet++) 00047 { 00048 tmp_ptr = (float *)my_chunk_malloc((net[inet].num_sinks) * 00049 sizeof(float), 00050 chunk_list_head_ptr, 00051 &chunk_bytes_avail, 00052 &chunk_next_avail_mem); 00053 local_crit[inet] = tmp_ptr - 1; /* [1..num_sinks] */ 00054 } 00055 00056 return (local_crit); 00057 }
void alloc_lookups_and_criticalities | ( | t_chan_width_dist | chan_width_dist, | |
struct s_router_opts | router_opts, | |||
struct s_det_routing_arch | det_routing_arch, | |||
t_segment_inf * | segment_inf, | |||
t_timing_inf | timing_inf, | |||
t_subblock_data | subblock_data, | |||
float *** | net_delay, | |||
float *** | net_slack | |||
) |
Definition at line 138 of file timing_place.c.
00146 { 00147 00148 (*net_slack) = alloc_and_load_timing_graph(timing_inf, subblock_data); 00149 00150 (*net_delay) = alloc_net_delay(&net_delay_chunk_list_head); 00151 00152 compute_delay_lookup_tables(router_opts, det_routing_arch, segment_inf, 00153 timing_inf, chan_width_dist, subblock_data); 00154 00155 timing_place_crit = alloc_crit(&timing_place_crit_chunk_list_head); 00156 00157 }
static void free_crit | ( | struct s_linked_vptr ** | chunk_list_head_ptr | ) | [static] |
Definition at line 61 of file timing_place.c.
00062 { 00063 00064 free_chunk_memory(*chunk_list_head_ptr); 00065 *chunk_list_head_ptr = NULL; 00066 }
void free_lookups_and_criticalities | ( | float *** | net_delay, | |
float *** | net_slack | |||
) |
Definition at line 161 of file timing_place.c.
00163 { 00164 00165 free(timing_place_crit); 00166 free_crit(&timing_place_crit_chunk_list_head); 00167 00168 free_timing_graph(*net_slack); 00169 free_net_delay(*net_delay, &net_delay_chunk_list_head); 00170 00171 }
void load_criticalities | ( | struct s_placer_opts | placer_opts, | |
float ** | net_slack, | |||
float | d_max, | |||
float | crit_exponent | |||
) |
Definition at line 100 of file timing_place.c.
00104 { 00105 00106 /*set criticality values, returns the maximum criticality found */ 00107 /*assumes that net_slack contains correct values, ie. assumes * 00108 *that load_net_slack has been called*/ 00109 00110 int inet, ipin; 00111 float pin_crit; 00112 00113 00114 00115 for(inet = 0; inet < num_nets; inet++) 00116 { 00117 00118 if(inet == OPEN) 00119 continue; 00120 if(net[inet].is_global) 00121 continue; 00122 00123 for(ipin = 1; ipin <= net[inet].num_sinks; ipin++) 00124 { 00125 /*clip the criticality to never go negative (could happen */ 00126 /*for a constant generator since it's slack is huge) */ 00127 pin_crit = max(1 - net_slack[inet][ipin] / d_max, 0.); 00128 timing_place_crit[inet][ipin] = 00129 pow(pin_crit, crit_exponent); 00130 00131 } 00132 } 00133 }
void print_sink_delays | ( | char * | fname | ) |
Definition at line 70 of file timing_place.c.
00071 { 00072 00073 00074 int num_at_level, num_edges, inode, ilevel, i; 00075 FILE *fp; 00076 00077 fp = my_fopen(fname, "w"); 00078 00079 00080 for(ilevel = num_tnode_levels - 1; ilevel >= 0; ilevel--) 00081 { 00082 num_at_level = tnodes_at_level[ilevel].nelem; 00083 00084 for(i = 0; i < num_at_level; i++) 00085 { 00086 inode = tnodes_at_level[ilevel].list[i]; 00087 num_edges = tnode[inode].num_edges; 00088 00089 if(num_edges == 0) 00090 { /* sink */ 00091 fprintf(fp, "%g\n", tnode[inode].T_arr); 00092 } 00093 } 00094 } 00095 fclose(fp); 00096 }
struct s_linked_vptr* net_delay_chunk_list_head [static] |
Definition at line 16 of file timing_place.c.
float** timing_place_crit |
Definition at line 13 of file timing_place.c.
struct s_linked_vptr* timing_place_crit_chunk_list_head [static] |
Definition at line 15 of file timing_place.c.