Go to the source code of this file.
Functions | |
void | update_screen (int priority, char *msg, enum pic_type pic_on_screen_val, boolean crit_path_button_enabled) |
void | alloc_draw_structs (void) |
void | init_draw_coords (float clb_width) |
void | set_graphics_state (boolean show_graphics_val, int gr_automode_val, enum e_route_type route_type) |
void alloc_draw_structs | ( | void | ) |
Definition at line 455 of file draw.c.
00456 { 00457 00458 /* Allocate the structures needed to draw the placement and routing. Set * 00459 * up the default colors for blocks and nets. */ 00460 00461 tile_x = (float *)my_malloc((nx + 2) * sizeof(float)); 00462 tile_y = (float *)my_malloc((ny + 2) * sizeof(float)); 00463 00464 net_color = (enum color_types *) 00465 my_malloc(num_nets * sizeof(enum color_types)); 00466 00467 block_color = (enum color_types *) 00468 my_malloc(num_blocks * sizeof(enum color_types)); 00469 00470 deselect_all(); /* Set initial colors */ 00471 }
void init_draw_coords | ( | float | clb_width | ) |
Definition at line 475 of file draw.c.
00476 { 00477 00478 /* Load the arrays containing the left and bottom coordinates of the clbs * 00479 * forming the FPGA. tile_width_val sets the width and height of a drawn * 00480 * clb. */ 00481 00482 int i; 00483 int j; 00484 00485 if(!show_graphics) 00486 return; /* -nodisp was selected. */ 00487 00488 tile_width = width_val; 00489 pin_size = 0.3; 00490 for(i = 0; i < num_types; ++i) 00491 { 00492 pin_size = 00493 min(pin_size, 00494 (tile_width / (4.0 * type_descriptors[i].num_pins))); 00495 } 00496 00497 j = 0; 00498 for(i = 0; i < (nx + 1); i++) 00499 { 00500 tile_x[i] = (i * tile_width) + j; 00501 j += chan_width_y[i] + 1; /* N wires need N+1 units of space */ 00502 } 00503 tile_x[nx + 1] = ((nx + 1) * tile_width) + j; 00504 00505 j = 0; 00506 for(i = 0; i < (ny + 1); ++i) 00507 { 00508 tile_y[i] = (i * tile_width) + j; 00509 j += chan_width_x[i] + 1; 00510 } 00511 tile_y[ny + 1] = ((ny + 1) * tile_width) + j; 00512 00513 init_world(0.0, 00514 tile_y[ny + 1] + tile_width, tile_x[nx + 1] + tile_width, 0.0); 00515 }
void set_graphics_state | ( | boolean | show_graphics_val, | |
int | gr_automode_val, | |||
enum e_route_type | route_type | |||
) |
Definition at line 155 of file draw.c.
00158 { 00159 00160 /* Sets the static show_graphics and gr_automode variables to the * 00161 * desired values. They control if graphics are enabled and, if so, * 00162 * how often the user is prompted for input. */ 00163 00164 show_graphics = show_graphics_val; 00165 gr_automode = gr_automode_val; 00166 draw_route_type = route_type; 00167 }
void update_screen | ( | int | priority, | |
char * | msg, | |||
enum pic_type | pic_on_screen_val, | |||
boolean | crit_path_button_enabled | |||
) |
Definition at line 171 of file draw.c.
00175 { 00176 00177 /* Updates the screen if the user has requested graphics. The priority * 00178 * value controls whether or not the Proceed button must be clicked to * 00179 * continue. Saves the pic_on_screen_val to allow pan and zoom redraws. */ 00180 00181 if(!show_graphics) /* Graphics turned off */ 00182 return; 00183 00184 00185 00186 /* If it's the type of picture displayed has changed, set up the proper * 00187 * buttons. */ 00188 if(pic_on_screen != pic_on_screen_val) 00189 { 00190 if(pic_on_screen_val == PLACEMENT && pic_on_screen == NO_PICTURE) 00191 { 00192 create_button("Window", "Toggle Nets", toggle_nets); 00193 } 00194 else if(pic_on_screen_val == ROUTING 00195 && pic_on_screen == PLACEMENT) 00196 { 00197 create_button("Toggle Nets", "Toggle RR", toggle_rr); 00198 create_button("Toggle RR", "Congestion", 00199 toggle_congestion); 00200 00201 if(crit_path_button_enabled) 00202 { 00203 create_button("Congestion", "Crit. Path", 00204 highlight_crit_path); 00205 } 00206 } 00207 else if(pic_on_screen_val == PLACEMENT 00208 && pic_on_screen == ROUTING) 00209 { 00210 destroy_button("Toggle RR"); 00211 destroy_button("Congestion"); 00212 00213 if(crit_path_button_enabled) 00214 { 00215 destroy_button("Crit. Path"); 00216 } 00217 } 00218 else if(pic_on_screen_val == ROUTING 00219 && pic_on_screen == NO_PICTURE) 00220 { 00221 create_button("Window", "Toggle Nets", toggle_nets); 00222 create_button("Toggle Nets", "Toggle RR", toggle_rr); 00223 create_button("Toggle RR", "Congestion", 00224 toggle_congestion); 00225 00226 if(crit_path_button_enabled) 00227 { 00228 create_button("Congestion", "Crit. Path", 00229 highlight_crit_path); 00230 } 00231 } 00232 } 00233 /* Save the main message. */ 00234 00235 my_strncpy(default_message, msg, BUFSIZE); 00236 00237 pic_on_screen = pic_on_screen_val; 00238 update_message(msg); 00239 drawscreen(); 00240 if(priority >= gr_automode) 00241 { 00242 event_loop(highlight_blocks, drawscreen); 00243 } 00244 else 00245 { 00246 flushinput(); 00247 } 00248 }