vpr/src/pack/cluster.cpp
/**
 * This function returns true if the given physical block has
 * a primitive matching the given blif model and is used
 */
This function returns true if the given physical block has
a primitive matching the given blif model and is used
This function returns true if the given physical block has a primitive matching the given blif model and is used
static bool pb_used_for_blif_model(const t_pb* pb, std::string blif_model_name) {
    auto pb_graph_node = pb->pb_graph_node;
    auto pb_type = pb_graph_node->pb_type;
    auto mode = &pb_type->modes[pb->mode];
    if (pb_type->blif_model) {
        if (blif_model_name == pb_type->blif_model || ".subckt " + blif_model_name == pb_type->blif_model) {
            return true;
        }
    }
    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) {
                    if (pb_used_for_blif_model(&pb->child_pbs[i][j], blif_model_name)) {
                        return true;
                    }
                }
            }
        }
    }
    return false;
}
static bool pb_used_for_blif_model ( const t_pb * pb , std :: string blif_model_name ) { auto pb_graph_node = pb -> pb_graph_node ; auto pb_type = pb_graph_node -> pb_type ; auto mode = & pb_type -> modes [ pb -> mode ] ; if ( pb_type -> blif_model ) { if ( blif_model_name == pb_type -> blif_model || " " + blif_model_name == pb_type -> blif_model ) { return true ; } } 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 ) { if ( pb_used_for_blif_model ( & pb -> child_pbs [ i ] [ j ] , blif_model_name ) ) { return true ; } } } } } return false ; }
This function returns true if the given physical block has
 a primitive matching the given blif model and is used
This function returns true if the given physical block has a primitive matching the given blif model and is used
// if this is a primitive check if it matches the given blif model name