Skip to content

Commit 7296b32

Browse files
committed
[VPR] Now consider the max. number of pins among equivalent sites when computing the physical pin index
1 parent 62335b5 commit 7296b32

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

vpr/src/util/vpr_utils.cpp

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2350,7 +2350,21 @@ int get_post_placement_physical_pin(t_physical_tile_type_ptr physical_tile,
23502350
}
23512351

23522352
int sub_tile_physical_pin = get_sub_tile_physical_pin(sub_tile_index, physical_tile, logical_block, pin);
2353-
return (sub_tile_capacity - physical_tile->sub_tiles[sub_tile_index].capacity.low) * logical_block->pb_type->num_pins
2353+
2354+
/* Find the relative capacity of the logical_block in this sub tile */
2355+
int relative_capacity = sub_tile_capacity - physical_tile->sub_tiles[sub_tile_index].capacity.low;
2356+
2357+
/* Find the maximum number of pins among all the logical blocks in the equivalent site list
2358+
* of the sub tile. Otherwise, the current logical block may have smaller number of pins
2359+
* than other logical blocks that can be placed in the sub-tile. This will lead to an error
2360+
* when computing the pin index!
2361+
*/
2362+
int max_logical_block_num_pins = logical_block->pb_type->num_pins;
2363+
for (t_logical_block_type_ptr eq_lb : physical_tile->sub_tiles[sub_tile_index].equivalent_sites) {
2364+
max_logical_block_num_pins = std::max(max_logical_block_num_pins, eq_lb->pb_type->num_pins);
2365+
}
2366+
2367+
return relative_capacity * max_logical_block_num_pins
23542368
+ physical_tile->sub_tiles[sub_tile_index].sub_tile_to_tile_pin_indices[sub_tile_physical_pin];
23552369
}
23562370

vpr/src/util/vpr_utils.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,14 @@ int get_logical_block_physical_sub_tile_index(t_physical_tile_type_ptr physical_
219219
//logical index ('pin' of the first instance of 'logical_block' within the physcial tile.
220220
//This function considers if a given offset is in the range of sub tile capacity
221221
//
222+
// (First pin index at current sub-tile) (The wanted pin index)
223+
//
224+
// | |<----- pin ------->|
225+
// v v
226+
//
227+
// |<----- capacity.low ----->|<----- capacity.low + 1 ----->| ... |<----- sub_tile_capacity ---->|
228+
//
229+
//
222230
//This function is called only after placement is finished, where all the logical
223231
//blocks are assigned to a specific location of a tile!!!
224232
//

0 commit comments

Comments
 (0)