Skip to content

Commit 8a254de

Browse files
committed
Merge remote-tracking branch 'upstream/master' into vtr_task_and_test_rewrite
2 parents 9f11e6c + 25efd66 commit 8a254de

29 files changed

+2679
-286
lines changed

.github/kokoro/run-vtr.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ set -x
66
set -e
77

88
# Set up the host
9-
source $SCRIPT_DIR/steps/hostsetup.sh
10-
source $SCRIPT_DIR/steps/hostinfo.sh
11-
12-
# Output git information
139
ls -l
1410
cd github
1511
ls -l
1612
cd vtr-verilog-to-routing
13+
source $SCRIPT_DIR/steps/hostsetup.sh
14+
source $SCRIPT_DIR/steps/hostinfo.sh
15+
16+
# Output git information
1717
source $SCRIPT_DIR/steps/git.sh
1818

1919
if [ $VTR_TEST == "vtr_reg_strong" ]; then

.github/kokoro/steps/hostsetup.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ echo
2828
echo "========================================"
2929
echo "Host install packages"
3030
echo "----------------------------------------"
31+
3132
sudo apt-get install -y \
3233
bash \
3334
bison \
@@ -58,6 +59,15 @@ sudo apt-get install -y \
5859
#Don't include libtbb-dev since it may increase memory usage
5960
#libtbb-dev \
6061

62+
export PATH="$PATH:/home/kbuilder/.local/bin"
63+
64+
pyenv install -f 3.6.3
65+
pyenv global 3.6.3
66+
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
67+
python3 get-pip.py
68+
rm get-pip.py
69+
python3 -m pip install -r requirements.txt
70+
6171
if [ -z "${BUILD_TOOL}" ]; then
6272
export BUILD_TOOL=make
6373
fi

.travis.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -272,9 +272,8 @@ before_script:
272272
- curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
273273
- python3 get-pip.py
274274
- rm get-pip.py
275-
- python3 -m pip install \
276-
pylint \
277-
black
275+
- python3 -m pip install -r requirements.txt
276+
278277
- source .github/travis/common.sh
279278
- ./.github/travis/setup.sh
280279

dev/upgrade_vtr_archs.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#!/usr/bin/env bash
22

3-
find vpr libs/libarchfpga ODIN_II vtr_flow/arch utils/fasm/test -name '*.xml' | xargs -n 1 ./vtr_flow/scripts/upgrade_arch.py
3+
find vpr libs/libarchfpga ODIN_II vtr_flow/arch utils/fasm/test -name '*.xml' | xargs -n 1 python3 ./vtr_flow/scripts/upgrade_arch.py

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+
}

libs/libvtrutil/src/vtr_geometry.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,12 @@ Rect<T> bounding_box(const Rect<T>& lhs, const Rect<T>& rhs);
149149
template<typename T, typename std::enable_if<std::is_integral<T>::value>::type...>
150150
Point<T> sample(const vtr::Rect<T>& r, T x, T y, T d);
151151

152+
// clamps v to be between low (lo) and high (hi), inclusive.
153+
template<class T>
154+
static constexpr const T& clamp(const T& v, const T& lo, const T& hi) {
155+
return std::min(std::max(v, lo), hi);
156+
}
157+
152158
//A 2D line
153159
template<class T>
154160
class Line {

requirements.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
black
2+
prettytable
3+
pylint
4+
lxml

vpr/src/base/ShowSetup.cpp

Lines changed: 6 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;
@@ -444,6 +447,9 @@ static void ShowRouterOpts(const t_router_opts& RouterOpts) {
444447
case e_router_lookahead::MAP:
445448
VTR_LOG("MAP\n");
446449
break;
450+
case e_router_lookahead::EXTENDED_MAP:
451+
VTR_LOG("EXTENDED_MAP\n");
452+
break;
447453
case e_router_lookahead::NO_OP:
448454
VTR_LOG("NO_OP\n");
449455
break;

vpr/src/base/echo_files.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ void alloc_and_load_echo_file_info() {
114114
setEchoFileName(E_ECHO_CHAN_DETAILS, "chan_details.txt");
115115
setEchoFileName(E_ECHO_SBLOCK_PATTERN, "sblock_pattern.txt");
116116
setEchoFileName(E_ECHO_ENDPOINT_TIMING, "endpoint_timing.echo.json");
117+
setEchoFileName(E_ECHO_LOOKAHEAD_MAP, "lookahead_map.echo");
117118
}
118119

119120
void free_echo_file_info() {

vpr/src/base/echo_files.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ enum e_echo_files {
4646
E_ECHO_CHAN_DETAILS,
4747
E_ECHO_SBLOCK_PATTERN,
4848
E_ECHO_ENDPOINT_TIMING,
49+
E_ECHO_LOOKAHEAD_MAP,
4950

5051
//Timing Graphs
5152
E_ECHO_PRE_PACKING_TIMING_GRAPH,

vpr/src/base/read_options.cpp

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -773,6 +773,8 @@ struct ParseRouterLookahead {
773773
conv_value.set_value(e_router_lookahead::CLASSIC);
774774
else if (str == "map")
775775
conv_value.set_value(e_router_lookahead::MAP);
776+
else if (str == "extended_map")
777+
conv_value.set_value(e_router_lookahead::EXTENDED_MAP);
776778
else {
777779
std::stringstream msg;
778780
msg << "Invalid conversion from '"
@@ -788,15 +790,17 @@ struct ParseRouterLookahead {
788790
ConvertedValue<std::string> conv_value;
789791
if (val == e_router_lookahead::CLASSIC)
790792
conv_value.set_value("classic");
791-
else {
792-
VTR_ASSERT(val == e_router_lookahead::MAP);
793+
else if (val == e_router_lookahead::MAP) {
793794
conv_value.set_value("map");
795+
} else {
796+
VTR_ASSERT(val == e_router_lookahead::EXTENDED_MAP);
797+
conv_value.set_value("extended_map");
794798
}
795799
return conv_value;
796800
}
797801

798802
std::vector<std::string> default_choices() {
799-
return {"classic", "map"};
803+
return {"classic", "map", "extended_map"};
800804
}
801805
};
802806

@@ -2093,7 +2097,14 @@ argparse::ArgumentParser create_arg_parser(std::string prog_name, t_options& arg
20932097
"Controls what lookahead the router uses to calculate cost of completing a connection.\n"
20942098
" * classic: The classic VPR lookahead (may perform better on un-buffered routing\n"
20952099
" architectures)\n"
2096-
" * map: A more advanced lookahead which accounts for diverse wire type\n")
2100+
" * map: An advanced lookahead which accounts for diverse wire type\n"
2101+
" * extended_map: A more advanced and extended lookahead which accounts for a more\n"
2102+
" exhaustive node sampling method\n"
2103+
"\n"
2104+
" The extended map differs from the map lookahead in the lookahead computation.\n"
2105+
" It is better suited for architectures that have specialized routing for specific\n"
2106+
" kinds of connections, but note that the time and memory necessary to compute the\n"
2107+
" extended lookahead map are greater than the basic lookahead map.\n")
20972108
.default_value("map")
20982109
.show_in(argparse::ShowIn::HELP_ONLY);
20992110

vpr/src/base/vpr_context.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,8 @@ struct DeviceContext : public Context {
161161
///@brief The indicies of rr nodes of a given type at a specific x,y grid location
162162
t_rr_node_indices rr_node_indices; // [0..NUM_RR_TYPES-1][0..grid.width()-1][0..grid.width()-1][0..size-1]
163163

164-
std::vector<t_rr_switch_inf> rr_switch_inf; // autogenerated in build_rr_graph based on switch fan-in. [0..(num_rr_switches-1)]
164+
///@brief Autogenerated in build_rr_graph based on switch fan-in. [0..(num_rr_switches-1)]
165+
std::vector<t_rr_switch_inf> rr_switch_inf;
165166

166167
///@brief Wire segment types in RR graph
167168
std::vector<t_segment_inf> rr_segments;

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: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,6 @@
3939
#include "bucket.h"
4040
#include "connection_router.h"
4141

42-
#include "router_lookahead_map.h"
43-
4442
#include "tatum/TimingReporter.hpp"
4543
#include "overuse_report.h"
4644

vpr/src/route/route_timing.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
#include "heap_type.h"
1515
#include "routing_predictor.h"
1616

17+
extern bool f_router_debug;
18+
1719
int get_max_pins_per_net();
1820

1921
bool try_timing_driven_route(const t_router_opts& router_opts,

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)