34
34
#include " noc_place_utils.h"
35
35
#include " vtr_math.h"
36
36
37
+ #include < array>
38
+
37
39
using std::max;
38
40
using std::min;
39
41
@@ -47,32 +49,14 @@ static constexpr int MAX_FANOUT_CROSSING_COUNT = 50;
47
49
* for higher fanout nets. Each entry is the correction factor for the
48
50
* fanout index-1
49
51
*/
50
- static const float cross_count[ MAX_FANOUT_CROSSING_COUNT] = {/* [0..49] */ 1.0 , 1.0 , 1.0 , 1.0828 ,
51
- 1.1536 , 1.2206 , 1.2823 , 1.3385 , 1.3991 , 1.4493 , 1.4974 , 1.5455 , 1.5937 ,
52
- 1.6418 , 1.6899 , 1.7304 , 1.7709 , 1.8114 , 1.8519 , 1.8924 , 1.9288 , 1.9652 ,
53
- 2.0015 , 2.0379 , 2.0743 , 2.1061 , 2.1379 , 2.1698 , 2.2016 , 2.2334 , 2.2646 ,
54
- 2.2958 , 2.3271 , 2.3583 , 2.3895 , 2.4187 , 2.4479 , 2.4772 , 2.5064 , 2.5356 ,
55
- 2.5610 , 2.5864 , 2.6117 , 2.6371 , 2.6625 , 2.6887 , 2.7148 , 2.7410 , 2.7671 ,
56
- 2.7933 };
52
+ constexpr std::array< float , MAX_FANOUT_CROSSING_COUNT> cross_count = {1.0000 , 1.0000 , 1.0000 , 1.0828 , 1.1536 , 1.2206 , 1.2823 , 1.3385 ,
53
+ 1.3991 , 1.4493 , 1.4974 , 1.5455 , 1.5937 , 1.6418 , 1.6899 , 1.7304 ,
54
+ 1.7709 , 1.8114 , 1.8519 , 1.8924 , 1.9288 , 1.9652 , 2.0015 , 2.0379 ,
55
+ 2.0743 , 2.1061 , 2.1379 , 2.1698 , 2.2016 , 2.2334 , 2.2646 , 2.2958 ,
56
+ 2.3271 , 2.3583 , 2.3895 , 2.4187 , 2.4479 , 2.4772 , 2.5064 , 2.5356 ,
57
+ 2.5610 , 2.5864 , 2.6117 , 2.6371 , 2.6625 , 2.6887 , 2.7148 , 2.7410 ,
58
+ 2.7671 , 2.7933 };
57
59
58
- /* *
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
- */
63
- static bool driven_by_moved_block (const ClusterNetId net,
64
- const std::vector<t_pl_moved_block>& moved_blocks);
65
-
66
- /* *
67
- * @brief Given the per-layer BB, calculate the wire-length estimate of the net on each layer
68
- * and return the sum of the lengths
69
- * @param net_id ID of the net which wirelength estimate is requested
70
- * @param bb Bounding box of the net
71
- * @return Wirelength estimate of the net
72
- */
73
- static double get_net_wirelength_from_layer_bb (ClusterNetId /* net_id*/ ,
74
- const std::vector<t_2D_bb>& bb,
75
- const vtr::NdMatrixProxy<int , 1 > layer_pin_sink_count);
76
60
77
61
78
62
@@ -327,9 +311,7 @@ double NetCostHandler::comp_per_layer_bb_cost_(e_cost_methods method) {
327
311
place_move_ctx.num_sink_pin_layer [size_t (net_id)]);
328
312
cost += net_cost_[net_id];
329
313
if (method == e_cost_methods::CHECK) {
330
- expected_wirelength += get_net_wirelength_from_layer_bb (net_id,
331
- place_move_ctx.layer_bb_coords [net_id],
332
- place_move_ctx.num_sink_pin_layer [size_t (net_id)]);
314
+ expected_wirelength += get_net_wirelength_from_layer_bb_ (net_id);
333
315
}
334
316
}
335
317
}
@@ -1545,12 +1527,14 @@ static double get_net_wirelength_estimate(ClusterNetId net_id, const t_bb& bb) {
1545
1527
return ncost;
1546
1528
}
1547
1529
1548
- static double get_net_wirelength_from_layer_bb (ClusterNetId /* net_id */ ,
1549
- const std::vector<t_2D_bb>& bb,
1550
- const vtr::NdMatrixProxy<int , 1 > layer_pin_sink_count) {
1530
+ double NetCostHandler::get_net_wirelength_from_layer_bb_ (ClusterNetId net_id) {
1551
1531
/* WMF: Finds the estimate of wirelength due to one net by looking at *
1552
1532
* its coordinate bounding box. */
1553
1533
1534
+ const auto & move_ctx = placer_state_.move ();
1535
+ const std::vector<t_2D_bb>& bb = move_ctx.layer_bb_coords [net_id];
1536
+ const auto & layer_pin_sink_count = move_ctx.num_sink_pin_layer [size_t (net_id)];
1537
+
1554
1538
double ncost = 0 .;
1555
1539
const int num_layers = g_vpr_ctx.device ().grid .get_num_layers ();
1556
1540
@@ -1632,7 +1616,7 @@ void NetCostHandler::find_affected_nets_and_update_costs(const PlaceDelayModel*
1632
1616
bool is_src_moving = false ;
1633
1617
if (clb_nlist.pin_type (blk_pin) == PinType::SINK) {
1634
1618
ClusterNetId net_id = clb_nlist.pin_net (blk_pin);
1635
- is_src_moving = driven_by_moved_block (net_id, blocks_affected. moved_blocks );
1619
+ is_src_moving = blocks_affected. driven_by_moved_block (net_id);
1636
1620
}
1637
1621
update_net_info_on_pin_move_ (delay_model,
1638
1622
criticalities,
@@ -1785,20 +1769,3 @@ void NetCostHandler::set_ts_edge_(const ClusterNetId net_id) {
1785
1769
place_move_ctx.layer_bb_num_on_edges [net_id] = layer_ts_bb_edge_new_[net_id];
1786
1770
}
1787
1771
}
1788
-
1789
-
1790
- static bool driven_by_moved_block (const ClusterNetId net,
1791
- const std::vector<t_pl_moved_block>& moved_blocks) {
1792
- auto & clb_nlist = g_vpr_ctx.clustering ().clb_nlist ;
1793
- bool is_driven_by_move_blk = false ;
1794
- ClusterBlockId net_driver_block = clb_nlist.net_driver_block (net);
1795
-
1796
- for (const t_pl_moved_block& block : moved_blocks) {
1797
- if (net_driver_block == block.block_num ) {
1798
- is_driven_by_move_blk = true ;
1799
- break ;
1800
- }
1801
- }
1802
-
1803
- return is_driven_by_move_blk;
1804
- }
0 commit comments