|
1 | 1 | #include "connection_router.h" |
2 | | -#include "rr_graph.h" |
3 | 2 |
|
| 3 | +#include <algorithm> |
| 4 | +#include "rr_graph.h" |
4 | 5 | #include "binary_heap.h" |
5 | 6 | #include "four_ary_heap.h" |
6 | 7 | #include "bucket.h" |
@@ -660,8 +661,8 @@ float ConnectionRouter<Heap>::compute_node_cost_using_rcv(const t_conn_cost_para |
660 | 661 | float expected_total_delay_cost; |
661 | 662 | float expected_total_cong_cost; |
662 | 663 |
|
663 | | - float expected_total_cong = cost_params.astar_fac * expected_cong + backwards_cong; |
664 | | - float expected_total_delay = cost_params.astar_fac * expected_delay + backwards_delay; |
| 664 | + float expected_total_cong = expected_cong + backwards_cong; |
| 665 | + float expected_total_delay = expected_delay + backwards_delay; |
665 | 666 |
|
666 | 667 | //If budgets specified calculate cost as described by RCV paper: |
667 | 668 | // R. Fung, V. Betz and W. Chow, "Slack Allocation and Routing to Improve FPGA Timing While |
@@ -813,7 +814,7 @@ void ConnectionRouter<Heap>::evaluate_timing_driven_node_costs(t_heap* to, |
813 | 814 | rr_node_arch_name(target_node, is_flat_).c_str(), |
814 | 815 | describe_rr_node(device_ctx.rr_graph, device_ctx.grid, device_ctx.rr_indexed_data, target_node, is_flat_).c_str(), |
815 | 816 | expected_cost, to->R_upstream); |
816 | | - total_cost += to->backward_path_cost + cost_params.astar_fac * expected_cost; |
| 817 | + total_cost += to->backward_path_cost + cost_params.astar_fac * std::max(0.f, expected_cost - cost_params.astar_offset); |
817 | 818 | } |
818 | 819 | to->cost = total_cost; |
819 | 820 | } |
@@ -905,12 +906,8 @@ void ConnectionRouter<Heap>::add_route_tree_node_to_heap( |
905 | 906 |
|
906 | 907 | if (!rcv_path_manager.is_enabled()) { |
907 | 908 | // tot_cost = backward_path_cost + cost_params.astar_fac * expected_cost; |
908 | | - float tot_cost = backward_path_cost |
909 | | - + cost_params.astar_fac |
910 | | - * router_lookahead_.get_expected_cost(inode, |
911 | | - target_node, |
912 | | - cost_params, |
913 | | - R_upstream); |
| 909 | + float expected_cost = router_lookahead_.get_expected_cost(inode, target_node, cost_params, R_upstream); |
| 910 | + float tot_cost = backward_path_cost + cost_params.astar_fac * std::max(0.f, expected_cost - cost_params.astar_offset); |
914 | 911 | VTR_LOGV_DEBUG(router_debug_, " Adding node %8d to heap from init route tree with cost %g (%s)\n", |
915 | 912 | inode, |
916 | 913 | tot_cost, |
|
0 commit comments