コード例 #1
0
ファイル: draw.c プロジェクト: BackupTheBerlios/pvpr
static void toggle_congestion (void (*drawscreen_ptr) (void)) {

/* Turns the congestion display on and off.   */

 char msg[BUFSIZE];
 int inode, num_congested;

 show_nets = FALSE;
 draw_rr_toggle = DRAW_NO_RR;
 show_congestion = !show_congestion;

 if (!show_congestion) {
    update_message (default_message);
 }
 else {
    num_congested = 0;
    for (inode=0;inode<num_rr_nodes;inode++) {
       if (rr_node[inode].occ > rr_node[inode].capacity) 
          num_congested++;
    }

    sprintf (msg, "%d routing resources are overused.", num_congested);
    update_message (msg);
 }
 
 drawscreen_ptr ();
}
コード例 #2
0
ファイル: draw.c プロジェクト: BackupTheBerlios/pvpr
static void toggle_nets (void (*drawscreen_ptr) (void)) {

/* Enables/disables drawing of nets when a the user clicks on a button.    *
 * Also disables drawing of routing resources.  See graphics.c for details *
 * of how buttons work.                                                    */

 show_nets = !show_nets;
 draw_rr_toggle = DRAW_NO_RR; 
 show_congestion = FALSE;

 update_message (default_message);
 drawscreen_ptr ();
}
コード例 #3
0
ファイル: draw.c プロジェクト: BackupTheBerlios/pvpr
static void toggle_rr (void (*drawscreen_ptr) (void)) {

/* Cycles through the options for viewing the routing resources available   *
 * in an FPGA.  If a routing isn't on screen, the routing graph hasn't been *
 * built, and this routine doesn't switch the view. Otherwise, this routine *
 * switches to the routing resource view.  Clicking on the toggle cycles    *
 * through the options:  DRAW_NO_RR, DRAW_ALL_RR, DRAW_ALL_BUT_BUFFERS_RR,  *
 * DRAW_NODES_AND_SBOX_RR, and DRAW_NODES_RR.                               */

 draw_rr_toggle = (draw_rr_toggle + 1) % (DRAW_NODES_RR + 1);
 show_nets = FALSE;
 show_congestion = FALSE;

 update_message (default_message);
 drawscreen_ptr ();
}
コード例 #4
0
ファイル: utility.cpp プロジェクト: swlpark/ece1387
void act_on_toggle_nets_button (void (*drawscreen_ptr) (void)) {
     show_nets = (show_nets) ? false : true;
     // Re-draw the screen (a few squares are changing colour with time)
     drawscreen_ptr();  
}
コード例 #5
0
ファイル: draw.c プロジェクト: BackupTheBerlios/pvpr
static void highlight_crit_path (void (*drawscreen_ptr) (void)) {

/* Highlights all the blocks and nets on the critical path.                 */

 t_linked_int *critical_path_head, *critical_path_node;
 int inode, iblk, inet, num_nets_seen;
 static int nets_to_highlight = 1;
 char msg[BUFSIZE];

 if (nets_to_highlight == 0) {   /* Clear the display of all highlighting. */
    nets_to_highlight = 1;
    deselect_all ();
    update_message (default_message);
    drawscreen_ptr ();
    return;
 }
    
 critical_path_head = allocate_and_load_critical_path ();
 critical_path_node = critical_path_head;
 num_nets_seen = 0;

 while (critical_path_node != NULL)  {

    inode = critical_path_node->data;
    get_tnode_block_and_output_net (inode, &iblk, &inet);

    if (num_nets_seen == nets_to_highlight)            /* Last block */
       block_color[iblk] = MAGENTA;
    else if (num_nets_seen == nets_to_highlight - 1)   /* 2nd last block */
       block_color[iblk] = YELLOW;
    else if (num_nets_seen < nets_to_highlight)    /* Earlier block */
       block_color[iblk] = DARKGREEN;

    if (inet != OPEN) {
       num_nets_seen++;

       if (num_nets_seen < nets_to_highlight)   /* First nets. */
          net_color[inet] = DARKGREEN;
       else if (num_nets_seen == nets_to_highlight) 
          net_color[inet] = CYAN;               /* Last (new) net. */
    }

    critical_path_node = critical_path_node->next;
 }

 if (nets_to_highlight == num_nets_seen) {
    nets_to_highlight = 0;
    sprintf (msg, "All %d nets on the critical path highlighted.", 
            num_nets_seen);
 }
 else {
    sprintf (msg, "First %d nets on the critical path highlighted.", 
            nets_to_highlight);
    nets_to_highlight++;
 }

 free_int_list (&critical_path_head);

 update_message (msg);
 drawscreen_ptr ();
}