vpr/src/place/place.cpp
//Puts all the nets changed by the current swap into nets_to_update,
//and updates their bounding box.
//
//Returns the number of affected nets.
Puts all the nets changed by the current swap into nets_to_update,
and updates their bounding box.

Returns the number of affected nets.
Puts all the nets changed by the current swap into nets_to_update and updates their bounding box . Returns the number of affected nets .
static int find_affected_nets_and_update_costs(e_place_algorithm place_algorithm,
                                               const t_pl_blocks_to_be_moved& blocks_affected,
                                               const PlaceDelayModel* delay_model,
                                               double& bb_delta_c,
                                               double& timing_delta_c) {
    VTR_ASSERT_SAFE(bb_delta_c == 0.);
    VTR_ASSERT_SAFE(timing_delta_c == 0.);
    auto& cluster_ctx = g_vpr_ctx.clustering();
    int num_affected_nets = 0;
    for (int iblk = 0; iblk < blocks_affected.num_moved_blocks; iblk++) {
        ClusterBlockId blk = blocks_affected.moved_blocks[iblk].block_num;
        for (ClusterPinId blk_pin : cluster_ctx.clb_nlist.block_pins(blk)) {
            ClusterNetId net_id = cluster_ctx.clb_nlist.pin_net(blk_pin);
            VTR_ASSERT_SAFE_MSG(net_id, "Only valid nets should be found in compressed netlist block pins");
            if (cluster_ctx.clb_nlist.net_is_ignored(net_id))
                continue; 
            record_affected_net(net_id, num_affected_nets);
            Do not update the net cost here since it should only be updated
            once per net, not once per pin.
            update_net_bb(net_id, blocks_affected, iblk, blk, blk_pin);
            if (place_algorithm == PATH_TIMING_DRIVEN_PLACE) {
                Determine the change in timing costs if required
                update_td_delta_costs(delay_model, blocks_affected, net_id, blk_pin, timing_delta_c);
            }
        }
    }
    for (int inet_affected = 0; inet_affected < num_affected_nets; inet_affected++) {
        ClusterNetId net_id = ts_nets_to_update[inet_affected];
        temp_net_cost[net_id] = get_net_cost(net_id, &ts_bb_coord_new[net_id]);
        bb_delta_c += temp_net_cost[net_id] - net_cost[net_id];
    }
    return num_affected_nets;
}
static int find_affected_nets_and_update_costs ( e_place_algorithm place_algorithm , const t_pl_blocks_to_be_moved & blocks_affected , const PlaceDelayModel * delay_model , double & bb_delta_c , double & timing_delta_c ) { VTR_ASSERT_SAFE ( bb_delta_c == 0. ) ; VTR_ASSERT_SAFE ( timing_delta_c == 0. ) ; auto & cluster_ctx = g_vpr_ctx . clustering ( ) ; int num_affected_nets = 0 ; for ( int iblk = 0 ; iblk < blocks_affected . num_moved_blocks ; iblk ++ ) { ClusterBlockId blk = blocks_affected . moved_blocks [ iblk ] . block_num ; for ( ClusterPinId blk_pin : cluster_ctx . clb_nlist . block_pins ( blk ) ) { ClusterNetId net_id = cluster_ctx . clb_nlist . pin_net ( blk_pin ) ; VTR_ASSERT_SAFE_MSG ( net_id , " " ) ; if ( cluster_ctx . clb_nlist . net_is_ignored ( net_id ) ) continue ; record_affected_net ( net_id , num_affected_nets ) ; update_net_bb ( net_id , blocks_affected , iblk , blk , blk_pin ) ; if ( place_algorithm == PATH_TIMING_DRIVEN_PLACE ) { update_td_delta_costs ( delay_model , blocks_affected , net_id , blk_pin , timing_delta_c ) ; } } } for ( int inet_affected = 0 ; inet_affected < num_affected_nets ; inet_affected ++ ) { ClusterNetId net_id = ts_nets_to_update [ inet_affected ] ; temp_net_cost [ net_id ] = get_net_cost ( net_id , & ts_bb_coord_new [ net_id ] ) ; bb_delta_c += temp_net_cost [ net_id ] - net_cost [ net_id ] ; } return num_affected_nets ; }
Puts all the nets changed by the current swap into nets_to_update,
and updates their bounding box.
Puts all the nets changed by the current swap into nets_to_update and updates their bounding box .
//Go through all the blocks moved //Go through all the pins in the moved block //TODO: do we require anyting special here for global nets. "Global nets are assumed to span the whole chip, and do not effect costs" //Record effected nets //Update the net bounding boxes // //Do not update the net cost here since it should only be updated //once per net, not once per pin. //Determine the change in timing costs if required /* Now update the bounding box costs (since the net bounding boxes are up-to-date).
     * The cost is only updated once per net.
     */