Skip to content

Commit 1962cb3

Browse files
check if placement is done when estimating channel utilization
1 parent e095d5d commit 1962cb3

File tree

2 files changed

+26
-6
lines changed

2 files changed

+26
-6
lines changed

vpr/src/route/route_common.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -289,8 +289,7 @@ void init_route_structs(const Netlist<>& net_list,
289289
is_flat);
290290

291291
route_ctx.is_clock_net = load_is_clock_net(net_list, device_ctx.arch->models, is_flat);
292-
route_ctx.route_bb = load_route_bb(net_list,
293-
bb_factor);
292+
route_ctx.route_bb = load_route_bb(net_list, bb_factor);
294293
route_ctx.rr_blk_source = load_rr_clb_sources(device_ctx.rr_graph,
295294
net_list,
296295
is_flat);

vpr/src/route/route_utilization.cpp

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,32 @@ RoutingChanUtilEstimator::RoutingChanUtilEstimator(const BlkLocRegistry& blk_loc
1414
}
1515

1616
std::pair<vtr::NdMatrix<double, 3>, vtr::NdMatrix<double, 3>> RoutingChanUtilEstimator::estimate_routing_chan_util() {
17-
// Compute net bounding boxes
18-
net_cost_handler_->comp_bb_cost(e_cost_methods::NORMAL);
17+
const auto& clb_nlist = g_vpr_ctx.clustering().clb_nlist;
18+
const auto& block_locs = placer_state_->block_locs();
1919

20-
// Estimate routing channel utilization using
21-
return net_cost_handler_->estimate_routing_chan_util();
20+
bool placement_is_done = (block_locs.size() == clb_nlist.blocks().size());
21+
22+
if (placement_is_done) {
23+
// Compute net bounding boxes
24+
net_cost_handler_->comp_bb_cost(e_cost_methods::NORMAL);
25+
26+
// Estimate routing channel utilization using
27+
return net_cost_handler_->estimate_routing_chan_util();
28+
} else {
29+
const auto& device_ctx = g_vpr_ctx.device();
30+
31+
auto chanx_util = vtr::NdMatrix<double, 3>({{(size_t)device_ctx.grid.get_num_layers(),
32+
device_ctx.grid.width(),
33+
device_ctx.grid.height()}},
34+
0);
35+
36+
auto chany_util = vtr::NdMatrix<double, 3>({{(size_t)device_ctx.grid.get_num_layers(),
37+
device_ctx.grid.width(),
38+
device_ctx.grid.height()}},
39+
0);
40+
41+
return {chanx_util, chany_util};
42+
}
2243
}
2344

2445
vtr::Matrix<float> calculate_routing_usage(e_rr_type rr_type, bool is_flat, bool is_print) {

0 commit comments

Comments
 (0)