Skip to content

Commit 2da44e5

Browse files
[AP][InitialPlacement] Improved Initial Placement
Found that the Initial Placer stage of the AP flow (after APPack, but before Detailed Placement) was not working as expected. The intention was that clusters would be placed at their centroid location accordin to the flat placement, and if that site was illegal or taken it would take a nearby point instead (falling back on the original initial placer if nothing can be found). To achieve this, I was using a method called find_centroid_neighbor which I thought would return the nearest legal location to the given location. This was not correct. This method just creates a bounding-box and tries to find a random point in that box around the given point. This was causing our AP flow to move clusters WAY farther than they wanted, which moved them into places other clusters wanted to go. This was also not exhaustive, so it was often falling back on the original approach which was putting clusters in practically random locations. All of this was causing the post-FL placement from the AP flow to actually have worse quality than the default AP flow! To resolve this, I wrote the actual method I was intending. It performs a BFS-style search from the src location to all legal locations and returns the closest one. By doing this BFS on the compressed grid, I found that this is actually quite efficient. With these changes, I found that the quality of the post-FL placement more than doubled and the average atom displacement from the GP solution decrease dramatically.
1 parent ce17681 commit 2da44e5

File tree

3 files changed

+259
-71
lines changed

3 files changed

+259
-71
lines changed

vpr/src/base/flat_placement_types.h

+10
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,16 @@ struct t_flat_pl_loc {
3535
return *this;
3636
}
3737

38+
/**
39+
* @brief Subtracts the coordinates of another t_flat_pl_loc to this one.
40+
*/
41+
t_flat_pl_loc& operator-=(const t_flat_pl_loc& other) {
42+
x -= other.x;
43+
y -= other.y;
44+
layer -= other.layer;
45+
return *this;
46+
}
47+
3848
/**
3949
* @brief Divides the coordinates of this t_flat_pl_loc by a divisor.
4050
*

0 commit comments

Comments
 (0)