Esempio n. 1
0
static void compute_delta_clb_to_outpad(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 source_x, source_y, sink_x, sink_y;
  int delta_x, delta_y;
  enum e_block_types source_type, sink_type;

  source_type = CLB;
  sink_type = OUTPAD;

  delta_clb_to_outpad[0][0] = IMPOSSIBLE;
  delta_clb_to_outpad[nx][ny] = IMPOSSIBLE;

  sink_x = 0; sink_y = 1;
  for (source_x = 1; source_x <= nx; source_x ++) {
    for (source_y =1; source_y <= ny; source_y ++) {
      delta_x = abs(source_x - sink_x);
      delta_y = abs(source_y - sink_y);

      delta_clb_to_outpad[delta_x][delta_y] =
	assign_blocks_and_route_net (source_type, source_x, source_y, sink_type,
				     sink_x, sink_y,router_opts, det_routing_arch,
				     segment_inf,timing_inf);
    }
  }

  sink_x = 1; sink_y = 0;
  source_x = 1;
  delta_x = abs(source_x - sink_x);
  for (source_y = 1; source_y <= ny; source_y ++) {
    delta_y = abs(source_y - sink_y);
    delta_clb_to_outpad[delta_x][delta_y] =
      assign_blocks_and_route_net (source_type, source_x, source_y, sink_type,
				   sink_x, sink_y, router_opts, det_routing_arch,
				   segment_inf,timing_inf);
  }

  sink_x = 1; sink_y = 0;
  source_y = ny;
  delta_y = abs(source_y - sink_y);
  for (source_x = 2; source_x <= nx; source_x ++) {
    delta_x = abs(source_x - sink_x);
    delta_clb_to_outpad[delta_x][delta_y] =
      assign_blocks_and_route_net (source_type, source_x, source_y, sink_type,
				   sink_x, sink_y, router_opts, det_routing_arch,
				   segment_inf,timing_inf);
  }
}
Esempio n. 2
0
static void generic_compute_matrix(float ***matrix_ptr,
                            enum e_block_types source_type,
			    enum e_block_types 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
			    ){

  int delta_x, delta_y;
  int sink_x, sink_y;

  for (sink_x = start_x; sink_x <= end_x; sink_x ++) {
    for (sink_y = start_y; sink_y <= end_y; sink_y ++) {
      delta_x = abs(sink_x - source_x);
      delta_y = abs(sink_y - source_y);

      if (delta_x == 0 && delta_y ==0)
	continue;  /*do not compute distance from a block to itself     */
                   /*if a value is desired, pre-assign it somewhere else*/

      (*matrix_ptr)[delta_x][delta_y] =
	assign_blocks_and_route_net (source_type, source_x, source_y,
				     sink_type, sink_x, sink_y, router_opts,
				     det_routing_arch,
				     segment_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)
{

    /*this routine must compute delay values in a slightly different way than the */
    /*other compute routines. We cannot use a location close to the edge as the  */
    /*source location for the majority of the delay computations  because this   */
    /*would give gradually increasing delay values. To avoid this from happening */
    /*a clb that is at least longest_length away from an edge should be chosen   */
    /*as a source , if longest_length is more than 0.5 of the total size then    */
    /*choose a CLB at the center as the source CLB */

    int source_x, source_y, sink_x, sink_y;
    int start_x, start_y, end_x, end_y;
    int delta_x, delta_y;
    t_type_ptr source_type, sink_type;

    source_type = FILL_TYPE;
    sink_type = FILL_TYPE;

    if(longest_length < 0.5 * (nx))
	{
	    start_x = longest_length;
	}
    else
	{
	    start_x = (int)(0.5 * nx);
	}
    end_x = nx;
    source_x = start_x;

    if(longest_length < 0.5 * (ny))
	{
	    start_y = longest_length;
	}
    else
	{
	    start_y = (int)(0.5 * ny);
	}
    end_y = ny;
    source_y = start_y;


    /*don't put the sink all the way to the corner, until it is necessary */
    for(sink_x = start_x; sink_x <= end_x - 1; sink_x++)
	{
	    for(sink_y = start_y; sink_y <= end_y - 1; sink_y++)
		{
		    delta_x = abs(sink_x - source_x);
		    delta_y = abs(sink_y - source_y);

		    if(delta_x == 0 && delta_y == 0)
			{
			    delta_clb_to_clb[delta_x][delta_y] = 0.0;
			    continue;
			}
		    delta_clb_to_clb[delta_x][delta_y] =
			assign_blocks_and_route_net(source_type, source_x,
						    source_y, sink_type,
						    sink_x, sink_y,
						    router_opts,
						    det_routing_arch,
						    segment_inf, timing_inf);
		}

	}


    sink_x = end_x - 1;
    sink_y = end_y - 1;

    for(source_x = start_x - 1; source_x >= 1; source_x--)
	{
	    for(source_y = start_y; source_y <= end_y - 1; source_y++)
		{
		    delta_x = abs(sink_x - source_x);
		    delta_y = abs(sink_y - source_y);

		    delta_clb_to_clb[delta_x][delta_y] =
			assign_blocks_and_route_net(source_type, source_x,
						    source_y, sink_type,
						    sink_x, sink_y,
						    router_opts,
						    det_routing_arch,
						    segment_inf, timing_inf);
		}
	}

    for(source_x = 1; source_x <= end_x - 1; source_x++)
	{
	    for(source_y = 1; source_y < start_y; source_y++)
		{
		    delta_x = abs(sink_x - source_x);
		    delta_y = abs(sink_y - source_y);

		    delta_clb_to_clb[delta_x][delta_y] =
			assign_blocks_and_route_net(source_type, source_x,
						    source_y, sink_type,
						    sink_x, sink_y,
						    router_opts,
						    det_routing_arch,
						    segment_inf, timing_inf);
		}
	}


    /*now move sink into the top right corner */
    sink_x = end_x;
    sink_y = end_y;
    source_x = 1;
    for(source_y = 1; source_y <= end_y; source_y++)
	{
	    delta_x = abs(sink_x - source_x);
	    delta_y = abs(sink_y - source_y);

	    delta_clb_to_clb[delta_x][delta_y] =
		assign_blocks_and_route_net(source_type, source_x, source_y,
					    sink_type, sink_x, sink_y,
					    router_opts, det_routing_arch,
					    segment_inf, timing_inf);

	}

    sink_x = end_x;
    sink_y = end_y;
    source_y = 1;
    for(source_x = 1; source_x <= end_x; source_x++)
	{
	    delta_x = abs(sink_x - source_x);
	    delta_y = abs(sink_y - source_y);

	    delta_clb_to_clb[delta_x][delta_y] =
		assign_blocks_and_route_net(source_type, source_x, source_y,
					    sink_type, sink_x, sink_y,
					    router_opts, det_routing_arch,
					    segment_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)
{
    int source_x, source_y, sink_x, sink_y;
    int delta_x, delta_y;
    t_type_ptr source_type, sink_type;

    source_type = IO_TYPE;
    sink_type = IO_TYPE;

    delta_io_to_io[0][0] = 0;	/*delay to itself is 0 (this can happen) */
    delta_io_to_io[nx + 1][ny + 1] = IMPOSSIBLE;
    delta_io_to_io[0][ny] = IMPOSSIBLE;
    delta_io_to_io[nx][0] = IMPOSSIBLE;
    delta_io_to_io[nx][ny + 1] = IMPOSSIBLE;
    delta_io_to_io[nx + 1][ny] = IMPOSSIBLE;


    source_x = 0;
    source_y = 1;
    sink_x = 0;
    delta_x = abs(sink_x - source_x);


    for(sink_y = 2; sink_y <= ny; sink_y++)
	{
	    delta_y = abs(sink_y - source_y);
	    delta_io_to_io[delta_x][delta_y] =
		assign_blocks_and_route_net(source_type, source_x, source_y,
					    sink_type, sink_x, sink_y,
					    router_opts, det_routing_arch,
					    segment_inf, timing_inf);

	}

    source_x = 0;
    source_y = 1;
    sink_x = nx + 1;
    delta_x = abs(sink_x - source_x);

    for(sink_y = 1; sink_y <= ny; sink_y++)
	{
	    delta_y = abs(sink_y - source_y);
	    delta_io_to_io[delta_x][delta_y] =
		assign_blocks_and_route_net(source_type, source_x, source_y,
					    sink_type, sink_x, sink_y,
					    router_opts, det_routing_arch,
					    segment_inf, timing_inf);

	}


    source_x = 1;
    source_y = 0;
    sink_y = 0;
    delta_y = abs(sink_y - source_y);

    for(sink_x = 2; sink_x <= nx; sink_x++)
	{
	    delta_x = abs(sink_x - source_x);
	    delta_io_to_io[delta_x][delta_y] =
		assign_blocks_and_route_net(source_type, source_x, source_y,
					    sink_type, sink_x, sink_y,
					    router_opts, det_routing_arch,
					    segment_inf, timing_inf);

	}

    source_x = 1;
    source_y = 0;
    sink_y = ny + 1;
    delta_y = abs(sink_y - source_y);

    for(sink_x = 1; sink_x <= nx; sink_x++)
	{
	    delta_x = abs(sink_x - source_x);
	    delta_io_to_io[delta_x][delta_y] =
		assign_blocks_and_route_net(source_type, source_x, source_y,
					    sink_type, sink_x, sink_y,
					    router_opts, det_routing_arch,
					    segment_inf, timing_inf);

	}

    source_x = 0;
    sink_y = ny + 1;
    for(source_y = 1; source_y <= ny; source_y++)
	{
	    for(sink_x = 1; sink_x <= nx; sink_x++)
		{
		    delta_y = abs(source_y - sink_y);
		    delta_x = abs(source_x - sink_x);
		    delta_io_to_io[delta_x][delta_y] =
			assign_blocks_and_route_net(source_type, source_x,
						    source_y, sink_type,
						    sink_x, sink_y,
						    router_opts,
						    det_routing_arch,
						    segment_inf, timing_inf);

		}
	}
}