Skip to content

Commit ba5f464

Browse files
committed
update SetupGrid.cpp:count_grid_tiles to count the tiles on all layers
1 parent 582c387 commit ba5f464

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

libs/libarchfpga/src/device_grid.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,16 @@ class DeviceGrid {
2828

2929
const std::string& name() const { return name_; }
3030

31-
///@brief Return the width of the grid at the specified layer
32-
size_t width() const { return grid_.dim_size(1); }
33-
///@brief Return the height of the grid at the specified layer
34-
size_t height() const { return grid_.dim_size(2); }
35-
3631
///@brief Return the number of layers(number of dies)
3732
inline int get_num_layers() const {
3833
return (int)grid_.dim_size(0);
3934
}
4035

36+
///@brief Return the width of the grid at the specified layer
37+
size_t width() const { return grid_.dim_size(1); }
38+
///@brief Return the height of the grid at the specified layer
39+
size_t height() const { return grid_.dim_size(2); }
40+
4141
///@brief Given t_grid_tile, return the x coordinate of the tile on the given layer
4242
inline int get_grid_loc_x(const t_grid_tile*& grid_loc) const {
4343
int layer_num = std::floor(static_cast<int>(grid_loc - &grid_.get(0)) / (width() * height()));

vpr/src/base/SetupGrid.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -800,5 +800,5 @@ float calculate_device_utilization(const DeviceGrid& grid, std::map<t_logical_bl
800800
}
801801

802802
size_t count_grid_tiles(const DeviceGrid& grid) {
803-
return grid.width() * grid.height();
803+
return grid.get_num_layers() * grid.width() * grid.height();
804804
}

0 commit comments

Comments
 (0)