Skip to content

Commit 3f1b16e

Browse files
[Packer] Fixed NightlyTest Failure with Tight Floorplan Constr.
The very tight floorplan constraints were failing after the recent changes to the iterative packing algorithm. After investigation I found that there is a bug with unrelated clustering and RAMs which is causing floorplan constraints to not be adhered to. The original code ignored this issue by not doing unrelated clustering when there are floorplan constraints. To fix this issue, reimplemented what the code was originally doing to allow this testcase to proceed. This just moves the unrelated clustering to after trying all floorplan region options.
1 parent 06beac6 commit 3f1b16e

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

vpr/src/pack/pack.cpp

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -105,22 +105,6 @@ static e_packer_state get_next_packer_state(e_packer_state current_packer_state,
105105
return e_packer_state::SUCCESS;
106106
}
107107

108-
// Check if the utilizaion of any block types is over 100%
109-
if (!fits_on_device) {
110-
// The utilization of some block types are too high. Need to increase the
111-
// density of the block types available.
112-
113-
// Check if we can turn on unrelated cluster and/or balanced block type
114-
// utilization.
115-
if (packer_opts.allow_unrelated_clustering == e_unrelated_clustering::AUTO && packer_opts.balance_block_type_utilization == e_balance_block_type_util::AUTO) {
116-
117-
// Check if they are not already on. If not, set the next state to turn them on.
118-
if (!using_unrelated_clustering || !using_balanced_block_type_util) {
119-
return e_packer_state::SET_UNRELATED_AND_BALANCED;
120-
}
121-
}
122-
}
123-
124108
// Check if there are overfilled floorplan regions.
125109
if (floorplan_regions_overfull) {
126110
// If there are overfilled region constraints, try to use attraction
@@ -152,6 +136,22 @@ static e_packer_state get_next_packer_state(e_packer_state current_packer_state,
152136
}
153137
}
154138

139+
// Check if the utilizaion of any block types is over 100%
140+
if (!fits_on_device) {
141+
// The utilization of some block types are too high. Need to increase the
142+
// density of the block types available.
143+
144+
// Check if we can turn on unrelated cluster and/or balanced block type
145+
// utilization.
146+
if (packer_opts.allow_unrelated_clustering == e_unrelated_clustering::AUTO && packer_opts.balance_block_type_utilization == e_balance_block_type_util::AUTO) {
147+
148+
// Check if they are not already on. If not, set the next state to turn them on.
149+
if (!using_unrelated_clustering || !using_balanced_block_type_util) {
150+
return e_packer_state::SET_UNRELATED_AND_BALANCED;
151+
}
152+
}
153+
}
154+
155155
// Check if we can increase the target density of the overused block types.
156156
// This is a last resort since increasing the target pin density can have
157157
// bad affects on quality and routability.

0 commit comments

Comments
 (0)