-
Notifications
You must be signed in to change notification settings - Fork 415
Clusterer feasibility changes #1641
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
Changes from all commits
Commits
Show all changes
35 commits
Select commit
Hold shift + click to select a range
918219f
Added a vpr floorplanning constraints context
sfkhalid 1fdf881
Wrote code to set the PartitionRegion of the new cluster in start_new…
sfkhalid ca7b577
Added code to check for an empty PartitionRegion and code to check in…
sfkhalid ed6e7a8
Modified function for intersecting atom and cluster PartitionRegions
sfkhalid 532a143
Fixed bug where cluster PartitionRegion was not updated soon enough i…
sfkhalid 511a994
Ran make format
sfkhalid 8008b2e
Added function to echo cluster contents
sfkhalid 54f4995
Merge branch 'master' into clusterer_feasibility_changes
sfkhalid 5845338
Added routine print_pack_status to print some cluster stats increment…
sfkhalid 7b465fe
Printed end of clustering stats in table format
sfkhalid 6fb45ff
Shortened and clarified some comments
sfkhalid 3a606e8
Made formatting changes to cluster echo file
sfkhalid 4fceb1e
Changed frequency of cluster progress messages
sfkhalid f00d55d
Need to merge changes to be able to push to remote branch. Merge bran…
sfkhalid f34a1d6
Changed data structure for holding cluster constraints from unordered…
sfkhalid e4b8257
Changed place where cluster's PartitionRegion is updated so that it d…
sfkhalid 6e59e42
Added comments and removed unnecessary variables
sfkhalid ffa49a1
Merge branch 'master' into clusterer_feasibility_changes
sfkhalid 83cfe2b
Made packing progress print every 4%
sfkhalid ed0cd07
Need to update local branchMerge branch 'clusterer_feasibility_change…
sfkhalid 7e8f9d5
Print clustering progress in a table
sfkhalid c8b58b8
Added function level comments and table headers
sfkhalid f11da67
Modified build_device_grid function call in SetupGrid.cpp to get rid …
sfkhalid 899a3da
Create the temporary cluster PartitionRegion earlier in the flow when…
sfkhalid afcb926
Merge branch 'master' into clusterer_feasibility_changes
sfkhalid ee4bf86
Moved print functions to be within their respective class. ex - print…
sfkhalid 37ef5a7
Merge origin with local to be able to push changes to local 'clustere…
sfkhalid cfb812f
Comment update for print_constraints function
sfkhalid e2a7bfc
Updated comment for echo_constraints function
sfkhalid 680cbdc
Merge branch 'master' into clusterer_feasibility_changes
sfkhalid 40e9534
Merge branch 'master' into clusterer_feasibility_changes
sfkhalid d2d6fcb
Updated PartitionRegion class comment
sfkhalid bd217bf
Need to run make format on changes that were merged remotely 'cluster…
sfkhalid 8c5bc25
Ran make format to fix formatting in vtr geometry file
sfkhalid b807f83
Merge branch 'master' into clusterer_feasibility_changes
sfkhalid File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,82 +1,14 @@ | ||
#include "constraints_load.h" | ||
|
||
static void print_region(FILE* fp, Region region); | ||
static void print_partition(FILE* fp, Partition part); | ||
static void print_partition_region(FILE* fp, PartitionRegion pr); | ||
static void print_constraints(FILE* fp, VprConstraints constraints, int num_parts); | ||
|
||
void print_region(FILE* fp, Region region) { | ||
vtr::Rect<int> rect = region.get_region_rect(); | ||
int xmin = rect.xmin(); | ||
int xmax = rect.xmax(); | ||
int ymin = rect.ymin(); | ||
int ymax = rect.ymax(); | ||
int subtile = region.get_sub_tile(); | ||
|
||
fprintf(fp, "\tRegion: \n"); | ||
fprintf(fp, "\txmin: %d\n", xmin); | ||
fprintf(fp, "\txmax: %d\n", xmax); | ||
fprintf(fp, "\tymin: %d\n", ymin); | ||
fprintf(fp, "\tymax: %d\n", ymax); | ||
fprintf(fp, "\tsubtile: %d\n\n", subtile); | ||
} | ||
|
||
void print_partition(FILE* fp, Partition part) { | ||
std::string name = part.get_name(); | ||
fprintf(fp, "partition_name: %s\n", name.c_str()); | ||
|
||
PartitionRegion pr = part.get_part_region(); | ||
|
||
print_partition_region(fp, pr); | ||
} | ||
|
||
void print_partition_region(FILE* fp, PartitionRegion pr) { | ||
std::vector<Region> part_region = pr.get_partition_region(); | ||
|
||
int pr_size = part_region.size(); | ||
|
||
fprintf(fp, "\tNumber of regions in partition is: %d\n", pr_size); | ||
|
||
for (unsigned int i = 0; i < part_region.size(); i++) { | ||
print_region(fp, part_region[i]); | ||
} | ||
} | ||
|
||
void print_constraints(FILE* fp, VprConstraints constraints, int num_parts) { | ||
Partition temp_part; | ||
std::vector<AtomBlockId> atoms; | ||
|
||
for (int i = 0; i < num_parts; i++) { | ||
PartitionId part_id(i); | ||
|
||
temp_part = constraints.get_partition(part_id); | ||
|
||
fprintf(fp, "\npartition_id: %zu\n", size_t(part_id)); | ||
print_partition(fp, temp_part); | ||
|
||
atoms = constraints.get_part_atoms(part_id); | ||
|
||
int atoms_size = atoms.size(); | ||
|
||
fprintf(fp, "\tAtom vector size is %d\n", atoms_size); | ||
fprintf(fp, "\tIds of atoms in partition: \n"); | ||
for (unsigned int j = 0; j < atoms.size(); j++) { | ||
AtomBlockId atom_id = atoms[j]; | ||
fprintf(fp, "\t#%zu\n", size_t(atom_id)); | ||
} | ||
} | ||
} | ||
|
||
void echo_constraints(char* filename, VprConstraints constraints, int num_parts) { | ||
void echo_constraints(char* filename, VprConstraints constraints) { | ||
FILE* fp; | ||
fp = vtr::fopen(filename, "w"); | ||
|
||
fprintf(fp, "--------------------------------------------------------------\n"); | ||
fprintf(fp, "Constraints\n"); | ||
fprintf(fp, "--------------------------------------------------------------\n"); | ||
fprintf(fp, "\n"); | ||
fprintf(fp, "\n Number of partitions is %d \n", num_parts); | ||
print_constraints(fp, constraints, num_parts); | ||
print_constraints(fp, constraints); | ||
|
||
fclose(fp); | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At top, file controls echo files, we have an enum to each one, search for in code to see what each one prints
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
say what echo files are, what they are used for - dumps that intended to be written and read by a developer, typically direct reps of data structures to make debugging easier
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
enum e_output_files - line 66 - see what these are in code and leave a brief comment, or make an issue saying this may just be same as other enum and we should just put them both together
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
set an issue to clean up these two enums (either just need to comment, or merge the two diff enums)
whole thing could be wrapped in a class
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
echo file name can maybe also take a default name (person can choose to pass it in - if not, default set to null), the set_output_filename would work fore everything
investigate - is there some other reason to have the second output enum? - look at the call sites for that
in the cpp file -> instead of the mallocs, recode using c++ strings and wrap it all in a class
-> all the members of the class could be static members (don't have to turn into class, see if it's worth it) (make a member object of the echo class in something like the vpr_options file)