Skip to content

Commit 8bead96

Browse files
committed
[vpr][place][net_cost] add get_chanz_cost_factor signiture and acc_tile_num_inter_die_conn_
1 parent 11ee10f commit 8bead96

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

vpr/src/place/net_cost_handler.h

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -196,12 +196,12 @@ class NetCostHandler {
196196
vtr::NdOffsetMatrix<float, 2> chanx_place_cost_fac_; // [-1...device_ctx.grid.width()-1]
197197
vtr::NdOffsetMatrix<float, 2> chany_place_cost_fac_; // [-1...device_ctx.grid.height()-1]
198198
/**
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.
203203
*/
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_;
205205

206206

207207
private:
@@ -511,4 +511,14 @@ class NetCostHandler {
511511
*/
512512
double get_net_wirelength_from_layer_bb_(ClusterNetId net_id);
513513

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+
514524
};

0 commit comments

Comments
 (0)