-
Notifications
You must be signed in to change notification settings - Fork 416
Vpr constraints parsing #1600
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
Vpr constraints parsing #1600
Changes from 4 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
a3dad81
Added files and changes needed for vpr constraints parsing
sfkhalid 1ebe25a
Removed debug statements from serializer file
sfkhalid 24e7c78
Made small changes to get rid of compiler warnings
sfkhalid 952f978
Ran make format
sfkhalid 3b3a874
Added check for invalid atom names, removed unused functions, and add…
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
#include "constraints_load.h" | ||
|
||
void print_region(FILE* fp, Region region); | ||
sfkhalid marked this conversation as resolved.
Show resolved
Hide resolved
|
||
void print_partition(FILE* fp, Partition part); | ||
sfkhalid marked this conversation as resolved.
Show resolved
Hide resolved
|
||
void print_partition_region(FILE* fp, PartitionRegion pr); | ||
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, "Region: \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, "\tpartition_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, "\tpart_region size is: %d\n", pr_size); | ||
sfkhalid marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
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) { | ||
sfkhalid marked this conversation as resolved.
Show resolved
Hide resolved
|
||
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); | ||
|
||
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); | ||
|
||
for (unsigned int j = 0; j < atoms.size(); j++) { | ||
AtomBlockId atom_id = atoms[j]; | ||
fprintf(fp, "\tAtom %d is in the partition\n", atom_id); | ||
sfkhalid marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
} | ||
} | ||
|
||
void echo_region(char* filename, Region region) { | ||
sfkhalid marked this conversation as resolved.
Show resolved
Hide resolved
|
||
FILE* fp; | ||
fp = vtr::fopen(filename, "w"); | ||
|
||
fprintf(fp, "--------------------------------------------------------------\n"); | ||
fprintf(fp, "Region\n"); | ||
fprintf(fp, "--------------------------------------------------------------\n"); | ||
fprintf(fp, "\n"); | ||
print_region(fp, region); | ||
|
||
fclose(fp); | ||
} | ||
|
||
void echo_partition(char* filename, Partition part) { | ||
sfkhalid marked this conversation as resolved.
Show resolved
Hide resolved
|
||
FILE* fp; | ||
fp = vtr::fopen(filename, "w"); | ||
|
||
fprintf(fp, "--------------------------------------------------------------\n"); | ||
fprintf(fp, "Partition\n"); | ||
fprintf(fp, "--------------------------------------------------------------\n"); | ||
fprintf(fp, "\n"); | ||
print_partition(fp, part); | ||
|
||
fclose(fp); | ||
} | ||
|
||
void echo_constraints(char* filename, VprConstraints constraints, int num_parts) { | ||
FILE* fp; | ||
fp = vtr::fopen(filename, "w"); | ||
|
||
fprintf(fp, "--------------------------------------------------------------\n"); | ||
fprintf(fp, "Constraints\n"); | ||
fprintf(fp, "--------------------------------------------------------------\n"); | ||
fprintf(fp, "\n"); | ||
print_constraints(fp, constraints, num_parts); | ||
|
||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#ifndef CONSTRAINTS_LOAD_H_ | ||
#define CONSTRAINTS_LOAD_H_ | ||
|
||
#include "region.h" | ||
#include "partition.h" | ||
#include "partition_region.h" | ||
#include "vpr_constraints.h" | ||
#include "vtr_vector.h" | ||
|
||
void echo_region(char* filename, Region region); | ||
sfkhalid marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
void echo_partition(char* filename, Partition part); | ||
|
||
void echo_constraints(char* filename, VprConstraints constraints, int num_parts); | ||
|
||
#endif |
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
`vpr_constraints_uxsdcxx.h`and | ||
`vpr_constraints_uxsdcxx_interface.h` are generated via uxsdcxx and are checked in to | ||
avoid requiring python3 and the uxsdcxx depedencies to build VPR. |
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.
Uh oh!
There was an error while loading. Please reload this page.