vpr/src/place/place.cpp
/* Finds the cost from scratch.  Done only when the placement   *
 * has been radically changed (i.e. after initial placement).   *
 * Otherwise find the cost change incrementally.  If method     *
 * check is NORMAL, we find bounding boxes that are updateable  *
 * for the larger nets.  If method is CHECK, all bounding boxes *
 * are found via the non_updateable_bb routine, to provide a    *
 * cost which can be used to check the correctness of the       *
 * other routine.                                               */
Finds the cost from scratch.  Done only when the placement
has been radically changed .
Otherwise find the cost change incrementally.  If method
check is NORMAL, we find bounding boxes that are updateable
for the larger nets.  If method is CHECK, all bounding boxes
are found via the non_updateable_bb routine, to provide a
cost which can be used to check the correctness of the
other routine.
Finds the cost from scratch . Done only when the placement has been radically changed . Otherwise find the cost change incrementally . If method check is NORMAL we find bounding boxes that are updateable for the larger nets . If method is CHECK all bounding boxes are found via the non_updateable_bb routine to provide a cost which can be used to check the correctness of the other routine .
static double comp_bb_cost(e_cost_methods method) {
    double cost = 0;
    double expected_wirelength = 0.0;
    auto& cluster_ctx = g_vpr_ctx.clustering();
    for (auto net_id : cluster_ctx.clb_nlist.nets()) {       
        if (!cluster_ctx.clb_nlist.net_is_ignored(net_id)) { 
            if (cluster_ctx.clb_nlist.net_sinks(net_id).size() >= SMALL_NET && method == NORMAL) {
                get_bb_from_scratch(net_id, &bb_coords[net_id],
                                    &bb_num_on_edges[net_id]);
            } else {
                get_non_updateable_bb(net_id, &bb_coords[net_id]);
            }
            net_cost[net_id] = get_net_cost(net_id, &bb_coords[net_id]);
            cost += net_cost[net_id];
            if (method == CHECK)
                expected_wirelength += get_net_wirelength_estimate(net_id, &bb_coords[net_id]);
        }
    }
    if (method == CHECK) {
        VTR_LOG("\n");
        VTR_LOG("BB estimate of min-dist (placement) wire length: %.0f\n", expected_wirelength);
    }
    return cost;
}
static double comp_bb_cost ( e_cost_methods method ) { double cost = 0 ; double expected_wirelength = 0.0 ; auto & cluster_ctx = g_vpr_ctx . clustering ( ) ; for ( auto net_id : cluster_ctx . clb_nlist . nets ( ) ) { if ( ! cluster_ctx . clb_nlist . net_is_ignored ( net_id ) ) { if ( cluster_ctx . clb_nlist . net_sinks ( net_id ) . size ( ) >= SMALL_NET && method == NORMAL ) { get_bb_from_scratch ( net_id , & bb_coords [ net_id ] , & bb_num_on_edges [ net_id ] ) ; } else { get_non_updateable_bb ( net_id , & bb_coords [ net_id ] ) ; } net_cost [ net_id ] = get_net_cost ( net_id , & bb_coords [ net_id ] ) ; cost += net_cost [ net_id ] ; if ( method == CHECK ) expected_wirelength += get_net_wirelength_estimate ( net_id , & bb_coords [ net_id ] ) ; } } if ( method == CHECK ) { VTR_LOG ( " \n " ) ; VTR_LOG ( " \n " , expected_wirelength ) ; } return cost ; }
Finds the cost from scratch.
Finds the cost from scratch .
/* for each net ... */ /* Do only if not ignored. */ /* Small nets don't use incremental updating on their bounding boxes, *
             * so they can use a fast bounding box calculator.                    */