@@ -17,25 +17,24 @@ void GridBlock::init_grid_blocks(const DeviceGrid& device_grid) {
1717 for (size_t x = 0 ; x < grid_width; x++) {
1818 for (size_t y = 0 ; y < grid_height; y++) {
1919 const t_physical_tile_loc tile_loc ({(int )x, (int )y, (int )layer_num});
20- auto type = device_grid.get_physical_type (tile_loc);
20+ t_physical_tile_type_ptr type = device_grid.get_physical_type (tile_loc);
2121 initialized_grid_block_at_location (tile_loc, type->capacity );
2222 }
2323 }
2424 }
2525}
2626
2727void GridBlock::zero_initialize () {
28- auto & device_ctx = g_vpr_ctx.device ();
28+ const DeviceContext & device_ctx = g_vpr_ctx.device ();
2929
3030 /* Initialize all occupancy to zero. */
3131 for (int layer_num = 0 ; layer_num < (int )device_ctx.grid .get_num_layers (); layer_num++) {
3232 for (int i = 0 ; i < (int )device_ctx.grid .width (); i++) {
3333 for (int j = 0 ; j < (int )device_ctx.grid .height (); j++) {
34- set_usage ({i, j, layer_num}, 0 );
35- auto tile = device_ctx.grid .get_physical_type ({i, j, layer_num});
34+ t_physical_tile_type_ptr tile = device_ctx.grid .get_physical_type ({i, j, layer_num});
3635
37- for (const auto & sub_tile : tile->sub_tiles ) {
38- auto capacity = sub_tile.capacity ;
36+ for (const t_sub_tile & sub_tile : tile->sub_tiles ) {
37+ t_capacity_range capacity = sub_tile.capacity ;
3938
4039 for (int k = 0 ; k < capacity.total (); k++) {
4140 set_block_at_location ({i, j, k + capacity.low , layer_num}, ClusterBlockId::INVALID ());
@@ -47,8 +46,8 @@ void GridBlock::zero_initialize() {
4746}
4847
4948void GridBlock::load_from_block_locs (const vtr::vector_map<ClusterBlockId, t_block_loc>& block_locs) {
50- auto & cluster_ctx = g_vpr_ctx.clustering ();
51- auto & device_ctx = g_vpr_ctx.device ();
49+ const ClusteringContext & cluster_ctx = g_vpr_ctx.clustering ();
50+ const DeviceContext & device_ctx = g_vpr_ctx.device ();
5251
5352 zero_initialize ();
5453
@@ -59,20 +58,5 @@ void GridBlock::load_from_block_locs(const vtr::vector_map<ClusterBlockId, t_blo
5958 VTR_ASSERT (location.y < (int )device_ctx.grid .height ());
6059
6160 set_block_at_location (location, blk_id);
62- increment_usage ({location.x , location.y , location.layer });
6361 }
6462}
65-
66- int GridBlock::increment_usage (const t_physical_tile_loc& loc) {
67- int curr_usage = get_usage (loc);
68- int updated_usage = set_usage (loc, curr_usage + 1 );
69-
70- return updated_usage;
71- }
72-
73- int GridBlock::decrement_usage (const t_physical_tile_loc& loc) {
74- int curr_usage = get_usage (loc);
75- int updated_usage = set_usage (loc, curr_usage - 1 );
76-
77- return updated_usage;
78- }
0 commit comments