@@ -14,11 +14,32 @@ RoutingChanUtilEstimator::RoutingChanUtilEstimator(const BlkLocRegistry& blk_loc
14
14
}
15
15
16
16
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 ( );
19
19
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
+ }
22
43
}
23
44
24
45
vtr::Matrix<float > calculate_routing_usage (e_rr_type rr_type, bool is_flat, bool is_print) {
0 commit comments