From 4dd555e9ce88bfa3703e5c0073a22655c525e9cf Mon Sep 17 00:00:00 2001 From: amin1377 Date: Wed, 12 Jun 2024 09:01:15 -0400 Subject: [PATCH 1/2] [vpr][utils] remove get_physical_tile_type since physical_tile_type has a similar functionality --- vpr/src/util/vpr_utils.cpp | 19 ++----------------- vpr/src/util/vpr_utils.h | 4 ---- 2 files changed, 2 insertions(+), 21 deletions(-) diff --git a/vpr/src/util/vpr_utils.cpp b/vpr/src/util/vpr_utils.cpp index aaa1a6016b9..a7339891258 100644 --- a/vpr/src/util/vpr_utils.cpp +++ b/vpr/src/util/vpr_utils.cpp @@ -527,10 +527,9 @@ t_physical_tile_type_ptr physical_tile_type(ClusterBlockId blk) { auto& place_ctx = g_vpr_ctx.placement(); auto& device_ctx = g_vpr_ctx.device(); - auto block_loc = place_ctx.block_locs[blk]; - auto loc = block_loc.loc; + auto block_loc = place_ctx.block_locs[blk].loc; - return device_ctx.grid.get_physical_type({loc.x, loc.y, loc.layer}); + return device_ctx.grid.get_physical_type({block_loc.x, block_loc.y, block_loc.layer}); } t_physical_tile_type_ptr physical_tile_type(AtomBlockId atom_blk) { @@ -2150,20 +2149,6 @@ int max_pins_per_grid_tile() { return max_pins; } -t_physical_tile_type_ptr get_physical_tile_type(const ClusterBlockId blk) { - auto& cluster_ctx = g_vpr_ctx.clustering(); - auto& place_ctx = g_vpr_ctx.placement(); - if (place_ctx.block_locs.empty()) { //No placement, pick best match - return pick_physical_type(cluster_ctx.clb_nlist.block_type(blk)); - } else { //Have placement, select physical tile implementing blk - auto& device_ctx = g_vpr_ctx.device(); - - t_pl_loc loc = place_ctx.block_locs[blk].loc; - - return device_ctx.grid.get_physical_type({loc.x, loc.y, loc.layer}); - } -} - int net_pin_to_tile_pin_index(const ClusterNetId net_id, int net_pin_index) { auto& cluster_ctx = g_vpr_ctx.clustering(); diff --git a/vpr/src/util/vpr_utils.h b/vpr/src/util/vpr_utils.h index edd148d6974..9382660142c 100644 --- a/vpr/src/util/vpr_utils.h +++ b/vpr/src/util/vpr_utils.h @@ -234,10 +234,6 @@ AtomBlockId find_memory_sibling(const t_pb* pb); */ void place_sync_external_block_connections(ClusterBlockId iblk); -//Returns the current tile implemnting blk (if placement is valid), or -//the best expected physical tile the block should use (if no valid placement). -t_physical_tile_type_ptr get_physical_tile_type(const ClusterBlockId blk); - //Returns the physical pin of the tile, related to the given ClusterNedId, and the net pin index int net_pin_to_tile_pin_index(const ClusterNetId net_id, int net_pin_index); From 07f4175bfd54b34d84c17897fe9078deb618e3ee Mon Sep 17 00:00:00 2001 From: amin1377 Date: Wed, 12 Jun 2024 09:02:05 -0400 Subject: [PATCH 2/2] [vpr][draw] use physical_tile_type if the block is placed, otherwise call pick_physical_type --- vpr/src/draw/draw_types.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/vpr/src/draw/draw_types.cpp b/vpr/src/draw/draw_types.cpp index d1532564938..bd63798d398 100644 --- a/vpr/src/draw/draw_types.cpp +++ b/vpr/src/draw/draw_types.cpp @@ -13,7 +13,15 @@ *******************************************/ ezgl::color t_draw_state::block_color(ClusterBlockId blk) const { if (use_default_block_color_[blk]) { - t_physical_tile_type_ptr tile_type = get_physical_tile_type(blk); + t_physical_tile_type_ptr tile_type = nullptr; + auto& cluster_ctx = g_vpr_ctx.clustering(); + auto& place_ctx = g_vpr_ctx.placement(); + if (place_ctx.block_locs.empty()) { //No placement, pick best match + tile_type = pick_physical_type(cluster_ctx.clb_nlist.block_type(blk)); + } else { // Have placement, select physical tile implementing blk + tile_type = physical_tile_type(blk); + } + VTR_ASSERT(tile_type != nullptr); return get_block_type_color(tile_type); } else { return block_color_[blk];