-
Notifications
You must be signed in to change notification settings - Fork 415
Add constraints propagation to update the PartitionRegions of blocks … #1751
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 11 commits
7f86bba
73fded7
5b085c3
d9026e4
9fddc1c
be89488
b59daed
d8414cc
c8b4a59
1c608ca
09f7411
34641cb
5fe84dd
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 |
---|---|---|
|
@@ -6,6 +6,7 @@ | |
#include "vpr_constraints.h" | ||
#include "partition.h" | ||
#include "region.h" | ||
#include "place_constraints.h" | ||
|
||
/** | ||
* This file contains unit tests that check the functionality of all classes related to vpr constraints. These classes include | ||
|
@@ -425,6 +426,34 @@ TEST_CASE("RegionLocked", "[vpr]") { | |
REQUIRE(is_r2_locked == false); | ||
} | ||
|
||
sfkhalid marked this conversation as resolved.
Show resolved
Hide resolved
|
||
//Test calculation of macro constraints | ||
TEST_CASE("MacroConstraints", "[vpr]") { | ||
t_pl_macro pl_macro; | ||
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. What is pl_macro initialized to? Maybe you're relying on the default constructor? Better to initialize it I think, and describe what the test does (macro of size 1, macro of size 2, ??). 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. The pl_macro wasn't initialized to anything. It is only passed in to update_macro_member_pr so that if there is an error the error message can be printed with the macro. This won't happen in the case of this unit test, since the test is just checking that the PartRegion is updated properly for a particular case. I can initialize it to something though, and yes, I'll add some comments about what the test is doing. |
||
PartitionRegion head_pr; | ||
t_pl_offset offset(2, 1, 0); | ||
|
||
Region reg; | ||
reg.set_region_rect(5, 2, 9, 6); | ||
|
||
head_pr.add_to_part_region(reg); | ||
|
||
Region grid_reg; | ||
grid_reg.set_region_rect(0, 0, 20, 20); | ||
PartitionRegion grid_pr; | ||
grid_pr.add_to_part_region(grid_reg); | ||
|
||
PartitionRegion macro_pr = update_macro_member_pr(head_pr, offset, grid_pr, pl_macro); | ||
|
||
std::vector<Region> mac_regions = macro_pr.get_partition_region(); | ||
|
||
vtr::Rect<int> mac_rect = mac_regions[0].get_region_rect(); | ||
|
||
REQUIRE(mac_rect.xmin() == 7); | ||
REQUIRE(mac_rect.ymin() == 3); | ||
REQUIRE(mac_rect.xmax() == 11); | ||
REQUIRE(mac_rect.ymax() == 7); | ||
} | ||
|
||
static constexpr const char kArchFile[] = "test_read_arch_metadata.xml"; | ||
|
||
// Test that place constraints are not changed during placement | ||
|
Uh oh!
There was an error while loading. Please reload this page.