File tree 2 files changed +21
-4
lines changed
2 files changed +21
-4
lines changed Original file line number Diff line number Diff line change @@ -1746,17 +1746,32 @@ double NetCostHandler::estimate_routing_chann_util() {
1746
1746
}
1747
1747
}
1748
1748
1749
- const t_chan_width& chan_width = device_ctx.chan_width ;
1749
+ // const t_chan_width& chan_width = device_ctx.chan_width;
1750
+
1751
+ if (chanx_width_.empty ()) {
1752
+ VTR_ASSERT (chany_width_.empty ());
1753
+ std::tie (chanx_width_, chany_width_) = calculate_channel_width ();
1754
+ }
1755
+
1750
1756
1751
1757
for (size_t x = 0 ; x < chanx_util_.dim_size (0 ); ++x) {
1752
1758
for (size_t y = 0 ; y < chanx_util_.dim_size (1 ); ++y) {
1753
- chanx_util_[x][y] /= chan_width.x_list [y];
1759
+ if (chanx_width_[0 ][x][y] > 0 ) {
1760
+ chanx_util_[x][y] /= chanx_width_[0 ][x][y];
1761
+ } else {
1762
+ chanx_util_[x][y] = 1 .;
1763
+ }
1764
+
1754
1765
}
1755
1766
}
1756
1767
1757
1768
for (size_t x = 0 ; x < chany_util_.dim_size (0 ); ++x) {
1758
1769
for (size_t y = 0 ; y < chany_util_.dim_size (1 ); ++y) {
1759
- chany_util_[x][y] /= chan_width.y_list [x];
1770
+ if (chany_width_[0 ][x][y] > 0 ) {
1771
+ chany_util_[x][y] /= chany_width_[0 ][x][y];
1772
+ } else {
1773
+ chany_util_[x][y] = 1 .;
1774
+ }
1760
1775
}
1761
1776
}
1762
1777
Original file line number Diff line number Diff line change @@ -245,10 +245,12 @@ class NetCostHandler {
245
245
vtr::PrefixSum2D<double > acc_chanx_util_;
246
246
vtr::PrefixSum2D<double > acc_chany_util_;
247
247
248
-
249
248
vtr::Matrix<double > chanx_util_;
250
249
vtr::Matrix<double > chany_util_;
251
250
251
+ vtr::NdMatrix<int , 3 > chanx_width_;
252
+ vtr::NdMatrix<int , 3 > chany_width_;
253
+
252
254
253
255
/* *
254
256
* @brief The matrix below is used to calculate a chanz_place_cost_fac based on the average channel width in
You can’t perform that action at this time.
0 commit comments