Skip to content

Commit aa8e049

Browse files
committed
vpr: print route now takes the correct blkid based on subtile loc
Signed-off-by: Alessandro Comodi <[email protected]>
1 parent 4d1857b commit aa8e049

File tree

4 files changed

+26
-3
lines changed

4 files changed

+26
-3
lines changed

libs/libarchfpga/src/physical_types.cpp

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,24 @@ std::vector<int> t_physical_tile_type::get_clock_pins_indices() const {
111111
return this->clock_pin_indices;
112112
}
113113

114+
int t_physical_tile_type::get_sub_tile_loc_from_pin(int pin_num) const {
115+
VTR_ASSERT(pin_num < this->num_pins);
116+
117+
for (auto sub_tile : this->sub_tiles) {
118+
auto max_inst_pins = sub_tile.num_phy_pins / sub_tile.capacity.total();
119+
120+
for (int pin = 0; pin < sub_tile.num_phy_pins; pin++) {
121+
if (sub_tile.sub_tile_to_tile_pin_indices[pin] == pin_num) {
122+
//If the physical tile pin matches pin_num, return the
123+
//corresponding absolute capacity location of the sub_tile
124+
return pin / max_inst_pins + sub_tile.capacity.low;
125+
}
126+
}
127+
}
128+
129+
return OPEN;
130+
}
131+
114132
/**
115133
* t_pb_graph_node
116134
*/

libs/libarchfpga/src/physical_types.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -624,6 +624,8 @@ struct t_physical_tile_type {
624624
/* Returns the indices of pins that contain a clock for this physical logic block */
625625
std::vector<int> get_clock_pins_indices() const;
626626

627+
int get_sub_tile_loc_from_pin(int pin_num) const;
628+
627629
// TODO: Remove is_input_type / is_output_type as part of
628630
// https://github.com/verilog-to-routing/vtr-verilog-to-routing/issues/1193
629631

vpr/src/route/route_common.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1278,11 +1278,14 @@ void print_route(FILE* fp, const vtr::vector<ClusterNetId, t_traceback>& traceba
12781278

12791279
fprintf(fp, "%d ", device_ctx.rr_nodes[inode].ptc_num());
12801280

1281-
if (!is_io_type(device_ctx.grid[ilow][jlow].type) && (rr_type == IPIN || rr_type == OPIN)) {
1281+
auto physical_tile = device_ctx.grid[ilow][jlow].type;
1282+
if (!is_io_type(physical_tile) && (rr_type == IPIN || rr_type == OPIN)) {
12821283
int pin_num = device_ctx.rr_nodes[inode].ptc_num();
12831284
int xoffset = device_ctx.grid[ilow][jlow].width_offset;
12841285
int yoffset = device_ctx.grid[ilow][jlow].height_offset;
1285-
ClusterBlockId iblock = place_ctx.grid_blocks[ilow - xoffset][jlow - yoffset].blocks[0];
1286+
int sub_tile_offset = physical_tile->get_sub_tile_loc_from_pin(pin_num);
1287+
1288+
ClusterBlockId iblock = place_ctx.grid_blocks[ilow - xoffset][jlow - yoffset].blocks[sub_tile_offset];
12861289
VTR_ASSERT(iblock);
12871290
t_pb_graph_pin* pb_pin = get_pb_graph_node_pin_from_block_pin(iblock, pin_num);
12881291
t_pb_type* pb_type = pb_pin->parent_node->pb_type;

vpr/src/util/vpr_utils.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ bool is_empty_type(t_logical_block_type_ptr type);
3030
//Returns the corresponding physical type given the logical type as parameter
3131
t_physical_tile_type_ptr physical_tile_type(ClusterBlockId blk);
3232

33-
//Retyrbs the sub tile corresponding to the logical block location within a physical type
33+
//Returns the sub tile corresponding to the logical block location within a physical type
3434
int get_sub_tile_index(ClusterBlockId blk);
3535

3636
int get_unique_pb_graph_node_id(const t_pb_graph_node* pb_graph_node);

0 commit comments

Comments
 (0)