Skip to content

Commit 9baa569

Browse files
committed
lookahead: add new extended map lookahead
This lookahead generates a map with a more complex and complete way of sampling and expanding the nodes to reach all destinations. The dijkstra expansion is parallelized to overcome the higher number of samples needed. It also adds a penalty cost factor based on distance between the origin and destination nodes. Signed-off-by: Alessandro Comodi <[email protected]>
1 parent 3a4f53c commit 9baa569

12 files changed

+1540
-7
lines changed

libs/libvtrcapnproto/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ set(CAPNP_DEFS
2222
matrix.capnp
2323
gen/rr_graph_uxsdcxx.capnp
2424
map_lookahead.capnp
25+
extended_map_lookahead.capnp
2526
)
2627
capnp_generate_cpp(CAPNP_SRCS CAPNP_HDRS
2728
${CAPNP_DEFS}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
@0x876ec83c2fea5a18;
2+
3+
using Matrix = import "matrix.capnp";
4+
5+
struct VprCostEntry {
6+
delay @0 :Float32;
7+
congestion @1 :Float32;
8+
fill @2 :Bool;
9+
}
10+
11+
struct VprVector2D {
12+
x @0 :Int64;
13+
y @1 :Int64;
14+
}
15+
16+
struct VprFloatEntry {
17+
value @0 :Float32;
18+
}
19+
20+
struct VprCostMap {
21+
costMap @0 :Matrix.Matrix((Matrix.Matrix(VprCostEntry)));
22+
offset @1 :Matrix.Matrix(VprVector2D);
23+
depField @2 :List(Int64);
24+
penalty @3 :Matrix.Matrix(VprFloatEntry);
25+
}

vpr/src/base/ShowSetup.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,9 @@ static void ShowRouterOpts(const t_router_opts& RouterOpts) {
307307
case e_router_lookahead::MAP:
308308
VTR_LOG("MAP\n");
309309
break;
310+
case e_router_lookahead::EXTENDED_MAP:
311+
VTR_LOG("EXTENDED_MAP\n");
312+
break;
310313
case e_router_lookahead::NO_OP:
311314
VTR_LOG("NO_OP\n");
312315
break;

vpr/src/base/read_options.cpp

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -692,6 +692,8 @@ struct ParseRouterLookahead {
692692
conv_value.set_value(e_router_lookahead::CLASSIC);
693693
else if (str == "map")
694694
conv_value.set_value(e_router_lookahead::MAP);
695+
else if (str == "extended_map")
696+
conv_value.set_value(e_router_lookahead::EXTENDED_MAP);
695697
else {
696698
std::stringstream msg;
697699
msg << "Invalid conversion from '"
@@ -707,15 +709,17 @@ struct ParseRouterLookahead {
707709
ConvertedValue<std::string> conv_value;
708710
if (val == e_router_lookahead::CLASSIC)
709711
conv_value.set_value("classic");
710-
else {
711-
VTR_ASSERT(val == e_router_lookahead::MAP);
712+
else if (val == e_router_lookahead::MAP) {
712713
conv_value.set_value("map");
714+
} else {
715+
VTR_ASSERT(val == e_router_lookahead::EXTENDED_MAP);
716+
conv_value.set_value("extended_map");
713717
}
714718
return conv_value;
715719
}
716720

717721
std::vector<std::string> default_choices() {
718-
return {"classic", "map"};
722+
return {"classic", "map", "extended_map"};
719723
}
720724
};
721725

@@ -1957,7 +1961,9 @@ argparse::ArgumentParser create_arg_parser(std::string prog_name, t_options& arg
19571961
"Controls what lookahead the router uses to calculate cost of completing a connection.\n"
19581962
" * classic: The classic VPR lookahead (may perform better on un-buffered routing\n"
19591963
" architectures)\n"
1960-
" * map: A more advanced lookahead which accounts for diverse wire type\n")
1964+
" * map: An advanced lookahead which accounts for diverse wire type\n"
1965+
" * extended_map: A more advanced and extended lookahead which accounts for a more\n"
1966+
" exhaustive node sampling method")
19611967
.default_value("map")
19621968
.show_in(argparse::ShowIn::HELP_ONLY);
19631969

vpr/src/base/vpr_types.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,10 @@ constexpr const char* EMPTY_BLOCK_NAME = "EMPTY";
110110
#endif
111111

112112
enum class e_router_lookahead {
113-
CLASSIC, ///<VPR's classic lookahead (assumes uniform wire types)
114-
MAP, ///<Lookahead considering different wire types (see Oleg Petelin's MASc Thesis)
115-
NO_OP ///<A no-operation lookahead which always returns zero
113+
CLASSIC, ///<VPR's classic lookahead (assumes uniform wire types)
114+
MAP, ///<Lookahead considering different wire types (see Oleg Petelin's MASc Thesis)
115+
EXTENDED_MAP, ///<Lookahead with a more extensive node sampling method
116+
NO_OP ///<A no-operation lookahead which always returns zero
116117
};
117118

118119
enum class e_route_bb_update {

vpr/src/route/route_timing.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
#include "connection_router.h"
3838

3939
#include "router_lookahead_map.h"
40+
#include "router_lookahead_extended_map.h"
4041

4142
#include "tatum/TimingReporter.hpp"
4243
#include "overuse_report.h"

vpr/src/route/router_lookahead.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#include "router_lookahead.h"
22

33
#include "router_lookahead_map.h"
4+
#include "router_lookahead_extended_map.h"
45
#include "vpr_error.h"
56
#include "globals.h"
67
#include "route_timing.h"
@@ -13,6 +14,8 @@ static std::unique_ptr<RouterLookahead> make_router_lookahead_object(e_router_lo
1314
return std::make_unique<ClassicLookahead>();
1415
} else if (router_lookahead_type == e_router_lookahead::MAP) {
1516
return std::make_unique<MapLookahead>();
17+
} else if (router_lookahead_type == e_router_lookahead::EXTENDED_MAP) {
18+
return std::make_unique<ExtendedMapLookahead>();
1619
} else if (router_lookahead_type == e_router_lookahead::NO_OP) {
1720
return std::make_unique<NoOpLookahead>();
1821
}

0 commit comments

Comments
 (0)