9
9
using std::max;
10
10
using std::min;
11
11
12
- /* Flags for the states of the bounding box. *
13
- * Stored as char for memory efficiency. */
14
-
12
+ /* *
13
+ * @brief for the states of the bounding box.
14
+ * Stored as char for memory efficiency.
15
+ */
15
16
enum class NetUpdateState {
16
17
NOT_UPDATED_YET,
17
18
UPDATED_ONCE,
18
19
GOT_FROM_SCRATCH
19
20
};
20
21
21
- /* This defines the error tolerance for floating points variables used in *
22
- * cost computation. 0.01 means that there is a 1% error tolerance. */
22
+ /* *
23
+ * @brief The error tolerance due to round off for the total cost computation.
24
+ * When we check it from scratch vs. incrementally. 0.01 means that there is a 1% error tolerance.
25
+ */
23
26
#define ERROR_TOL .01
24
27
25
- /* Expected crossing counts for nets with different #'s of pins. From *
26
- * ICCAD 94 pp. 690 - 695 (with linear interpolation applied by me). *
27
- * Multiplied to bounding box of a net to better estimate wire length *
28
- * for higher fanout nets. Each entry is the correction factor for the *
29
- * fanout index-1 */
28
+ /* *
29
+ * @brief Crossing counts for nets with different #'s of pins. From
30
+ * ICCAD 94 pp. 690 - 695 (with linear interpolation applied by me).
31
+ * Multiplied to bounding box of a net to better estimate wire length
32
+ * for higher fanout nets. Each entry is the correction factor for the
33
+ * fanout index-1
34
+ */
30
35
static const float cross_count[50 ] = {/* [0..49] */ 1.0 , 1.0 , 1.0 , 1.0828 ,
31
36
1.1536 , 1.2206 , 1.2823 , 1.3385 , 1.3991 , 1.4493 , 1.4974 , 1.5455 , 1.5937 ,
32
37
1.6418 , 1.6899 , 1.7304 , 1.7709 , 1.8114 , 1.8519 , 1.8924 , 1.9288 , 1.9652 ,
@@ -35,33 +40,35 @@ static const float cross_count[50] = {/* [0..49] */ 1.0, 1.0, 1.0, 1.0828,
35
40
2.5610 , 2.5864 , 2.6117 , 2.6371 , 2.6625 , 2.6887 , 2.7148 , 2.7410 , 2.7671 ,
36
41
2.7933 };
37
42
38
- /* The arrays below are used to precompute the inverse of the average *
39
- * number of tracks per channel between [subhigh] and [sublow]. Access *
40
- * them as chan?_place_cost_fac[subhigh][sublow]. They are used to *
41
- * speed up the computation of the cost function that takes the length *
42
- * of the net bounding box in each dimension, divided by the average *
43
- * number of tracks in that direction; for other cost functions they *
44
- * will never be used. *
43
+ /* *
44
+ * @brief Matrices below are used to precompute the inverse of the average
45
+ * number of tracks per channel between [subhigh] and [sublow]. Access
46
+ * them as chan?_place_cost_fac[subhigh][sublow]. They are used to
47
+ * speed up the computation of the cost function that takes the length
48
+ * of the net bounding box in each dimension, divided by the average
49
+ * number of tracks in that direction; for other cost functions they
50
+ * will never be used.
45
51
*/
46
- static vtr::NdMatrix<float , 2 > chanx_place_cost_fac ({0 , 0 }); // [0...device_ctx.grid.width()-2]
47
- static vtr::NdMatrix<float , 2 > chany_place_cost_fac ({0 , 0 }); // [0...device_ctx.grid.height()-2]
52
+ static vtr::NdMatrix<float , 2 > chanx_place_cost_fac ({0 , 0 }); // [0...device_ctx.grid.width()-2]
53
+ static vtr::NdMatrix<float , 2 > chany_place_cost_fac ({0 , 0 }); // [0...device_ctx.grid.height()-2]
48
54
49
55
/* Cost of a net, and a temporary cost of a net used during move assessment. */
50
56
static vtr::vector<ClusterNetId, double > net_cost, proposed_net_cost;
51
57
52
- /* [0...cluster_ctx.clb_nlist.nets().size()-1] *
53
- * A flag array to indicate whether the specific bounding box has been updated *
54
- * in this particular swap or not. If it has been updated before, the code *
55
- * must use the updated data, instead of the out-of-date data passed into the *
56
- * subroutine, particularly used in try_swap(). The value NOT_UPDATED_YET *
57
- * indicates that the net has not been updated before, UPDATED_ONCE indicated *
58
- * that the net has been updated once, if it is going to be updated again, the *
59
- * values from the previous update must be used. GOT_FROM_SCRATCH is only *
60
- * applicable for nets larger than SMALL_NETS and it indicates that the *
61
- * particular bounding box cannot be updated incrementally before, hence the *
62
- * bounding box is got from scratch, so the bounding box would definitely be *
63
- * right, DO NOT update again. */
64
- static vtr::vector<ClusterNetId, NetUpdateState> bb_updated_before;
58
+ /* * *
59
+ * @brief Flag array to indicate whether the specific bounding box has been updated
60
+ * in this particular swap or not. If it has been updated before, the code
61
+ * must use the updated data, instead of the out-of-date data passed into the
62
+ * subroutine, particularly used in try_swap(). The value NOT_UPDATED_YET
63
+ * indicates that the net has not been updated before, UPDATED_ONCE indicated
64
+ * that the net has been updated once, if it is going to be updated again, the
65
+ * values from the previous update must be used. GOT_FROM_SCRATCH is only
66
+ * applicable for nets larger than SMALL_NETS and it indicates that the
67
+ * particular bounding box is not incrementally updated, and hence the
68
+ * bounding box is got from scratch, so the bounding box would definitely be
69
+ * right, DO NOT update again.
70
+ */
71
+ static vtr::vector<ClusterNetId, NetUpdateState> bb_updated_before; // [0...cluster_ctx.clb_nlist.nets().size()-1]
65
72
66
73
/* The following arrays are used by the try_swap function for speed. */
67
74
@@ -77,9 +84,9 @@ static vtr::vector<ClusterNetId, NetUpdateState> bb_updated_before;
77
84
78
85
/* [0...cluster_ctx.clb_nlist.nets().size()-1] -> 3D bounding box*/
79
86
static vtr::vector<ClusterNetId, t_bb> ts_bb_coord_new, ts_bb_edge_new;
80
- /* [0...cluster_ctx.clb_nlist.nets().size()-1][0...num_layers] -> 2D bonding box on a layer*/
87
+ /* [0...cluster_ctx.clb_nlist.nets().size()-1][0...num_layers-1 ] -> 2D bonding box on a layer*/
81
88
static vtr::vector<ClusterNetId, std::vector<t_2D_bb>> layer_ts_bb_edge_new, layer_ts_bb_coord_new;
82
- /* [0...cluster_ctx.clb_nlist.nets().size()-1][0...num_layers] -> number of sink pins on a layer*/
89
+ /* [0...cluster_ctx.clb_nlist.nets().size()-1][0...num_layers-1 ] -> number of sink pins on a layer*/
83
90
static vtr::Matrix<int > ts_layer_sink_pin_count;
84
91
/* [0...num_afftected_nets] -> net_id of the affected nets */
85
92
static std::vector<ClusterNetId> ts_nets_to_update;
0 commit comments