Skip to content

Commit b1e78f0

Browse files
calculate channel utilization by using channel width info extracted from RR graph
1 parent 5f11b9b commit b1e78f0

File tree

2 files changed

+21
-4
lines changed

2 files changed

+21
-4
lines changed

vpr/src/place/net_cost_handler.cpp

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1746,17 +1746,32 @@ double NetCostHandler::estimate_routing_chann_util() {
17461746
}
17471747
}
17481748

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+
17501756

17511757
for (size_t x = 0; x < chanx_util_.dim_size(0); ++x) {
17521758
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+
17541765
}
17551766
}
17561767

17571768
for (size_t x = 0; x < chany_util_.dim_size(0); ++x) {
17581769
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+
}
17601775
}
17611776
}
17621777

vpr/src/place/net_cost_handler.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,10 +245,12 @@ class NetCostHandler {
245245
vtr::PrefixSum2D<double> acc_chanx_util_;
246246
vtr::PrefixSum2D<double> acc_chany_util_;
247247

248-
249248
vtr::Matrix<double> chanx_util_;
250249
vtr::Matrix<double> chany_util_;
251250

251+
vtr::NdMatrix<int, 3> chanx_width_;
252+
vtr::NdMatrix<int, 3> chany_width_;
253+
252254

253255
/**
254256
* @brief The matrix below is used to calculate a chanz_place_cost_fac based on the average channel width in

0 commit comments

Comments
 (0)