VPR-7.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
timing_place_lookup.c File Reference
#include <stdio.h>
#include <math.h>
#include <string.h>
#include "util.h"
#include "vpr_types.h"
#include "globals.h"
#include "route_common.h"
#include "place_and_route.h"
#include "route_tree_timing.h"
#include "route_timing.h"
#include "timing_place_lookup.h"
#include "rr_graph.h"
#include "route_export.h"
#include <assert.h>
#include "read_xml_arch_file.h"
+ Include dependency graph for timing_place_lookup.c:

Go to the source code of this file.

Macros

#define NET_COUNT   1 /*we only use one net in these routines, */
 
#define NET_USED   0 /*we use net at location zero of the net */
 
#define NET_USED_SOURCE_BLOCK   0 /*net.block[0] is source block */
 
#define NET_USED_SINK_BLOCK   1 /*net.block[1] is sink block */
 
#define SOURCE_BLOCK   0 /*block[0] is source */
 
#define SINK_BLOCK   1 /*block[1] is sink */
 
#define BLOCK_COUNT   2 /*use 2 blocks to compute delay between */
 
#define NUM_TYPES_USED   3 /* number of types used in look up */
 
#define DEBUG_TIMING_PLACE_LOOKUP   /*initialize arrays to known state */
 
#define DUMPFILE   "lookup_dump.echo"
 

Functions

static void alloc_net (void)
 
static void alloc_block (void)
 
static void load_simplified_device (void)
 
static void restore_original_device (void)
 
static void alloc_and_assign_internal_structures (struct s_net **original_net, struct s_block **original_block, int *original_num_nets, int *original_num_blocks)
 
static void free_and_reset_internal_structures (struct s_net *original_net, struct s_block *original_block, int original_num_nets, int original_num_blocks)
 
static void setup_chan_width (struct s_router_opts router_opts, t_chan_width_dist chan_width_dist)
 
static void alloc_routing_structs (struct s_router_opts router_opts, struct s_det_routing_arch det_routing_arch, t_segment_inf *segment_inf, t_timing_inf timing_inf, INP t_direct_inf *directs, INP int num_directs)
 
static void free_routing_structs (struct s_router_opts router_opts, struct s_det_routing_arch det_routing_arch, t_segment_inf *segment_inf, t_timing_inf timing_inf)
 
static void assign_locations (t_type_ptr source_type, int source_x_loc, int source_y_loc, int source_z_loc, t_type_ptr sink_type, int sink_x_loc, int sink_y_loc, int sink_z_loc)
 
static float assign_blocks_and_route_net (t_type_ptr source_type, int source_x_loc, int source_y_loc, t_type_ptr sink_type, int sink_x_loc, int sink_y_loc, struct s_router_opts router_opts, struct s_det_routing_arch det_routing_arch, t_segment_inf *segment_inf, t_timing_inf timing_inf)
 
static void alloc_delta_arrays (void)
 
static void free_delta_arrays (void)
 
static void generic_compute_matrix (float ***matrix_ptr, t_type_ptr source_type, t_type_ptr sink_type, int source_x, int source_y, int start_x, int end_x, int start_y, int end_y, struct s_router_opts router_opts, struct s_det_routing_arch det_routing_arch, t_segment_inf *segment_inf, t_timing_inf timing_inf)
 
static void compute_delta_clb_to_clb (struct s_router_opts router_opts, struct s_det_routing_arch det_routing_arch, t_segment_inf *segment_inf, t_timing_inf timing_inf, int longest_length)
 
static void compute_delta_io_to_clb (struct s_router_opts router_opts, struct s_det_routing_arch det_routing_arch, t_segment_inf *segment_inf, t_timing_inf timing_inf)
 
static void compute_delta_clb_to_io (struct s_router_opts router_opts, struct s_det_routing_arch det_routing_arch, t_segment_inf *segment_inf, t_timing_inf timing_inf)
 
static void compute_delta_io_to_io (struct s_router_opts router_opts, struct s_det_routing_arch det_routing_arch, t_segment_inf *segment_inf, t_timing_inf timing_inf)
 
static void compute_delta_arrays (struct s_router_opts router_opts, struct s_det_routing_arch det_routing_arch, t_segment_inf *segment_inf, t_timing_inf timing_inf, int longest_length)
 
static int get_first_pin (enum e_pin_type pintype, t_type_ptr type)
 
static int get_longest_segment_length (struct s_det_routing_arch det_routing_arch, t_segment_inf *segment_inf)
 
static void reset_placement (void)
 
void compute_delay_lookup_tables (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_chan_width_dist chan_width_dist, INP t_direct_inf *directs, INP int num_directs)
 
void free_place_lookup_structs (void)
 

Variables

float ** delta_io_to_clb
 
float ** delta_clb_to_clb
 
float ** delta_clb_to_io
 
float ** delta_io_to_io
 
static float ** net_delay
 
static float * pin_criticality
 
static int * sink_order
 
static t_rt_node ** rt_node_of_sink
 
static t_type_ptr IO_TYPE_BACKUP
 
static t_type_ptr EMPTY_TYPE_BACKUP
 
static t_type_ptr FILL_TYPE_BACKUP
 
static t_type_descriptor dummy_type_descriptors [NUM_TYPES_USED]
 
static t_type_descriptortype_descriptors_backup
 
static struct s_grid_tile ** grid_backup
 
static int num_types_backup
 
static t_ivec ** clb_opins_used_locally
 

Macro Definition Documentation

#define BLOCK_COUNT   2 /*use 2 blocks to compute delay between */

Definition at line 46 of file timing_place_lookup.c.

#define DEBUG_TIMING_PLACE_LOOKUP   /*initialize arrays to known state */

Definition at line 55 of file timing_place_lookup.c.

#define DUMPFILE   "lookup_dump.echo"

Definition at line 57 of file timing_place_lookup.c.

#define NET_COUNT   1 /*we only use one net in these routines, */

Definition at line 35 of file timing_place_lookup.c.

#define NET_USED   0 /*we use net at location zero of the net */

Definition at line 39 of file timing_place_lookup.c.

#define NET_USED_SINK_BLOCK   1 /*net.block[1] is sink block */

Definition at line 42 of file timing_place_lookup.c.

#define NET_USED_SOURCE_BLOCK   0 /*net.block[0] is source block */

Definition at line 41 of file timing_place_lookup.c.

#define NUM_TYPES_USED   3 /* number of types used in look up */

Definition at line 53 of file timing_place_lookup.c.

#define SINK_BLOCK   1 /*block[1] is sink */

Definition at line 44 of file timing_place_lookup.c.

#define SOURCE_BLOCK   0 /*block[0] is source */

Definition at line 43 of file timing_place_lookup.c.

Function Documentation

static void alloc_and_assign_internal_structures ( struct s_net **  original_net,
struct s_block **  original_block,
int *  original_num_nets,
int *  original_num_blocks 
)
static

Definition at line 344 of file timing_place_lookup.c.

346  {
347  /*allocate new data structures to hold net, and block info */
348 
349  *original_net = clb_net;
350  *original_num_nets = num_nets;
352  alloc_net();
353 
354  *original_block = block;
355  *original_num_blocks = num_blocks;
357  alloc_block();
358 
359  /* [0..num_nets-1][1..num_pins-1] */
360  net_delay = (float **) alloc_matrix(0, NET_COUNT - 1, 1, BLOCK_COUNT - 1,
361  sizeof(float));
362 
363  reset_placement();
364 }
void ** alloc_matrix(int nrmin, int nrmax, int ncmin, int ncmax, size_t elsize)
Definition: util.c:551
static void alloc_net(void)
static void alloc_block(void)
static float ** net_delay
#define NET_COUNT
int num_nets
Definition: globals.c:27
int num_blocks
Definition: globals.c:30
static void reset_placement(void)
struct s_block * block
Definition: globals.c:31
struct s_net * clb_net
Definition: globals.c:28
#define BLOCK_COUNT

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void alloc_block ( void  )
static

Definition at line 236 of file timing_place_lookup.c.

236  {
237 
238  /*allocates block structure, and assigns values to known parameters */
239  /*type and x,y fields are left undefined at this stage since they */
240  /*are not known until we start moving blocks through the clb array */
241 
242  int ix_b, ix_p, len, i;
243  int max_pins;
244 
245  max_pins = 0;
246  for (i = 0; i < NUM_TYPES_USED; i++) {
247  max_pins = std::max(max_pins, type_descriptors[i].num_pins);
248  }
249 
250  block = (struct s_block *) my_malloc(num_blocks * sizeof(struct s_block));
251 
252  for (ix_b = 0; ix_b < BLOCK_COUNT; ix_b++) {
253  len = strlen("TEMP_BLOCK");
254  block[ix_b].name = (char *) my_malloc((len + 1) * sizeof(char));
255  strcpy(block[ix_b].name, "TEMP_BLOCK");
256 
257  block[ix_b].nets = (int *) my_malloc(max_pins * sizeof(int));
258  block[ix_b].nets[0] = 0;
259  for (ix_p = 1; ix_p < max_pins; ix_p++)
260  block[ix_b].nets[ix_p] = OPEN;
261  }
262 }
int num_blocks
Definition: globals.c:30
char * name
Definition: vpr_types.h:560
static void * my_malloc(int ibytes)
Definition: graphics.c:499
#define max(a, b)
Definition: graphics.c:171
struct s_block * block
Definition: globals.c:31
Definition: slre.c:50
int * nets
Definition: vpr_types.h:562
#define NUM_TYPES_USED
struct s_type_descriptor * type_descriptors
Definition: globals.c:38
#define BLOCK_COUNT

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void alloc_delta_arrays ( void  )
static

Definition at line 565 of file timing_place_lookup.c.

565  {
566  int id_x, id_y;
567 
568  delta_clb_to_clb = (float **) alloc_matrix(0, nx - 1, 0, ny - 1,
569  sizeof(float));
570  delta_io_to_clb = (float **) alloc_matrix(0, nx, 0, ny, sizeof(float));
571  delta_clb_to_io = (float **) alloc_matrix(0, nx, 0, ny, sizeof(float));
572  delta_io_to_io = (float **) alloc_matrix(0, nx + 1, 0, ny + 1,
573  sizeof(float));
574 
575  /*initialize all of the array locations to -1 */
576 
577  for (id_x = 0; id_x <= nx; id_x++) {
578  for (id_y = 0; id_y <= ny; id_y++) {
579  delta_io_to_clb[id_x][id_y] = IMPOSSIBLE;
580  }
581  }
582  for (id_x = 0; id_x <= nx - 1; id_x++) {
583  for (id_y = 0; id_y <= ny - 1; id_y++) {
584  delta_clb_to_clb[id_x][id_y] = IMPOSSIBLE;
585  }
586  }
587  for (id_x = 0; id_x <= nx; id_x++) {
588  for (id_y = 0; id_y <= ny; id_y++) {
589  delta_clb_to_io[id_x][id_y] = IMPOSSIBLE;
590  }
591  }
592  for (id_x = 0; id_x <= nx + 1; id_x++) {
593  for (id_y = 0; id_y <= ny + 1; id_y++) {
594  delta_io_to_io[id_x][id_y] = IMPOSSIBLE;
595  }
596  }
597 }
void ** alloc_matrix(int nrmin, int nrmax, int ncmin, int ncmax, size_t elsize)
Definition: util.c:551
float ** delta_clb_to_clb
float ** delta_io_to_clb
#define IMPOSSIBLE
int nx
Definition: globals.c:46
float ** delta_io_to_io
float ** delta_clb_to_io
int ny
Definition: globals.c:47

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void alloc_net ( void  )
static

Definition at line 211 of file timing_place_lookup.c.

211  {
212 
213  int i, len;
214 
215  clb_net = (struct s_net *) my_malloc(num_nets * sizeof(struct s_net));
216  for (i = 0; i < NET_COUNT; i++) {
217  /* FIXME: We *really* shouldn't be allocating write-once copies */
218  len = strlen("TEMP_NET");
219  clb_net[i].name = (char *) my_malloc((len + 1) * sizeof(char));
220  clb_net[i].is_global = FALSE;
221  strcpy(clb_net[NET_USED].name, "TEMP_NET");
222 
223  clb_net[i].num_sinks = (BLOCK_COUNT - 1);
224  clb_net[i].node_block = (int *) my_malloc(BLOCK_COUNT * sizeof(int));
227 
228  clb_net[i].node_block_pin = (int *) my_malloc(
229  BLOCK_COUNT * sizeof(int));
230  /*the values for this are allocated in assign_blocks_and_route_net */
231 
232  }
233 }
int * node_block_pin
Definition: vpr_types.h:509
#define NET_USED
#define NET_USED_SOURCE_BLOCK
#define NET_COUNT
int num_nets
Definition: globals.c:27
int * node_block
Definition: vpr_types.h:507
char * name
Definition: vpr_types.h:505
Definition: util.h:12
static void * my_malloc(int ibytes)
Definition: graphics.c:499
struct s_net * clb_net
Definition: globals.c:28
boolean is_global
Definition: vpr_types.h:510
#define NET_USED_SINK_BLOCK
int num_sinks
Definition: vpr_types.h:506
#define BLOCK_COUNT

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void alloc_routing_structs ( struct s_router_opts  router_opts,
struct s_det_routing_arch  det_routing_arch,
t_segment_inf segment_inf,
t_timing_inf  timing_inf,
INP t_direct_inf directs,
INP int  num_directs 
)
static

Definition at line 422 of file timing_place_lookup.c.

425  {
426 
427  int bb_factor;
428  int warnings;
429  t_graph_type graph_type;
430 
431  /*calls routines that set up routing resource graph and associated structures */
432 
433  /*must set up dummy blocks for the first pass through to setup locally used opins */
434  /* Only one block per tile */
435  assign_locations(FILL_TYPE, 1, 1, 0, FILL_TYPE, nx, ny, 0);
436 
438 
439  free_rr_graph();
440 
441  if (router_opts.route_type == GLOBAL) {
442  graph_type = GRAPH_GLOBAL;
443  } else {
444  graph_type = (
445  det_routing_arch.directionality == BI_DIRECTIONAL ?
447  }
448 
450  chan_width_x[0], NULL, det_routing_arch.switch_block_type,
451  det_routing_arch.Fs, det_routing_arch.num_segment,
452  det_routing_arch.num_switch, segment_inf,
453  det_routing_arch.global_route_switch,
454  det_routing_arch.delayless_switch, timing_inf,
455  det_routing_arch.wire_to_ipin_switch, router_opts.base_cost_type,
456  NULL, 0, TRUE, /* do not send in direct connections because we care about general placement timing instead of special pin placement timing */
457  &warnings);
458 
460 
462  &rt_node_of_sink);
463 
464  bb_factor = nx + ny; /*set it to a huge value */
465  init_route_structs(bb_factor);
466 }
t_type_ptr FILL_TYPE
Definition: globals.c:42
void free_rr_graph(void)
Definition: rr_graph.c:798
short delayless_switch
Definition: vpr_types.h:764
short global_route_switch
Definition: vpr_types.h:763
static void assign_locations(t_type_ptr source_type, int source_x_loc, int source_y_loc, int source_z_loc, t_type_ptr sink_type, int sink_x_loc, int sink_y_loc, int sink_z_loc)
enum e_graph_type t_graph_type
Definition: rr_graph.h:11
int * chan_width_x
Definition: globals.c:56
static t_ivec ** clb_opins_used_locally
void alloc_and_load_rr_node_route_structs(void)
Definition: route_common.c:785
void init_route_structs(int bb_factor)
Definition: route_common.c:394
enum e_directionality directionality
Definition: vpr_types.h:758
void build_rr_graph(INP t_graph_type graph_type, INP int L_num_types, INP t_type_ptr types, INP int L_nx, INP int L_ny, INP struct s_grid_tile **L_grid, INP int chan_width, INP struct s_chan_width_dist *chan_capacity_inf, INP enum e_switch_block_type sb_type, 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 t_timing_inf timing_inf, INP int wire_to_ipin_switch, INP enum e_base_cost_type base_cost_type, INP t_direct_inf *directs, INP int num_directs, INP boolean ignore_Fc_0, OUTP int *Warnings)
Definition: rr_graph.c:192
static float * pin_criticality
int nx
Definition: globals.c:46
t_ivec ** alloc_route_structs(void)
Definition: route_common.c:611
void alloc_timing_driven_route_structs(float **pin_criticality_ptr, int **sink_order_ptr, t_rt_node ***rt_node_of_sink_ptr)
Definition: route_timing.c:253
enum e_route_type route_type
Definition: vpr_types.h:703
struct s_grid_tile ** grid
Definition: globals.c:59
enum e_switch_block_type switch_block_type
Definition: vpr_types.h:760
int num_types
Definition: globals.c:37
static t_type_descriptor dummy_type_descriptors[NUM_TYPES_USED]
static t_rt_node ** rt_node_of_sink
int ny
Definition: globals.c:47
short wire_to_ipin_switch
Definition: vpr_types.h:765
enum e_base_cost_type base_cost_type
Definition: vpr_types.h:706
Definition: util.h:12
static int * sink_order

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static float assign_blocks_and_route_net ( t_type_ptr  source_type,
int  source_x_loc,
int  source_y_loc,
t_type_ptr  sink_type,
int  sink_x_loc,
int  sink_y_loc,
struct s_router_opts  router_opts,
struct s_det_routing_arch  det_routing_arch,
t_segment_inf segment_inf,
t_timing_inf  timing_inf 
)
static

Definition at line 521 of file timing_place_lookup.c.

525  {
526  /*places blocks at the specified locations, and routes a net between them */
527  /*returns the delay of this net */
528 
529  float pres_fac, net_delay_value;
530 
531  int source_z_loc, sink_z_loc;
532 
533  /* Only one block per tile */
534  source_z_loc = 0;
535  sink_z_loc = 0;
536 
537  net_delay_value = IMPOSSIBLE; /*set to known value for debug purposes */
538 
539  assign_locations(source_type, source_x_loc, source_y_loc, source_z_loc,
540  sink_type, sink_x_loc, sink_y_loc, sink_z_loc);
541 
543 
544  pres_fac = 0; /* ignore congestion */
545 
546  /* Route this net with a dummy criticality of 0 by calling
547  timing_driven_route_net with slacks set to NULL. */
549  router_opts.max_criticality, router_opts.criticality_exp,
550  router_opts.astar_fac, router_opts.bend_cost,
552  net_delay[NET_USED], NULL);
553 
554  net_delay_value = net_delay[NET_USED][NET_USED_SINK_BLOCK];
555 
556  grid[source_x_loc][source_y_loc].usage = 0;
557  grid[source_x_loc][source_y_loc].blocks[source_z_loc] = EMPTY;
558  grid[sink_x_loc][sink_y_loc].usage = 0;
559  grid[sink_x_loc][sink_y_loc].blocks[sink_z_loc] = EMPTY;
560 
561  return (net_delay_value);
562 }
#define NET_USED
static void assign_locations(t_type_ptr source_type, int source_x_loc, int source_y_loc, int source_z_loc, t_type_ptr sink_type, int sink_x_loc, int sink_y_loc, int sink_z_loc)
static float ** net_delay
#define IMPOSSIBLE
void load_net_rr_terminals(t_ivec ***L_rr_node_indices)
Definition: rr_graph.c:855
static float pres_fac
#define EMPTY
Definition: vpr_types.h:90
float bend_cost
Definition: vpr_types.h:700
static float * pin_criticality
struct s_grid_tile ** grid
Definition: globals.c:59
float astar_fac
Definition: vpr_types.h:707
int * blocks
Definition: vpr_types.h:525
t_ivec *** rr_node_indices
Definition: globals.c:71
boolean timing_driven_route_net(int inet, float pres_fac, float max_criticality, float criticality_exp, float astar_fac, float bend_cost, float *pin_criticality, int *sink_order, t_rt_node **rt_node_of_sink, float *net_delay, t_slack *slacks)
Definition: route_timing.c:307
float max_criticality
Definition: vpr_types.h:708
float criticality_exp
Definition: vpr_types.h:709
static t_rt_node ** rt_node_of_sink
#define NET_USED_SINK_BLOCK
static int * sink_order

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void assign_locations ( t_type_ptr  source_type,
int  source_x_loc,
int  source_y_loc,
int  source_z_loc,
t_type_ptr  sink_type,
int  sink_x_loc,
int  sink_y_loc,
int  sink_z_loc 
)
static

Definition at line 493 of file timing_place_lookup.c.

495  {
496  /*all routing occurs between block 0 (source) and block 1 (sink) */
497  block[SOURCE_BLOCK].type = source_type;
498  block[SOURCE_BLOCK].x = source_x_loc;
499  block[SOURCE_BLOCK].y = source_y_loc;
500  block[SOURCE_BLOCK].z = source_z_loc;
501 
502  block[SINK_BLOCK].type = sink_type;
503  block[SINK_BLOCK].x = sink_x_loc;
504  block[SINK_BLOCK].y = sink_y_loc;
505  block[SINK_BLOCK].z = sink_z_loc;
506 
507  grid[source_x_loc][source_y_loc].blocks[source_z_loc] = SOURCE_BLOCK;
508  grid[sink_x_loc][sink_y_loc].blocks[sink_z_loc] = SINK_BLOCK;
509 
511  DRIVER, block[SOURCE_BLOCK].type);
513  RECEIVER, block[SINK_BLOCK].type);
514 
515  grid[source_x_loc][source_y_loc].usage += 1;
516  grid[sink_x_loc][sink_y_loc].usage += 1;
517 
518 }
int * node_block_pin
Definition: vpr_types.h:509
static int get_first_pin(enum e_pin_type pintype, t_type_ptr type)
#define NET_USED
#define SINK_BLOCK
#define SOURCE_BLOCK
int x
Definition: vpr_types.h:563
#define NET_USED_SOURCE_BLOCK
t_type_ptr type
Definition: vpr_types.h:561
int y
Definition: vpr_types.h:564
struct s_block * block
Definition: globals.c:31
struct s_net * clb_net
Definition: globals.c:28
struct s_grid_tile ** grid
Definition: globals.c:59
int * blocks
Definition: vpr_types.h:525
int z
Definition: vpr_types.h:565
#define NET_USED_SINK_BLOCK

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void compute_delay_lookup_tables ( 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_chan_width_dist  chan_width_dist,
INP t_direct_inf directs,
INP int  num_directs 
)

Definition at line 978 of file timing_place_lookup.c.

981  {
982 
983  static struct s_net *original_net; /*this will be used as a pointer to remember what */
984 
985  /*the "real" nets in the circuit are. This is */
986  /*required because we are using the net structure */
987  /*in these routines to find delays between blocks */
988  static struct s_block *original_block; /*same def as original_nets, but for block */
989 
990  static int original_num_nets;
991  static int original_num_blocks;
992  static int longest_length;
993 
995 
996  alloc_and_assign_internal_structures(&original_net, &original_block,
997  &original_num_nets, &original_num_blocks);
998  setup_chan_width(router_opts, chan_width_dist);
999 
1000  alloc_routing_structs(router_opts, det_routing_arch, segment_inf,
1001  timing_inf, directs, num_directs);
1002 
1003  longest_length = get_longest_segment_length(det_routing_arch, segment_inf);
1004 
1005  /*now setup and compute the actual arrays */
1007  compute_delta_arrays(router_opts, det_routing_arch, segment_inf, timing_inf,
1008  longest_length);
1009 
1010  /*free all data structures that are no longer needed */
1011  free_routing_structs(router_opts, det_routing_arch, segment_inf,
1012  timing_inf);
1013 
1015 
1016  free_and_reset_internal_structures(original_net, original_block,
1017  original_num_nets, original_num_blocks);
1018 }
static void load_simplified_device(void)
static void alloc_delta_arrays(void)
static void free_and_reset_internal_structures(struct s_net *original_net, struct s_block *original_block, int original_num_nets, int original_num_blocks)
static void free_routing_structs(struct s_router_opts router_opts, struct s_det_routing_arch det_routing_arch, t_segment_inf *segment_inf, t_timing_inf timing_inf)
static void compute_delta_arrays(struct s_router_opts router_opts, struct s_det_routing_arch det_routing_arch, t_segment_inf *segment_inf, t_timing_inf timing_inf, int longest_length)
static void setup_chan_width(struct s_router_opts router_opts, t_chan_width_dist chan_width_dist)
static int get_longest_segment_length(struct s_det_routing_arch det_routing_arch, t_segment_inf *segment_inf)
static void restore_original_device(void)
static void alloc_routing_structs(struct s_router_opts router_opts, struct s_det_routing_arch det_routing_arch, t_segment_inf *segment_inf, t_timing_inf timing_inf, INP t_direct_inf *directs, INP int num_directs)
static void alloc_and_assign_internal_structures(struct s_net **original_net, struct s_block **original_block, int *original_num_nets, int *original_num_blocks)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void compute_delta_arrays ( struct s_router_opts  router_opts,
struct s_det_routing_arch  det_routing_arch,
t_segment_inf segment_inf,
t_timing_inf  timing_inf,
int  longest_length 
)
static

Definition at line 947 of file timing_place_lookup.c.

949  {
950 
951  vpr_printf(TIO_MESSAGE_INFO, "Computing delta_io_to_io lookup matrix, may take a few seconds, please wait...\n");
952  compute_delta_io_to_io(router_opts, det_routing_arch, segment_inf, timing_inf);
953  vpr_printf(TIO_MESSAGE_INFO, "Computing delta_io_to_clb lookup matrix, may take a few seconds, please wait...\n");
954  compute_delta_io_to_clb(router_opts, det_routing_arch, segment_inf, timing_inf);
955  vpr_printf(TIO_MESSAGE_INFO, "Computing delta_clb_to_io lookup matrix, may take a few seconds, please wait...\n");
956  compute_delta_clb_to_io(router_opts, det_routing_arch, segment_inf, timing_inf);
957  vpr_printf(TIO_MESSAGE_INFO, "Computing delta_clb_to_clb lookup matrix, may take a few seconds, please wait...\n");
958  compute_delta_clb_to_clb(router_opts, det_routing_arch, segment_inf, timing_inf, longest_length);
959 
960 #ifdef PRINT_ARRAYS
961  lookup_dump = my_fopen(DUMPFILE, "w", 0);
962  fprintf(lookup_dump, "\n\nprinting delta_clb_to_clb\n");
963  print_array(delta_clb_to_clb, 0, nx - 1, 0, ny - 1);
964  fprintf(lookup_dump, "\n\nprinting delta_io_to_clb\n");
965  print_array(delta_io_to_clb, 0, nx, 0, ny);
966  fprintf(lookup_dump, "\n\nprinting delta_clb_to_io\n");
967  print_array(delta_clb_to_io, 0, nx, 0, ny);
968  fprintf(lookup_dump, "\n\nprinting delta_io_to_io\n");
969  print_array(delta_io_to_io, 0, nx + 1, 0, ny + 1);
970  fclose(lookup_dump);
971 #endif
972 
973 }
FILE * my_fopen(const char *fname, const char *flag, int prompt)
Definition: util.c:54
static void compute_delta_io_to_io(struct s_router_opts router_opts, struct s_det_routing_arch det_routing_arch, t_segment_inf *segment_inf, t_timing_inf timing_inf)
float ** delta_clb_to_clb
float ** delta_io_to_clb
static void compute_delta_clb_to_io(struct s_router_opts router_opts, struct s_det_routing_arch det_routing_arch, t_segment_inf *segment_inf, t_timing_inf timing_inf)
#define DUMPFILE
int nx
Definition: globals.c:46
float ** delta_io_to_io
float ** delta_clb_to_io
static void compute_delta_clb_to_clb(struct s_router_opts router_opts, struct s_det_routing_arch det_routing_arch, t_segment_inf *segment_inf, t_timing_inf timing_inf, int longest_length)
int ny
Definition: globals.c:47
messagelogger vpr_printf
Definition: util.c:17
static void compute_delta_io_to_clb(struct s_router_opts router_opts, struct s_det_routing_arch det_routing_arch, t_segment_inf *segment_inf, t_timing_inf timing_inf)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void compute_delta_clb_to_clb ( struct s_router_opts  router_opts,
struct s_det_routing_arch  det_routing_arch,
t_segment_inf segment_inf,
t_timing_inf  timing_inf,
int  longest_length 
)
static

Definition at line 636 of file timing_place_lookup.c.

638  {
639 
640  /*this routine must compute delay values in a slightly different way than the */
641  /*other compute routines. We cannot use a location close to the edge as the */
642  /*source location for the majority of the delay computations because this */
643  /*would give gradually increasing delay values. To avoid this from happening */
644  /*a clb that is at least longest_length away from an edge should be chosen */
645  /*as a source , if longest_length is more than 0.5 of the total size then */
646  /*choose a CLB at the center as the source CLB */
647 
648  int source_x, source_y, sink_x, sink_y;
649  int start_x, start_y, end_x, end_y;
650  int delta_x, delta_y;
651  t_type_ptr source_type, sink_type;
652 
653  source_type = FILL_TYPE;
654  sink_type = FILL_TYPE;
655 
656  if (longest_length < 0.5 * (nx)) {
657  start_x = longest_length;
658  } else {
659  start_x = (int) (0.5 * nx);
660  }
661  end_x = nx;
662  source_x = start_x;
663 
664  if (longest_length < 0.5 * (ny)) {
665  start_y = longest_length;
666  } else {
667  start_y = (int) (0.5 * ny);
668  }
669  end_y = ny;
670  source_y = start_y;
671 
672  /*don't put the sink all the way to the corner, until it is necessary */
673  for (sink_x = start_x; sink_x <= end_x - 1; sink_x++) {
674  for (sink_y = start_y; sink_y <= end_y - 1; sink_y++) {
675  delta_x = abs(sink_x - source_x);
676  delta_y = abs(sink_y - source_y);
677 
678  if (delta_x == 0 && delta_y == 0) {
679  delta_clb_to_clb[delta_x][delta_y] = 0.0;
680  continue;
681  }
682  delta_clb_to_clb[delta_x][delta_y] = assign_blocks_and_route_net(
683  source_type, source_x, source_y, sink_type, sink_x, sink_y,
684  router_opts, det_routing_arch, segment_inf, timing_inf);
685  }
686 
687  }
688 
689  sink_x = end_x - 1;
690  sink_y = end_y - 1;
691 
692  for (source_x = start_x - 1; source_x >= 1; source_x--) {
693  for (source_y = start_y; source_y <= end_y - 1; source_y++) {
694  delta_x = abs(sink_x - source_x);
695  delta_y = abs(sink_y - source_y);
696 
697  delta_clb_to_clb[delta_x][delta_y] = assign_blocks_and_route_net(
698  source_type, source_x, source_y, sink_type, sink_x, sink_y,
699  router_opts, det_routing_arch, segment_inf, timing_inf);
700  }
701  }
702 
703  for (source_x = 1; source_x <= end_x - 1; source_x++) {
704  for (source_y = 1; source_y < start_y; source_y++) {
705  delta_x = abs(sink_x - source_x);
706  delta_y = abs(sink_y - source_y);
707 
708  delta_clb_to_clb[delta_x][delta_y] = assign_blocks_and_route_net(
709  source_type, source_x, source_y, sink_type, sink_x, sink_y,
710  router_opts, det_routing_arch, segment_inf, timing_inf);
711  }
712  }
713 
714  /*now move sink into the top right corner */
715  sink_x = end_x;
716  sink_y = end_y;
717  source_x = 1;
718  for (source_y = 1; source_y <= end_y; source_y++) {
719  delta_x = abs(sink_x - source_x);
720  delta_y = abs(sink_y - source_y);
721 
722  delta_clb_to_clb[delta_x][delta_y] = assign_blocks_and_route_net(
723  source_type, source_x, source_y, sink_type, sink_x, sink_y,
724  router_opts, det_routing_arch, segment_inf, timing_inf);
725 
726  }
727 
728  sink_x = end_x;
729  sink_y = end_y;
730  source_y = 1;
731  for (source_x = 1; source_x <= end_x; source_x++) {
732  delta_x = abs(sink_x - source_x);
733  delta_y = abs(sink_y - source_y);
734 
735  delta_clb_to_clb[delta_x][delta_y] = assign_blocks_and_route_net(
736  source_type, source_x, source_y, sink_type, sink_x, sink_y,
737  router_opts, det_routing_arch, segment_inf, timing_inf);
738  }
739 }
t_type_ptr FILL_TYPE
Definition: globals.c:42
float ** delta_clb_to_clb
int nx
Definition: globals.c:46
int ny
Definition: globals.c:47
static float assign_blocks_and_route_net(t_type_ptr source_type, int source_x_loc, int source_y_loc, t_type_ptr sink_type, int sink_x_loc, int sink_y_loc, struct s_router_opts router_opts, struct s_det_routing_arch det_routing_arch, t_segment_inf *segment_inf, t_timing_inf timing_inf)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void compute_delta_clb_to_io ( struct s_router_opts  router_opts,
struct s_det_routing_arch  det_routing_arch,
t_segment_inf segment_inf,
t_timing_inf  timing_inf 
)
static

Definition at line 787 of file timing_place_lookup.c.

789  {
790  int source_x, source_y, sink_x, sink_y;
791  int delta_x, delta_y;
792  t_type_ptr source_type, sink_type;
793 
794  source_type = FILL_TYPE;
795  sink_type = IO_TYPE;
796 
797  delta_clb_to_io[0][0] = IMPOSSIBLE;
799 
800  sink_x = 0;
801  sink_y = 1;
802  for (source_x = 1; source_x <= nx; source_x++) {
803  for (source_y = 1; source_y <= ny; source_y++) {
804  delta_x = abs(source_x - sink_x);
805  delta_y = abs(source_y - sink_y);
806 
807  delta_clb_to_io[delta_x][delta_y] = assign_blocks_and_route_net(
808  source_type, source_x, source_y, sink_type, sink_x, sink_y,
809  router_opts, det_routing_arch, segment_inf, timing_inf);
810  }
811  }
812 
813  sink_x = 1;
814  sink_y = 0;
815  source_x = 1;
816  delta_x = abs(source_x - sink_x);
817  for (source_y = 1; source_y <= ny; source_y++) {
818  delta_y = abs(source_y - sink_y);
819  delta_clb_to_io[delta_x][delta_y] = assign_blocks_and_route_net(
820  source_type, source_x, source_y, sink_type, sink_x, sink_y,
821  router_opts, det_routing_arch, segment_inf, timing_inf);
822  }
823 
824  sink_x = 1;
825  sink_y = 0;
826  source_y = ny;
827  delta_y = abs(source_y - sink_y);
828  for (source_x = 2; source_x <= nx; source_x++) {
829  delta_x = abs(source_x - sink_x);
830  delta_clb_to_io[delta_x][delta_y] = assign_blocks_and_route_net(
831  source_type, source_x, source_y, sink_type, sink_x, sink_y,
832  router_opts, det_routing_arch, segment_inf, timing_inf);
833  }
834 }
t_type_ptr FILL_TYPE
Definition: globals.c:42
#define IMPOSSIBLE
int nx
Definition: globals.c:46
float ** delta_clb_to_io
t_type_ptr IO_TYPE
Definition: globals.c:40
int ny
Definition: globals.c:47
static float assign_blocks_and_route_net(t_type_ptr source_type, int source_x_loc, int source_y_loc, t_type_ptr sink_type, int sink_x_loc, int sink_y_loc, struct s_router_opts router_opts, struct s_det_routing_arch det_routing_arch, t_segment_inf *segment_inf, t_timing_inf timing_inf)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void compute_delta_io_to_clb ( struct s_router_opts  router_opts,
struct s_det_routing_arch  det_routing_arch,
t_segment_inf segment_inf,
t_timing_inf  timing_inf 
)
static

Definition at line 742 of file timing_place_lookup.c.

744  {
745  int source_x, source_y;
746  int start_x, start_y, end_x, end_y;
747  t_type_ptr source_type, sink_type;
748 
749  source_type = IO_TYPE;
750  sink_type = FILL_TYPE;
751 
752  delta_io_to_clb[0][0] = IMPOSSIBLE;
754 
755  source_x = 0;
756  source_y = 1;
757 
758  start_x = 1;
759  end_x = nx;
760  start_y = 1;
761  end_y = ny;
762  generic_compute_matrix(&delta_io_to_clb, source_type, sink_type, source_x,
763  source_y, start_x, end_x, start_y, end_y, router_opts,
764  det_routing_arch, segment_inf, timing_inf);
765 
766  source_x = 1;
767  source_y = 0;
768 
769  start_x = 1;
770  end_x = 1;
771  start_y = 1;
772  end_y = ny;
773  generic_compute_matrix(&delta_io_to_clb, source_type, sink_type, source_x,
774  source_y, start_x, end_x, start_y, end_y, router_opts,
775  det_routing_arch, segment_inf, timing_inf);
776 
777  start_x = 1;
778  end_x = nx;
779  start_y = ny;
780  end_y = ny;
781  generic_compute_matrix(&delta_io_to_clb, source_type, sink_type, source_x,
782  source_y, start_x, end_x, start_y, end_y, router_opts,
783  det_routing_arch, segment_inf, timing_inf);
784 }
t_type_ptr FILL_TYPE
Definition: globals.c:42
float ** delta_io_to_clb
#define IMPOSSIBLE
int nx
Definition: globals.c:46
t_type_ptr IO_TYPE
Definition: globals.c:40
int ny
Definition: globals.c:47
static void generic_compute_matrix(float ***matrix_ptr, t_type_ptr source_type, t_type_ptr sink_type, int source_x, int source_y, int start_x, int end_x, int start_y, int end_y, struct s_router_opts router_opts, struct s_det_routing_arch det_routing_arch, t_segment_inf *segment_inf, t_timing_inf timing_inf)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void compute_delta_io_to_io ( struct s_router_opts  router_opts,
struct s_det_routing_arch  det_routing_arch,
t_segment_inf segment_inf,
t_timing_inf  timing_inf 
)
static

Definition at line 837 of file timing_place_lookup.c.

839  {
840  int source_x, source_y, sink_x, sink_y;
841  int delta_x, delta_y;
842  t_type_ptr source_type, sink_type;
843 
844  source_type = IO_TYPE;
845  sink_type = IO_TYPE;
846 
847  delta_io_to_io[0][0] = 0; /*delay to itself is 0 (this can happen) */
848  delta_io_to_io[nx + 1][ny + 1] = IMPOSSIBLE;
851  delta_io_to_io[nx][ny + 1] = IMPOSSIBLE;
852  delta_io_to_io[nx + 1][ny] = IMPOSSIBLE;
853 
854  source_x = 0;
855  source_y = 1;
856  sink_x = 0;
857  delta_x = abs(sink_x - source_x);
858 
859  for (sink_y = 2; sink_y <= ny; sink_y++) {
860  delta_y = abs(sink_y - source_y);
861  delta_io_to_io[delta_x][delta_y] = assign_blocks_and_route_net(
862  source_type, source_x, source_y, sink_type, sink_x, sink_y,
863  router_opts, det_routing_arch, segment_inf, timing_inf);
864 
865  }
866 
867  source_x = 0;
868  source_y = 1;
869  sink_x = nx + 1;
870  delta_x = abs(sink_x - source_x);
871 
872  for (sink_y = 1; sink_y <= ny; sink_y++) {
873  delta_y = abs(sink_y - source_y);
874  delta_io_to_io[delta_x][delta_y] = assign_blocks_and_route_net(
875  source_type, source_x, source_y, sink_type, sink_x, sink_y,
876  router_opts, det_routing_arch, segment_inf, timing_inf);
877 
878  }
879 
880  source_x = 1;
881  source_y = 0;
882  sink_y = 0;
883  delta_y = abs(sink_y - source_y);
884 
885  for (sink_x = 2; sink_x <= nx; sink_x++) {
886  delta_x = abs(sink_x - source_x);
887  delta_io_to_io[delta_x][delta_y] = assign_blocks_and_route_net(
888  source_type, source_x, source_y, sink_type, sink_x, sink_y,
889  router_opts, det_routing_arch, segment_inf, timing_inf);
890 
891  }
892 
893  source_x = 1;
894  source_y = 0;
895  sink_y = ny + 1;
896  delta_y = abs(sink_y - source_y);
897 
898  for (sink_x = 1; sink_x <= nx; sink_x++) {
899  delta_x = abs(sink_x - source_x);
900  delta_io_to_io[delta_x][delta_y] = assign_blocks_and_route_net(
901  source_type, source_x, source_y, sink_type, sink_x, sink_y,
902  router_opts, det_routing_arch, segment_inf, timing_inf);
903 
904  }
905 
906  source_x = 0;
907  sink_y = ny + 1;
908  for (source_y = 1; source_y <= ny; source_y++) {
909  for (sink_x = 1; sink_x <= nx; sink_x++) {
910  delta_y = abs(source_y - sink_y);
911  delta_x = abs(source_x - sink_x);
912  delta_io_to_io[delta_x][delta_y] = assign_blocks_and_route_net(
913  source_type, source_x, source_y, sink_type, sink_x, sink_y,
914  router_opts, det_routing_arch, segment_inf, timing_inf);
915 
916  }
917  }
918 }
#define IMPOSSIBLE
int nx
Definition: globals.c:46
float ** delta_io_to_io
t_type_ptr IO_TYPE
Definition: globals.c:40
int ny
Definition: globals.c:47
static float assign_blocks_and_route_net(t_type_ptr source_type, int source_x_loc, int source_y_loc, t_type_ptr sink_type, int sink_x_loc, int sink_y_loc, struct s_router_opts router_opts, struct s_det_routing_arch det_routing_arch, t_segment_inf *segment_inf, t_timing_inf timing_inf)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void free_and_reset_internal_structures ( struct s_net original_net,
struct s_block original_block,
int  original_num_nets,
int  original_num_blocks 
)
static

Definition at line 367 of file timing_place_lookup.c.

369  {
370  /*reset gloabal data structures to the state that they were in before these */
371  /*lookup computation routines were called */
372 
373  int i;
374 
375  /*there should be only one net to free, but this is safer */
376  for (i = 0; i < NET_COUNT; i++) {
377  free(clb_net[i].name);
378  free(clb_net[i].node_block);
379  free(clb_net[i].node_block_pin);
380  }
381  free(clb_net);
382  clb_net = original_net;
383 
384  for (i = 0; i < BLOCK_COUNT; i++) {
385  free(block[i].name);
386  free(block[i].nets);
387  }
388  free(block);
389  block = original_block;
390 
391  num_nets = original_num_nets;
392  num_blocks = original_num_blocks;
393 
394  free_matrix(net_delay, 0, NET_COUNT - 1, 1, sizeof(float));
395 
396 }
void free_matrix(void *vptr, int nrmin, int nrmax, int ncmin, size_t elsize)
Definition: util.c:573
static float ** net_delay
#define NET_COUNT
int num_nets
Definition: globals.c:27
int num_blocks
Definition: globals.c:30
char * name
Definition: vpr_types.h:560
struct s_block * block
Definition: globals.c:31
struct s_net * clb_net
Definition: globals.c:28
int * nets
Definition: vpr_types.h:562
#define BLOCK_COUNT

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void free_delta_arrays ( void  )
static

Definition at line 600 of file timing_place_lookup.c.

600  {
601 
602  free_matrix(delta_io_to_clb, 0, nx, 0, sizeof(float));
603  free_matrix(delta_clb_to_clb, 0, nx - 1, 0, sizeof(float));
604  free_matrix(delta_clb_to_io, 0, nx, 0, sizeof(float));
605  free_matrix(delta_io_to_io, 0, nx + 1, 0, sizeof(float));
606 
607 }
void free_matrix(void *vptr, int nrmin, int nrmax, int ncmin, size_t elsize)
Definition: util.c:573
float ** delta_clb_to_clb
float ** delta_io_to_clb
int nx
Definition: globals.c:46
float ** delta_io_to_io
float ** delta_clb_to_io

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void free_place_lookup_structs ( void  )

Definition at line 1021 of file timing_place_lookup.c.

1021  {
1022 
1024 
1025 }
static void free_delta_arrays(void)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void free_routing_structs ( struct s_router_opts  router_opts,
struct s_det_routing_arch  det_routing_arch,
t_segment_inf segment_inf,
t_timing_inf  timing_inf 
)
static

Definition at line 469 of file timing_place_lookup.c.

471  {
472  int i;
473  free_rr_graph();
474 
478 
481 
482  if (clb_opins_used_locally != NULL) {
483  for (i = 0; i < num_blocks; i++) {
485  block[i].type->num_class - 1);
486  }
488  clb_opins_used_locally = NULL;
489  }
490 }
void free_rr_graph(void)
Definition: rr_graph.c:798
void free_timing_driven_route_structs(float *pin_criticality, int *sink_order, t_rt_node **rt_node_of_sink)
Definition: route_timing.c:279
void free_trace_structs(void)
Definition: route_common.c:733
t_type_ptr type
Definition: vpr_types.h:561
int num_blocks
Definition: globals.c:30
static t_ivec ** clb_opins_used_locally
static float * pin_criticality
struct s_block * block
Definition: globals.c:31
void free_ivec_vector(struct s_ivec *ivec_vector, int nrmin, int nrmax)
Definition: util.c:498
void free_rr_node_route_structs(void)
Definition: route_common.c:828
static t_rt_node ** rt_node_of_sink
void free_route_structs()
Definition: route_common.c:750
static int * sink_order

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void generic_compute_matrix ( float ***  matrix_ptr,
t_type_ptr  source_type,
t_type_ptr  sink_type,
int  source_x,
int  source_y,
int  start_x,
int  end_x,
int  start_y,
int  end_y,
struct s_router_opts  router_opts,
struct s_det_routing_arch  det_routing_arch,
t_segment_inf segment_inf,
t_timing_inf  timing_inf 
)
static

Definition at line 610 of file timing_place_lookup.c.

614  {
615 
616  int delta_x, delta_y;
617  int sink_x, sink_y;
618 
619  for (sink_x = start_x; sink_x <= end_x; sink_x++) {
620  for (sink_y = start_y; sink_y <= end_y; sink_y++) {
621  delta_x = abs(sink_x - source_x);
622  delta_y = abs(sink_y - source_y);
623 
624  if (delta_x == 0 && delta_y == 0)
625  continue; /*do not compute distance from a block to itself */
626  /*if a value is desired, pre-assign it somewhere else */
627 
628  (*matrix_ptr)[delta_x][delta_y] = assign_blocks_and_route_net(
629  source_type, source_x, source_y, sink_type, sink_x, sink_y,
630  router_opts, det_routing_arch, segment_inf, timing_inf);
631  }
632  }
633 }
static float assign_blocks_and_route_net(t_type_ptr source_type, int source_x_loc, int source_y_loc, t_type_ptr sink_type, int sink_x_loc, int sink_y_loc, struct s_router_opts router_opts, struct s_det_routing_arch det_routing_arch, t_segment_inf *segment_inf, t_timing_inf timing_inf)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static int get_first_pin ( enum e_pin_type  pintype,
t_type_ptr  type 
)
static

Definition at line 178 of file timing_place_lookup.c.

178  {
179 
180  /*this code assumes logical equivilance between all driving pins */
181  /*global pins are not hooked up to the temporary net */
182 
183  int i, currpin;
184 
185  currpin = 0;
186  for (i = 0; i < type->num_class; i++) {
187  if (type->class_inf[i].type == pintype && !type->is_global_pin[currpin])
188  return (type->class_inf[i].pinlist[0]);
189  else
190  currpin += type->class_inf[i].num_pins;
191  }
192  assert(0);
193  exit(0); /*should never hit this line */
194 }
struct s_class * class_inf
int * pinlist
enum e_pin_type type
boolean * is_global_pin

+ Here is the caller graph for this function:

static int get_longest_segment_length ( struct s_det_routing_arch  det_routing_arch,
t_segment_inf segment_inf 
)
static

Definition at line 197 of file timing_place_lookup.c.

198  {
199 
200  int i, length;
201 
202  length = 0;
203  for (i = 0; i < det_routing_arch.num_segment; i++) {
204  if (segment_inf[i].length > length)
205  length = segment_inf[i].length;
206  }
207  return (length);
208 }

+ Here is the caller graph for this function:

static void load_simplified_device ( void  )
static

Definition at line 265 of file timing_place_lookup.c.

265  {
266  int i, j;
267 
268  /* Backup original globals */
275 
276  /* Fill in homogeneous core type info */
287 
288  /* Fill in homogeneous core grid info */
289  grid_backup = grid;
290  grid = (struct s_grid_tile **) alloc_matrix(0, nx + 1, 0, ny + 1,
291  sizeof(struct s_grid_tile));
292  for (i = 0; i < nx + 2; i++) {
293  for (j = 0; j < ny + 2; j++) {
294  if ((i == 0 && j == 0) || (i == nx + 1 && j == 0)
295  || (i == 0 && j == ny + 1)
296  || (i == nx + 1 && j == ny + 1)) {
297  grid[i][j].type = EMPTY_TYPE;
298  } else if (i == 0 || i == nx + 1 || j == 0 || j == ny + 1) {
299  grid[i][j].type = IO_TYPE;
300  } else {
301  grid[i][j].type = FILL_TYPE;
302  }
303  grid[i][j].blocks = (int*)my_malloc(
304  grid[i][j].type->capacity * sizeof(int));
305  grid[i][j].offset = 0;
306  }
307  }
308 }
t_type_ptr type
Definition: vpr_types.h:522
static struct s_grid_tile ** grid_backup
t_type_ptr FILL_TYPE
Definition: globals.c:42
void ** alloc_matrix(int nrmin, int nrmax, int ncmin, int ncmax, size_t elsize)
Definition: util.c:551
static t_type_ptr EMPTY_TYPE_BACKUP
t_type_ptr EMPTY_TYPE
Definition: globals.c:41
static t_type_ptr IO_TYPE_BACKUP
static t_type_descriptor * type_descriptors_backup
static t_type_ptr FILL_TYPE_BACKUP
static void * my_malloc(int ibytes)
Definition: graphics.c:499
int nx
Definition: globals.c:46
struct s_grid_tile ** grid
Definition: globals.c:59
int * blocks
Definition: vpr_types.h:525
static int num_types_backup
int num_types
Definition: globals.c:37
t_type_ptr IO_TYPE
Definition: globals.c:40
static t_type_descriptor dummy_type_descriptors[NUM_TYPES_USED]
#define NUM_TYPES_USED
struct s_type_descriptor * type_descriptors
Definition: globals.c:38
int ny
Definition: globals.c:47

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void reset_placement ( void  )
static

Definition at line 330 of file timing_place_lookup.c.

330  {
331  int i, j, k;
332 
333  for (i = 0; i <= nx + 1; i++) {
334  for (j = 0; j <= ny + 1; j++) {
335  grid[i][j].usage = 0;
336  for (k = 0; k < grid[i][j].type->capacity; k++) {
337  grid[i][j].blocks[k] = EMPTY;
338  }
339  }
340  }
341 }
t_type_ptr type
Definition: vpr_types.h:522
#define EMPTY
Definition: vpr_types.h:90
int nx
Definition: globals.c:46
struct s_grid_tile ** grid
Definition: globals.c:59
int * blocks
Definition: vpr_types.h:525
int ny
Definition: globals.c:47

+ Here is the caller graph for this function:

static void restore_original_device ( void  )
static

Definition at line 309 of file timing_place_lookup.c.

309  {
310  int i, j;
311 
312  /* restore previous globals */
318 
319  /* free allocatd data */
320  for (i = 0; i < nx + 2; i++) {
321  for (j = 0; j < ny + 2; j++) {
322  free(grid[i][j].blocks);
323  }
324  }
325  free_matrix(grid, 0, nx + 1, 0, sizeof(struct s_grid_tile));
326  grid = grid_backup;
327 }
static struct s_grid_tile ** grid_backup
t_type_ptr FILL_TYPE
Definition: globals.c:42
static t_type_ptr EMPTY_TYPE_BACKUP
t_type_ptr EMPTY_TYPE
Definition: globals.c:41
void free_matrix(void *vptr, int nrmin, int nrmax, int ncmin, size_t elsize)
Definition: util.c:573
static t_type_ptr IO_TYPE_BACKUP
static t_type_descriptor * type_descriptors_backup
static t_type_ptr FILL_TYPE_BACKUP
int nx
Definition: globals.c:46
struct s_grid_tile ** grid
Definition: globals.c:59
int * blocks
Definition: vpr_types.h:525
static int num_types_backup
int num_types
Definition: globals.c:37
t_type_ptr IO_TYPE
Definition: globals.c:40
struct s_type_descriptor * type_descriptors
Definition: globals.c:38
int ny
Definition: globals.c:47

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void setup_chan_width ( struct s_router_opts  router_opts,
t_chan_width_dist  chan_width_dist 
)
static

Definition at line 399 of file timing_place_lookup.c.

400  {
401  /*we give plenty of tracks, this increases routability for the */
402  /*lookup table generation */
403 
404  int width_fac, i, max_pins_per_clb;
405 
406  max_pins_per_clb = 0;
407  for (i = 0; i < num_types; i++) {
408  max_pins_per_clb = std::max(max_pins_per_clb, type_descriptors[i].num_pins);
409  }
410 
411  if (router_opts.fixed_channel_width == NO_FIXED_CHANNEL_WIDTH)
412  width_fac = 4 * max_pins_per_clb; /*this is 2x the value that binary search starts */
413  /*this should be enough to allow most pins to */
414  /*connect to tracks in the architecture */
415  else
416  width_fac = router_opts.fixed_channel_width;
417 
418  init_chan(width_fac, chan_width_dist);
419 }
int fixed_channel_width
Definition: vpr_types.h:704
#define max(a, b)
Definition: graphics.c:171
void init_chan(int cfactor, t_chan_width_dist chan_width_dist)
int num_types
Definition: globals.c:37
#define NO_FIXED_CHANNEL_WIDTH
Definition: vpr_types.h:692
struct s_type_descriptor * type_descriptors
Definition: globals.c:38

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Variable Documentation

t_ivec** clb_opins_used_locally
static

Definition at line 88 of file timing_place_lookup.c.

float** delta_clb_to_clb

Definition at line 67 of file timing_place_lookup.c.

float** delta_clb_to_io

Definition at line 68 of file timing_place_lookup.c.

float** delta_io_to_clb

Definition at line 66 of file timing_place_lookup.c.

float** delta_io_to_io

Definition at line 69 of file timing_place_lookup.c.

t_type_descriptor dummy_type_descriptors[NUM_TYPES_USED]
static

Definition at line 83 of file timing_place_lookup.c.

t_type_ptr EMPTY_TYPE_BACKUP
static

Definition at line 81 of file timing_place_lookup.c.

t_type_ptr FILL_TYPE_BACKUP
static

Definition at line 82 of file timing_place_lookup.c.

struct s_grid_tile** grid_backup
static

Definition at line 85 of file timing_place_lookup.c.

t_type_ptr IO_TYPE_BACKUP
static

Definition at line 80 of file timing_place_lookup.c.

float** net_delay
static

Definition at line 76 of file timing_place_lookup.c.

int num_types_backup
static

Definition at line 86 of file timing_place_lookup.c.

float* pin_criticality
static

Definition at line 77 of file timing_place_lookup.c.

t_rt_node** rt_node_of_sink
static

Definition at line 79 of file timing_place_lookup.c.

int* sink_order
static

Definition at line 78 of file timing_place_lookup.c.

t_type_descriptor* type_descriptors_backup
static

Definition at line 84 of file timing_place_lookup.c.