Skip to content

Commit f4f46d5

Browse files
authored
Merge pull request verilog-to-routing#2720 from ueqri/ueqri-enhanced-heap-for-connection-router
[Router] Enhanced the Connection Router by Optimizing the Heap Structure
2 parents 387f187 + d7ea38a commit f4f46d5

37 files changed

+673
-2120
lines changed

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,3 +155,8 @@ tags
155155
cmake-build-debug
156156
cmake-build-release
157157
/.metadata/
158+
159+
#
160+
# Clangd
161+
#
162+
compile_commands.json

doc/src/api/vpr/route_tree.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,10 @@ RouteTreeNode
2020
.. doxygenclass:: RouteTreeNode
2121
:project: vpr
2222
:members:
23+
24+
RTExploredNode
25+
-------------
26+
27+
.. doxygenclass:: RTExploredNode
28+
:project: vpr
29+
:members:

doc/src/api/vprinternals/router_heap.rst

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,13 @@
22
Router Heap
33
==============
44

5-
t_heap
6-
----------
7-
.. doxygenstruct:: t_heap
8-
:project: vpr
9-
:members:
10-
115
HeapInterface
126
----------
137
.. doxygenclass:: HeapInterface
148
:project: vpr
159
:members:
1610

17-
HeapStorage
18-
----------
19-
.. doxygenclass:: HeapStorage
20-
:project: vpr
21-
:members:
22-
23-
KAryHeap
11+
DAryHeap
2412
----------
25-
.. doxygenclass:: KAryHeap
13+
.. doxygenclass:: DAryHeap
2614
:project: vpr
27-
28-
FourAryHeap
29-
----------
30-
.. doxygenclass:: FourAryHeap
31-
:project: vpr

doc/src/vpr/command_line_usage.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1396,15 +1396,17 @@ The following options are only valid when the router is in timing-driven mode (t
13961396

13971397
**Default:** ``safe``
13981398

1399-
.. option:: --routing_budgets_algorithm { disable | minimax | scale_delay }
1399+
.. option:: --routing_budgets_algorithm { disable | minimax | yoyo | scale_delay }
14001400

14011401
.. warning:: Experimental
14021402

14031403
Controls how the routing budgets are created. Routing budgets are used to guid VPR's routing algorithm to consider both short path and long path timing constraints :cite:`RCV_algorithm`.
14041404

14051405
``disable`` is used to disable the budget feature. This uses the default VPR and ignores hold time constraints.
14061406

1407-
``minimax`` sets the minimum and maximum budgets by distributing the long path and short path slacks depending on the the current delay values. This uses the routing cost valleys and Minimax-PERT algorithm :cite:`minimax_pert,RCV_algorithm`.
1407+
``minimax`` sets the minimum and maximum budgets by distributing the long path and short path slacks depending on the the current delay values. This uses the Minimax-PERT algorithm :cite:`minimax_pert`.
1408+
1409+
``yoyo`` allocates budgets using minimax algorithm (as above), and enables hold slack resolution in the router using the Routing Cost Valleys (RCV) algorithm :cite:`RCV_algorithm`.
14081410

14091411
``scale_delay`` has the minimum budgets set to 0 and the maximum budgets is set to the delay of a net scaled by the pin criticality (net delay/pin criticality).
14101412

utils/route_diag/src/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ static void do_one_route(const Netlist<>& net_list,
114114
is_flat);
115115
enable_router_debug(router_opts, ParentNetId(), sink_node, 1, &router);
116116
bool found_path;
117-
t_heap cheapest;
117+
RTExploredNode cheapest;
118118
ConnectionParameters conn_params(ParentNetId::INVALID(),
119119
-1,
120120
false,

vpr/src/base/ShowSetup.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -468,9 +468,6 @@ static void ShowRouterOpts(const t_router_opts& RouterOpts) {
468468
case e_heap_type::FOUR_ARY_HEAP:
469469
VTR_LOG("FOUR_ARY_HEAP\n");
470470
break;
471-
case e_heap_type::BUCKET_HEAP_APPROXIMATION:
472-
VTR_LOG("BUCKET_HEAP_APPROXIMATION\n");
473-
break;
474471
default:
475472
VPR_FATAL_ERROR(VPR_ERROR_UNKNOWN, "Unknown router_heap\n");
476473
}

vpr/src/base/read_options.cpp

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ struct RouteBudgetsAlgorithm {
272272
}
273273

274274
std::vector<std::string> default_choices() {
275-
return {"minimax", "scale_delay", "disable"};
275+
return {"minimax", "yoyo", "scale_delay", "disable"};
276276
}
277277
};
278278

@@ -1063,8 +1063,6 @@ struct ParseRouterHeap {
10631063
conv_value.set_value(e_heap_type::BINARY_HEAP);
10641064
else if (str == "four_ary")
10651065
conv_value.set_value(e_heap_type::FOUR_ARY_HEAP);
1066-
else if (str == "bucket")
1067-
conv_value.set_value(e_heap_type::BUCKET_HEAP_APPROXIMATION);
10681066
else {
10691067
std::stringstream msg;
10701068
msg << "Invalid conversion from '" << str << "' to e_heap_type (expected one of: " << argparse::join(default_choices(), ", ") << ")";
@@ -1077,11 +1075,9 @@ struct ParseRouterHeap {
10771075
ConvertedValue<std::string> conv_value;
10781076
if (val == e_heap_type::BINARY_HEAP)
10791077
conv_value.set_value("binary");
1080-
else if (val == e_heap_type::FOUR_ARY_HEAP)
1081-
conv_value.set_value("four_ary");
10821078
else {
1083-
VTR_ASSERT(val == e_heap_type::BUCKET_HEAP_APPROXIMATION);
1084-
conv_value.set_value("bucket");
1079+
VTR_ASSERT(val == e_heap_type::FOUR_ARY_HEAP);
1080+
conv_value.set_value("four_ary");
10851081
}
10861082
return conv_value;
10871083
}

vpr/src/base/read_route.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
#include <ctime>
2121
#include <sstream>
2222
#include <string>
23-
#include <unordered_set>
2423

2524
#include "atom_netlist.h"
2625
#include "atom_netlist_utils.h"
@@ -46,7 +45,6 @@
4645
#include "route_common.h"
4746
#include "route_tree.h"
4847
#include "read_route.h"
49-
#include "four_ary_heap.h"
5048

5149
#include "old_traceback.h"
5250

vpr/src/base/vpr_types.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1607,14 +1607,18 @@ constexpr bool is_src_sink(e_rr_type type) { return (type == SOURCE || type == S
16071607
* is being used.
16081608
* @param backward_path_cost Total cost of the path up to and including this
16091609
* node.
1610-
* @param occ The current occupancy of the associated rr node
1610+
* @param R_upstream Upstream resistance to ground from this node in the current
1611+
* path search (connection routing), including the resistance
1612+
* of the node itself (device_ctx.rr_nodes[index].R).
1613+
* @param occ The current occupancy of the associated rr node.
16111614
*/
16121615
struct t_rr_node_route_inf {
16131616
RREdgeId prev_edge;
16141617

16151618
float acc_cost;
16161619
float path_cost;
16171620
float backward_path_cost;
1621+
float R_upstream;
16181622

16191623
public: //Accessors
16201624
short occ() const { return occ_; }

vpr/src/route/binary_heap.cpp

Lines changed: 0 additions & 77 deletions
This file was deleted.

vpr/src/route/binary_heap.h

Lines changed: 0 additions & 17 deletions
This file was deleted.

0 commit comments

Comments
 (0)