vpr/src/device/rr_graph_obj_util.cpp
/*********************************************************************
 * Find a list of rr_nodes that locate at a side of a grid
 **********************************************************************/
Find a list of rr_nodes that locate at a side of a grid
Find a list of rr_nodes that locate at a side of a grid
std::vector<RRNodeId> find_rr_graph_grid_nodes(const RRGraph& rr_graph,
                                               const DeviceGrid& device_grid,
                                               const int& x,
                                               const int& y,
                                               const t_rr_type& rr_type,
                                               const e_side& side) {
    std::vector<RRNodeId> indices;
    VTR_ASSERT(rr_type == IPIN || rr_type == OPIN);
    VTR_ASSERT(size_t(x) <= device_grid.width() && size_t(y) <= device_grid.height());
    VTR_ASSERT(side != NUM_SIDES);
    int width_offset = device_grid[x][y].width_offset;
    int height_offset = device_grid[x][y].height_offset;
    for (int pin = 0; pin < device_grid[x][y].type->num_pins; ++pin) {
        if (true == device_grid[x][y].type->is_ignored_pin[pin]) {
            continue;
        }
        if (false == device_grid[x][y].type->pinloc[width_offset][height_offset][side][pin]) {
            continue;
        }
        RRNodeId rr_node_index = rr_graph.find_node(x, y, rr_type, pin, side);
        if (rr_node_index != RRNodeId::INVALID()) {
            indices.push_back(rr_node_index);
        }
    }
    return indices;
}
std :: vector < RRNodeId > find_rr_graph_grid_nodes ( const RRGraph & rr_graph , const DeviceGrid & device_grid , const int & x , const int & y , const t_rr_type & rr_type , const e_side & side ) { std :: vector < RRNodeId > indices ; VTR_ASSERT ( rr_type == IPIN || rr_type == OPIN ) ; VTR_ASSERT ( size_t ( x ) <= device_grid . width ( ) && size_t ( y ) <= device_grid . height ( ) ) ; VTR_ASSERT ( side != NUM_SIDES ) ; int width_offset = device_grid [ x ] [ y ] . width_offset ; int height_offset = device_grid [ x ] [ y ] . height_offset ; for ( int pin = 0 ; pin < device_grid [ x ] [ y ] . type -> num_pins ; ++ pin ) { if ( true == device_grid [ x ] [ y ] . type -> is_ignored_pin [ pin ] ) { continue ; } if ( false == device_grid [ x ] [ y ] . type -> pinloc [ width_offset ] [ height_offset ] [ side ] [ pin ] ) { continue ; } RRNodeId rr_node_index = rr_graph . find_node ( x , y , rr_type , pin , side ) ; if ( rr_node_index != RRNodeId :: INVALID ( ) ) { indices . push_back ( rr_node_index ) ; } } return indices ; }
Find a list of rr_nodes that locate at a side of a grid
Find a list of rr_nodes that locate at a side of a grid
/* Ensure that (x, y) is a valid location in grids */ /* Ensure we have a valid side */ /* Find all the pins on the side of the grid */ /* Skip those pins have been ignored during rr_graph build-up */ /* Not the pin on this side, we skip */ /* Try to find the rr node */