@@ -260,10 +260,7 @@ std::pair<double, double> NetCostHandler::comp_cube_bb_cost_(e_cost_methods meth
260
260
/* Small nets don't use incremental updating on their bounding boxes, *
261
261
* so they can use a fast bounding box calculator. */
262
262
if (cluster_ctx.clb_nlist .net_sinks (net_id).size () >= SMALL_NET && method == e_cost_methods::NORMAL) {
263
- get_bb_from_scratch_ (net_id,
264
- bb_coords_[net_id],
265
- bb_num_on_edges_[net_id],
266
- num_sink_pin_layer_[size_t (net_id)]);
263
+ get_bb_from_scratch_ (net_id, /* use_ts=*/ false );
267
264
} else {
268
265
get_non_updatable_cube_bb_ (net_id, /* use_ts=*/ false );
269
266
}
@@ -580,7 +577,7 @@ void NetCostHandler::update_bb_(ClusterNetId net_id,
580
577
// TODO: account for multiple physical pin instances per logical pin
581
578
const t_bb *curr_bb_edge, *curr_bb_coord;
582
579
583
- auto & device_ctx = g_vpr_ctx.device ();
580
+ const auto & device_ctx = g_vpr_ctx.device ();
584
581
585
582
const int num_layers = device_ctx.grid .get_num_layers ();
586
583
@@ -618,7 +615,7 @@ void NetCostHandler::update_bb_(ClusterNetId net_id,
618
615
619
616
if (pin_old_loc.x == curr_bb_coord->xmax ) { /* Old position at xmax. */
620
617
if (curr_bb_edge->xmax == 1 ) {
621
- get_bb_from_scratch_ (net_id, bb_coord_new, bb_edge_new, num_sink_pin_layer_new );
618
+ get_bb_from_scratch_ (net_id, /* use_ts= */ true );
622
619
bb_update_status_[net_id] = NetUpdateState::GOT_FROM_SCRATCH;
623
620
return ;
624
621
} else {
@@ -650,7 +647,7 @@ void NetCostHandler::update_bb_(ClusterNetId net_id,
650
647
651
648
if (pin_old_loc.x == curr_bb_coord->xmin ) { /* Old position at xmin. */
652
649
if (curr_bb_edge->xmin == 1 ) {
653
- get_bb_from_scratch_ (net_id, bb_coord_new, bb_edge_new, num_sink_pin_layer_new );
650
+ get_bb_from_scratch_ (net_id, /* use_ts= */ true );
654
651
bb_update_status_[net_id] = NetUpdateState::GOT_FROM_SCRATCH;
655
652
return ;
656
653
} else {
@@ -691,7 +688,7 @@ void NetCostHandler::update_bb_(ClusterNetId net_id,
691
688
692
689
if (pin_old_loc.y == curr_bb_coord->ymax ) { /* Old position at ymax. */
693
690
if (curr_bb_edge->ymax == 1 ) {
694
- get_bb_from_scratch_ (net_id, bb_coord_new, bb_edge_new, num_sink_pin_layer_new );
691
+ get_bb_from_scratch_ (net_id, /* use_ts= */ true );
695
692
bb_update_status_[net_id] = NetUpdateState::GOT_FROM_SCRATCH;
696
693
return ;
697
694
} else {
@@ -723,7 +720,7 @@ void NetCostHandler::update_bb_(ClusterNetId net_id,
723
720
724
721
if (pin_old_loc.y == curr_bb_coord->ymin ) { /* Old position at ymin. */
725
722
if (curr_bb_edge->ymin == 1 ) {
726
- get_bb_from_scratch_ (net_id, bb_coord_new, bb_edge_new, num_sink_pin_layer_new );
723
+ get_bb_from_scratch_ (net_id, /* use_ts= */ true );
727
724
bb_update_status_[net_id] = NetUpdateState::GOT_FROM_SCRATCH;
728
725
return ;
729
726
} else {
@@ -773,7 +770,7 @@ void NetCostHandler::update_bb_(ClusterNetId net_id,
773
770
if (pin_new_loc.layer_num < pin_old_loc.layer_num ) {
774
771
if (pin_old_loc.layer_num == curr_bb_coord->layer_max ) {
775
772
if (curr_bb_edge->layer_max == 1 ) {
776
- get_bb_from_scratch_ (net_id, bb_coord_new, bb_edge_new, num_sink_pin_layer_new );
773
+ get_bb_from_scratch_ (net_id, /* use_ts= */ true );
777
774
bb_update_status_[net_id] = NetUpdateState::GOT_FROM_SCRATCH;
778
775
return ;
779
776
} else {
@@ -799,7 +796,7 @@ void NetCostHandler::update_bb_(ClusterNetId net_id,
799
796
} else if (pin_new_loc.layer_num > pin_old_loc.layer_num ) {
800
797
if (pin_old_loc.layer_num == curr_bb_coord->layer_min ) {
801
798
if (curr_bb_edge->layer_min == 1 ) {
802
- get_bb_from_scratch_ (net_id, bb_coord_new, bb_edge_new, num_sink_pin_layer_new );
799
+ get_bb_from_scratch_ (net_id, /* use_ts= */ true );
803
800
bb_update_status_[net_id] = NetUpdateState::GOT_FROM_SCRATCH;
804
801
return ;
805
802
} else {
@@ -1180,15 +1177,16 @@ static void add_block_to_bb(const t_physical_tile_loc& new_pin_loc,
1180
1177
}
1181
1178
}
1182
1179
1183
- void NetCostHandler::get_bb_from_scratch_ (ClusterNetId net_id,
1184
- t_bb& coords,
1185
- t_bb& num_on_edges,
1186
- vtr::NdMatrixProxy<int , 1 > num_sink_pin_layer) {
1180
+ void NetCostHandler::get_bb_from_scratch_ (ClusterNetId net_id, bool use_ts) {
1187
1181
const auto & cluster_ctx = g_vpr_ctx.clustering ();
1188
1182
const auto & device_ctx = g_vpr_ctx.device ();
1189
1183
const auto & grid = device_ctx.grid ;
1190
1184
const auto & blk_loc_registry = placer_state_.blk_loc_registry ();
1191
1185
1186
+ t_bb& coords = use_ts ? ts_bb_coord_new_[net_id] : bb_coords_[net_id];
1187
+ t_bb& num_on_edges = use_ts ? ts_bb_edge_new_[net_id] : bb_num_on_edges_[net_id];
1188
+ 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];
1189
+
1192
1190
// get the source pin's location
1193
1191
ClusterPinId source_pin_id = cluster_ctx.clb_nlist .net_pin (net_id, 0 );
1194
1192
t_physical_tile_loc source_pin_loc = blk_loc_registry.get_coordinate_of_pin (source_pin_id);
0 commit comments