⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 timing_place_lookup.c

📁 用于学术研究的FPGA布局布线软件VPR
💻 C
📖 第 1 页 / 共 3 页
字号:
    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_fb_to_fb[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_fb_to_fb[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_fb_to_fb[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_fb_to_fb[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 voidcompute_delta_io_to_fb(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;    int start_x, start_y, end_x, end_y;    t_type_ptr source_type, sink_type;    source_type = IO_TYPE;    sink_type = FILL_TYPE;    delta_io_to_fb[0][0] = IMPOSSIBLE;    delta_io_to_fb[nx][ny] = IMPOSSIBLE;    source_x = 0;    source_y = 1;    start_x = 1;    end_x = nx;    start_y = 1;    end_y = ny;    generic_compute_matrix(&delta_io_to_fb, source_type, sink_type,			   source_x, source_y, start_x, end_x, start_y,			   end_y, router_opts, det_routing_arch,			   segment_inf, timing_inf);    source_x = 1;    source_y = 0;    start_x = 1;    end_x = 1;    start_y = 1;    end_y = ny;    generic_compute_matrix(&delta_io_to_fb, source_type, sink_type,			   source_x, source_y, start_x, end_x, start_y,			   end_y, router_opts, det_routing_arch,			   segment_inf, timing_inf);    start_x = 1;    end_x = nx;    start_y = ny;    end_y = ny;    generic_compute_matrix(&delta_io_to_fb, source_type, sink_type,			   source_x, source_y, start_x, end_x, start_y,			   end_y, router_opts, det_routing_arch,			   segment_inf, timing_inf);}/**************************************/static voidcompute_delta_fb_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 = FILL_TYPE;    sink_type = IO_TYPE;    delta_fb_to_io[0][0] = IMPOSSIBLE;    delta_fb_to_io[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_fb_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);		}	}    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_fb_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);	}    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_fb_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);	}}/**************************************/static voidcompute_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);		}	}}/**************************************/#ifdef PRINT_ARRAYSstatic voidprint_array(float **array_to_print,	    int x1,	    int x2,	    int y1,	    int y2){    int idx_x, idx_y;    fprintf(lookup_dump, "\nPrinting Array \n\n");    for(idx_y = y2; idx_y >= y1; idx_y--)	{	    for(idx_x = x1; idx_x <= x2; idx_x++)		{		    fprintf(lookup_dump, " %9.2e",			    array_to_print[idx_x][idx_y]);		}	    fprintf(lookup_dump, "\n");	}    fprintf(lookup_dump, "\n\n");}#endif/**************************************/static voidcompute_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){    printf	("Computing delta_io_to_io lookup matrix, may take a few seconds, please wait...\n");    compute_delta_io_to_io(router_opts, det_routing_arch, segment_inf,			   timing_inf);    printf	("Computing delta_io_to_fb lookup matrix, may take a few seconds, please wait...\n");    compute_delta_io_to_fb(router_opts, det_routing_arch, segment_inf,			   timing_inf);    printf	("Computing delta_fb_to_io lookup matrix, may take a few seconds, please wait...\n");    compute_delta_fb_to_io(router_opts, det_routing_arch, segment_inf,			   timing_inf);    printf	("Computing delta_fb_to_fb lookup matrix, may take a few seconds, please wait...\n");    compute_delta_fb_to_fb(router_opts, det_routing_arch, segment_inf,			   timing_inf, longest_length);#ifdef PRINT_ARRAYS    lookup_dump = my_fopen(DUMPFILE, "w");    fprintf(lookup_dump, "\n\nprinting delta_fb_to_fb\n");    print_array(delta_fb_to_fb, 0, nx - 1, 0, ny - 1);    fprintf(lookup_dump, "\n\nprinting delta_io_to_fb\n");    print_array(delta_io_to_fb, 0, nx, 0, ny);    fprintf(lookup_dump, "\n\nprinting delta_fb_to_io\n");    print_array(delta_fb_to_io, 0, nx, 0, ny);    fprintf(lookup_dump, "\n\nprinting delta_io_to_io\n");    print_array(delta_io_to_io, 0, nx + 1, 0, ny + 1);    fclose(lookup_dump);#endif}/******* Globally Accessable Functions **********//**************************************/voidcompute_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,			    t_subblock_data subblock_data){    static struct s_net *original_net;	/*this will be used as a pointer to remember what */    /*the "real" nets in the circuit are. This is    */    /*required because we are using the net structure */    /*in these routines to find delays between blocks */    static struct s_block *original_block;	/*same def as original_nets, but for block  */    static int original_num_nets;    static int original_num_blocks;    static int longest_length;    load_simplified_device();    alloc_and_assign_internal_structures(&original_net,					 &original_block,					 &original_num_nets,					 &original_num_blocks);    setup_chan_width(router_opts, chan_width_dist);    alloc_routing_structs(router_opts, det_routing_arch, segment_inf,			  timing_inf, subblock_data);    longest_length =	get_longest_segment_length(det_routing_arch, segment_inf);    /*now setup and compute the actual arrays */    alloc_delta_arrays();    compute_delta_arrays(router_opts, det_routing_arch, segment_inf,			 timing_inf, longest_length);    /*free all data structures that are no longer needed */    free_routing_structs(router_opts, det_routing_arch, segment_inf,			 timing_inf);    restore_original_device();    free_and_reset_internal_structures(original_net, original_block,				       original_num_nets,				       original_num_blocks);}/**************************************/voidfree_place_lookup_structs(void){    free_delta_arrays();}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -