Skip to content

Commit 2f1b25d

Browse files
committed
Merge branch 'master' into RefactorPlaceCpp
2 parents 9b25514 + 7ae49bf commit 2f1b25d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+5948
-472
lines changed

.travis.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,22 @@ jobs:
113113
script:
114114
- ./.github/travis/build.sh
115115
- travis_wait 30 ./run_reg_test.pl vtr_reg_basic -show_failures -j2
116+
- stage: Test
117+
name: "Basic Regression Tests with NO_GRAPHICS"
118+
env:
119+
- CMAKE_PARAMS="-DVTR_ASSERT_LEVEL=3 -DWITH_BLIFEXPLORER=on -DVPR_USE_EZGL=off"
120+
- MATRIX_EVAL="CC=gcc-5 && CXX=g++-5"
121+
script:
122+
- ./.github/travis/build.sh
123+
- travis_wait 30 ./run_reg_test.pl vtr_reg_basic -show_failures -j2
124+
- stage: Test
125+
name: "Basic Regression Tests with VTR_ENABLE_DEBUG_LOGGING"
126+
env:
127+
- CMAKE_PARAMS="-DVTR_ASSERT_LEVEL=3 -DWITH_BLIFEXPLORER=on -DVTR_ENABLE_DEBUG_LOGGING=on"
128+
- MATRIX_EVAL="CC=gcc-5 && CXX=g++-5"
129+
script:
130+
- ./.github/travis/build.sh
131+
- travis_wait 30 ./run_reg_test.pl vtr_reg_basic -show_failures -j2
116132
- stage: Test
117133
name: "Strong Regression Tests"
118134
env:

CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,15 @@ option(VTR_ENABLE_PROFILING "Enable performance profiler (gprof)" OFF)
3232
option(VTR_ENABLE_COVERAGE "Enable code coverage tracking (gcov)" OFF)
3333
option(VTR_ENABLE_DEBUG_LOGGING "Enable debug logging" OFF)
3434

35-
#Allow the user to decide weather to compile the graphics library
35+
#Allow the user to decide whether to compile the graphics library
3636
set(VPR_USE_EZGL "auto" CACHE STRING "Specify whether vpr uses the graphics library")
3737
set_property(CACHE VPR_USE_EZGL PROPERTY STRINGS auto off on)
3838
option(VTR_ENABLE_CAPNPROTO "Enable capnproto binary serialization support in VPR." ON)
3939

40+
#Allow the user to enable/disable VPR analytic placement
41+
#VPR option --enable_analytic_placer is also required for Analytic Placement
42+
option(VPR_ANALYTIC_PLACE "Enable analytic placement in VPR." ON)
43+
4044
option(WITH_BLIFEXPLORER "Enable build with blifexplorer" OFF)
4145

4246
option(WITH_ABC "Enable building abc" ON)

ODIN_II/SRC/simulate_blif.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -557,11 +557,11 @@ static int is_node_ready(nnode_t* node, int cycle) {
557557
for (i = 0; i < node->num_input_pins; i++) {
558558
npin_t* pin = node->input_pins[i];
559559

560-
bool has_missing_driver = false;
561-
for (int j = 0; j < pin->net->num_driver_pins && !has_missing_driver; j++)
560+
bool has_missing_driver = pin->net == NULL;
561+
for (int j = 0; !has_missing_driver && j < pin->net->num_driver_pins; j++)
562562
has_missing_driver = pin->net->driver_pins[j]->node == NULL;
563563

564-
if (!pin->net || has_missing_driver) {
564+
if (has_missing_driver) {
565565
bool already_flagged = false;
566566
int j;
567567
for (j = 0; j < node->num_undriven_pins; j++) {

libs/libvtrutil/src/vtr_geometry.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,9 @@ class Rect {
110110
//Returns true if the point is coincident with the rectangle (including the top-right edges)
111111
bool coincident(Point<T> point) const;
112112

113+
//Returns true if other is contained within the rectangle (including all edges)
114+
bool contains(const Rect<T>& other) const;
115+
113116
//Returns true if no points are contained in the rectangle
114117
// rect.empty() => not exists p. rect.contains(p)
115118
// This also implies either the width or height is 0.

libs/libvtrutil/src/vtr_geometry.tpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,13 @@ bool Rect<T>::coincident(Point<T> point) const {
151151
&& point.y() >= ymin() && point.y() <= ymax();
152152
}
153153

154+
template<class T>
155+
bool Rect<T>::contains(const Rect<T>& other) const {
156+
//Including all edges
157+
return other.xmin() >= xmin() && other.xmax() <= xmax()
158+
&& other.ymin() >= ymin() && other.ymax() <= ymax();
159+
}
160+
154161
template<class T>
155162
bool Rect<T>::empty() const {
156163
return xmax() <= xmin() || ymax() <= ymin();

vpr/CMakeLists.txt

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,25 @@ add_library(libvpr STATIC
5151
${LIB_SOURCES}
5252
)
5353

54+
5455
target_include_directories(libvpr PUBLIC ${LIB_INCLUDE_DIRS})
56+
57+
#VPR_ANALYTIC_PLACE is inisitalized in the root CMakeLists
58+
#Check Eigen dependency
59+
if(${VPR_ANALYTIC_PLACE})
60+
message(STATUS "VPR Analytic Placement: Requested")
61+
find_package(Eigen3 3.3 NO_MODULE)
62+
if (TARGET Eigen3::Eigen)
63+
message(STATUS "VPR Analytic Placement dependency (Eigen3): Found")
64+
message(STATUS "VPR Analytic Placement: Enabled")
65+
target_link_libraries (libvpr Eigen3::Eigen)
66+
target_compile_definitions(libvpr PUBLIC -DENABLE_ANALYTIC_PLACE)
67+
else ()
68+
message(STATUS "VPR Analytic Placement dependency (Eigen3): Not Found (Download manually with sudo apt install libeigen3-dev, and rebuild)")
69+
message(STATUS "VPR Analytic Placement: Disabled")
70+
endif(TARGET Eigen3::Eigen)
71+
endif()
72+
5573
set_target_properties(libvpr PROPERTIES PREFIX "") #Avoid extra 'lib' prefix
5674

5775
#Specify link-time dependancies
@@ -62,7 +80,8 @@ target_link_libraries(libvpr
6280
libblifparse
6381
libtatum
6482
libargparse
65-
libpugixml)
83+
libpugixml
84+
)
6685

6786
#link graphics library only when graphics set to on
6887
if (VPR_USE_EZGL STREQUAL "on")

vpr/src/base/SetupVPR.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -574,6 +574,7 @@ static void SetupPlacerOpts(const t_options& Options, t_placer_opts* PlacerOpts)
574574

575575
PlacerOpts->effort_scaling = Options.place_effort_scaling;
576576
PlacerOpts->timing_update_type = Options.timing_update_type;
577+
PlacerOpts->enable_analytic_placer = Options.enable_analytic_placer;
577578
}
578579

579580
static void SetupAnalysisOpts(const t_options& Options, t_analysis_opts& analysis_opts) {

vpr/src/base/ShowSetup.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,8 @@ static void ShowRouterOpts(const t_router_opts& RouterOpts) {
352352
VTR_LOG("RouterOpts.routing_budgets_algorithm = DISABLE\n");
353353
} else if (RouterOpts.routing_budgets_algorithm == MINIMAX) {
354354
VTR_LOG("RouterOpts.routing_budgets_algorithm = MINIMAX\n");
355+
} else if (RouterOpts.routing_budgets_algorithm == YOYO) {
356+
VTR_LOG("RouterOpts.routing_budgets_algorithm = YOYO\n");
355357
} else if (RouterOpts.routing_budgets_algorithm == SCALE_DELAY) {
356358
VTR_LOG("RouterOpts.routing_budgets_algorithm = SCALE_DELAY\n");
357359
}
@@ -544,7 +546,7 @@ static void ShowPlacerOpts(const t_placer_opts& PlacerOpts,
544546
VTR_LOG("PlacerOpts.td_place_exp_last: %f\n", PlacerOpts.td_place_exp_last);
545547
VTR_LOG("PlacerOpts.delay_offset: %f\n", PlacerOpts.delay_offset);
546548
VTR_LOG("PlacerOpts.delay_ramp_delta_threshold: %d\n", PlacerOpts.delay_ramp_delta_threshold);
547-
VTR_LOG("PlacerOpts.delay_ramp_slope: %d\n", PlacerOpts.delay_ramp_slope);
549+
VTR_LOG("PlacerOpts.delay_ramp_slope: %f\n", PlacerOpts.delay_ramp_slope);
548550
VTR_LOG("PlacerOpts.tsu_rel_margin: %f\n", PlacerOpts.tsu_rel_margin);
549551
VTR_LOG("PlacerOpts.tsu_abs_margin: %f\n", PlacerOpts.tsu_abs_margin);
550552
VTR_LOG("PlacerOpts.post_place_timing_report_file: %s\n", PlacerOpts.post_place_timing_report_file.c_str());

vpr/src/base/read_options.cpp

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,8 @@ struct RouteBudgetsAlgorithm {
203203
ConvertedValue<e_routing_budgets_algorithm> conv_value;
204204
if (str == "minimax")
205205
conv_value.set_value(MINIMAX);
206+
else if (str == "yoyo")
207+
conv_value.set_value(YOYO);
206208
else if (str == "scale_delay")
207209
conv_value.set_value(SCALE_DELAY);
208210
else if (str == "disable")
@@ -220,6 +222,8 @@ struct RouteBudgetsAlgorithm {
220222
ConvertedValue<std::string> conv_value;
221223
if (val == MINIMAX)
222224
conv_value.set_value("minimax");
225+
else if (val == YOYO)
226+
conv_value.set_value("yoyo");
223227
else if (val == DISABLE)
224228
conv_value.set_value("disable");
225229
else {
@@ -1739,6 +1743,13 @@ argparse::ArgumentParser create_arg_parser(std::string prog_name, t_options& arg
17391743
.default_value("0")
17401744
.show_in(argparse::ShowIn::HELP_ONLY);
17411745

1746+
place_grp.add_argument(args.enable_analytic_placer, "--enable_analytic_placer")
1747+
.help(
1748+
"Enables the analytic placer. "
1749+
"Once analytic placement is done, the result is passed through the quench phase of the annealing placer for local improvement")
1750+
.default_value("false")
1751+
.show_in(argparse::ShowIn::HELP_ONLY);
1752+
17421753
auto& place_timing_grp = parser.add_argument_group("timing-driven placement options");
17431754

17441755
place_timing_grp.add_argument(args.PlaceTimingTradeoff, "--timing_tradeoff")
@@ -2031,12 +2042,13 @@ argparse::ArgumentParser create_arg_parser(std::string prog_name, t_options& arg
20312042

20322043
route_timing_grp.add_argument<e_routing_budgets_algorithm, RouteBudgetsAlgorithm>(args.routing_budgets_algorithm, "--routing_budgets_algorithm")
20332044
.help(
2034-
"Controls how the routing budgets are created.\n"
2035-
" * slack: Sets the budgets depending on the amount slack between connections and the current delay values. [EXPERIMENTAL]\n"
2036-
" * criticality: Sets the minimum budgets to 0 and the maximum budgets as a function of delay and criticality (net delay/ pin criticality) [EXPERIMENTAL]\n"
2045+
"Controls how the routing budgets are created and applied.\n"
2046+
" * yoyo: Allocates budgets using minimax algorithm, and enables hold slack resolution in the router using the RCV algorithm. [EXPERIMENTAL]\n"
2047+
" * minimax: Sets the budgets depending on the amount slack between connections and the current delay values. [EXPERIMENTAL]\n"
2048+
" * scale_delay: Sets the minimum budgets to 0 and the maximum budgets as a function of delay and criticality (net delay/ pin criticality) [EXPERIMENTAL]\n"
20372049
" * disable: Removes the routing budgets, use the default VPR and ignore hold time constraints\n")
20382050
.default_value("disable")
2039-
.choices({"minimax", "scale_delay", "disable"})
2051+
.choices({"minimax", "scale_delay", "yoyo", "disable"})
20402052
.show_in(argparse::ShowIn::HELP_ONLY);
20412053

20422054
route_timing_grp.add_argument<bool, ParseOnOff>(args.save_routing_per_iteration, "--save_routing_per_iteration")

vpr/src/base/read_options.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ struct t_options {
112112
argparse::ArgValue<int> placement_saves_per_temperature;
113113
argparse::ArgValue<e_place_effort_scaling> place_effort_scaling;
114114
argparse::ArgValue<e_place_delta_delay_algorithm> place_delta_delay_matrix_calculation_method;
115+
argparse::ArgValue<bool> enable_analytic_placer;
115116

116117
/* Timing-driven placement options only */
117118
argparse::ArgValue<float> PlaceTimingTradeoff;

vpr/src/base/read_place.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ void read_place_body(std::ifstream& placement_file,
205205
} else if (tokens[0][0] == '#') {
206206
continue; //Skip commented lines
207207

208-
} else if (tokens.size() == 4 || (tokens.size() == 5 && tokens[4][0] == '#')) {
208+
} else if (tokens.size() == 4 || (tokens.size() > 4 && tokens[4][0] == '#')) {
209209
//Load the block location
210210
//
211211
//We should have 4 tokens of actual data, with an optional 5th (commented) token indicating VPR's

vpr/src/base/vpr_types.h

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1035,6 +1035,14 @@ struct t_placer_opts {
10351035
std::string allowed_tiles_for_delay_model;
10361036

10371037
e_place_delta_delay_algorithm place_delta_delay_matrix_calculation_method;
1038+
1039+
/*
1040+
* @brief enables the analytic placer.
1041+
*
1042+
* Once analytic placement is done, the result is passed through the quench phase
1043+
* of the annealing placer for local improvement
1044+
*/
1045+
bool enable_analytic_placer;
10381046
};
10391047

10401048
/* All the parameters controlling the router's operation are in this *
@@ -1115,10 +1123,13 @@ enum e_routing_failure_predictor {
11151123
SAFE,
11161124
AGGRESSIVE
11171125
};
1126+
1127+
// How to allocate budgets, and if RCV should be enabled
11181128
enum e_routing_budgets_algorithm {
1119-
MINIMAX,
1129+
MINIMAX, // Use MINIMAX-PERT algorithm to allocate budgets
1130+
YOYO, // Use MINIMAX as above, and enable RCV algorithm to resolve negative hold slack
11201131
SCALE_DELAY,
1121-
DISABLE
1132+
DISABLE // Do not allocate budgets and run default router
11221133
};
11231134

11241135
enum class e_timing_report_detail {

vpr/src/draw/breakpoint.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
#include <iostream>
55

6+
#ifndef NO_GRAPHICS
67
//if the user adds a "proceed move" breakpoint using the entry field in the UI, this function converts it to the equivalent expression and calls the expression evaluator. Returns true if a breakpoint is encountered
78
//the way the proceed moves breakpoint works is that it proceeds the indicated number of moves from where the placer currently is i.e if at move 3 and proceed 4 ends up at move 7
89
bool check_for_moves_breakpoints(int moves_to_proceed) {
@@ -92,3 +93,4 @@ void print_current_info(bool in_placer) {
9293
else
9394
std::cout << "\nrouter_iter: " << get_bp_state_globals()->get_glob_breakpoint_state()->router_iter << "\nnet_id: " << get_bp_state_globals()->get_glob_breakpoint_state()->route_net_id << "\n----------------------------\n";
9495
}
96+
#endif

0 commit comments

Comments
 (0)