vpr/src/route/rr_graph.cpp
/* Allocates and loads the track to ipin lookup for each physical grid type. This
 * is the same information as the ipin_to_track map but accessed in a different way. */
Allocates and loads the track to ipin lookup for each physical grid type. This
is the same information as the ipin_to_track map but accessed in a different way.
Allocates and loads the track to ipin lookup for each physical grid type . This is the same information as the ipin_to_track map but accessed in a different way .
static vtr::NdMatrix<std::vector<int>, 4> alloc_and_load_track_to_pin_lookup(vtr::NdMatrix<std::vector<int>, 4> pin_to_track_map,
                                                                             const vtr::Matrix<int>& Fc,
                                                                             const int type_width,
                                                                             const int type_height,
                                                                             const int num_pins,
                                                                             const int max_chan_width,
                                                                             const int num_seg_types) {
    if (num_pins < 1) {
        return vtr::NdMatrix<std::vector<int>, 4>();
    }
    auto track_to_pin_lookup = vtr::NdMatrix<std::vector<int>, 4>({size_t(max_chan_width), size_t(type_width), size_t(type_height), 4});
    for (int pin = 0; pin < num_pins; ++pin) {
        for (int width = 0; width < type_width; ++width) {
            for (int height = 0; height < type_height; ++height) {
                for (int side = 0; side < 4; ++side) {
                    if (pin_to_track_map[pin][width][height][side].empty())
                        continue;
                    int num_tracks = 0;
                    for (int iseg = 0; iseg < num_seg_types; iseg++) {
                        num_tracks += Fc[pin][iseg];
                    }
                    for (int conn = 0; conn < num_tracks; ++conn) {
                        int track = pin_to_track_map[pin][width][height][side][conn];
                        VTR_ASSERT(track < max_chan_width);
                        VTR_ASSERT(track >= 0);
                        track_to_pin_lookup[track][width][height][side].push_back(pin);
                    }
                }
            }
        }
    }
    return track_to_pin_lookup;
}
static vtr :: NdMatrix < std :: vector < int > , 4 > alloc_and_load_track_to_pin_lookup ( vtr :: NdMatrix < std :: vector < int > , 4 > pin_to_track_map , const vtr :: Matrix < int > & Fc , const int type_width , const int type_height , const int num_pins , const int max_chan_width , const int num_seg_types ) { if ( num_pins < 1 ) { return vtr :: NdMatrix < std :: vector < int > , 4 > ( ) ; } auto track_to_pin_lookup = vtr :: NdMatrix < std :: vector < int > , 4 > ( { size_t ( max_chan_width ) , size_t ( type_width ) , size_t ( type_height ) , 4 } ) ; for ( int pin = 0 ; pin < num_pins ; ++ pin ) { for ( int width = 0 ; width < type_width ; ++ width ) { for ( int height = 0 ; height < type_height ; ++ height ) { for ( int side = 0 ; side < 4 ; ++ side ) { if ( pin_to_track_map [ pin ] [ width ] [ height ] [ side ] . empty ( ) ) continue ; int num_tracks = 0 ; for ( int iseg = 0 ; iseg < num_seg_types ; iseg ++ ) { num_tracks += Fc [ pin ] [ iseg ] ; } for ( int conn = 0 ; conn < num_tracks ; ++ conn ) { int track = pin_to_track_map [ pin ] [ width ] [ height ] [ side ] [ conn ] ; VTR_ASSERT ( track < max_chan_width ) ; VTR_ASSERT ( track >= 0 ) ; track_to_pin_lookup [ track ] [ width ] [ height ] [ side ] . push_back ( pin ) ; } } } } } return track_to_pin_lookup ; }
Allocates and loads the track to ipin lookup for each physical grid type.
Allocates and loads the track to ipin lookup for each physical grid type .
/* [0..max_chan_width-1][0..width][0..height][0..3].  For each track number
     * it stores a vector for each of the four sides.  x-directed channels will
     * use the TOP and   BOTTOM vectors to figure out what clb input pins they
     * connect to above  and below them, respectively, while y-directed channels
     * use the LEFT and RIGHT vectors.  Each vector contains an nelem field
     * saying how many ipins it connects to.  The list[0..nelem-1] array then
     * gives the pin numbers.                                                  */ /* Note that a clb pin that connects to a channel on its RIGHT means that  *
     * that channel connects to a clb pin on its LEFT.  The convention used    *
     * here is always in the perspective of the CLB                            */ /* Alloc and zero the the lookup table */ /* Count number of pins to which each track connects  */ /* get number of tracks to which this pin connects */