@@ -196,12 +196,12 @@ class NetCostHandler {
196
196
vtr::NdOffsetMatrix<float , 2 > chanx_place_cost_fac_; // [-1...device_ctx.grid.width()-1]
197
197
vtr::NdOffsetMatrix<float , 2 > chany_place_cost_fac_; // [-1...device_ctx.grid.height()-1]
198
198
/* *
199
- @brief This data structure functions similarly to the matrices described above
200
- but is applied to 3D connections linking different FPGA layers. It is used in the
201
- placement cost function calculation, where the height of the bounding box is divided
202
- by the average number of inter-die connections within the bounding box .
199
+ @brief This data structure stores the cumulative number of inter-die connections from the lower-left corner.
200
+ * It is later used to calculate the chanZ factor, which functions similarly to chanx_place_cost_fac_ and chany_place_cost_fac_,
201
+ * but applies to the height of the bounding box. The chanZ factor is calculated during block placement because storing it in the
202
+ * same way as the X and Y cost factors would require a 4D array and population it is an O(n^2) operation .
203
203
*/
204
- vtr::NdMatrix<float , 4 > chanz_place_cost_fac_; // [0...device_ctx.grid.width()-1][0...device_ctx.grid.height()-1][0...device_ctx.grid.width()-1][0...device_ctx.grid.height()-1]
204
+ vtr::NdMatrix<float , 2 > acc_tile_num_inter_die_conn_;
205
205
206
206
207
207
private:
@@ -511,4 +511,14 @@ class NetCostHandler {
511
511
*/
512
512
double get_net_wirelength_from_layer_bb_ (ClusterNetId net_id);
513
513
514
+ /* *
515
+ * @brief Calculate the chanz cost factor based on the inverse of the average number of inter-die connections
516
+ * in the given bounding box. This cost factor increases the placement cost for blocks that require inter-layer
517
+ * connections in areas with, on average, fewer inter-die connections. If inter-die connections are evenly
518
+ * distributed across tiles, the cost factor will be the same for all bounding boxes.
519
+ * @param bounding_box Bounding box of the net which chanz cost factor is to be calculated
520
+ * @return ChanZ cost factor
521
+ */
522
+ float get_chanz_cost_factor (const t_bb& bounding_box);
523
+
514
524
};
0 commit comments