00001 #include "util.h"
00002 #include "vpr_types.h"
00003 #include "globals_declare.h"
00004 #include "read_arch.h"
00005 #include "rr_graph.h"
00006 #include "draw.h"
00007 #include "graphics.h"
00008 #include <assert.h>
00009
00010 int
00011 main()
00012 {
00013 char msg[BUFSIZE] = "This is a test.";
00014 struct s_det_routing_arch det_routing_arch;
00015 t_segment_inf *segment_inf;
00016 t_timing_inf timing_inf;
00017 t_subblock_data subblock_data;
00018 t_chan_width_dist chan_width_dist;
00019 int nodes_per_chan;
00020 int i, j;
00021
00022 read_arch("test.arch", DETAILED, &det_routing_arch, &segment_inf,
00023 &timing_inf, &subblock_data, &chan_width_dist);
00024
00025 print_arch("test.arch", DETAILED, det_routing_arch, segment_inf,
00026 timing_inf, subblock_data, chan_width_dist);
00027
00028 num_clbs = 64;
00029 init_arch(1., FALSE);
00030 printf("nx = %d; ny = %d\n", nx, ny);
00031
00032 printf("Setting Nodes Per Channel ...\n");
00033
00034 nodes_per_chan = 8;
00035 for(i = 0; i < nx + 1; i++)
00036 chan_width_x[i] = nodes_per_chan;
00037 for(i = 0; i < ny + 1; i++)
00038 chan_width_y[i] = nodes_per_chan;
00039
00040 printf("Building rr_graph ...\n");
00041 build_rr_graph(DETAILED, det_routing_arch, segment_inf, timing_inf,
00042 INTRINSIC_DELAY);
00043 printf("Dumpping rr_graph ...\n");
00044 dump_rr_graph("rr_graph.echo");
00045
00046 printf("Done.\n");
00047
00048 printf("num_nets = %d\n", num_nets);
00049 printf("s_net = %d\n", (int)net);
00050
00051 num_nets = 0;
00052 num_blocks = 0;
00053 clb = my_malloc(sizeof(struct s_clb *) * (nx + 2));
00054 for(i = 0; i < nx + 2; i++)
00055 {
00056 clb[i] = my_malloc(sizeof(struct s_clb) * (ny + 2));
00057 }
00058 for(i = 0; i < nx + 2; i++)
00059 {
00060 for(j = 0; j < ny + 2; j++)
00061 {
00062 clb[i][j].type = CLB;
00063 clb[i][j].occ = 0;
00064 clb[i][j].u.block = 0;
00065 }
00066 }
00067 for(i = 0; i < nx + 2; i++)
00068 {
00069 clb[i][0].type = IO;
00070 clb[i][ny + 1].type = IO;
00071 clb[i][0].u.io_blocks = my_malloc(sizeof(int) * io_rat);
00072 clb[i][ny + 1].u.io_blocks = my_malloc(sizeof(int) * io_rat);
00073 }
00074 for(j = 0; j < ny + 2; j++)
00075 {
00076 clb[0][j].type = IO;
00077 clb[nx + 1][j].type = IO;
00078 clb[0][j].u.io_blocks = my_malloc(sizeof(int) * io_rat);
00079 clb[nx + 1][j].u.io_blocks = my_malloc(sizeof(int) * io_rat);
00080 }
00081 clb[0][0].type = ILLEGAL;
00082 clb[0][ny + 1].type = ILLEGAL;
00083 clb[nx + 1][0].type = ILLEGAL;
00084 clb[nx + 1][ny + 1].type = ILLEGAL;
00085
00086 set_graphics_state(TRUE, 0, DETAILED);
00087 init_graphics("testing drawing capabilities");
00088 alloc_draw_structs();
00089 init_draw_coords(pins_per_clb);
00090 printf("num_rr_nodes = %d\n", num_rr_nodes);
00091 update_screen(MAJOR, msg, ROUTING, FALSE);
00092 while(1);
00093 close_graphics();
00094
00095 return 0;
00096 }