Skip to content

Commit 225cac4

Browse files
acomodikmurray
authored andcommitted
place: added comments on the sub tile compatibility map
Signed-off-by: Alessandro Comodi <[email protected]>
1 parent 7af267a commit 225cac4

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

vpr/src/place/compressed_grid.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,21 @@ std::vector<t_compressed_block_grid> create_compressed_block_grids() {
2929
for (const auto& physical_tile : logical_block.equivalent_tiles) {
3030
std::vector<int> compatible_sub_tiles;
3131

32+
// Build a vector to store all the sub tile indices that are compatible with the
33+
// (physical_tile, logical_block) pair.
34+
//
35+
// Given that a logical block can potentially be compatible with only a subset of the
36+
// sub tiles of a physical tile, we need to ensure which sub tile locations are part of
37+
// this subset.
3238
for (int capacity = 0; capacity < physical_tile->capacity; capacity++) {
3339
if (is_sub_tile_compatible(physical_tile, &logical_block, capacity)) {
3440
compatible_sub_tiles.push_back(capacity);
3541
}
3642
}
3743

38-
compressed_block_grid.compatible_sub_tiles_map.insert({physical_tile->index, compatible_sub_tiles});
44+
// For each of physical tiles compatible with the current logical block, create add an entry
45+
// to the compatible sub tiles map with the physical tile index and the above generated vector.
46+
compressed_block_grid.compatible_sub_tiles_for_tile_map.insert({physical_tile->index, compatible_sub_tiles});
3947
}
4048

4149
compressed_type_grids[logical_block.index] = compressed_block_grid;

vpr/src/place/compressed_grid.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,11 @@ struct t_compressed_block_grid {
3333
//This makes it easy to check whether there exist
3434
std::vector<vtr::flat_map2<int, t_type_loc>> grid;
3535

36-
std::unordered_map<int, std::vector<int>> compatible_sub_tiles_map;
36+
//The sub type compatibility for a given physical tile and a compressed block grid
37+
//corresponding to the possible placement location for a given logical block
38+
// - key: physical tile index
39+
// - value: vector of compatible sub tiles for the physical tile/logical block pair
40+
std::unordered_map<int, std::vector<int>> compatible_sub_tiles_for_tile_map;
3741
};
3842

3943
//Compressed grid space for each block type

vpr/src/place/move_utils.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -639,7 +639,7 @@ bool find_to_loc_uniform(t_logical_block_type_ptr type,
639639

640640
//Each x/y location possibly contains multiple sub tiles, so we need to pick
641641
//a z location within a compatible sub tile.
642-
auto& compatible_sub_tiles = compressed_block_grid.compatible_sub_tiles_map.at(to_type->index);
642+
auto& compatible_sub_tiles = compressed_block_grid.compatible_sub_tiles_for_tile_map.at(to_type->index);
643643
to.sub_tile = compatible_sub_tiles[vtr::irand((int)compatible_sub_tiles.size() - 1)];
644644

645645
VTR_ASSERT_MSG(is_tile_compatible(to_type, type), "Type must be compatible");

0 commit comments

Comments
 (0)