-
Notifications
You must be signed in to change notification settings - Fork 415
Floorplan constraints tuning #1741
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
Changes from all commits
523368e
ea4e6df
f6f6d6a
b07b9de
9d4ed2e
34f583a
47d0622
3a86fac
8c6dc01
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,10 @@ std::vector<Region> PartitionRegion::get_partition_region() { | |
return partition_region; | ||
} | ||
|
||
void PartitionRegion::set_partition_region(std::vector<Region> pr) { | ||
partition_region = pr; | ||
} | ||
|
||
bool PartitionRegion::empty() { | ||
return partition_region.size() == 0; | ||
} | ||
|
@@ -26,20 +30,18 @@ bool PartitionRegion::is_loc_in_part_reg(t_pl_loc loc) { | |
return is_in_pr; | ||
} | ||
|
||
PartitionRegion intersection(PartitionRegion& pr1, PartitionRegion& pr2) { | ||
PartitionRegion intersection(const PartitionRegion& cluster_pr, const PartitionRegion& new_pr) { | ||
/**for N regions in part_region and M in the calling object you can get anywhere from | ||
* 0 to M*N regions in the resulting vector. Only intersection regions with non-zero area rectangles and | ||
* equivalent subtiles are put in the resulting vector | ||
* Rectangles are not merged even if it would be possible | ||
*/ | ||
PartitionRegion pr; | ||
Region intersect_region; | ||
bool regions_intersect; | ||
for (unsigned int i = 0; i < pr1.partition_region.size(); i++) { | ||
for (unsigned int j = 0; j < pr2.partition_region.size(); j++) { | ||
regions_intersect = do_regions_intersect(pr1.partition_region[i], pr2.partition_region[j]); | ||
if (regions_intersect) { | ||
intersect_region = intersection(pr1.partition_region[i], pr2.partition_region[j]); | ||
for (unsigned int i = 0; i < cluster_pr.partition_region.size(); i++) { | ||
for (unsigned int j = 0; j < new_pr.partition_region.size(); j++) { | ||
intersect_region = intersection(cluster_pr.partition_region[i], new_pr.partition_region[j]); | ||
if (!intersect_region.empty()) { | ||
pr.partition_region.push_back(intersect_region); | ||
} | ||
} | ||
|
@@ -48,6 +50,20 @@ PartitionRegion intersection(PartitionRegion& pr1, PartitionRegion& pr2) { | |
return pr; | ||
} | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's talk about this in our meeting this week. I can merge this to get it going, but this update_cluster_part_reg has a few problems:
|
||
void update_cluster_part_reg(PartitionRegion& cluster_pr, const PartitionRegion& new_pr) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. just delete this one and keep the original |
||
Region intersect_region; | ||
std::vector<Region> int_regions; | ||
for (unsigned int i = 0; i < cluster_pr.partition_region.size(); i++) { | ||
for (unsigned int j = 0; j < new_pr.partition_region.size(); j++) { | ||
intersect_region = intersection(cluster_pr.partition_region[i], new_pr.partition_region[j]); | ||
if (!intersect_region.empty()) { | ||
int_regions.push_back(intersect_region); | ||
} | ||
} | ||
} | ||
cluster_pr.set_partition_region(int_regions); | ||
} | ||
|
||
void print_partition_region(FILE* fp, PartitionRegion pr) { | ||
std::vector<Region> part_region = pr.get_partition_region(); | ||
|
||
|
Uh oh!
There was an error while loading. Please reload this page.