vpr/src/pack/cluster.cpp
/**
 * This function update the pb_type_count data structure by incrementing
 * the number of used pb_types in the given packed cluster t_pb
 */
This function update the pb_type_count data structure by incrementing
the number of used pb_types in the given packed cluster t_pb
This function update the pb_type_count data structure by incrementing the number of used pb_types in the given packed cluster t_pb
static void update_pb_type_count(const t_pb* pb, std::unordered_map<std::string, int>& pb_type_count) {
    auto pb_graph_node = pb->pb_graph_node;
    auto pb_type = pb_graph_node->pb_type;
    auto mode = &pb_type->modes[pb->mode];
    std::string pb_type_name(pb_type->name);
    auto it = pb_type_count.find(pb_type_name);
    if (it == pb_type_count.end())
        pb_type_count[pb_type_name] = 1;
    else
        pb_type_count[pb_type_name]++;
    if (pb_type->num_modes > 0) {
        for (int i = 0; i < mode->num_pb_type_children; i++) {
            for (int j = 0; j < mode->pb_type_children[i].num_pb; j++) {
                if (pb->child_pbs[i] && pb->child_pbs[i][j].name)
                    update_pb_type_count(&pb->child_pbs[i][j], pb_type_count);
            }
        }
    }
}
static void update_pb_type_count ( const t_pb * pb , std :: unordered_map < std :: string , int > & pb_type_count ) { auto pb_graph_node = pb -> pb_graph_node ; auto pb_type = pb_graph_node -> pb_type ; auto mode = & pb_type -> modes [ pb -> mode ] ; std :: string pb_type_name ( pb_type -> name ) ; auto it = pb_type_count . find ( pb_type_name ) ; if ( it == pb_type_count . end ( ) ) pb_type_count [ pb_type_name ] = 1 ; else pb_type_count [ pb_type_name ] ++ ; if ( pb_type -> num_modes > 0 ) { for ( int i = 0 ; i < mode -> num_pb_type_children ; i ++ ) { for ( int j = 0 ; j < mode -> pb_type_children [ i ] . num_pb ; j ++ ) { if ( pb -> child_pbs [ i ] && pb -> child_pbs [ i ] [ j ] . name ) update_pb_type_count ( & pb -> child_pbs [ i ] [ j ] , pb_type_count ) ; } } } }
This function update the pb_type_count data structure by incrementing
 the number of used pb_types in the given packed cluster t_pb
This function update the pb_type_count data structure by incrementing the number of used pb_types in the given packed cluster t_pb
// if this pb type is in the list increment its // count by 1 otherwise initialize the count to 1