Skip to content

Commit 467224a

Browse files
committed
equivalent: use logical-physical pin mappings
Signed-off-by: Alessandro Comodi <[email protected]>
1 parent 6eb1001 commit 467224a

File tree

2 files changed

+16
-10
lines changed

2 files changed

+16
-10
lines changed

vpr/src/base/ShowSetup.cpp

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -74,16 +74,20 @@ void printClusteredNetlistStats() {
7474
L_num_p_outputs = 0;
7575

7676
for (auto blk_id : cluster_ctx.clb_nlist.blocks()) {
77-
num_blocks_type[cluster_ctx.clb_nlist.block_type(blk_id)->index]++;
78-
// XXX mapping here
79-
auto type = cluster_ctx.clb_nlist.block_type(blk_id)->equivalent_tiles[0];
80-
if (is_io_type(type)) {
81-
for (j = 0; j < type->num_pins; j++) {
77+
auto logical_block = cluster_ctx.clb_nlist.block_type(blk_id);
78+
auto physical_tile = pick_random_physical_type(logical_block);
79+
num_blocks_type[logical_block->index]++;
80+
if (is_io_type(physical_tile)) {
81+
for (j = 0; j < logical_block->pb_type->num_pins; j++) {
82+
int phy_pin = get_physical_pin(physical_tile, logical_block, j);
83+
auto pin_class = physical_tile->pin_class[phy_pin];
84+
auto class_inf = physical_tile->class_inf[pin_class];
85+
8286
if (cluster_ctx.clb_nlist.block_net(blk_id, j) != ClusterNetId::INVALID()) {
83-
if (type->class_inf[type->pin_class[j]].type == DRIVER) {
87+
if (class_inf.type == DRIVER) {
8488
L_num_p_inputs++;
8589
} else {
86-
VTR_ASSERT(type->class_inf[type->pin_class[j]].type == RECEIVER);
90+
VTR_ASSERT(class_inf.type == RECEIVER);
8791
L_num_p_outputs++;
8892
}
8993
}

vpr/src/draw/draw.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2660,10 +2660,12 @@ void draw_highlight_blocks_color(t_logical_block_type_ptr type, ClusterBlockId b
26602660
if (net_id == ClusterNetId::INVALID())
26612661
continue;
26622662

2663-
// XXX Logical Physical Mapping to be used here
2664-
iclass = physical_tile_type(blk_id)->pin_class[k];
2663+
auto physical_tile = physical_tile_type(blk_id);
2664+
int phy_pin = get_physical_pin(physical_tile, type, k);
26652665

2666-
if (physical_tile_type(blk_id)->class_inf[iclass].type == DRIVER) { /* Fanout */
2666+
iclass = physical_tile->pin_class[phy_pin];
2667+
2668+
if (physical_tile->class_inf[iclass].type == DRIVER) { /* Fanout */
26672669
if (draw_state->block_color[blk_id] == SELECTED_COLOR) {
26682670
/* If block already highlighted, de-highlight the fanout. (the deselect case)*/
26692671
draw_state->net_color[net_id] = ezgl::BLACK;

0 commit comments

Comments
 (0)