203 int nodes_per_chan, i, j;
208 int *****opin_to_track_map = NULL;
209 int *****ipin_to_track_map = NULL;
210 t_ivec ****track_to_ipin_lookup = NULL;
211 t_ivec ***switch_block_conn = NULL;
212 short *****unidir_sb_pattern = NULL;
213 boolean *L_rr_edge_done = NULL;
214 boolean is_global_graph;
216 boolean use_full_seg_groups;
217 boolean *perturb_ipins = NULL;
219 int **Fc_xofs = NULL;
220 int **Fc_yofs = NULL;
231 is_global_graph =
FALSE;
233 is_global_graph =
TRUE;
235 use_full_seg_groups =
FALSE;
237 use_full_seg_groups =
TRUE;
243 if (is_global_graph) {
248 nodes_per_chan = (is_global_graph ? 1 : chan_width);
249 assert(nodes_per_chan > 0);
251 clb_to_clb_directs = NULL;
252 if(num_directs > 0) {
257 if (is_global_graph) {
260 global_route_switch);
266 std::max(L_nx, L_ny), num_seg_types, segment_inf,
267 use_full_seg_groups, is_global_graph, directionality);
268 if ((is_global_graph ? 1 : chan_width) != nodes_per_chan) {
281 if (is_global_graph) {
282 Fc_in = (
int **)
my_malloc(
sizeof(
int) * L_num_types);
283 Fc_out = (
int **)
my_malloc(
sizeof(
int) * L_num_types);
284 for (i = 0; i < L_num_types; ++i) {
285 for (j = 0; j < types[i].num_pins; ++j) {
293 FALSE, directionality, &Fc_clipped, ignore_Fc_0);
299 TRUE, directionality, &Fc_clipped, ignore_Fc_0);
305 for (i = 1; i < L_num_types; ++i) {
308 vpr_printf(TIO_MESSAGE_INFO,
"Fc Actual Values: type = %s, Fc_out = full, Fc_in = %d.\n",
312 vpr_printf(TIO_MESSAGE_INFO,
"Fc Actual Values: type = %s, Fc_out = %d, Fc_in = %d.\n",
321 Fc_in, Fc_out, directionality);
331 memset(L_rr_edge_done, 0,
sizeof(
boolean) *
num_rr_nodes);
335 Fc_xofs = (
int **)
alloc_matrix(0, L_ny, 0, L_nx,
sizeof(
int));
336 Fc_yofs = (
int **)
alloc_matrix(0, L_nx, 0, L_ny,
sizeof(
int));
337 for (i = 0; i <= L_nx; ++i) {
338 for (j = 0; j <= L_ny; ++j) {
347 if (is_global_graph) {
348 assert(nodes_per_chan == 1);
358 for (i = 0; i <= L_nx; i++) {
359 for (j = 0; j <= L_ny; j++) {
361 Fs, sb_type, unidir_sb_pattern);
369 ipin_to_track_map = (
int *****)
my_malloc(
sizeof(
int ****) * L_num_types);
371 sizeof(
struct s_ivec ***) * L_num_types);
372 for (i = 0; i < L_num_types; ++i) {
374 nodes_per_chan, Fc_in[i], &types[i], perturb_ipins[i],
377 ipin_to_track_map[i], Fc_in[i], types[i].height,
378 types[i].num_pins, nodes_per_chan);
385 opin_to_track_map = (
int *****)
my_malloc(
386 sizeof(
int ****) * L_num_types);
387 for (i = 0; i < L_num_types; ++i) {
389 nodes_per_chan, Fc_out[i], &types[i],
FALSE, directionality);
402 L_rr_edge_done, track_to_ipin_lookup, opin_to_track_map,
403 switch_block_conn, L_grid, L_nx, L_ny, Fs, unidir_sb_pattern,
405 delayless_switch, directionality, wire_to_ipin_switch, &Fc_clipped, directs, num_directs, clb_to_clb_directs);
407 #ifdef MUX_SIZE_DIST_DISPLAY
411 seg_details, seg_details);
425 wire_to_ipin_switch, base_cost_type);
432 num_seg_types, num_switches, segment_inf, global_route_switch,
433 delayless_switch, wire_to_ipin_switch, seg_details, Fc_in, Fc_out,
434 opin_to_track_map, ipin_to_track_map, track_to_ipin_lookup,
435 switch_block_conn, perturb_ipins);
447 free_matrix(Fc_out,0, L_num_types, 0,
sizeof(
int));
452 perturb_ipins = NULL;
454 if (switch_block_conn) {
456 switch_block_conn = NULL;
458 if (L_rr_edge_done) {
459 free(L_rr_edge_done);
460 L_rr_edge_done = NULL;
470 if (unidir_sb_pattern) {
472 unidir_sb_pattern = NULL;
474 if (opin_to_track_map) {
475 for (i = 0; i < L_num_types; ++i) {
476 free_matrix4(opin_to_track_map[i], 0, types[i].num_pins - 1, 0,
477 types[i].height - 1, 0, 3, 0,
sizeof(
int));
479 free(opin_to_track_map);
484 if(clb_to_clb_directs != NULL) {
485 free(clb_to_clb_directs);
void ** alloc_matrix(int nrmin, int nrmax, int ncmin, int ncmax, size_t elsize)
void free_matrix4(void *vptr, int nrmin, int nrmax, int ncmin, int ncmax, int ndmin, int ndmax, int nemin, size_t elsize)
void free_matrix(void *vptr, int nrmin, int nrmax, int ncmin, size_t elsize)
static t_seg_details * alloc_and_load_global_route_seg_details(INP int nodes_per_chan, INP int global_route_switch)
t_seg_details * alloc_and_load_seg_details(INOUTP int *nodes_per_chan, INP int max_len, INP int num_seg_types, INP t_segment_inf *segment_inf, INP boolean use_full_seg_groups, INP boolean is_global_graph, INP enum e_directionality directionality)
void check_rr_graph(INP t_graph_type graph_type, INP t_type_ptr types, INP int L_nx, INP int L_ny, INP int nodes_per_chan, INP int Fs, INP int num_seg_types, INP int num_switches, INP t_segment_inf *segment_inf, INP int global_route_switch, INP int delayless_switch, INP int wire_to_ipin_switch, t_seg_details *seg_details, int **Fc_in, int **Fc_out, int *****opin_to_track_map, int *****ipin_to_track_map, t_ivec ****track_to_ipin_lookup, t_ivec ***switch_block_conn, boolean *perturb_ipins)
void load_sblock_pattern_lookup(INP int i, INP int j, INP int nodes_per_chan, INP t_seg_details *seg_details, INP int Fs, INP enum e_switch_block_type switch_block_type, INOUTP short *****sblock_pattern)
struct s_ivec *** alloc_and_load_rr_node_indices(INP int nodes_per_chan, INP int L_nx, INP int L_ny, INOUTP int *index, INP t_seg_details *seg_details)
static void free_type_pin_to_track_map(int *****ipin_to_track_map, t_type_ptr types)
static int **** alloc_and_load_pin_to_track_map(INP enum e_pin_type pin_type, INP int nodes_per_chan, INP int *Fc, INP t_type_ptr Type, INP boolean perturb_switch_pattern, INP enum e_directionality directionality)
boolean getEchoEnabled(void)
static void rr_graph_externals(t_timing_inf timing_inf, t_segment_inf *segment_inf, int num_seg_types, int nodes_per_chan, int wire_to_ipin_switch, enum e_base_cost_type base_cost_type)
static void free_type_track_to_ipin_map(struct s_ivec ****track_to_pin_map, t_type_ptr types, int nodes_per_chan)
struct s_ivec *** alloc_and_load_switch_block_conn(INP int nodes_per_chan, INP enum e_switch_block_type switch_block_type, INP int Fs)
static int ** alloc_and_load_actual_fc(INP int L_num_types, INP t_type_ptr types, INP int nodes_per_chan, INP boolean is_Fc_out, INP enum e_directionality directionality, OUTP boolean *Fc_clipped, INP boolean ignore_Fc_0)
static void * my_malloc(int ibytes)
static t_clb_to_clb_directs * alloc_and_load_clb_to_clb_directs(INP t_direct_inf *directs, INP int num_directs)
void dump_rr_graph(INP const char *file_name)
boolean isEchoFileEnabled(enum e_echo_files echo_option)
void free_sblock_pattern_lookup(INOUTP short *****sblock_pattern)
t_ivec *** rr_node_indices
void free_seg_details(t_seg_details *seg_details, int nodes_per_chan)
static void alloc_and_load_rr_graph(INP int num_nodes, INP t_rr_node *L_rr_node, INP int num_seg_types, INP t_seg_details *seg_details, INP boolean *L_rr_edge_done, INP struct s_ivec ****track_to_ipin_lookup, INP int *****opin_to_track_map, INP struct s_ivec ***switch_block_conn, INP struct s_grid_tile **L_grid, INP int L_nx, INP int L_ny, INP int Fs, INP short *****sblock_pattern, INP int **Fc_out, INP int **Fc_xofs, INP int **Fc_yofs, INP t_ivec ***L_rr_node_indices, INP int nodes_per_chan, INP enum e_switch_block_type sb_type, INP int delayless_switch, INP enum e_directionality directionality, INP int wire_to_ipin_switch, OUTP boolean *Fc_clipped, INP t_direct_inf *directs, INP int num_directs, INP t_clb_to_clb_directs *clb_to_clb_directs)
static boolean * alloc_and_load_perturb_ipins(INP int nodes_per_chan, INP int L_num_types, INP int **Fc_in, INP int **Fc_out, INP enum e_directionality directionality)
short ***** alloc_sblock_pattern_lookup(INP int L_nx, INP int L_ny, INP int nodes_per_chan)
struct s_type_descriptor * type_descriptors
char * getEchoFileName(enum e_echo_files echo_option)
void free_switch_block_conn(struct s_ivec ***switch_block_conn, int nodes_per_chan)
void dump_seg_details(t_seg_details *seg_details, int nodes_per_chan, const char *fname)
static struct s_ivec *** alloc_and_load_track_to_pin_lookup(INP int ****pin_to_track_map, INP int *Fc, INP int height, INP int num_pins, INP int nodes_per_chan)