vpr/src/pack/cluster.cpp
/* Determine if speculatively packed cur_pb is pin feasible
 * Runtime is actually not that bad for this.  It's worst case O(k^2) where k is the
 * number of pb_graph pins.  Can use hash tables or make incremental if becomes an issue.
 */
Determine if speculatively packed cur_pb is pin feasible
Runtime is actually not that bad for this.  It's worst case O(k^2) where k is the
number of pb_graph pins.  Can use hash tables or make incremental if becomes an issue.
Determine if speculatively packed cur_pb is pin feasible Runtime is actually not that bad for this . It ' s worst case O ( k^2 ) where k is the number of pb_graph pins . Can use hash tables or make incremental if becomes an issue .
static void try_update_lookahead_pins_used(t_pb* cur_pb) {
    int i, j;
    const t_pb_type* pb_type = cur_pb->pb_graph_node->pb_type;
    if (pb_type->num_modes > 0 && cur_pb->name != nullptr) {
        if (cur_pb->child_pbs != nullptr) {
            for (i = 0; i < pb_type->modes[cur_pb->mode].num_pb_type_children; i++) {
                if (cur_pb->child_pbs[i] != nullptr) {
                    for (j = 0; j < pb_type->modes[cur_pb->mode].pb_type_children[i].num_pb; j++) {
                        try_update_lookahead_pins_used(&cur_pb->child_pbs[i][j]);
                    }
                }
            }
        }
    } else {
        auto& atom_ctx = g_vpr_ctx.atom();
        AtomBlockId blk_id = atom_ctx.lookup.pb_atom(cur_pb);
        if (pb_type->blif_model != nullptr && blk_id) {
            compute_and_mark_lookahead_pins_used(blk_id);
        }
    }
}
static void try_update_lookahead_pins_used ( t_pb * cur_pb ) { int i , j ; const t_pb_type * pb_type = cur_pb -> pb_graph_node -> pb_type ; if ( pb_type -> num_modes > 0 && cur_pb -> name != nullptr ) { if ( cur_pb -> child_pbs != nullptr ) { for ( i = 0 ; i < pb_type -> modes [ cur_pb -> mode ] . num_pb_type_children ; i ++ ) { if ( cur_pb -> child_pbs [ i ] != nullptr ) { for ( j = 0 ; j < pb_type -> modes [ cur_pb -> mode ] . pb_type_children [ i ] . num_pb ; j ++ ) { try_update_lookahead_pins_used ( & cur_pb -> child_pbs [ i ] [ j ] ) ; } } } } } else { auto & atom_ctx = g_vpr_ctx . atom ( ) ; AtomBlockId blk_id = atom_ctx . lookup . pb_atom ( cur_pb ) ; if ( pb_type -> blif_model != nullptr && blk_id ) { compute_and_mark_lookahead_pins_used ( blk_id ) ; } } }
Determine if speculatively packed cur_pb is pin feasible
 Runtime is actually not that bad for this.
Determine if speculatively packed cur_pb is pin feasible Runtime is actually not that bad for this .
// run recursively till a leaf (primitive) pb block is reached // find if this child (primitive) pb block has an atom mapped to it, // if yes compute and mark lookahead pins used for that pb block