@@ -56,9 +56,9 @@ static const float cross_count[MAX_FANOUT_CROSSING_COUNT] = {/* [0..49] */ 1.0,
56
56
2.7933 };
57
57
58
58
/* *
59
- * @param net
60
- * @param moved_blocks
61
- * @return True if the driver block of the net is among the moving blocks
59
+ * @param net The unique identifier of the net of interest.
60
+ * @param moved_blocks A vector of moving clustered blocks.
61
+ * @return True if the driver block of the net is among the moving blocks.
62
62
*/
63
63
static bool driven_by_moved_block (const ClusterNetId net,
64
64
const std::vector<t_pl_moved_block>& moved_blocks);
@@ -339,23 +339,6 @@ double NetCostHandler::comp_per_layer_bb_cost_(e_cost_methods method) {
339
339
return cost;
340
340
}
341
341
342
- // Returns true if 'net' is driven by one of the blocks in 'blocks_affected'
343
- static bool driven_by_moved_block (const ClusterNetId net,
344
- const std::vector<t_pl_moved_block>& moved_blocks) {
345
- auto & clb_nlist = g_vpr_ctx.clustering ().clb_nlist ;
346
- bool is_driven_by_move_blk = false ;
347
- ClusterBlockId net_driver_block = clb_nlist.net_driver_block (net);
348
-
349
- for (const auto & block : moved_blocks) {
350
- if (net_driver_block == block.block_num ) {
351
- is_driven_by_move_blk = true ;
352
- break ;
353
- }
354
- }
355
-
356
- return is_driven_by_move_blk;
357
- }
358
-
359
342
void NetCostHandler::update_net_bb_ (const ClusterNetId net,
360
343
const ClusterBlockId blk,
361
344
const ClusterPinId blk_pin,
@@ -493,16 +476,15 @@ void NetCostHandler::record_affected_net_(const ClusterNetId net) {
493
476
}
494
477
}
495
478
496
- void NetCostHandler::update_net_info_on_pin_move_ (const t_place_algorithm& place_algorithm,
497
- const PlaceDelayModel* delay_model,
479
+ void NetCostHandler::update_net_info_on_pin_move_ (const PlaceDelayModel* delay_model,
498
480
const PlacerCriticalities* criticalities,
499
- const ClusterBlockId blk_id,
500
481
const ClusterPinId pin_id,
501
482
const t_pl_moved_block& moving_blk_inf,
502
483
std::vector<ClusterPinId>& affected_pins,
503
484
double & timing_delta_c,
504
485
bool is_src_moving) {
505
486
const auto & cluster_ctx = g_vpr_ctx.clustering ();
487
+
506
488
const ClusterNetId net_id = cluster_ctx.clb_nlist .pin_net (pin_id);
507
489
VTR_ASSERT_SAFE_MSG (net_id,
508
490
" Only valid nets should be found in compressed netlist block pins" );
@@ -516,10 +498,11 @@ void NetCostHandler::update_net_info_on_pin_move_(const t_place_algorithm& place
516
498
/* Record effected nets */
517
499
record_affected_net_ (net_id);
518
500
501
+ ClusterBlockId blk_id = moving_blk_inf.block_num ;
519
502
/* Update the net bounding boxes. */
520
503
update_net_bb_ (net_id, blk_id, pin_id, moving_blk_inf);
521
504
522
- if (place_algorithm.is_timing_driven ()) {
505
+ if (placer_opts_. place_algorithm .is_timing_driven ()) {
523
506
/* Determine the change in connection delay and timing cost. */
524
507
update_td_delta_costs_ (delay_model,
525
508
*criticalities,
@@ -1621,8 +1604,7 @@ void NetCostHandler::set_bb_delta_cost_(double& bb_delta_c) {
1621
1604
}
1622
1605
}
1623
1606
1624
- void NetCostHandler::find_affected_nets_and_update_costs (const t_place_algorithm& place_algorithm,
1625
- const PlaceDelayModel* delay_model,
1607
+ void NetCostHandler::find_affected_nets_and_update_costs (const PlaceDelayModel* delay_model,
1626
1608
const PlacerCriticalities* criticalities,
1627
1609
t_pl_blocks_to_be_moved& blocks_affected,
1628
1610
double & bb_delta_c,
@@ -1636,19 +1618,17 @@ void NetCostHandler::find_affected_nets_and_update_costs(const t_place_algorithm
1636
1618
/* Go through all the blocks moved. */
1637
1619
for (const t_pl_moved_block& moving_block : blocks_affected.moved_blocks ) {
1638
1620
auto & affected_pins = blocks_affected.affected_pins ;
1639
- ClusterBlockId blk = moving_block.block_num ;
1621
+ ClusterBlockId blk_id = moving_block.block_num ;
1640
1622
1641
1623
/* Go through all the pins in the moved block. */
1642
- for (ClusterPinId blk_pin : clb_nlist.block_pins (blk )) {
1624
+ for (ClusterPinId blk_pin : clb_nlist.block_pins (blk_id )) {
1643
1625
bool is_src_moving = false ;
1644
1626
if (clb_nlist.pin_type (blk_pin) == PinType::SINK) {
1645
1627
ClusterNetId net_id = clb_nlist.pin_net (blk_pin);
1646
1628
is_src_moving = driven_by_moved_block (net_id, blocks_affected.moved_blocks );
1647
1629
}
1648
- update_net_info_on_pin_move_ (place_algorithm,
1649
- delay_model,
1630
+ update_net_info_on_pin_move_ (delay_model,
1650
1631
criticalities,
1651
- blk,
1652
1632
blk_pin,
1653
1633
moving_block,
1654
1634
affected_pins,
@@ -1697,8 +1677,7 @@ void NetCostHandler::reset_move_nets() {
1697
1677
}
1698
1678
}
1699
1679
1700
- void NetCostHandler::recompute_costs_from_scratch (const t_placer_opts& placer_opts,
1701
- const t_noc_opts& noc_opts,
1680
+ void NetCostHandler::recompute_costs_from_scratch (const t_noc_opts& noc_opts,
1702
1681
const PlaceDelayModel* delay_model,
1703
1682
const PlacerCriticalities* criticalities,
1704
1683
t_placer_costs* costs) {
@@ -1717,13 +1696,13 @@ void NetCostHandler::recompute_costs_from_scratch(const t_placer_opts& placer_op
1717
1696
check_and_print_cost (new_bb_cost, costs->bb_cost , " bb_cost" );
1718
1697
costs->bb_cost = new_bb_cost;
1719
1698
1720
- if (placer_opts .place_algorithm .is_timing_driven ()) {
1699
+ if (placer_opts_ .place_algorithm .is_timing_driven ()) {
1721
1700
double new_timing_cost = 0 .;
1722
1701
comp_td_costs (delay_model, *criticalities, placer_ctx_, &new_timing_cost);
1723
1702
check_and_print_cost (new_timing_cost, costs->timing_cost , " timing_cost" );
1724
1703
costs->timing_cost = new_timing_cost;
1725
1704
} else {
1726
- VTR_ASSERT (placer_opts .place_algorithm == BOUNDING_BOX_PLACE);
1705
+ VTR_ASSERT (placer_opts_ .place_algorithm == BOUNDING_BOX_PLACE);
1727
1706
costs->cost = new_bb_cost * costs->bb_cost_norm ;
1728
1707
}
1729
1708
@@ -1777,21 +1756,21 @@ void NetCostHandler::get_non_updatable_bb_(const ClusterNetId net) {
1777
1756
void NetCostHandler::update_bb_ (ClusterNetId net_id, t_physical_tile_loc pin_old_loc, t_physical_tile_loc pin_new_loc, bool is_driver) {
1778
1757
if (cube_bb_) {
1779
1758
update_bb_ (net_id,
1780
- ts_bb_edge_new_[net_id],
1781
- ts_bb_coord_new_[net_id],
1782
- ts_layer_sink_pin_count_[size_t (net_id)],
1783
- pin_old_loc,
1784
- pin_new_loc,
1785
- is_driver);
1759
+ ts_bb_edge_new_[net_id],
1760
+ ts_bb_coord_new_[net_id],
1761
+ ts_layer_sink_pin_count_[size_t (net_id)],
1762
+ pin_old_loc,
1763
+ pin_new_loc,
1764
+ is_driver);
1786
1765
}
1787
1766
else {
1788
1767
update_layer_bb_ (net_id,
1789
- layer_ts_bb_edge_new_[net_id],
1790
- layer_ts_bb_coord_new_[net_id],
1791
- ts_layer_sink_pin_count_[size_t (net_id)],
1792
- pin_old_loc,
1793
- pin_new_loc,
1794
- is_driver);
1768
+ layer_ts_bb_edge_new_[net_id],
1769
+ layer_ts_bb_coord_new_[net_id],
1770
+ ts_layer_sink_pin_count_[size_t (net_id)],
1771
+ pin_old_loc,
1772
+ pin_new_loc,
1773
+ is_driver);
1795
1774
}
1796
1775
}
1797
1776
@@ -1821,3 +1800,20 @@ void NetCostHandler::set_ts_edge_(const ClusterNetId net_id) {
1821
1800
place_move_ctx.layer_bb_num_on_edges [net_id] = layer_ts_bb_edge_new_[net_id];
1822
1801
}
1823
1802
}
1803
+
1804
+
1805
+ static bool driven_by_moved_block (const ClusterNetId net,
1806
+ const std::vector<t_pl_moved_block>& moved_blocks) {
1807
+ auto & clb_nlist = g_vpr_ctx.clustering ().clb_nlist ;
1808
+ bool is_driven_by_move_blk = false ;
1809
+ ClusterBlockId net_driver_block = clb_nlist.net_driver_block (net);
1810
+
1811
+ for (const t_pl_moved_block& block : moved_blocks) {
1812
+ if (net_driver_block == block.block_num ) {
1813
+ is_driven_by_move_blk = true ;
1814
+ break ;
1815
+ }
1816
+ }
1817
+
1818
+ return is_driven_by_move_blk;
1819
+ }
0 commit comments