Skip to content

Automatically generate floorplan test files after placement, and enhancements to cluster attraction groups #1938

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

Merged
merged 60 commits into from
Feb 10, 2022
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
2276efb
Fixed bug in region tile count by intersecting region with grid befor…
sfkhalid Nov 15, 2021
bbaa785
Added ability to generate different constraints file by creating part…
sfkhalid Nov 17, 2021
0b71f8b
Added ability to print multiple constraints files at once and add deb…
sfkhalid Nov 24, 2021
15ee41d
Commented out debug line
sfkhalid Nov 24, 2021
1280f59
Adding changes to way molecule gain is updated according to attractio…
sfkhalid Nov 24, 2021
b24ce10
Changed way molecule gain is updated when it is part of an attraction…
sfkhalid Nov 24, 2021
0aa6e7a
Added new error checking routines during clustering and placement, ad…
sfkhalid Dec 14, 2021
2702e13
When a cluster fails routing, its PartitionRegion must be reset set t…
sfkhalid Dec 14, 2021
066a996
Merge branch 'master' into generate_test_constraints_files
sfkhalid Dec 15, 2021
b521467
Improved comment for new routine in initial placement
sfkhalid Dec 15, 2021
e370bbf
Cleaned up control routine for generating constraints files
sfkhalid Dec 15, 2021
2f654cd
Replaced numbers in get_molecule_gain with defined constants and adde…
sfkhalid Dec 15, 2021
1def2e3
Ran make format
sfkhalid Dec 15, 2021
9cab9b2
Reversed some changes during clustering which were degrading the qor …
sfkhalid Dec 16, 2021
7dcdeb8
Added more detailed comments about the --floorplan_split vpr option, …
sfkhalid Dec 16, 2021
9c37438
Corrected a mistake where one of the constraint generating function w…
sfkhalid Dec 16, 2021
5830eaf
Added comment to explain bug fix in do_clustering
sfkhalid Dec 17, 2021
f479b76
Added more detail to try_pack_molecule comment
sfkhalid Dec 17, 2021
87ac95e
Improved constraints report routine - every region in PartitionRegion…
sfkhalid Dec 17, 2021
4e761ed
Added more detailed commenting to constraints report header file
sfkhalid Dec 17, 2021
7735f74
Improved error message that is printed when some blocks are not place…
sfkhalid Dec 17, 2021
581c498
Took out loop in do_clustering that counted number of failed molecule…
sfkhalid Dec 21, 2021
5f4685e
Added hash function and equal operator to the Region class. Refactore…
sfkhalid Dec 22, 2021
ea133c1
Added constructor to GridTileLookup class which initializes the data …
sfkhalid Dec 22, 2021
7107b45
Ran make format
sfkhalid Dec 22, 2021
7d2abcc
Overhauled the way molecules are pulled from attraction groups during…
sfkhalid Jan 4, 2022
88150c9
Added a fix to the while loop in do_clustering, which counts how many…
sfkhalid Jan 4, 2022
746bf8a
Added return line to make sure that when a molecule is removed it is …
sfkhalid Jan 4, 2022
fd636f3
Added a re-try loop that makes the the cluster's attraction group be …
sfkhalid Jan 12, 2022
9607452
Removed unused code
sfkhalid Jan 14, 2022
ae969b1
Added routine for filling attraction groups based on overfull regions…
sfkhalid Jan 17, 2022
5bcc77d
Made changes to constraints writer to ensure that it works in all cases
sfkhalid Jan 18, 2022
04a2b28
Added comments and removed unused code
sfkhalid Jan 19, 2022
a806ffb
Resolved cluster.cpp merge conflicts
sfkhalid Jan 19, 2022
7375979
Ran make format
sfkhalid Jan 19, 2022
fbdd65c
Fixed parameter type in writer setup function
sfkhalid Jan 19, 2022
8f92765
Fixed variable type that was causing compiler errors and warnings
sfkhalid Jan 19, 2022
609d16b
Minor fixes to get rid of compiler warnings
sfkhalid Jan 19, 2022
839d256
Added a routine to be able to constrain half of all blocks with the c…
sfkhalid Jan 20, 2022
07727d1
Added comments and removed unnecessary lines
sfkhalid Jan 23, 2022
7bc8468
Added a helper function to record molecule failures during clustering
sfkhalid Jan 23, 2022
b3cf6b8
Edited the comment which explain how to use the floorplan constraints…
sfkhalid Jan 24, 2022
954d60f
Removed outdated code from the constraints generator
sfkhalid Jan 24, 2022
968e82c
Changed packing flow when running with floorplan constraints. Before,…
sfkhalid Jan 24, 2022
7097a30
ran make format
sfkhalid Jan 24, 2022
553c323
Reversed a minor change with adding constrained atoms because it was …
sfkhalid Jan 25, 2022
0567b68
Ran make format
sfkhalid Jan 25, 2022
4dccac4
Initialized att_group_pulls value, as it was causing a memory leak
sfkhalid Jan 25, 2022
a449463
Added comments to further clarify how the attraction groups are worki…
sfkhalid Jan 25, 2022
8a5951c
Changed the formation of attraction groups - only create them for ove…
sfkhalid Jan 30, 2022
545ca65
Merge branch 'master' into generate_test_constraints_files
sfkhalid Jan 30, 2022
b79865b
Changed routine that gets molecule candidates from the attraction gro…
sfkhalid Jan 31, 2022
553766b
Added more detailed commenting to clustering stage
sfkhalid Jan 31, 2022
9bdc971
Refactored the way attraction group molecules are added when looking …
sfkhalid Jan 31, 2022
9f14605
Changed vpr command line options used for generating test constraints…
sfkhalid Jan 31, 2022
f26768a
cleaned up names of routines which check whether floorplan regions ar…
sfkhalid Jan 31, 2022
f1506e8
Ran make format
sfkhalid Jan 31, 2022
20097c5
Added a comment to state which pack iteration we are on when we are d…
sfkhalid Feb 2, 2022
39b78b5
Added to-do note for routine that needs to be enhanced in another pul…
sfkhalid Feb 2, 2022
ca7d60a
Merge branch 'master' into generate_test_constraints_files
sfkhalid Feb 2, 2022
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 vpr/src/base/SetupVPR.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -609,6 +609,7 @@ static void SetupPlacerOpts(const t_options& Options, t_placer_opts* PlacerOpts)
PlacerOpts->place_agent_algorithm = Options.place_agent_algorithm;
PlacerOpts->place_constraint_expand = Options.place_constraint_expand;
PlacerOpts->place_constraint_subtile = Options.place_constraint_subtile;
PlacerOpts->floorplan_split = Options.floorplan_split;
}

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

struct ParseFloorplanSplit {
ConvertedValue<constraints_split_factor> from_str(std::string str) {
ConvertedValue<constraints_split_factor> conv_value;
if (str == "halves")
conv_value.set_value(HALVES);
else if (str == "quadrants")
conv_value.set_value(QUADRANTS);
else if (str == "sixteenths")
conv_value.set_value(SIXTEENTHS);
else if (str == "one_spot")
conv_value.set_value(ONE_SPOT);
else {
std::stringstream msg;
msg << "Invalid conversion from '" << str << "' to constraints_split_factor (expected one of: " << argparse::join(default_choices(), ", ") << ")";
conv_value.set_error(msg.str());
}
return conv_value;
}

ConvertedValue<std::string> to_str(constraints_split_factor val) {
ConvertedValue<std::string> conv_value;
if (val == HALVES)
conv_value.set_value("halves");
else if (val == QUADRANTS)
conv_value.set_value("quadrants");
else if (val == SIXTEENTHS)
conv_value.set_value("sixteenths");
else {
VTR_ASSERT(val == ONE_SPOT);
conv_value.set_value("one_spot");
}
return conv_value;
}

std::vector<std::string> default_choices() {
return {"halves", "quadrants", "sixteenths", "one_spot"};
}
};

struct ParseClusterSeed {
ConvertedValue<e_cluster_seed> from_str(std::string str) {
ConvertedValue<e_cluster_seed> conv_value;
Expand Down Expand Up @@ -1950,6 +1989,11 @@ argparse::ArgumentParser create_arg_parser(std::string prog_name, t_options& arg
.default_value("off")
.show_in(argparse::ShowIn::HELP_ONLY);

place_grp.add_argument<constraints_split_factor, ParseFloorplanSplit>(args.floorplan_split, "--floorplan_split")
.help("Used to say how many partitions the floorplan constraints file should split the blocks into.")
.default_value("halves")
.choices({"halves", "quadrants", "sixteenths", "one_spot"})
.show_in(argparse::ShowIn::HELP_ONLY);
/*
* place_grp.add_argument(args.place_timing_cost_func, "--place_timing_cost_func")
* .help(
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 @@ -133,6 +133,7 @@ struct t_options {
argparse::ArgValue<float> place_crit_limit;
argparse::ArgValue<int> place_constraint_expand;
argparse::ArgValue<bool> place_constraint_subtile;
argparse::ArgValue<constraints_split_factor> floorplan_split;

/* Timing-driven placement options only */
argparse::ArgValue<float> PlaceTimingTradeoff;
Expand Down
4 changes: 4 additions & 0 deletions vpr/src/base/region.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ bool Region::is_loc_in_reg(t_pl_loc loc) {
return is_loc_in_reg;
}

bool regions_equal(Region r1, Region r2) {
return (r1.get_region_rect() == r2.get_region_rect() && r1.get_sub_tile() == r2.get_sub_tile());
}

bool do_regions_intersect(Region r1, Region r2) {
bool intersect = true;

Expand Down
9 changes: 9 additions & 0 deletions vpr/src/base/region.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,15 @@ bool do_regions_intersect(Region r1, Region r2);
*/
Region intersection(const Region& r1, const Region& r2);

/**
* @brief Returns true if the two regions passed in have the same rectangle coordinates
* and subtile values, false otherwise. Used to determine whether two clusters have the
* same region after clustering.
*
* @param r1, r2 The two regions to be checked for equality
*/
bool regions_equal(Region r1, Region r2);

///@brief Used to print data from a Region
void print_region(FILE* fp, Region region);

Expand Down
2 changes: 1 addition & 1 deletion vpr/src/base/vpr_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,7 @@ bool vpr_place_flow(t_vpr_setup& vpr_setup, const t_arch& arch) {

//Write out a vpr floorplanning constraints file if the option is specified
if (!filename_opts.write_vpr_constraints_file.empty()) {
write_vpr_floorplan_constraints(filename_opts.write_vpr_constraints_file.c_str(), placer_opts.place_constraint_expand, placer_opts.place_constraint_subtile);
write_vpr_floorplan_constraints(filename_opts.write_vpr_constraints_file.c_str(), placer_opts.place_constraint_expand, placer_opts.place_constraint_subtile, placer_opts.floorplan_split);
}

return true;
Expand Down
Loading