Skip to content

Add PlacerSetupSlacks interface #1450

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
f4ea4a1
Added interface for mapping between CLB pins and setup slacks. Refact…
Bill-hbrhbr Jul 23, 2020
c024603
Refactored criticalities update in place.cpp and added setup slacks u…
Bill-hbrhbr Jul 23, 2020
cb6e9a6
Fixe up format and compilation errors
Bill-hbrhbr Jul 23, 2020
63db2e1
Merged 3 update routines into 1 single routine
Bill-hbrhbr Jul 31, 2020
aa7b233
Resolve merge conflicts
Bill-hbrhbr Jul 31, 2020
e8f73c6
Resolve more merge conflicts
Bill-hbrhbr Jul 31, 2020
d80de58
Changed crit_exponent to first_crit_exponent/state.crit_exponent
Bill-hbrhbr Jul 31, 2020
831df44
Created a setup slack matrix that copies data from the PlacerSetupSla…
Bill-hbrhbr Aug 6, 2020
d329911
Provided more complete explanation for the record_setup_slacks routine.
Bill-hbrhbr Aug 6, 2020
225870e
Added placement snapshot functions that facilitates the reversion of …
Bill-hbrhbr Aug 6, 2020
9056301
Merge the master branch into PlacerSetupSlacks (updating vtr flow
Bill-hbrhbr Aug 6, 2020
0e01ed7
Implemented do_setup_slack_cost_analysis: softmax of negative slacks
Bill-hbrhbr Aug 6, 2020
2e212dc
Added single move reversion for setup slack analysis(rather than taki…
Bill-hbrhbr Aug 11, 2020
96e65ba
Corrected the timing update and reversion of setup slack analysis dur…
Bill-hbrhbr Aug 14, 2020
112bde5
Moved four boolean global variables controlling the timing update int…
Bill-hbrhbr Aug 14, 2020
29b55a3
Added vpr option --place_quench_metric to turn on/off setup slack ana…
Bill-hbrhbr Aug 20, 2020
da55abf
Merged t_placer_costs and t_placer_prev_inverse_costs and added
Bill-hbrhbr Aug 21, 2020
92c416a
Reduced down the argument list for starting_t, placement_inner_loop, …
Bill-hbrhbr Aug 22, 2020
870eca6
Moved t_placer_costs and t_annealing_state and related routines to pl…
Bill-hbrhbr Aug 22, 2020
a2685c7
Changed major place.cpp data structures from file scope to global sco…
Bill-hbrhbr Aug 23, 2020
cc4488e
Moved timing update routines from place.cpp to place_timing_update.*.…
Bill-hbrhbr Aug 24, 2020
38f25cc
Enchanced documentation for timing_place.*. Moved chanx, chany 2d arr…
Bill-hbrhbr Aug 25, 2020
74d279c
Added documentation for the timing driven routines used in try_swap()…
Bill-hbrhbr Aug 26, 2020
9f18666
Merge branch 'master' into PlacerSetupSlacks
Bill-hbrhbr Aug 26, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions libs/libvtrutil/src/vtr_vec_id_set.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#define VTR_SET_H

#include <vector>
#include <algorithm>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was this added?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After moving around the code, the compiler gave me an error saying error: 'sort' is not a member of 'std' in L79 of this file. That's why I added it.


namespace vtr {

Expand Down
2 changes: 2 additions & 0 deletions vpr/src/base/SetupVPR.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -572,6 +572,8 @@ static void SetupPlacerOpts(const t_options& Options, t_placer_opts* PlacerOpts)

PlacerOpts->effort_scaling = Options.place_effort_scaling;
PlacerOpts->timing_update_type = Options.timing_update_type;

PlacerOpts->place_quench_metric = Options.place_quench_metric;
}

static void SetupAnalysisOpts(const t_options& Options, t_analysis_opts& analysis_opts) {
Expand Down
46 changes: 46 additions & 0 deletions vpr/src/base/read_options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1025,6 +1025,41 @@ struct ParseTimingUpdateType {
}
};

struct ParsePlaceQuenchMetric {
ConvertedValue<e_place_quench_metric> from_str(std::string str) {
ConvertedValue<e_place_quench_metric> conv_value;
if (str == "auto")
conv_value.set_value(e_place_quench_metric::AUTO);
else if (str == "timing_cost")
conv_value.set_value(e_place_quench_metric::TIMING_COST);
else if (str == "setup_slack")
conv_value.set_value(e_place_quench_metric::SETUP_SLACK);
else {
std::stringstream msg;
msg << "Invalid conversion from '" << str << "' to e_place_quench_metric (expected one of: " << argparse::join(default_choices(), ", ") << ")";
conv_value.set_error(msg.str());
}
return conv_value;
}

ConvertedValue<std::string> to_str(e_place_quench_metric val) {
ConvertedValue<std::string> conv_value;
if (val == e_place_quench_metric::AUTO)
conv_value.set_value("auto");
if (val == e_place_quench_metric::TIMING_COST)
conv_value.set_value("timing_cost");
else {
VTR_ASSERT(val == e_place_quench_metric::SETUP_SLACK);
conv_value.set_value("setup_slack");
}
return conv_value;
}

std::vector<std::string> default_choices() {
return {"auto", "timing_cost", "setup_slack"};
}
};

argparse::ArgumentParser create_arg_parser(std::string prog_name, t_options& args) {
std::string description =
"Implements the specified circuit onto the target FPGA architecture"
Expand Down Expand Up @@ -1814,6 +1849,17 @@ argparse::ArgumentParser create_arg_parser(std::string prog_name, t_options& arg
.default_value("")
.show_in(argparse::ShowIn::HELP_ONLY);

place_timing_grp.add_argument<e_place_quench_metric, ParsePlaceQuenchMetric>(args.place_quench_metric, "--place_quench_metric")
.help(
"Controls which cost function the placer uses during the quench stage:\n"
" * auto: VPR decides\n"
" * timing_cost: The same cost formulation as the one used during\n"
" the annealing stage (more stable)\n"
" * setup_slack: Directly uses setup slacks (in combination with wiring)\n"
" to check if the block moves should be accepted\n")
.default_value("auto")
.show_in(argparse::ShowIn::HELP_ONLY);

auto& route_grp = parser.add_argument_group("routing options");

route_grp.add_argument(args.max_router_iterations, "--max_router_iterations")
Expand Down
1 change: 1 addition & 0 deletions vpr/src/base/read_options.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ struct t_options {
argparse::ArgValue<PlaceDelayModelType> place_delay_model;
argparse::ArgValue<e_reducer> place_delay_model_reducer;
argparse::ArgValue<std::string> allowed_tiles_for_delay_model;
argparse::ArgValue<e_place_quench_metric> place_quench_metric;

/* Router Options */
argparse::ArgValue<bool> check_rr_graph;
Expand Down
10 changes: 9 additions & 1 deletion vpr/src/base/vpr_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -851,7 +851,8 @@ struct t_annealing_sched {
* doPlacement: true if placement is supposed to be done in the CAD flow, false otherwise */
enum e_place_algorithm {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment what each enum constant chooses.
I also think we should PATH_DRIVEN_TIMING_PLACE to CRITICALITY_TIMING_PLACE (would be more clear; PATH_DRIVEN is no longer very relevant as all our timing data comes from timing paths).

BOUNDING_BOX_PLACE,
PATH_TIMING_DRIVEN_PLACE
PATH_TIMING_DRIVEN_PLACE,
SETUP_SLACK_ANALYSIS_PLACE
};

enum e_pad_loc_type {
Expand Down Expand Up @@ -889,6 +890,12 @@ enum class e_place_delta_delay_algorithm {
DIJKSTRA_EXPANSION,
};

enum class e_place_quench_metric {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment what each enum value does. Instead of TIMING_COST I think we should call the first one TIMING_CRITICALITY (or TIMING_CRITICALITY_COST if you prefer).

TIMING_COST,
SETUP_SLACK,
AUTO
};

struct t_placer_opts {
enum e_place_algorithm place_algorithm;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be good to add comments for each data member here too.

float timing_tradeoff;
Expand Down Expand Up @@ -935,6 +942,7 @@ struct t_placer_opts {
std::string allowed_tiles_for_delay_model;

e_place_delta_delay_algorithm place_delta_delay_matrix_calculation_method;
e_place_quench_metric place_quench_metric;
};

/* All the parameters controlling the router's operation are in this *
Expand Down
Loading