@@ -87,10 +87,6 @@ NetCostHandler::NetCostHandler(PlacerState& placer_state,
8787
8888 bb_num_on_edges_.resize (num_nets, t_bb ());
8989
90- // This initializes the whole matrix to UNDEFINED which is an invalid value
91- ts_layer_sink_pin_count_.resize ({num_nets, size_t (num_layers)}, UNDEFINED );
92- num_sink_pin_layer_.resize ({num_nets, size_t (num_layers)}, UNDEFINED );
93-
9490 ts_nets_to_update_.resize (num_nets, ClusterNetId::INVALID ());
9591
9692 // negative net costs mean the cost is not valid.
@@ -221,7 +217,6 @@ void NetCostHandler::update_net_bb_(const ClusterNetId net,
221217 t_physical_tile_type_ptr blk_type = physical_tile_type (block_loc);
222218 int pin_width_offset = blk_type->pin_width_offset [iblk_pin];
223219 int pin_height_offset = blk_type->pin_height_offset [iblk_pin];
224- bool is_driver = cluster_ctx.clb_nlist .pin_type (blk_pin) == PinType::DRIVER ;
225220
226221 // Incremental bounding box update
227222 update_bb_ (net,
@@ -230,8 +225,7 @@ void NetCostHandler::update_net_bb_(const ClusterNetId net,
230225 pl_moved_block.old_loc .layer },
231226 {pl_moved_block.new_loc .x + pin_width_offset,
232227 pl_moved_block.new_loc .y + pin_height_offset,
233- pl_moved_block.new_loc .layer },
234- is_driver);
228+ pl_moved_block.new_loc .layer });
235229 }
236230}
237231
@@ -375,13 +369,10 @@ void NetCostHandler::update_net_info_on_pin_move_(const PlaceDelayModel* delay_m
375369void NetCostHandler::get_non_updatable_bb_ (ClusterNetId net_id, bool use_ts) {
376370 // TODO: account for multiple physical pin instances per logical pin
377371 const ClusteringContext& cluster_ctx = g_vpr_ctx.clustering ();
378- const DeviceContext& device_ctx = g_vpr_ctx.device ();
379372 const BlkLocRegistry& blk_loc_registry = placer_state_.blk_loc_registry ();
380373
381374 // the bounding box coordinates that is going to be updated by this function
382375 t_bb& bb_coord_new = use_ts ? ts_bb_coord_new_[net_id] : bb_coords_[net_id];
383- // the number of sink pins of "net_id" on each layer
384- vtr::NdMatrixProxy<int , 1 > num_sink_pin_layer = use_ts ? ts_layer_sink_pin_count_[size_t (net_id)] : num_sink_pin_layer_[size_t (net_id)];
385376
386377 // get the source pin's location
387378 ClusterPinId source_pin_id = cluster_ctx.clb_nlist .net_pin (net_id, 0 );
@@ -395,10 +386,6 @@ void NetCostHandler::get_non_updatable_bb_(ClusterNetId net_id, bool use_ts) {
395386 bb_coord_new.ymax = source_pin_loc.y ;
396387 bb_coord_new.layer_max = source_pin_loc.layer_num ;
397388
398- for (size_t layer_num = 0 ; layer_num < device_ctx.grid .get_num_layers (); layer_num++) {
399- num_sink_pin_layer[layer_num] = 0 ;
400- }
401-
402389 for (ClusterPinId pin_id : cluster_ctx.clb_nlist .net_sinks (net_id)) {
403390 t_physical_tile_loc pin_loc = blk_loc_registry.get_coordinate_of_pin (pin_id);
404391
@@ -419,8 +406,6 @@ void NetCostHandler::get_non_updatable_bb_(ClusterNetId net_id, bool use_ts) {
419406 } else if (pin_loc.layer_num > bb_coord_new.layer_max ) {
420407 bb_coord_new.layer_max = pin_loc.layer_num ;
421408 }
422-
423- num_sink_pin_layer[pin_loc.layer_num ]++;
424409 }
425410
426411 // Update average CHANX and CHANY usage for this net within its bounding box if congestion modeling is enabled
@@ -434,28 +419,20 @@ void NetCostHandler::get_non_updatable_bb_(ClusterNetId net_id, bool use_ts) {
434419
435420void NetCostHandler::update_bb_ (ClusterNetId net_id,
436421 t_physical_tile_loc pin_old_loc,
437- t_physical_tile_loc pin_new_loc,
438- bool src_pin) {
422+ t_physical_tile_loc pin_new_loc) {
439423 // TODO: account for multiple physical pin instances per logical pin
440- const DeviceContext& device_ctx = g_vpr_ctx.device ();
441-
442- const int num_layers = device_ctx.grid .get_num_layers ();
443424
444425 // Number of blocks on the edges of the bounding box
445426 t_bb& bb_edge_new = ts_bb_edge_new_[net_id];
446427 // Coordinates of the bounding box
447428 t_bb& bb_coord_new = ts_bb_coord_new_[net_id];
448- // Number of sinks of the given net on each layer
449- vtr::NdMatrixProxy<int , 1 > num_sink_pin_layer_new = ts_layer_sink_pin_count_[size_t (net_id)];
450429
451430 /* Check if the net had been updated before. */
452431 if (bb_update_status_[net_id] == NetUpdateState::GOT_FROM_SCRATCH ) {
453432 /* The net had been updated from scratch, DO NOT update again! */
454433 return ;
455434 }
456435
457- vtr::NdMatrixProxy<int , 1 > curr_num_sink_pin_layer = (bb_update_status_[net_id] == NetUpdateState::NOT_UPDATED_YET ) ? num_sink_pin_layer_[size_t (net_id)] : num_sink_pin_layer_new;
458-
459436 const t_bb *curr_bb_edge, *curr_bb_coord;
460437 if (bb_update_status_[net_id] == NetUpdateState::NOT_UPDATED_YET ) {
461438 /* The net had NOT been updated before, could use the old values */
@@ -616,18 +593,6 @@ void NetCostHandler::update_bb_(ClusterNetId net_id,
616593
617594 /* Now account for the layer motion. */
618595 if (is_multi_layer_) {
619- /* We need to update it only if multiple layers are available */
620- for (int layer_num = 0 ; layer_num < num_layers; layer_num++) {
621- num_sink_pin_layer_new[layer_num] = curr_num_sink_pin_layer[layer_num];
622- }
623- if (!src_pin) {
624- /* if src pin is being moved, we don't need to update this data structure */
625- if (pin_old_loc.layer_num != pin_new_loc.layer_num ) {
626- num_sink_pin_layer_new[pin_old_loc.layer_num ] = (curr_num_sink_pin_layer)[pin_old_loc.layer_num ] - 1 ;
627- num_sink_pin_layer_new[pin_new_loc.layer_num ] = (curr_num_sink_pin_layer)[pin_new_loc.layer_num ] + 1 ;
628- }
629- }
630-
631596 if (pin_new_loc.layer_num < pin_old_loc.layer_num ) {
632597 if (pin_old_loc.layer_num == curr_bb_coord->layer_max ) {
633598 if (curr_bb_edge->layer_max == 1 ) {
@@ -709,13 +674,10 @@ void NetCostHandler::update_bb_(ClusterNetId net_id,
709674
710675void NetCostHandler::get_bb_from_scratch_ (ClusterNetId net_id, bool use_ts) {
711676 const ClusteringContext& cluster_ctx = g_vpr_ctx.clustering ();
712- const DeviceContext& device_ctx = g_vpr_ctx.device ();
713- const DeviceGrid& grid = device_ctx.grid ;
714677 const BlkLocRegistry& blk_loc_registry = placer_state_.blk_loc_registry ();
715678
716679 t_bb& coords = use_ts ? ts_bb_coord_new_[net_id] : bb_coords_[net_id];
717680 t_bb& num_on_edges = use_ts ? ts_bb_edge_new_[net_id] : bb_num_on_edges_[net_id];
718- vtr::NdMatrixProxy<int , 1 > num_sink_pin_layer = use_ts ? ts_layer_sink_pin_count_[(size_t )net_id] : num_sink_pin_layer_[(size_t )net_id];
719681
720682 // get the source pin's location
721683 ClusterPinId source_pin_id = cluster_ctx.clb_nlist .net_pin (net_id, 0 );
@@ -735,10 +697,6 @@ void NetCostHandler::get_bb_from_scratch_(ClusterNetId net_id, bool use_ts) {
735697 int ymax_edge = 1 ;
736698 int layer_max_edge = 1 ;
737699
738- for (size_t layer_num = 0 ; layer_num < grid.get_num_layers (); layer_num++) {
739- num_sink_pin_layer[layer_num] = 0 ;
740- }
741-
742700 for (ClusterPinId pin_id : cluster_ctx.clb_nlist .net_sinks (net_id)) {
743701 t_physical_tile_loc pin_loc = blk_loc_registry.get_coordinate_of_pin (pin_id);
744702
@@ -780,8 +738,6 @@ void NetCostHandler::get_bb_from_scratch_(ClusterNetId net_id, bool use_ts) {
780738 layer_max = pin_loc.layer_num ;
781739 layer_max_edge = 1 ;
782740 }
783-
784- num_sink_pin_layer[pin_loc.layer_num ]++;
785741 }
786742
787743 // Copy the coordinates and number on edges information into the proper structures.
@@ -791,8 +747,8 @@ void NetCostHandler::get_bb_from_scratch_(ClusterNetId net_id, bool use_ts) {
791747 coords.ymax = ymax;
792748 coords.layer_min = layer_min;
793749 coords.layer_max = layer_max;
794- VTR_ASSERT_DEBUG (layer_min >= 0 && layer_min < (int )device_ctx .grid .get_num_layers ());
795- VTR_ASSERT_DEBUG (layer_max >= 0 && layer_max < (int )device_ctx .grid .get_num_layers ());
750+ VTR_ASSERT_DEBUG (layer_min >= 0 && layer_min < (int )g_vpr_ctx. device () .grid .get_num_layers ());
751+ VTR_ASSERT_DEBUG (layer_max >= 0 && layer_max < (int )g_vpr_ctx. device () .grid .get_num_layers ());
796752
797753 num_on_edges.xmin = xmin_edge;
798754 num_on_edges.xmax = xmax_edge;
@@ -993,10 +949,6 @@ void NetCostHandler::update_move_nets() {
993949
994950 set_ts_bb_coord_ (net_id);
995951
996- for (size_t layer_num = 0 ; layer_num < g_vpr_ctx.device ().grid .get_num_layers (); layer_num++) {
997- num_sink_pin_layer_[size_t (net_id)][layer_num] = ts_layer_sink_pin_count_[size_t (net_id)][layer_num];
998- }
999-
1000952 if (cluster_ctx.clb_nlist .net_sinks (net_id).size () >= SMALL_NET ) {
1001953 set_ts_edge_ (net_id);
1002954 }
0 commit comments