Skip to content

Commit

Permalink
Merge pull request #2720 from ueqri/ueqri-enhanced-heap-for-connectio…
Browse files Browse the repository at this point in the history
…n-router

[Router] Enhanced the Connection Router by Optimizing the Heap Structure
  • Loading branch information
vaughnbetz authored Oct 18, 2024
2 parents 387f187 + d7ea38a commit f4f46d5
Show file tree
Hide file tree
Showing 37 changed files with 673 additions and 2,120 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -155,3 +155,8 @@ tags
cmake-build-debug
cmake-build-release
/.metadata/

#
# Clangd
#
compile_commands.json
7 changes: 7 additions & 0 deletions doc/src/api/vpr/route_tree.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,10 @@ RouteTreeNode
.. doxygenclass:: RouteTreeNode
:project: vpr
:members:

RTExploredNode
-------------

.. doxygenclass:: RTExploredNode
:project: vpr
:members:
21 changes: 2 additions & 19 deletions doc/src/api/vprinternals/router_heap.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,13 @@
Router Heap
==============

t_heap
----------
.. doxygenstruct:: t_heap
:project: vpr
:members:

HeapInterface
----------
.. doxygenclass:: HeapInterface
:project: vpr
:members:

HeapStorage
----------
.. doxygenclass:: HeapStorage
:project: vpr
:members:

KAryHeap
DAryHeap
----------
.. doxygenclass:: KAryHeap
.. doxygenclass:: DAryHeap
:project: vpr

FourAryHeap
----------
.. doxygenclass:: FourAryHeap
:project: vpr
6 changes: 4 additions & 2 deletions doc/src/vpr/command_line_usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1396,15 +1396,17 @@ The following options are only valid when the router is in timing-driven mode (t

**Default:** ``safe``

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

.. warning:: Experimental

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`.

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

``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`.
``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`.

``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`.

``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).

Expand Down
2 changes: 1 addition & 1 deletion utils/route_diag/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ static void do_one_route(const Netlist<>& net_list,
is_flat);
enable_router_debug(router_opts, ParentNetId(), sink_node, 1, &router);
bool found_path;
t_heap cheapest;
RTExploredNode cheapest;
ConnectionParameters conn_params(ParentNetId::INVALID(),
-1,
false,
Expand Down
3 changes: 0 additions & 3 deletions vpr/src/base/ShowSetup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -468,9 +468,6 @@ static void ShowRouterOpts(const t_router_opts& RouterOpts) {
case e_heap_type::FOUR_ARY_HEAP:
VTR_LOG("FOUR_ARY_HEAP\n");
break;
case e_heap_type::BUCKET_HEAP_APPROXIMATION:
VTR_LOG("BUCKET_HEAP_APPROXIMATION\n");
break;
default:
VPR_FATAL_ERROR(VPR_ERROR_UNKNOWN, "Unknown router_heap\n");
}
Expand Down
10 changes: 3 additions & 7 deletions vpr/src/base/read_options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ struct RouteBudgetsAlgorithm {
}

std::vector<std::string> default_choices() {
return {"minimax", "scale_delay", "disable"};
return {"minimax", "yoyo", "scale_delay", "disable"};
}
};

Expand Down Expand Up @@ -1063,8 +1063,6 @@ struct ParseRouterHeap {
conv_value.set_value(e_heap_type::BINARY_HEAP);
else if (str == "four_ary")
conv_value.set_value(e_heap_type::FOUR_ARY_HEAP);
else if (str == "bucket")
conv_value.set_value(e_heap_type::BUCKET_HEAP_APPROXIMATION);
else {
std::stringstream msg;
msg << "Invalid conversion from '" << str << "' to e_heap_type (expected one of: " << argparse::join(default_choices(), ", ") << ")";
Expand All @@ -1077,11 +1075,9 @@ struct ParseRouterHeap {
ConvertedValue<std::string> conv_value;
if (val == e_heap_type::BINARY_HEAP)
conv_value.set_value("binary");
else if (val == e_heap_type::FOUR_ARY_HEAP)
conv_value.set_value("four_ary");
else {
VTR_ASSERT(val == e_heap_type::BUCKET_HEAP_APPROXIMATION);
conv_value.set_value("bucket");
VTR_ASSERT(val == e_heap_type::FOUR_ARY_HEAP);
conv_value.set_value("four_ary");
}
return conv_value;
}
Expand Down
2 changes: 0 additions & 2 deletions vpr/src/base/read_route.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
#include <ctime>
#include <sstream>
#include <string>
#include <unordered_set>

#include "atom_netlist.h"
#include "atom_netlist_utils.h"
Expand All @@ -46,7 +45,6 @@
#include "route_common.h"
#include "route_tree.h"
#include "read_route.h"
#include "four_ary_heap.h"

#include "old_traceback.h"

Expand Down
6 changes: 5 additions & 1 deletion vpr/src/base/vpr_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -1607,14 +1607,18 @@ constexpr bool is_src_sink(e_rr_type type) { return (type == SOURCE || type == S
* is being used.
* @param backward_path_cost Total cost of the path up to and including this
* node.
* @param occ The current occupancy of the associated rr node
* @param R_upstream Upstream resistance to ground from this node in the current
* path search (connection routing), including the resistance
* of the node itself (device_ctx.rr_nodes[index].R).
* @param occ The current occupancy of the associated rr node.
*/
struct t_rr_node_route_inf {
RREdgeId prev_edge;

float acc_cost;
float path_cost;
float backward_path_cost;
float R_upstream;

public: //Accessors
short occ() const { return occ_; }
Expand Down
77 changes: 0 additions & 77 deletions vpr/src/route/binary_heap.cpp

This file was deleted.

17 changes: 0 additions & 17 deletions vpr/src/route/binary_heap.h

This file was deleted.

Loading

0 comments on commit f4f46d5

Please sign in to comment.